texlive[60058] Master: tonevalue (25jul21)

commits+karl at tug.org commits+karl at tug.org
Sun Jul 25 22:45:28 CEST 2021


Revision: 60058
          http://tug.org/svn/texlive?view=revision&revision=60058
Author:   karl
Date:     2021-07-25 22:45:28 +0200 (Sun, 25 Jul 2021)
Log Message:
-----------
tonevalue (25jul21)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/tonevalue/
    trunk/Master/texmf-dist/doc/latex/tonevalue/LICENSE
    trunk/Master/texmf-dist/doc/latex/tonevalue/README
    trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.pdf
    trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.tex
    trunk/Master/texmf-dist/tex/latex/tonevalue/
    trunk/Master/texmf-dist/tex/latex/tonevalue/tonevalue.sty
    trunk/Master/tlpkg/tlpsrc/tonevalue.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/tonevalue/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tonevalue/LICENSE	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tonevalue/LICENSE	2021-07-25 20:45:28 UTC (rev 60058)
@@ -0,0 +1,13 @@
+Copyright [2021] [Yuanhao (Nyoeghau) Chen]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/latex/tonevalue/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tonevalue/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tonevalue/README	2021-07-25 20:45:28 UTC (rev 60058)
@@ -0,0 +1,3 @@
+This package provides a tikz-based solution to typeset visualisations of tone vales. In this version (v1.0), unt's model is implemented. Support for more models is planned.
+
+Read more in the PDF documentation.
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/tonevalue/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.pdf	2021-07-25 18:09:03 UTC (rev 60057)
+++ trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.pdf	2021-07-25 20:45:28 UTC (rev 60058)

Property changes on: trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.tex	2021-07-25 20:45:28 UTC (rev 60058)
@@ -0,0 +1,320 @@
+% !TEX program = xelatex
+
+\RequirePackage{xcolor}
+
+\documentclass{ltxdockit}
+\makeatletter
+  \def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\hspace{\marglistsep}}}
+\makeatother
+
+\usepackage{xltxtra}
+
+\usepackage[defaultcolors]{tonevalue}
+
+\usepackage{cleveref}
+
+\usepackage{listings}
+\lstset{
+  basicstyle=\ttfamily,
+  frame=single,
+  columns=flexible,
+  language=[LaTeX]TeX,
+  breaklines=true,
+  postbreak=\mbox{\textcolor{spot}{$\hookrightarrow$}\space},
+  morekeywords={drawuntpoint,untpoint,linkuntpoints},
+  escapeinside={<@}{@>},
+}
+
+\usepackage{xeCJK}
+\setCJKmainfont[Script=CJK, Scale=0.9]{Source Han Serif K}
+\newCJKfontfamily\simplified[Script=CJK, Language=Chinese Simplified, Scale=0.9]{Source Han Serif K}
+\setmainfont[Script=Latin]{Minion 3}
+\setCJKsansfont[Script=CJK, Scale=0.9]{Source Han Sans K}
+\setsansfont[Script=Latin]{Myriad Pro}
+\setCJKmonofont[Script=CJK, Scale=0.9]{Sarasa Mono K}
+\setmonofont[Script=Latin, Scale=0.9]{Sarasa Mono K}
+
+\usepackage{graphicx}
+\usepackage{caption}
+\usepackage{microtype}
+
+\newcommand{\colourcirc}[1]{\tikz{\node[draw, shape=circle, scale=0.9, inner sep=0.1em, fill, #1, text=white] {\sffamily #1};}}
+\newcommand{\showcolour}[2]{{\raisebox{-0.2em}{\colourcirc{#1}} \sffamily\textcolor{#1}{#2}}}
+
+\makeatletter
+\def\blfootnote{\gdef\@thefnmark{}\@footnotetext}
+\makeatother
+
+\title{The \texttt{tonevalue} package}
+\author{Yuanhao Chen}
+\date{\today{\quad}v1.0}
+\begin{document}
+\maketitle
+\tableofcontents
+
+\section{Introduction}
+This package provides a \sty{tikz}-based solution to typeset visualisations of tone vales. In this version (v1.0), unt's model\footnote{\simplified unt. 一种直观的调值格局可视化方法 (A Novel Approach to Visualization of Tone Value Pattern). 第十四届中国语音学学术会议 (The 14th Phonetic Association of China). July 2021.} is implemented. Support for more models is planned.
+
+\section{User Interface}
+
+\subsection{Basic Usage}
+Put in your preamble
+\begin{lstlisting}
+\usepackage<@\oprm{\sty{tonevalue} options}@>{tonevalue}
+\end{lstlisting}
+then after \lstinline|\begin{document}|, use
+\begin{lstlisting}
+\begin{<@\prm{name of visualisation environment}@>}[<@\prm{visualisation environment options}@>]
+  \<@\prm{name of drawing command}@>[<@\prm{drawing options}@>]{<@\prm{tone value}@>}{<@\prm{name of tone}@>}
+\end{<@\prm{name of visualisation environment}@>}
+\end{lstlisting}
+
+\subsection{A Brief Working Example}
+An example of complete working code looks like
+\begin{lstlisting}[caption={basic example.}]
+\documentclass{article}
+
+% load the package, and use the predefined color set
+\usepackage[defaultcolors]{tonevalue}
+
+\begin{document}
+
+% set showlabels to true
+% set range of tone values to 1 to 4
+% set scale of graph to 0.8
+\begin{untVisualisation}[showlabels=true, minmax={1,4}, scale=0.8]
+  % T1
+  \untpoint[bgcolor=1, label=left]{312}{T1}
+  \untpoint[bgcolor=1]{33}{T1}
+  % change in tone value
+  \linkuntpoints[color=1, bend=bend right]{{312}{T1}}{{33}{T1}}
+\end{untVisualisation}
+
+\end{document}
+\end{lstlisting}
+with the result
+\begin{figure}[htb]
+  \centering
+  % set showlabels to true
+  % set range of tone values to 1 to 4
+  % set scale of graph to 0.8
+  \begin{untVisualisation}[showlabels=true, minmax={1,4}, scale=0.8]
+    % T1
+    \untpoint[bgcolor=1, label=left, stem=true]{312}{T1}
+    \untpoint[bgcolor=1]{33}{T1}
+    % change in tone value
+    \linkuntpoints[color=1, bend=bend right]{{312}{T1}}{{33}{T1}}
+  \end{untVisualisation}
+  \caption{}
+  \label{exampleuntVisualisation}
+\end{figure}
+
+\subsection{Details}
+\subsubsection{Package Options}
+The package options can be called like in
+\ltxsyntax
+\cmditem{usepackage}
+\lstinline[mathescape]|[defaultcolors, draft, fontcmd=$\prm{font commands}$,|\newline
+\lstinline[mathescape]| contourlength=$\prm{length}$, contournumber=$\prm{integer}$]{tonevalue}|
+\endltxsyntax
+
+The effects of the options are listed below.
+\begin{optionlist}
+  \optitem[]{defaultcolors}{no value required\footnote{}}\footnotetext{`No value required' means it could be called on its own, i.e.~\opt{defaultcolors}, or with an arbitrary string passed to it, i.e.~\lstinline|defaultcolors={any string}| without affecting the result.}
+  Use the pre-defined colour scheme designed for the four-tone and the eight-tone systems (四聲八聲) and their simplifications. The colours are chosen such that the representative character taken from each of their names falls into the category of the tone it describes, and such that the \emph{yin} tone is of the same colour tone as but darker than its corresponding \emph{yang} tone in the eight-tone system. 
+  
+  The colours are programmatically named \lstinline{1} to \lstinline{8}, defined as \sty{xcolor} \textsc{html} colours. 
+  
+  {\centering
+    \showcolour{1}{蘇/蘇芳色}\quad\showcolour{3}{朽/朽葉色}\quad\showcolour{5}{熨/熨斗目花色}\quad\showcolour{7}{竹/老竹色}\\
+    \showcolour{2}{梅/紅梅色}\quad\showcolour{4}{柿/柿 色}\quad\showcolour{6}{露/露 草 色}\quad\showcolour{8}{鶸/鶸萌黄}\par
+  }
+
+  The names are taken with reference to \emph{A Dictionary of Color Combinations}\footnote{青幻舎 (Seigensha). 配色事典 (\emph{A Dictionary of Color Combinations}).}.
+
+  \optitem[]{draft}{no value required}
+  This will speed up compilations by \lstinline|\contournumber{50}| defined by \sty{contour}.
+
+  \optitem[\cmd{sffamily}]{fontcmd}{\prm{font commands}}
+  This sets the font commands to use in all graphs.
+
+  \optitem[0.075em]{contourlength}{\prm{length}}
+  This sets the width of contours around labels of tones to allow them stand out in the grid.
+
+  \optitem[1000]{contournumber}{\prm{integer}}
+  Increase this to improve contour quality; decrease to compile faster.
+\end{optionlist}
+
+\subsubsection{The \env{untVisualisation} environment}
+Use this environment to draw the axes and, optionally, labels of unt's model. Later, put the drawing commands of points and lines inside this environment.
+\ltxsyntax
+\cmditem{begin}\lstinline|{untVisualisation}|\lstinline[mathescape]|[minmax=$\prm{range of tone values}$,|\newline
+\lstinline[mathescape]|                   scale=$\prm{float}$, showlabels=$\prm{boolean}$]|
+\cmditem{untpoint}\lstinline[mathescape]|[$\prm{\cmd{untpoint} options}$]{$\prm{tone value, e.g.~3124}$}{$\prm{tone name, e.g.~上}$}|
+\cmditem{linkuntpoints}\lstinline[mathescape]|[$\prm{\cmd{linkuntpoints} options}$]{{$\prm{tone value}$}{$\prm{tone name}$}}{{$\prm{tone value}$}{$\prm{tone name}$}}|
+\cmditem{end}\lstinline|{untVisualisation}|
+\endltxsyntax
+
+A default empty \env{untVisualisation} environment looks like \cref{defaultuntVisualisation}. A modified\\\env{untVisualisation} environment looks like \cref{exampleuntVisualisation}.
+\begin{figure}[htb]
+  \centering
+  \begin{untVisualisation}[]
+    % 
+  \end{untVisualisation}
+  \caption{empty \env{untVisualisation}.}
+  \label{defaultuntVisualisation}
+\end{figure}
+
+\begin{optionlist}
+  \optitem[\{1,5\}]{minmax}{\prm{range of tone values}}
+  Sometimes we deal with languages whose tone values do not range from 1 to 5. Use this command to modify the minima and maxima of the axes.
+
+  \optitem[1]{scale}{\prm{float}}
+  Scales the grid, but not the font size, as in \cref{showlabelsuntVisualisation}.
+
+  \optitem[false]{showlabels}{\prm{boolean}}
+  Controls whether to display the labels, as in \cref{showlabelsuntVisualisation}.
+\end{optionlist}
+\begin{figure}[!h]
+  \centering
+  \begin{untVisualisation}[showlabels=true, scale=0.5]
+    % 
+  \end{untVisualisation}
+  \caption{\env{untVisualisation} with labels, and scaled to factor \lstinline|0.5|.}
+  \label{showlabelsuntVisualisation}
+\end{figure}
+
+\subsubsection{The \lstinline|\\untpoint| Command}
+Use inside the \env{untVisualisation} environment to plot tone values.
+\ltxsyntax
+\cmditem{untpoint}[list of options]{tone value, e.g.~3124}{tone name, e.g.~上}
+\endltxsyntax
+Below is a complete list of \lstinline{\untpoint} options.
+\begin{optionlist}
+  \optitem[false]{stem}{\prm{boolean}}
+  Use \lstinline{stem=true} to add a stem for turning tones.
+
+  \optitem[above]{label}{\prm{combinations of \lstinline|above, below, left, right|}}
+  For instance, use \lstinline|label=below left| to put the label (tone value) below left of the point.
+
+  \optitem[black]{bgcolor}{\prm{color}}
+  For instance, with the package option \opt{defaultcolors} on, use \lstinline|bgcolor=4| to colour the point in \textcolor{4}{the \emph{yangshang} colour}.
+
+  \optitem[0pt]{xshift}{\prm{length}}
+  When there are two different points at the same coordinates, use this option to slightly shift the points horizontally, e.g.~\lstinline|xshift=0.8em|.
+
+  \optitem[0pt]{yshift}{\prm{length}}
+  The vertical variant of \opt{xshift}.
+
+  \optitem[1]{scale}{\prm{float}}
+  Scales the size of the point.
+
+  \optitem[\{\}]{tikzoptions}{\prm{\sty{tikz} options not in the key-value format} \emph{\textcolor{spot}{Unstable (this might clash with the options required to plot the point). Use at risk.}}}
+  For instance, use \lstinline|tikzoptions={black}| to make the point completely black (the name of the tone becomes invisible), but preserving the size of the point which fits to the invisible name of the tone.
+\end{optionlist}
+
+\subsubsection{The \lstinline|\\linkuntpoints| Command}
+It must be called after the points involved are drawn.
+\ltxsyntax
+\cmditem{linkuntpoints}[list of options]\lstinline|{{tone value 1}{tone name 1}}{{tone value 2}{tone name 2}}|
+\endltxsyntax
+Below is a complete list of \lstinline{\linkuntpoints} options.
+\begin{optionlist}
+  \optitem[black]{color}{\prm{color}}
+  Colours the connecting line.
+
+  \optitem[\{\}]{bend}{\prm{bend direction}}
+  Set \lstinline{bend=bend left} or \lstinline{bend=bend right} to bend the line.
+\end{optionlist}
+
+\subsection{A More Complicated Example}
+Shifts in the tone value pattern of Shanghainese in the past 150 years (\cref{shanghaineseexample})\footnote{unt. Ibid.},
+\begin{figure}[!htb]
+  \centering
+  \begin{untVisualisation}[showlabels=true]
+    % 1
+    \untpoint[bgcolor=1]{53}{平}
+    \untpoint[bgcolor=1]{51}{平}
+    % 2
+    \untpoint[bgcolor=2, label=right, xshift=0.8em]{11}{平}
+    % 3
+    \untpoint[bgcolor=3, xshift=-0.8em]{55}{上}
+    \untpoint[bgcolor=3, label=left]{44}{上}
+    % 4
+    \untpoint[bgcolor=4, label=below]{113}{上}
+    % 5
+    \untpoint[bgcolor=5]{35}{去}
+    \untpoint[bgcolor=5, label=below]{34}{去}
+    \untpoint[bgcolor=5]{445}{去}
+    % 6
+    \untpoint[bgcolor=6]{13}{去}
+    % 7
+    \untpoint[bgcolor=7, xshift=0.8em]{5}{入}
+    % 8
+    \untpoint[bgcolor=8, label=left, xshift=-0.8em]{1}{入}
+    \untpoint[bgcolor=8]{23}{入}
+    % 
+    \linkuntpoints[color=1]{{53}{平}}{{51}{平}}
+    \linkuntpoints[color=3]{{55}{上}}{{44}{上}}
+    \linkuntpoints[color=3]{{44}{上}}{{34}{去}}
+    \linkuntpoints[color=4]{{113}{上}}{{13}{去}}
+    \linkuntpoints[color=5]{{35}{去}}{{34}{去}}
+    \linkuntpoints[color=5]{{34}{去}}{{445}{去}}
+    \linkuntpoints[color=2]{{11}{平}}{{13}{去}}
+    \linkuntpoints[color=8]{{1}{入}}{{23}{入}}
+    % 
+  \end{untVisualisation}
+  \caption{shifts in the tone value pattern of Shanghainese in the past 150 years.}
+  \label{shanghaineseexample}
+\end{figure}
+drawn with the following code, compiled with \XeLaTeX{}.
+\begin{lstlisting}[caption={example regarding Shanghainese.}]
+% !TEX program = xelatex
+
+\documentclass{ctexart}
+
+\usepackage[defaultcolors]{tonevalue}
+
+\begin{document}
+
+\begin{untVisualisation}[showlabels=true]
+  % 1
+  \untpoint[bgcolor=1]{53}{平}
+  \untpoint[bgcolor=1]{51}{平}
+  % 2
+  \untpoint[bgcolor=2, label=right, xshift=0.8em]{11}{平}
+  % 3
+  \untpoint[bgcolor=3, xshift=-0.8em]{55}{上}
+  \untpoint[bgcolor=3, label=left]{44}{上}
+  % 4
+  \untpoint[bgcolor=4, label=below]{113}{上}
+  % 5
+  \untpoint[bgcolor=5]{35}{去}
+  \untpoint[bgcolor=5, label=below]{34}{去}
+  \untpoint[bgcolor=5]{445}{去}
+  % 6
+  \untpoint[bgcolor=6]{13}{去}
+  % 7
+  \untpoint[bgcolor=7, xshift=0.8em]{5}{入}
+  % 8
+  \untpoint[bgcolor=8, label=left, xshift=-0.8em]{1}{入}
+  \untpoint[bgcolor=8]{23}{入}
+  % 
+  \linkuntpoints[color=1]{{53}{平}}{{51}{平}}
+  \linkuntpoints[color=3]{{55}{上}}{{44}{上}}
+  \linkuntpoints[color=3]{{44}{上}}{{34}{去}}
+  \linkuntpoints[color=4]{{113}{上}}{{13}{去}}
+  \linkuntpoints[color=5]{{35}{去}}{{34}{去}}
+  \linkuntpoints[color=5]{{34}{去}}{{445}{去}}
+  \linkuntpoints[color=2]{{11}{平}}{{13}{去}}
+  \linkuntpoints[color=8]{{1}{入}}{{23}{入}}
+  % 
+\end{untVisualisation}
+
+\end{document}  
+\end{lstlisting}
+
+\section{Implementation}
+\lstinputlisting[caption={the implementation.}]{tonevalue.sty}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/tonevalue/tonevalue.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/tonevalue/tonevalue.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tonevalue/tonevalue.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/tonevalue/tonevalue.sty	2021-07-25 20:45:28 UTC (rev 60058)
@@ -0,0 +1,160 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tonevalue}
+  [2021/07/25 v1.0 LaTeX Package (Tone value: visualising tone value patterns)]
+
+\RequirePackage{etoolbox}
+\RequirePackage{listofitems}
+\RequirePackage{xstring}
+\RequirePackage{xkeyval}
+\RequirePackage{xcolor}
+\RequirePackage{tikz}
+  \usetikzlibrary{positioning,decorations.markings,arrows}
+\RequirePackage{contour}
+
+% package options
+  % font command
+  \DeclareOptionX{fontcmd}[\sffamily]{\def\toneVisualisationFontCmd{#1}}
+  % colors
+  \DeclareOptionX{defaultcolors}{
+    \definecolor{1}{HTML}{7E2639}
+    \definecolor{2}{HTML}{FF98AF}
+    \definecolor{3}{HTML}{AD724A}
+    \definecolor{4}{HTML}{DE6A1C}
+    \definecolor{5}{HTML}{426579}
+    \definecolor{6}{HTML}{86B8F3}
+    \definecolor{7}{HTML}{769164}
+    \definecolor{8}{HTML}{ACC551}
+  }
+  % contour around numbers
+  \DeclareOptionX{draft}{\contournumber{50}}
+  \DeclareOptionX{contourlength}[0.075em]{\contourlength{#1}}
+  \DeclareOptionX{contournumber}[1000]{\contournumber{#1}}
+\ExecuteOptionsX{
+  contourlength=0.075em,
+  contournumber=1000,
+  fontcmd=\sffamily,
+}
+\ProcessOptionsX*\relax
+\ProcessOptionsX\relax
+
+\def\xjoinbycomma<#1#2>{%
+  \ifx\relax#1
+  \else
+    #1,\xjoinbycomma<#2>%
+  \fi
+}
+\def\sendiauToListStr#1{\xjoinbycomma<#1\relax>}
+
+% environment for unt's visualisation approach
+\define at key{untVisualisation}{minmax}{\def\untVisualisation at minmax{#1}}
+\define at key{untVisualisation}{scale}{\def\untVisualisation at scale{#1}}
+\define at key{untVisualisation}{showlabels}{\def\untVisualisation at showlabels{#1}}
+\newenvironment{untVisualisation}[1][]{
+  \setkeys{untVisualisation}{minmax={1,5}, scale=1, showlabels=false}
+  \setkeys{untVisualisation}{#1}
+  \toneVisualisationFontCmd
+  % mxn minmax
+  \pgfmathparse{{\untVisualisation at minmax}[0]}
+  \edef\xstart{\pgfmathresult}
+  \pgfmathparse{{\untVisualisation at minmax}[1]}
+  \edef\xend{\pgfmathresult}
+  \pgfmathparse{{\untVisualisation at minmax}[0]}
+  \edef\ystart{\pgfmathresult}
+  \pgfmathparse{{\untVisualisation at minmax}[1]}
+  \edef\yend{\pgfmathresult}
+  \tikzpicture[scale=\untVisualisation at scale]
+    \begin{scope}[rotate=45, scale=1.4142, line width=0.1em, gray]
+      \foreach \x in {\xstart,...,\xend}
+        \draw (\x,\ystart) -- (\x,\yend);
+      \foreach \y in {\ystart,...,\yend}
+        \draw (\xstart,\y) -- (\xend,\y);
+    \end{scope}
+    \begin{scope}[gray]
+      \expandafter\ifstrequal\expandafter{\untVisualisation at showlabels}{true}{
+        \node at (0,\ystart*2-0.5) {\large\bfseries\xstart};
+        \node at (-\xend+0.6767+\xstart-1,\yend+0.6767+\ystart-1) {\large\bfseries\xend};
+        \node at (\xend-0.6767-\xstart+1,\yend+0.6767+\ystart-1) {\large\bfseries\xend};
+        \node (xAxisArrowTip) at (-\xend+0.6767+\xstart-1+\xend/2-\xstart/2,\yend+0.6767+\ystart-1-\yend/2+\ystart/2) {};
+        \node[below left=1.25em of xAxisArrowTip] (xAxisArrowTail) {};
+        \draw[line width=0.125em, -angle 60] (xAxisArrowTail) -- (xAxisArrowTip);
+        \node (yAxisArrowTail) at (\xend-0.6767-\xstart+1-\xend/2+\xstart/2,\yend+0.6767+\ystart-1-\yend/2+\ystart/2) {};
+        \node[below right=1.25em of yAxisArrowTail] (yAxisArrowTip) {};
+        \draw[line width=0.125em, -angle 60] (yAxisArrowTail) -- (yAxisArrowTip);
+      }{}
+    \end{scope}
+}{
+  \endtikzpicture
+}
+
+% draw a point
+\newcommand{\drawuntpoint}[9][]{
+  % override tikz options, background color, coordinates, tone name, tone value in numbers, label position
+    \node[draw, shape=circle, scale=#9*0.75, inner sep=0.1em, fill, #2, text=white, #1, xshift=#7, yshift=#8]
+    ({#5}{#4})
+    at ({#3}[0],{#3}[1])
+    {#4};
+  \node[#2, #6 = 0pt of {#5}{#4}] {\contour{white}{#5}};
+}
+
+\newcounter{sumOfPitchHeights}
+% keys of options
+\define at key{untpoint}{label}{\def\untpoint at label{#1}}
+\define at key{untpoint}{tikzoptions}{\def\untpoint at tikzoptions{#1}}
+\define at key{untpoint}{bgcolor}{\def\untpoint at bgcolor{#1}}
+\define at key{untpoint}{xshift}{\def\untpoint at xshift{#1}}
+\define at key{untpoint}{yshift}{\def\untpoint at yshift{#1}}
+\define at key{untpoint}{scale}{\def\untpoint at scale{#1}}
+\define at key{untpoint}{stem}{\def\untpoint at stem{#1}}
+% drawing interface
+\newcommand{\untpoint}[3][]{
+  % options, tone value in numbers, tone name
+  \setkeys{untpoint}{label=above, tikzoptions={}, bgcolor=black, xshift=0pt, yshift=0pt, scale=1, stem=false}
+  \setkeys{untpoint}{#1}
+
+  \StrGobbleRight{\sendiauToListStr{#2}}{2}[\sendiaulistStr] % readlist cannot parse trailing comma
+  \readlist\sendiaulist{\sendiaulistStr}
+  \edef\len{\listlen\sendiaulist[]}
+
+  \ifnum0\len=1
+    \drawuntpoint[{\untpoint at tikzoptions}]{\untpoint at bgcolor}{0,{#2}[0]*2}{#3}{#2}
+      {\untpoint at label}{\untpoint at xshift}{\untpoint at yshift}{\untpoint at scale}
+  \else
+    \setcounter{sumOfPitchHeights}{0}
+    \pgfmathparse{\len-2}
+    % calculate the sum of pitch heights
+    \foreach \pitchHeightIndex in {0,...,{\pgfmathresult}} {
+      \pgfmathparse{{#2}[\pitchHeightIndex]}
+      \addtocounter{sumOfPitchHeights}{\pgfmathresult}
+      \pgfmathparse{{#2}[\pitchHeightIndex+1]}
+      \addtocounter{sumOfPitchHeights}{\pgfmathresult}
+    }
+    % draw the point
+    \drawuntpoint[\untpoint at tikzoptions]
+      {\untpoint at bgcolor}
+      {{-({#2}[0])+{#2}[\len-1]},{\thesumOfPitchHeights/(\len-1)}}
+      {#3}{#2}
+      {\untpoint at label}{\untpoint at xshift}{\untpoint at yshift}{\untpoint at scale}
+    % draw the stem
+    \expandafter\ifstrequal\expandafter{\untpoint at stem}{true}{
+      \draw[\untpoint at bgcolor, line width=0.1em] ({-({#2}[0])+{#2}[\len-1]},{#2}[0]+{#2}[\len-1]) -- ({#2}{#3});
+    }{}
+  \fi
+}
+
+% link points
+\define at key{linkuntpoints}{color}{\def\linkuntpoints at color{#1}}
+\define at key{linkuntpoints}{bend}{\def\linkuntpoints at bend{#1}}
+\newcommand{\linkuntpoints}[3][]{
+  \setkeys{linkuntpoints}{color=black, bend={}}
+  \setkeys{linkuntpoints}{#1}
+
+  \begin{scope}[
+      decoration={
+        markings,
+        mark=at position 0.5 with {\arrow[scale=0.875]{angle 60}}}
+    ]
+    \draw[postaction={decorate}, line width=0.15em, \linkuntpoints at color] (#2) to [\linkuntpoints at bend] (#3);
+  \end{scope}
+}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/tonevalue/tonevalue.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2021-07-25 18:09:03 UTC (rev 60057)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2021-07-25 20:45:28 UTC (rev 60058)
@@ -779,8 +779,9 @@
     tkz-orm tikz-page
     tlc-article tlc2 tlcockpit tlmgr-intro-zh-cn tlmgrbasics
     to-be-determined tocbibind tocdata tocloft tocvsec2 todo todonotes
-    tokcycle tokenizer toolbox tools topfloat topiclongtable topletter
-    totalcount totcount totpages toptesi
+    tokcycle tokenizer tonevalue toolbox tools
+    topfloat topiclongtable topletter toptesi
+    totalcount totcount totpages
     tpic2pdftex tpslifonts tqft
     tracklang trajan tram
     translation-array-fr

Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2021-07-25 18:09:03 UTC (rev 60057)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2021-07-25 20:45:28 UTC (rev 60058)
@@ -209,6 +209,7 @@
 depend tkz-graph
 depend tkz-orm
 depend tkz-tab
+depend tonevalue
 depend tqft
 depend tsemlines
 depend tufte-latex

Added: trunk/Master/tlpkg/tlpsrc/tonevalue.tlpsrc
===================================================================


More information about the tex-live-commits mailing list.