| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
%% File: metrix.dtx Copyright (c) Tobias Weh |
| 4 |
%% |
| 5 |
%% This file may be distributed and/or modified under the conditions of the |
| 6 |
%% LaTeX Project Public License (LPPL), either version 1.3c of this |
| 7 |
%% license or (at your option) any later version. The latest version |
| 8 |
%% of this license is in the file |
| 9 |
%% |
| 10 |
%% http://www.latex-project.org/lppl.txt |
| 11 |
%% |
| 12 |
%<*driver|package> |
| 13 |
% The version of expl3 required is tested as early as possible, as |
| 14 |
% some really old versions do not define \ProvidesExplPackage. |
| 15 |
\RequirePackage{expl3}[2016/01/03] |
| 16 |
%<package>\@ifpackagelater{expl3}{2016/01/03} |
| 17 |
%<package> {} |
| 18 |
%<package> {% |
| 19 |
%<package> \PackageError{metrix}{Support package l3kernel too old} |
| 20 |
%<package> {% |
| 21 |
%<package> Please install an up to date version of l3kernel\MessageBreak |
| 22 |
%<package> using your TeX package manager or from CTAN.\MessageBreak |
| 23 |
%<package> \MessageBreak |
| 24 |
%<package> Loading xparse will abort!% |
| 25 |
%<package> }% |
| 26 |
%<package> \endinput |
| 27 |
%<package> } |
| 28 |
\def\metrixFileName{metrix} |
| 29 |
\def\metrixFileDescription{Typeset prosody/metric symbols.} |
| 30 |
\def\metrixFileDate{2019/10/09} |
| 31 |
\def\metrixFileVersion{1.5} |
| 32 |
%</driver|package> |
| 33 |
%<*driver> |
| 34 |
\documentclass[full,english]{l3doc} |
| 35 |
|
| 36 |
\usepackage[latin1]{inputenc} |
| 37 |
\usepackage[T1]{fontenc} |
| 38 |
|
| 39 |
\usepackage{etoolbox} |
| 40 |
|
| 41 |
\usepackage{babel} |
| 42 |
|
| 43 |
\usepackage{xparse} |
| 44 |
\usepackage{xcolor} |
| 45 |
\definecolor{twred}{HTML}{91031F} |
| 46 |
|
| 47 |
\hypersetup{ |
| 48 |
allcolors=twred, |
| 49 |
} |
| 50 |
|
| 51 |
\usepackage{metrix} |
| 52 |
|
| 53 |
\usepackage{longtable,tabu,booktabs} |
| 54 |
\renewcommand{\arraystretch}{1.3} |
| 55 |
\usepackage[bottom]{footmisc} |
| 56 |
|
| 57 |
\usepackage{mdframed} |
| 58 |
\newmdenv[ |
| 59 |
backgroundcolor=black!15, |
| 60 |
linecolor=twred, |
| 61 |
linewidth=1.25pt, |
| 62 |
topline=false, |
| 63 |
rightline=false, |
| 64 |
bottomline=false, |
| 65 |
frametitlefont=\sffamily\bfseries, |
| 66 |
frametitle=Example, |
| 67 |
]{example} |
| 68 |
|
| 69 |
\usepackage{microtype} |
| 70 |
\usepackage{tgpagella} |
| 71 |
\usepackage[scale=0.875]{tgheros} |
| 72 |
\usepackage{ascii} |
| 73 |
|
| 74 |
\usepackage{upquote} |
| 75 |
% add \@noligs to the redefinitions made by doc.sty to make upquote work |
| 76 |
\makeatother |
| 77 |
\patchcmd{\verb}{\ttfamily}{\ttfamily\@noligs}{}{} |
| 78 |
\patchcmd{\verbatim}{\frenchspacing}{\frenchspacing\@noligs}{}{} |
| 79 |
\patchcmd{\macrocode}{\frenchspacing}{\frenchspacing\@noligs}{}{} |
| 80 |
\makeatother |
| 81 |
|
| 82 |
\edef\pluschar{+} |
| 83 |
|
| 84 |
\AtBeginDocument{ |
| 85 |
\DeleteShortVerb{\|} |
| 86 |
\DeleteShortVerb{\"} |
| 87 |
\MakeShortVerb{\+} |
| 88 |
} |
| 89 |
|
| 90 |
\makeatletter |
| 91 |
\def\meta@font@select{\itshape\rmfamily} |
| 92 |
\makeatother |
| 93 |
|
| 94 |
\IndexPrologue{ |
| 95 |
\section*{Index} |
| 96 |
\addcontentsline{toc}{section}{Index} |
| 97 |
The italic numbers denote the pages where the |
| 98 |
corresponding entry is described, |
| 99 |
numbers underlined point to the definition, |
| 100 |
all others indicate the places where it is used. |
| 101 |
} |
| 102 |
\GlossaryPrologue{ |
| 103 |
\section{Change History} |
| 104 |
{\GlossaryParms\ttfamily\hyphenchar\font=`\-} |
| 105 |
} |
| 106 |
\AtBeginDocument{\renewcommand*{\glossaryname}{Change History}} |
| 107 |
|
| 108 |
\def\metrix/{\textcolor{twred}{\textbf{\textsf{m\u{e}trix}}}} |
| 109 |
\def\TikZ/{Ti\emph{k}Z} |
| 110 |
\newrobustcmd{\Star}{\meta{\textup{\texttt{*}}}} |
| 111 |
\newrobustcmd{\mail}[1]{\href{mailto:#1}{#1}} |
| 112 |
|
| 113 |
|
| 114 |
\begin{document} |
| 115 |
\DocInput{\metrixFileName.dtx} |
| 116 |
\end{document} |
| 117 |
%</driver> |
| 118 |
% \fi |
| 119 |
% |
| 120 |
% |
| 121 |
% \title{The \metrix/ package} |
| 122 |
% |
| 123 |
% \author{Tobias Weh\thanks{URL: \url{http://tobiw.de/en}, Mail: \mail{[email protected]}}} |
| 124 |
% \changes{v1.1a}{2015/07/23}{New contact info (mail and URL).} |
| 125 |
% |
| 126 |
% \date{Version \metrixFileVersion\ -- Released \metrixFileDate} |
| 127 |
% |
| 128 |
% \maketitle |
| 129 |
% |
| 130 |
% \begin{documentation}\MakePrivateLetters |
| 131 |
% |
| 132 |
% \begin{abstract} |
| 133 |
% \mbox{}\par |
| 134 |
% \begin{center} |
| 135 |
% \Large |
| 136 |
% \metrics{_ _ _ _ _ | _ u u _ u u _ } |
| 137 |
% {\acct{e}t qu\acct{o}d temp-t\acct{a}-bam | scr\acct{i}-be-re v\acct{e}r-sus \acct{e}-rat} |
| 138 |
% \end{center} |
| 139 |
% \par\bigskip |
| 140 |
% The \metrix/ package can be used to print the prosodics/metrics of (latin) verses. |
| 141 |
% It provides macros to typeset the symbols stand alone and in combination with syllables |
| 142 |
% (including automatic alignment like seen above). Furthermore it defines a new br\brv{e}vis |
| 143 |
% and a l\lng{o}nga accent^^A |
| 144 |
% \footnote{I know that these signs are no accents in the liguistic sense, but |
| 145 |
% they are in the \TeX\ tradition \dots} |
| 146 |
% and \bow{a b}ow to contract syllables. |
| 147 |
% |
| 148 |
% \medskip |
| 149 |
% \emph{Thanks to David Carlisle, Marco Daniel, Enrico Gregorio, Bruno Le Floch and |
| 150 |
% Joseph Wright who helped me with starting in \LaTeX3 programming. The verse above |
| 151 |
% is by Ovid in his Tristia~4,10,26.} |
| 152 |
% \end{abstract} |
| 153 |
% |
| 154 |
% \section{Prerequisites} |
| 155 |
% \metrix/ relies only on a few packages: \pkg{tikz} (including the +calc+ library), \pkg{xpatch} |
| 156 |
% and \pkg{xparse}, which stand for the whole \LaTeX3 bundle. |
| 157 |
% |
| 158 |
% \section{Package loading} |
| 159 |
% Load \metrix/ as usual with +\usepackage{metrix}+. At the moment it has no options. |
| 160 |
% |
| 161 |
% \changes{v1.0a}{2013/08/14}{Added \texttt{cwl} file for TeXstudio} |
| 162 |
% A CWL file +metrix.cwl+ for autocompletition in TeXstudio is available in the |
| 163 |
% GitHub repo. To install the CWL file copy it to +~/.config/texstudio/+ |
| 164 |
% on Linux and OS X and to +C:\Documents and Settings/User/AppData/Roaming/texstudio/+. |
| 165 |
% See section 1.5 of the TeXstudio manual for more information. |
| 166 |
% |
| 167 |
% |
| 168 |
% \section{Bugs and feedback} |
| 169 |
% \subsection{Known issues} |
| 170 |
% \begin{itemize} |
| 171 |
% \item At the moment the escaping of hyphen chars is not that good (see section~\ref{faq:hyphen}). |
| 172 |
% \item Unfortunatly you can't use the active quotes of \pkg{csquotes} inside of |
| 173 |
% \cs{metrics} syllable list (see section~\ref{faq:quotes}). |
| 174 |
% \end{itemize} |
| 175 |
% I'm sure there are more bugs and issues let me know if you find them \dots |
| 176 |
% \subsection{Feedback} |
| 177 |
% Any feedback on \metrix/ is appreciated. You may use its GitHub repository at |
| 178 |
% \url{https://github.com/tweh/metrix} to request features and report bugs or |
| 179 |
% send me an e-mail (\mail{[email protected]}). |
| 180 |
% |
| 181 |
% Please note that I don't speak latin myself and forthat the examples in this manual |
| 182 |
% may be wrong---as long as they show how to use the package I don't consider such |
| 183 |
% errors as bugs +;-)+. |
| 184 |
% |
| 185 |
% \section{Metric symbols} |
| 186 |
% \subsection{Syntax for symbols}\label{sec:syntax} |
| 187 |
% \changes{v1.1}{2014/07/02}{New section about the symbol syntax (see \ref{sec:syntax})} |
| 188 |
% Before I'll show you the central macros for typesetting the symbols, you need |
| 189 |
% to ``learn'' the syntax for the symbols. All symbols are represented by a single |
| 190 |
% or a combination of characters. The list with all available abbreviations can |
| 191 |
% be found in table~\ref{tab:symbols}. Please keep in mind that \metrix/ uses spaces to |
| 192 |
% separate the abbreviations an something like +_'x+ will cause an error, the |
| 193 |
% correct input is \verb*|_ ' x| (where \verb*| | indicates a space/blank). |
| 194 |
% \subsubsection*{Accents above symbols (ictus)} |
| 195 |
% If you want to add an additional accent above a symbol you may precede the symbol with |
| 196 |
% an slash +/+ for an acute or a star +*+ for a grave accent. At the moment this only works |
| 197 |
% with breve (+/u+ or +*u+) and longum (+/_+ or +*_+). |
| 198 |
% \begin{example} |
| 199 |
% An ictus (although out of date). |
| 200 |
% \begin{verbatim} |
| 201 |
% \metricsymbols{/_ u u /_ _ /_} |
| 202 |
% \end{verbatim} |
| 203 |
% \metricsymbols{/_ u u /_ _ /_} |
| 204 |
% \end{example} |
| 205 |
%\pagebreak |
| 206 |
% \begin{longtabu}to \textwidth {l>{\itshape}lcXl} |
| 207 |
% \caption{Symbol abbreviations\label{tab:symbols}}\\ |
| 208 |
% \toprule |
| 209 |
% \rowfont{\bfseries\sffamily} \multicolumn{2}{l}{abbreviation} & symbol & name/explantion & accent/ictus? \\ |
| 210 |
% \midrule |
| 211 |
% \endfirsthead |
| 212 |
% \caption{Symbol abbreviations (cont.)}\\ |
| 213 |
% \toprule |
| 214 |
% \rowfont{\bfseries\sffamily} \multicolumn{2}{l}{abbreviation} & symbol & name/explantion & accent/ictus? \\ |
| 215 |
% \midrule |
| 216 |
% \endhead |
| 217 |
% \multicolumn{5}{r}{\dots} |
| 218 |
% \endfoot |
| 219 |
% \bottomrule |
| 220 |
% \endlastfoot |
| 221 |
% +e+ && \metricsymbols{e} & empty (=\,invisible) symbol & \\ |
| 222 |
% +u+ && \metricsymbols{u} & elementum breve & yes \\ |
| 223 |
% +_+ & underscore & \metricsymbols{_} & elementum longum & yes \\ |
| 224 |
% +uu+ && \metricsymbols{uu} & double breve & \\ |
| 225 |
% +uu_+ && \metricsymbols{uu_} & elementum biceps & \\ |
| 226 |
% +_uu+ && \metricsymbols{_uu} & elementum biceps & \\ |
| 227 |
% +u_uu+ && \metricsymbols{u_uu} & elementum anceps & \\ |
| 228 |
% +x+ && \metricsymbols{x} & elementum anceps & \\ |
| 229 |
% +n+ && \metricsymbols{n} & elementum indifferens & \\ |
| 230 |
% +u_+ && \metricsymbols{u_} & elementum indifferens & \\ |
| 231 |
% +_u+ && \metricsymbols{_u} & elementum indifferens & \\ |
| 232 |
% +A+ && \metricsymbols{A} & * & \\ |
| 233 |
% +v+ && \metricsymbols{v} & * & \\ |
| 234 |
% +o+ && \metricsymbols{o} & * & \\ |
| 235 |
% +oo+ && \metricsymbols{oo} & aeolic base & \\ |
| 236 |
% +l+ && \metricsymbols{l} & caesura or break & \\ |
| 237 |
% +ll+ && \metricsymbols{ll} & caesura or end of period & \\ |
| 238 |
% +p+ && \metricsymbols{p} & primary stress & \\ |
| 239 |
% +s+ && \metricsymbols{s} & secondary stress & \\ |
| 240 |
% +|+ & pipe & \metricsymbols{|} & break (see \ref{sec:breaks}) & \\ |
| 241 |
% +||+ & two pipes & \metricsymbols{||} & verse break (see \ref{sec:breaks}) & \\ |
| 242 |
% +'+ & apostrophe (shift\,\pluschar\,\#) & \metricsymbols{'} & |
| 243 |
% shorter break (see \ref{sec:breaks}) & \\ |
| 244 |
% +,+ & comma & \metricsymbols{,} & shorter break (see \ref{sec:breaks}) & \\ |
| 245 |
% \end{longtabu} |
| 246 |
% \par |
| 247 |
% {\vspace{-0.5\baselineskip}\itshape\footnotesize\noindent |
| 248 |
% * I added these symbols as someone might needs them. If you use them please let me |
| 249 |
% know what to add as name/explanation.\par} |
| 250 |
% \subsection{Stand alone metric symbols} |
| 251 |
% \begin{function}[EXP]{\metricsymbols} |
| 252 |
% \begin{syntax} |
| 253 |
% \cs{metricsymbols}\Star\oarg{highlighting}\Arg{symbols} |
| 254 |
% \end{syntax} |
| 255 |
% This macro typesets stand alone versions of the symbols, i.e. without |
| 256 |
% syllables below (or above) of them. Use the starred version for smaller (in line) symbols |
| 257 |
% and the normal version for bigger symbols. \meta{symbols} must be a list of |
| 258 |
% abbreviations as explained in section~\ref{sec:syntax}; the abbreviations must be |
| 259 |
% separated by one (or more) spaces. |
| 260 |
% \end{function} |
| 261 |
% \begin{example} |
| 262 |
% The \emph{diphilius} can be shown with this code. |
| 263 |
% \begin{verbatim} |
| 264 |
% \metricsymbols{_ _uu _ _uu u_ | x _ u u _ x u_} |
| 265 |
% \end{verbatim} |
| 266 |
% \metricsymbols{_ _uu _ _uu u_ | x _ u u _ x u_} |
| 267 |
% \end{example} |
| 268 |
% \subsection{Metric symbols above (or below) syllables} |
| 269 |
% \begin{function}[EXP]{\metrics} |
| 270 |
% \begin{syntax} |
| 271 |
% \cs{metrics}\oarg{highlighting}\Arg{symbols}\Arg{syllables} |
| 272 |
% \end{syntax} |
| 273 |
% This command can be used to align the symbols above (or below) |
| 274 |
% syllables. The first argument works as in \cs{metricsymbols}, |
| 275 |
% the second argument \meta{syllables} takes the hyphenated verse. |
| 276 |
% \end{function} |
| 277 |
% \begin{example} |
| 278 |
% \begin{verbatim} |
| 279 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 280 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 281 |
% \end{verbatim} |
| 282 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 283 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 284 |
% \end{example} |
| 285 |
% |
| 286 |
% \medskip\noindent |
| 287 |
% You may use multiple spaces to align the abbreviations above the syllables but this is not mandatory and |
| 288 |
% does not affect the output. But mind that the number of syllables equals the number of symbols. If you |
| 289 |
% use the \metricsymbols*{oo} symbol you may omit the hyphen between the two syllables beloning to this |
| 290 |
% symbol. You can merge multiple words by \emph{embracing} them. |
| 291 |
% \begin{example} |
| 292 |
% \begin{verbatim} |
| 293 |
% \metrics{_ u u _ _ _ _ _ } |
| 294 |
% {mol-ta quo-{que et} bel-lo pas-sus} |
| 295 |
% \end{verbatim} |
| 296 |
% \metrics{_ u u _ _ _ _ _ } |
| 297 |
% {mol-ta quo-{que et} bel-lo pas-sus} |
| 298 |
% \end{example} |
| 299 |
% |
| 300 |
% The macros \cs{metrics} and \cs{metricsymbols} can also be used to typeset |
| 301 |
% single symbols or symbol syllable combinations. |
| 302 |
% \begin{example} |
| 303 |
% \begin{verbatim} |
| 304 |
% The \metricsymbols*{_uu} shows an \emph{elementum biceps}. |
| 305 |
% \end{verbatim} |
| 306 |
% The \metricsymbols*{_uu} shows an \emph{elementum biceps}. |
| 307 |
% \end{example} |
| 308 |
% |
| 309 |
% \subsection{Adding symbols for breaks}\label{sec:breaks} |
| 310 |
% \changes{v1.1}{2014/07/02}{New section about breaks (see \ref{sec:breaks})} |
| 311 |
% As seen in the examples above you can use pipes, i.e. +|+ or +||+, to mark breaks. |
| 312 |
% In \cs{metrics} the markers must appear in \meta{symbols} and \meta{syllables}. |
| 313 |
% \begin{example} |
| 314 |
% \begin{verbatim} |
| 315 |
% \metrics{_ u u _ _ _ | _ _ u u _ ||} |
| 316 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||} |
| 317 |
% \end{verbatim} |
| 318 |
% \metrics{_ u u _ _ _ | _ _ u u _ ||} |
| 319 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||} |
| 320 |
% \end{example} |
| 321 |
% If you want the breaks to be shown in the symbol line only you can use the |
| 322 |
% shorter break which is represented by an apostrophe (shift\,\pluschar\,\#) |
| 323 |
% or a comma. This mark must be used in \meta{symbols} only and is kind of special: |
| 324 |
% \begin{itemize} |
| 325 |
% \item It \emph{can't} be highlighted and thus doesn't count for the numbers used |
| 326 |
% for highlights, |
| 327 |
% \item it is ignored at the beginning and the end of \meta{symbols}, |
| 328 |
% \item in \cs{metricsymbols} it is treated like the pipe, and |
| 329 |
% \item \TeX\ needs at least one additional run to get the right positions. |
| 330 |
% \end{itemize} |
| 331 |
% \begin{example} |
| 332 |
% \begin{verbatim} |
| 333 |
% \metrics{_ u u ' _ u u ' _ _ ' _ _ | _ u u | _ _ ||} |
| 334 |
% {Ar-ma vi-rum-que ca-no Tro-iae qui | pri-mus ab | o-ris ||} |
| 335 |
% \end{verbatim} |
| 336 |
% \metrics{_ u u ' _ u u ' _ _ ' _ _ | _ u u | _ _ ||} |
| 337 |
% {Ar-ma vi-rum-que ca-no Tro-iae qui | pri-mus ab | o-ris ||} |
| 338 |
% \end{example} |
| 339 |
% The difference between +'+ and +,+ is that the break defined with an apostrophe |
| 340 |
% is vertically centred between the surrounding symbols while the break set with |
| 341 |
% the comma is vertically centred between the corresponding syllables. They both |
| 342 |
% align horizontally within the row of symbols. |
| 343 |
% \begin{example} |
| 344 |
% \begin{verbatim} |
| 345 |
% \emph{apostrophe:} |
| 346 |
% \metrics{_ _ ' _ } |
| 347 |
% {au-ra-{r\bow{um e}st}} \qquad |
| 348 |
% \emph{comma:} |
| 349 |
% \metrics{_ _ , _ } |
| 350 |
% {au-ra-{r\bow{um e}st}} |
| 351 |
% \end{verbatim} |
| 352 |
% \emph{apostrophe:} |
| 353 |
% \metrics{_ _ ' _ } |
| 354 |
% {au-ra-{r\bow{um e}st}} \qquad |
| 355 |
% \emph{comma:} |
| 356 |
% \metrics{_ _ , _ } |
| 357 |
% {au-ra-{r\bow{um e}st}} |
| 358 |
% \end{example} |
| 359 |
% |
| 360 |
% \subsection{Highlight certain symbols/syllabels} |
| 361 |
% As you can see above \cs{metrics} and \cs{metricsymbols} got an optional argument taking |
| 362 |
% some options to highlight a certain symbol/syllable. The \meta{highlighting} list must |
| 363 |
% contain one or more comma separated pairs of \meta{numbers}+=+\meta{style}, where \meta{numbers} |
| 364 |
% is the number of a symbol/syllable (e.g. +3+) or a list of numbers separated by plus signs |
| 365 |
% (e.g. \verb.2+3+5.) in the list and \meta{style} is any \TikZ/ style (other \TikZ/ options may not |
| 366 |
% work properly, so you maybe must create your own style, see section~\ref{faq:highlight}.) |
| 367 |
% |
| 368 |
% \medskip\noindent |
| 369 |
% \metrix/ comes with several predefined highlighting styles: |
| 370 |
% \DeleteShortVerb{\+} |
| 371 |
% \begin{itemize} |
| 372 |
% \item \textbf{\texttt{add arrow}}\\[2ex] |
| 373 |
% \metrics[3+8={add arrow}]{_ u u _ _ _ | _ _ u u _ ||} |
| 374 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill |
| 375 |
% \metricsymbols[2={add arrow}]{u u_uu x _ | u _ n ||} |
| 376 |
% |
| 377 |
% This style adds an arrow above the metric symbol. To change the arrow symbol, edit |
| 378 |
% the \metrix/ variable \verb+arrow+. |
| 379 |
% |
| 380 |
% \item \textbf{\texttt{add text}=}\meta{text}\\[2ex] |
| 381 |
% \metrics[3+8={add text=shout!}]{_ u u _ _ _ | _ _ u u _ ||} |
| 382 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill |
| 383 |
% \metricsymbols[2={add text=whisper}]{u u_uu x _ | u _ n ||} |
| 384 |
% |
| 385 |
% This style takes a \emph{mandatory} argument to add some text above a symbol. |
| 386 |
% To change the default font change the font of the \TikZ/ node style |
| 387 |
% \verb|every metrix added text|. |
| 388 |
% |
| 389 |
% \item \textbf{\texttt{bold highlight}}\\[2ex] |
| 390 |
% \metrics[2+5+9+13={bold highlight}]{_ u u _ _ _ | _ _ u u _ ||} |
| 391 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill |
| 392 |
% \metricsymbols[2+3+5+7={bold highlight}]{u u_uu x _ | u _ n ||} |
| 393 |
% |
| 394 |
% \item \textbf{\texttt{colored highlight=}\meta{color}}\\[2ex] |
| 395 |
% \metrics[2+5+9+13={colored highlight}]{_ u u _ _ _ | _ _ u u _ ||} |
| 396 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill |
| 397 |
% \metricsymbols[2+3+5+7={colored highlight}]{u u_uu x _ | u _ n ||} |
| 398 |
% |
| 399 |
% This style has an \emph{optional} argument to change the highlighting color on the fly. |
| 400 |
% To change the color in general change the value of the variable \verb.highlightcolor.. |
| 401 |
% |
| 402 |
% \item \textbf{\texttt{dashed highlight}}\\[2ex] |
| 403 |
% \metrics[2+5+9+13={dashed highlight}]{_ u u _ _ _ | _ _ u u _ ||} |
| 404 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill |
| 405 |
% \metricsymbols[2+3+5+7={dashed highlight}]{u u_uu x _ | u _ n ||} |
| 406 |
% |
| 407 |
% \item \textbf{\texttt{filled highlight=}\meta{color}}\\[2ex] |
| 408 |
% \metrics[2+5+9+13={filled highlight}]{_ u u _ _ _ | _ _ u u _ ||} |
| 409 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill |
| 410 |
% \metricsymbols[2+3+5+7={filled highlight}]{u u_uu x _ | u _ n ||} |
| 411 |
% |
| 412 |
% This style has an \emph{optional} argument to change the filling color on the fly. |
| 413 |
% To change the color in general change the value of the variable \verb.fillcolor.. |
| 414 |
% |
| 415 |
% \item \textbf{\texttt{superscript=}\meta{text}}\\[2ex] |
| 416 |
% \metrics[7={superscript=a},13={superscript=b}]{_ u u _ _ _ | _ _ u u _ ||} |
| 417 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill |
| 418 |
% \metricsymbols[5={superscript=a},9={superscript=b}]{u u_uu x _ | u _ n ||} |
| 419 |
% |
| 420 |
% This style takes a \emph{mandatory} argument to add a superscript letter or a |
| 421 |
% number to a symbol. It is designed to work with the break symbols, but works with others too. |
| 422 |
% \end{itemize} |
| 423 |
% \MakeShortVerb{\+} |
| 424 |
% |
| 425 |
% \medskip\noindent |
| 426 |
% \textbf{Sytles with an agrument must be set in braces} (see the examples)\textbf{!} |
| 427 |
% \begin{example} |
| 428 |
% Higlight some syllables with color. |
| 429 |
% \begin{verbatim} |
| 430 |
% \metrics |
| 431 |
% [ |
| 432 |
% 2=colored highlight, |
| 433 |
% 4={colored highlight=orange}, |
| 434 |
% 5={colored highlight=blue}, |
| 435 |
% 7=colored highlight, |
| 436 |
% 11=colored highlight |
| 437 |
% ] |
| 438 |
% {_ u u _ _ _ | _ _ u u _ } |
| 439 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob} |
| 440 |
% \end{verbatim} |
| 441 |
% \metrics |
| 442 |
% [ |
| 443 |
% 2=colored highlight, |
| 444 |
% 4={colored highlight=orange}, |
| 445 |
% 5={colored highlight=blue}, |
| 446 |
% 7=colored highlight, |
| 447 |
% 11=colored highlight |
| 448 |
% ] |
| 449 |
% {_ u u _ _ _ | _ _ u u _ } |
| 450 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob} |
| 451 |
% \end{example} |
| 452 |
% \begin{example} |
| 453 |
% The shorter version using the \verb.+. syntax. |
| 454 |
% \begin{verbatim} |
| 455 |
% \metrics[2+5+9=bold highlight] |
| 456 |
% {_ u u _ _ _ | _ _ u u _ } |
| 457 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob} |
| 458 |
% \end{verbatim} |
| 459 |
% \DeleteShortVerb{\+} |
| 460 |
% \metrics[2+5+9=bold highlight] |
| 461 |
% {_ u u _ _ _ | _ _ u u _ } |
| 462 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob} |
| 463 |
% \end{example} |
| 464 |
% \begin{example} |
| 465 |
% Mixing and combining styles is possible too. |
| 466 |
% \begin{verbatim} |
| 467 |
% \metricsymbols[1+4=bold highlight, 3=colored highlight] |
| 468 |
% {u_uu x _ || u _ n ||} \\ |
| 469 |
% \metricsymbols[2={bold highlight,colored highlight}] |
| 470 |
% {u_uu x _ || u _ n ||} |
| 471 |
% \end{verbatim} |
| 472 |
% \DeleteShortVerb{\+} |
| 473 |
% \metricsymbols[1+4=bold highlight, 3=colored highlight] |
| 474 |
% {u_uu x _ || u _ n ||}\\ |
| 475 |
% \metricsymbols[2={bold highlight,colored highlight}] |
| 476 |
% {u_uu x _ || u _ n ||} |
| 477 |
% \MakeShortVerb{\+} |
| 478 |
% \end{example} |
| 479 |
% \begin{example} |
| 480 |
% Add some superscripts to the breaks. |
| 481 |
% \begin{verbatim} |
| 482 |
% \metricsymbols[6={superscript=5},10={colored highlight,superscript=bD}] |
| 483 |
% {_ _uu _ _uu _ | _uu _ _uu || _ uu _ u_} |
| 484 |
% \end{verbatim} |
| 485 |
% \metricsymbols[6={superscript=5},10={colored highlight,superscript=bD}] |
| 486 |
% {_ _uu _ _uu _ | _uu _ _uu || _ uu _ u_} |
| 487 |
% \end{example} |
| 488 |
% |
| 489 |
% \section{Accents and bows} |
| 490 |
% \begin{function}[EXP]{\brv,\lng,\acct} |
| 491 |
% \begin{syntax} |
| 492 |
% \cs{brv}\Arg{vowel}\qquad\cs{lng}\Arg{vowel}\qquad\cs{acct}\Arg{vowel} |
| 493 |
% \end{syntax} |
| 494 |
% The first commands offer an alternative to the standard accent macros +\u+ and +\=+. The difference |
| 495 |
% is that \cs{brv} centers the accent above the vowel or diphthong and \cs{lng} stretches the bar across |
| 496 |
% the whole vowel or diphthong. \cs{acct} adds an accent dot below a vowel or dipthtong.\footnotemark |
| 497 |
% \end{function} |
| 498 |
% \footnotetext{Actually you can use any vowel, diphtong, syllable or word as \meta{vowel}, |
| 499 |
% it makes no difference as long as it is text.} |
| 500 |
% \begin{example} |
| 501 |
% Add accents to all vowels. |
| 502 |
% \begin{verbatim} |
| 503 |
% \brv{a}m\acct{\lng{i}}c\brv{u}s pr\acct{\brv{o}}f\brv{u}g\brv{u}s |
| 504 |
% \end{verbatim} |
| 505 |
% \brv{a}m\acct{\lng{i}}c\brv{u}s pr\acct{\brv{o}}f\brv{u}g\brv{u}s |
| 506 |
% \end{example} |
| 507 |
% |
| 508 |
% \metrix/ also tries to do some kind of italic correction, and shifts the accents a little to the |
| 509 |
% right when an italic or slanted font is used. |
| 510 |
% \par\large\medskip |
| 511 |
% \brv{u}\enskip\textit{\brv{u}}\enskip\textsl{\brv{u}}\qquad |
| 512 |
% \brv{i}\enskip\textit{\brv{i}}\enskip\textsl{\brv{i}}\qquad |
| 513 |
% \brv{ae}\enskip\textit{\brv{ae}}\enskip\textsl{\brv{ae}}\hfill |
| 514 |
% {\sffamily |
| 515 |
% \brv{u}\enskip\textit{\brv{u}}\enskip\textsl{\brv{u}}\qquad |
| 516 |
% \brv{i}\enskip\textit{\brv{i}}\enskip\textsl{\brv{i}}\qquad |
| 517 |
% \brv{ae}\enskip\textit{\brv{ae}}\enskip\textsl{\brv{ae}}\hfill\mbox{}} |
| 518 |
% \par\medskip |
| 519 |
% \lng{u}\enskip\textit{\lng{u}}\enskip\textsl{\lng{u}}\qquad |
| 520 |
% \lng{i}\enskip\textit{\lng{i}}\enskip\textsl{\lng{i}}\qquad |
| 521 |
% \lng{ae}\enskip\textit{\lng{ae}}\enskip\textsl{\lng{ae}}\hfill |
| 522 |
% {\sffamily |
| 523 |
% \lng{u}\enskip\textit{\lng{u}}\enskip\textsl{\lng{u}}\qquad |
| 524 |
% \lng{i}\enskip\textit{\lng{i}}\enskip\textsl{\lng{i}}\qquad |
| 525 |
% \lng{ae}\enskip\textit{\lng{ae}}\enskip\textsl{\lng{ae}}\hfill\mbox{}} |
| 526 |
% \par\medskip |
| 527 |
% \acct{u}\enskip\textit{\acct{u}}\enskip\textsl{\acct{u}}\qquad |
| 528 |
% \acct{i}\enskip\textit{\acct{i}}\enskip\textsl{\acct{i}}\qquad |
| 529 |
% \acct{ae}\enskip\textit{\acct{ae}}\enskip\textsl{\acct{ae}}\hfill |
| 530 |
% {\sffamily |
| 531 |
% \acct{u}\enskip\textit{\acct{u}}\enskip\textsl{\acct{u}}\qquad |
| 532 |
% \acct{i}\enskip\textit{\acct{i}}\enskip\textsl{\acct{i}}\qquad |
| 533 |
% \acct{ae}\enskip\textit{\acct{ae}}\enskip\textsl{\acct{ae}}\hfill\mbox{}} |
| 534 |
% \par\normalsize |
| 535 |
% |
| 536 |
% \subsubsection*{Fine Tuning} |
| 537 |
% To make some fine tuning for a certain accent possible the three macros actually got |
| 538 |
% some additional, \emph{optional} arguments: |
| 539 |
% {\par\medskip\noindent\ttfamily |
| 540 |
% \cs{brv}+(+\meta{coordinate}+)+\Arg{vowel}\\ |
| 541 |
% \cs{lng}+(+\meta{coordinate}+)+\oarg{left length}\Arg{vowel}\oarg{right length}\\ |
| 542 |
% \cs{acct}+(+\meta{coordinate}+)+\Arg{vowel}\par} |
| 543 |
% |
| 544 |
% \medskip |
| 545 |
% Where \meta{coordinate} must be a valid \TikZ/ coordinate and can be used to move |
| 546 |
% the accent. In addition to that the accent produced by \cs{lng} can be extended |
| 547 |
% with \meta{left/right length} by a certain amount. |
| 548 |
% |
| 549 |
% \begin{example} |
| 550 |
% Prevent collision between accent and descender of an \textit{f}. |
| 551 |
% \begin{verbatim} |
| 552 |
% \itshape somn\acct(-0.05em,-0.45ex){i}fero |
| 553 |
% \end{verbatim} |
| 554 |
% \itshape somn\acct(-0.05em,-0.45ex){i}fero |
| 555 |
% \end{example} |
| 556 |
% |
| 557 |
% \begin{function}[EXP]{\bow} |
| 558 |
% \begin{syntax} |
| 559 |
% \cs{bow}\Arg{syllables} |
| 560 |
% \end{syntax} |
| 561 |
% \cs{bow} can be used to show the contraction of two vowels or syllables. |
| 562 |
% \end{function} |
| 563 |
% \begin{example} |
| 564 |
% \begin{verbatim} |
| 565 |
% mult\bow{um i}lle or d\bow{ei}nde |
| 566 |
% \end{verbatim} |
| 567 |
% mult\bow{um i}lle or d\bow{ei}nde |
| 568 |
% \end{example} |
| 569 |
% |
| 570 |
% \subsubsection*{Fine Tuning} |
| 571 |
% To make some fine tuning for a certain bow possible the macro actually has |
| 572 |
% some additional, \emph{optional} arguments: |
| 573 |
% {\par\medskip\noindent\ttfamily |
| 574 |
% \cs{bow}+(+\meta{coordinate}+)+\oarg{left length}\Arg{syllable}\oarg{right length}\par} |
| 575 |
% |
| 576 |
% \medskip |
| 577 |
% Where \meta{left/right length} can be used to shorten the bow by a certain amount. |
| 578 |
% |
| 579 |
% \begin{example} |
| 580 |
% Prevent collision between accent and bow. |
| 581 |
% \begin{verbatim} |
| 582 |
% c\acct{oe}-l\bow{um \acct{e}}[2pt]st |
| 583 |
% \end{verbatim} |
| 584 |
% c\acct{oe}-l\bow{um \acct{e}}[2pt]st |
| 585 |
% \end{example} |
| 586 |
% |
| 587 |
% \section{Environments} |
| 588 |
% \begin{function}{symbolline} |
| 589 |
% This environment can be used to display a line of stand alone symbols. |
| 590 |
% \end{function} |
| 591 |
% \begin{example} |
| 592 |
% \begin{verbatim} |
| 593 |
% Text text text ... |
| 594 |
% \begin{symbolline} |
| 595 |
% \metricsymbols{oo e _ u u _ e u _ e u _ u_} |
| 596 |
% \end{symbolline} |
| 597 |
% Text text text ... |
| 598 |
% \end{verbatim} |
| 599 |
% Text text text ... |
| 600 |
% \begin{symbolline} |
| 601 |
% \metricsymbols{oo e _ u u _ e u _ e u _ u_} |
| 602 |
% \end{symbolline} |
| 603 |
% Text text text ... |
| 604 |
% \end{example} |
| 605 |
% \begin{function}{metricverses} |
| 606 |
% \begin{syntax} |
| 607 |
% +\begin{metricverses}+\oarg{source} |
| 608 |
% \meta{content optional \cs{verseref}\Arg{reference}} |
| 609 |
% +\end{metricverses}+ |
| 610 |
% \end{syntax} |
| 611 |
% Use this environment to display a verse with metric symbols, separate |
| 612 |
% multiple verses by a blank line. |
| 613 |
% \end{function} |
| 614 |
% \begin{example} |
| 615 |
% \begin{verbatim} |
| 616 |
% Text text text ... |
| 617 |
% \begin{metricverses} |
| 618 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 619 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 620 |
% |
| 621 |
% \metrics{_ u u _ u u _ | _ _ u u |
| 622 |
% _ u u _ } |
| 623 |
% {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit |
| 624 |
% per te-ne-bras} |
| 625 |
% \end{metricverses} |
| 626 |
% Text text text ... |
| 627 |
% \end{verbatim} |
| 628 |
% Text text text ... |
| 629 |
% \begin{metricverses} |
| 630 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 631 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 632 |
% |
| 633 |
% \metrics{_ u u _ u u _ | _ _ u u |
| 634 |
% _ u u _ } |
| 635 |
% {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit |
| 636 |
% per te-ne-bras} |
| 637 |
% \end{metricverses} |
| 638 |
% Text text text ... |
| 639 |
% \end{example} |
| 640 |
% \begin{function}{\verseref} |
| 641 |
% \begin{syntax} |
| 642 |
% \cs{verseref}\Arg{reference} |
| 643 |
% \end{syntax} |
| 644 |
% Inside of +{metricverses}+ you may use \cs{verseref} to print a reference. |
| 645 |
% \end{function} |
| 646 |
% \begin{example} |
| 647 |
% \begin{verbatim} |
| 648 |
% Text text text ... |
| 649 |
% \begin{metricverses} |
| 650 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 651 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 652 |
% \verseref{Plaut. \emph{Curc.} 96f} |
| 653 |
% |
| 654 |
% \metrics{_ u u _ u u _ | _ _ u u |
| 655 |
% _ u u _ } |
| 656 |
% {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit |
| 657 |
% per te-ne-bras} |
| 658 |
% \end{metricverses} |
| 659 |
% Text text text ... |
| 660 |
% \end{verbatim} |
| 661 |
% Text text text ... |
| 662 |
% \begin{metricverses} |
| 663 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 664 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 665 |
% \verseref{Plaut. \emph{Curc.} 96f} |
| 666 |
% |
| 667 |
% \metrics{_ u u _ u u _ | _ _ u u _ u u _ } |
| 668 |
% {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit per te-ne-bras} |
| 669 |
% \end{metricverses} |
| 670 |
% Text text text ... |
| 671 |
% \end{example} |
| 672 |
% |
| 673 |
% \section{FAQs}\label{sec:faq} |
| 674 |
% \subsection{How can I display the symbols below the syllables?} |
| 675 |
% Change the variable +symbolshift+ to a negative value. |
| 676 |
% \begin{example} |
| 677 |
% \begin{verbatim} |
| 678 |
% \setmetrixvar{symbolshift}{-0.6em} |
| 679 |
% % later ... |
| 680 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 681 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 682 |
% \end{verbatim} |
| 683 |
% \setmetrixvar{symbolshift}{-0.6em} |
| 684 |
% \metrics{_ u u _ _ _ | _ _ u u _ _ _ } |
| 685 |
% {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust} |
| 686 |
% \end{example} |
| 687 |
% \subsection{How can I combine two words below one symbol?} |
| 688 |
% Use braces +{}+ in the lists to keep them processed as one element. |
| 689 |
% \begin{example} |
| 690 |
% \begin{verbatim} |
| 691 |
% \metrics{u u _ | _ _ u u } |
| 692 |
% {cu-pi-dam | {m\bow{e h}uc} pro-li-cit } |
| 693 |
% \end{verbatim} |
| 694 |
% \metrics{u u _ | _ _ u u } |
| 695 |
% {cu-pi-dam | {m\bow{e h}uc} pro-li-cit } |
| 696 |
% \end{example} |
| 697 |
% \subsection{How can I show a hyphen character?}\label{faq:hyphen} |
| 698 |
% To escape a hyphen +-+ put it inside braces, but you must still |
| 699 |
% add an unbraced hypen to show \metrix/ where your syllables split. |
| 700 |
% \begin{example} |
| 701 |
% If you enclose the hyphen in braces together with a syllable, the symbol gets |
| 702 |
% centered above both. |
| 703 |
% \begin{verbatim} |
| 704 |
% \metrics{_ _ } |
| 705 |
% {vi-{-ni}} |
| 706 |
% \end{verbatim} |
| 707 |
% \metrics{_ _ } |
| 708 |
% {vi-{-ni}} |
| 709 |
% \par\smallskip\noindent |
| 710 |
% You can enclose only the hyphen in braces and treat it as a syllable |
| 711 |
% but then you must add an empty symbol +e+ too. |
| 712 |
% \begin{verbatim} |
| 713 |
% \metrics{_ e _ } |
| 714 |
% {vi-{-}-ni} |
| 715 |
% \end{verbatim} |
| 716 |
% \metrics{_ e _ } |
| 717 |
% {vi-{-}-ni} |
| 718 |
% \end{example} |
| 719 |
% \subsection{How can I use quotes in \cs{metrics}?}\label{faq:quotes} |
| 720 |
% It should be possible to use all shorthands (or direct input with Unicode) etc. |
| 721 |
% for quotation marks except the active |
| 722 |
% quotes of \pkg{csquotes}, which won't work inside the \cs{metrics} syllable list. It |
| 723 |
% is possible to use \pkg{csquotes} besides \metrix/ though. |
| 724 |
% \begin{example} |
| 725 |
% \begin{verbatim} |
| 726 |
% \metrics{ _ u }{ ``si me'' } |
| 727 |
% \metrics{ _ u }{ \glqq si me\grqq }% with \usepackage[<lang>]{babel} |
| 728 |
% \metrics{ _ u }{ "`si me"' }% with \usepackage[ngerman]{babel} |
| 729 |
% \end{verbatim} |
| 730 |
% \metrics{ _ u }{ ``si me'' }\quad |
| 731 |
% \metrics{ _ u }{ \glqq si me\grqq }\quad |
| 732 |
% \metrics{ _ u }{ \glqq si me\grqq } |
| 733 |
% \end{example} |
| 734 |
% \subsection{How can I add a superscript letter to a certain symbol?} |
| 735 |
% Use the +superscript+ highlighting style as described above. |
| 736 |
% \subsection{How can I make subscripts instead of superscripts?} |
| 737 |
% The easiest way is to use the +superscript+ style and change a part of |
| 738 |
% its definition to shift the superscripts to subscript positions. |
| 739 |
% \begin{example} |
| 740 |
% \begin{verbatim} |
| 741 |
% \metricsymbols[2={superscript=x}]{ u || u } \qquad vs. \qquad |
| 742 |
% % ... |
| 743 |
% \tikzset{ |
| 744 |
% every superscript picture/.style={ |
| 745 |
% baseline=1ex, |
| 746 |
% }, |
| 747 |
% } |
| 748 |
% % ... |
| 749 |
% \metricsymbols[2={superscript=x}]{ u || u } |
| 750 |
% \end{verbatim} |
| 751 |
% \metricsymbols[2={superscript=x}]{ u || u } \qquad vs. \qquad |
| 752 |
% \tikzset{ |
| 753 |
% every superscript picture/.style={ |
| 754 |
% baseline=2ex, |
| 755 |
% }, |
| 756 |
% } |
| 757 |
% \metricsymbols[2={superscript=x}]{ u || u } |
| 758 |
% |
| 759 |
% \medskip\noindent |
| 760 |
% Normally the +\tikzset+ should be part of your preamble, I used it this way to |
| 761 |
% show the differences. |
| 762 |
% \end{example} |
| 763 |
% \subsection{How can I highlight all symbols/syllables?} |
| 764 |
% \textbf{Way 1}\qquad Just call your desired highlighting style before using on of the macros |
| 765 |
% \cs{metrics} or \cs{metricsymbols}. You may enclose this in a group to not affect the other following |
| 766 |
% sequences. Mind that the higlighting styles must be in a way changing the +every ...+ styles |
| 767 |
% to make this way work. |
| 768 |
% \begin{example} |
| 769 |
% \begin{verbatim} |
| 770 |
% {% begin group |
| 771 |
% \tikzset{colored highlight} |
| 772 |
% \metrics{_ u u _ _ _ } |
| 773 |
% {flos ve-te-ris vi-ni} |
| 774 |
% }% end group |
| 775 |
% \end{verbatim} |
| 776 |
% \tikzset{colored highlight} |
| 777 |
% \metrics{_ u u _ _ _ } |
| 778 |
% {flos ve-te-ris vi-ni} |
| 779 |
% \end{example} |
| 780 |
% \par\medskip\noindent |
| 781 |
% \textbf{Way 2}\qquad Change the +every metrix ...+ styles. |
| 782 |
% \begin{example} |
| 783 |
% \begin{verbatim} |
| 784 |
% {% begin group |
| 785 |
% \tikzset{every metrix symbol/.append style={red}} |
| 786 |
% \metrics{_ u u _ _ _ } |
| 787 |
% {flos ve-te-ris vi-ni} |
| 788 |
% }% end group |
| 789 |
% \end{verbatim} |
| 790 |
% \tikzset{every metrix symbol/.append style={red}} |
| 791 |
% \metrics{_ u u _ _ _ } |
| 792 |
% {flos ve-te-ris vi-ni} |
| 793 |
% \end{example} |
| 794 |
% Leave out the grouping (and put this to your preamble) if yout want to highlight |
| 795 |
% the symbols in your whole document. |
| 796 |
% \subsection{How can I change the size of a symbol?} |
| 797 |
% Change the two base vector units.\pagebreak |
| 798 |
% \begin{example} |
| 799 |
% \begin{verbatim} |
| 800 |
% \setmetrixvar{baseunit}{1em} |
| 801 |
% \setmetrixvar{bigbaseunit}{1.6em} |
| 802 |
% \end{verbatim} |
| 803 |
% \end{example} |
| 804 |
% If you want to change the size of a single symbol to highlight it you must |
| 805 |
% create your own highlighting style. |
| 806 |
% \begin{example} |
| 807 |
% \begin{verbatim} |
| 808 |
% \tikzset{ |
| 809 |
% bigger highlight/.style={ |
| 810 |
% every metrix symbol/.append style={x=2.5em,y=2.5em,line width=1.5pt}, |
| 811 |
% }, |
| 812 |
% } |
| 813 |
% % later |
| 814 |
% \metricsymbols[2=bigger highlight]{u_uu x _ || u _ n x} |
| 815 |
% \end{verbatim} |
| 816 |
% \tikzset{ |
| 817 |
% bigger highlight/.style={ |
| 818 |
% every metrix symbol/.append style={x=2.5em,y=2.5em,line width=1.5pt}, |
| 819 |
% }, |
| 820 |
% } |
| 821 |
% \metricsymbols[2=bigger highlight]{u_uu x _ || u _ n x} |
| 822 |
% \end{example} |
| 823 |
% \subsection{How can I stop highlighting the syllables too?}\label{faq:highlight} |
| 824 |
% \textbf{Way 1}\qquad Change the highlight styles (in your preamble). |
| 825 |
% \begin{example} |
| 826 |
% \begin{verbatim} |
| 827 |
% \tikzset{ |
| 828 |
% colored highlight/.style={ |
| 829 |
% every metrix symbol/.append style={ |
| 830 |
% draw=\usemetrixvar{highlightcolor}, |
| 831 |
% }, |
| 832 |
% }, |
| 833 |
% } |
| 834 |
% % later ... |
| 835 |
% \metrics[3=colored highlight]{_ u u _ _ _ } |
| 836 |
% {flos ve-te-ris vi-ni} |
| 837 |
% \end{verbatim} |
| 838 |
% {\tikzset{ |
| 839 |
% colored highlight/.style={ |
| 840 |
% every metrix symbol/.append style={draw=\usemetrixvar{highlightcolor}}, |
| 841 |
% } |
| 842 |
% } |
| 843 |
% \metrics[3=colored highlight]{_ u u _ _ _ } |
| 844 |
% {flos ve-te-ris vi-ni}} |
| 845 |
% \end{example} |
| 846 |
% \par\medskip\noindent |
| 847 |
% \textbf{Way 2}\qquad Create your own highlighting style, which is very similar |
| 848 |
% to way 1, as the following example shows. Every own style should change the apperance |
| 849 |
% by appending the settings to one of the +every ...+ styles. |
| 850 |
% \begin{example} |
| 851 |
% \begin{verbatim} |
| 852 |
% \tikzset{ |
| 853 |
% my highlight/.style={ |
| 854 |
% every metrix symbol/.append style={draw=blue,line width=0.07em}, |
| 855 |
% } |
| 856 |
% } |
| 857 |
% \metrics[5=my highlight]{_ u u _ _ _ } |
| 858 |
% {flos ve-te-ris vi-ni} |
| 859 |
% \end{verbatim} |
| 860 |
% \tikzset{ |
| 861 |
% my highlight/.style={ |
| 862 |
% every metrix symbol/.append style={draw=blue,line width=0.1em}, |
| 863 |
% } |
| 864 |
% } |
| 865 |
% \metrics[5=my highlight]{_ u u _ _ _ } |
| 866 |
% {flos ve-te-ris vi-ni} |
| 867 |
% \end{example} |
| 868 |
% \subsection{Why got the highlight styles that long names?} |
| 869 |
% To prevent conflict with other packages. |
| 870 |
% \begin{example} |
| 871 |
% If you want to shorten it create your own style as described above or use |
| 872 |
% \begin{verbatim} |
| 873 |
% \tikzset{ |
| 874 |
% hl/.style={colored highlight} |
| 875 |
% } |
| 876 |
% \end{verbatim} |
| 877 |
% to map the style to a shorter name. Then you can use it like in |
| 878 |
% \begin{verbatim} |
| 879 |
% \metricsymbols[2=hl]{u _ _ u} |
| 880 |
% \end{verbatim} |
| 881 |
% \end{example} |
| 882 |
% \subsection{How can I change the font of all syllables?} |
| 883 |
% Extend the +every metrix syllable node+ style |
| 884 |
% \begin{example} |
| 885 |
% Print all syllables in italic with the following extension. |
| 886 |
% \begin{verbatim} |
| 887 |
% \tikzset{ |
| 888 |
% every metrix syllable node/.append sytle={font=\itshape}, |
| 889 |
% } |
| 890 |
% \end{verbatim} |
| 891 |
% \end{example} |
| 892 |
% |
| 893 |
% \section{Customization} |
| 894 |
% Some hints were already given in the FAQ section (see section~\ref{sec:faq}) but here I will |
| 895 |
% list all variables and \TikZ/ styles that are in use and can be changed to customize |
| 896 |
% \metrix/ easily. |
| 897 |
% \subsection{Variables} |
| 898 |
% \begin{function}{\setmetrixvar,\usemetrixvar} |
| 899 |
% To customize the rendering of the symbols, accents and bow \metrix/ has some variables |
| 900 |
% that you can change. |
| 901 |
% \begin{syntax} |
| 902 |
% \cs{setmetrixvar}\Arg{variable}\Arg{value} |
| 903 |
% \end{syntax} |
| 904 |
% Use \cs{setmetrixvar} to change a value. The variables and the default values are listed |
| 905 |
% in table~\ref{tab:variables}. To access a value you can use \cs{usemetrixvar}\Arg{variable}. |
| 906 |
% \end{function} |
| 907 |
% It is highly recommended to use font size depending units, i.e. +em+ or +ex+, for all lengthen |
| 908 |
% to keep the symbols usable in different font sizes, for example in headlines or footnotes. |
| 909 |
% \begin{example} |
| 910 |
% Change the highlighting color to blue. |
| 911 |
% \begin{verbatim} |
| 912 |
% \setmetrixvar{higlightcolor}{blue} |
| 913 |
% % later |
| 914 |
% \metrics[5=colored highlight]{_ u u _ _ _ } |
| 915 |
% {flos ve-te-ris vi-ni} |
| 916 |
% \end{verbatim} |
| 917 |
% \setmetrixvar{highlightcolor}{blue} |
| 918 |
% \metrics[5=colored highlight]{_ u u _ _ _ } |
| 919 |
% {flos ve-te-ris vi-ni} |
| 920 |
% \end{example} |
| 921 |
% \begin{example} |
| 922 |
% Create your own highlighting style but use the default highlighting color. |
| 923 |
% \begin{verbatim} |
| 924 |
% \tikzset{ |
| 925 |
% my highlight/.style={ |
| 926 |
% every metrix symbol/.append style={ |
| 927 |
% draw=\usemetrixvar{highlightcolor}, |
| 928 |
% line width=0.15em |
| 929 |
% }, |
| 930 |
% }, |
| 931 |
% } |
| 932 |
% \metrics[5=my highlight]{_ u u _ _ _ } |
| 933 |
% {flos ve-te-ris vi-ni} |
| 934 |
% \end{verbatim} |
| 935 |
% \tikzset{ |
| 936 |
% my highlight/.style={ |
| 937 |
% every metrix symbol/.append style={ |
| 938 |
% draw=\usemetrixvar{highlightcolor}, |
| 939 |
% line width=0.15em |
| 940 |
% }, |
| 941 |
% }, |
| 942 |
% } |
| 943 |
% \metrics[5=my highlight]{_ u u _ _ _ } |
| 944 |
% {flos ve-te-ris vi-ni} |
| 945 |
% \end{example} |
| 946 |
% \begin{longtabu}to \textwidth {ll>{\strut}X} |
| 947 |
% \caption{Variables\label{tab:variables}}\\ |
| 948 |
% \toprule |
| 949 |
% \rowfont{\bfseries\sffamily} variable & default & explanation \\ |
| 950 |
% \midrule |
| 951 |
% \endfirsthead |
| 952 |
% \caption{Variables (cont.)}\\ |
| 953 |
% \toprule |
| 954 |
% \rowfont{\bfseries\sffamily} variable & default & explanation \\ |
| 955 |
% \midrule |
| 956 |
% \endhead |
| 957 |
% \multicolumn{3}{r}{\dots} |
| 958 |
% \endfoot |
| 959 |
% \bottomrule |
| 960 |
% \endlastfoot |
| 961 |
% +symbollinewidth+ & +0.04em+ & line width of symbols above syllables and small stand alone symbols \\ |
| 962 |
% +bigsymbollinewidth+ & +0.06em+ & line width of big stand alone symbols \\ |
| 963 |
% +accentlinewidth+ & +0.03em+ & line width of accents (\cs{lng} and \cs{brv}) \\ |
| 964 |
% +bowlinewidth+ & +0.03em+ & line width of bows (\cs{bow}) \\ |
| 965 |
% +symbolsep+ & +0.4em+ & gap between symbols in stand alone lists \\ |
| 966 |
% +baseunit+ & +0.9em+ & length of the base vector for drawing symbols above |
| 967 |
% syllables, small stand alone symbols, accents and bows\\ |
| 968 |
% +bigbaseunit+ & +1.4em+ & length of the base vector for drawing stand alone symbols \\ |
| 969 |
% +shortsyllablelimit+ & +0.8em+ & all syllables shorter than this can be treated specially, e.g. |
| 970 |
% they'll get a shorter elementum longum. \\ |
| 971 |
% +gap+ & +0.09em+ & small gap between lines of the symbols, e.g. the distance between the |
| 972 |
% two lines of a verse break \\ |
| 973 |
% +symbolshift+ & +1.1em+ & leght to shift the symbols above or below the syllables |
| 974 |
% (try +-0.6em+ to display the symbols below the base line) \\ |
| 975 |
% +lngshift+ & +0.8em+ & length to shift the longa accent \\ |
| 976 |
% +lngshortening+ & +0.075em+ & length to shorten the longa accent a little \\ |
| 977 |
% +lngminlength+ & +0.25em+ & minimum width of a longa accent \\ |
| 978 |
% +brvshift+ & +0.9em+ & length to shift the brevis accent \\ |
| 979 |
% +dotshift+ & +-0.15em+ & length to shift the dot accent \\ |
| 980 |
% +itcorrection+ & +0.11em+ & length to shift the accents above italic/slanted letters \\ |
| 981 |
% +accentxshift+ & +-0.025em+ & length to shift the accents horizontally \\ |
| 982 |
% +bowshift+ & +-0.15em+ & length to shift the bow below the base line \\ |
| 983 |
% +bowshortening+ & +0.15em+ & length to shrink the bow a little \\ |
| 984 |
% +bowlooseness+ & +0.75+ & value to influence the bending of the bow \\ |
| 985 |
% +symbolcolor+ & +.+ (curr. color) & color of metric symbols \\ |
| 986 |
% +accentcolor+ & +.+ (curr. color) & color of accents (\cs{lng} and \cs{brv}) \\ |
| 987 |
% +bowcolor+ & +.+ (curr. color) & color of bows (\cs{bow}) \\ |
| 988 |
% +highlightcolor+ & +red+ & color of highlighted symbols and syllabels |
| 989 |
% used in +colored highlight+ style \\ |
| 990 |
% +fillcolor+ & +yellow+ & color of filled symbol +node+s |
| 991 |
% used in +filled highlight+ style \\ |
| 992 |
% +arrow+ & +\$+\cs{downarrow}+\$+ & arrow for highlighting \\ |
| 993 |
% +breakgap+ & +0.6em+ & gap before and after a (verse) break \\ |
| 994 |
% +emptywidth+ & +1em+ & gap replacing an empty symbol (abbreviation +e+) \\ |
| 995 |
% +acute+ & +\string\textasciiacute+ & acute accent character/symbol \\ |
| 996 |
% +grave+ & +\string\textasciigrave+ & grave accent character/symbol \\ |
| 997 |
% \end{longtabu} |
| 998 |
% |
| 999 |
% \subsection{\TikZ/ styles}\label{sec:styles} |
| 1000 |
% Beside the variables you may change the \TikZ/ styles used by \metrix/. But please mind |
| 1001 |
% that all styles are not empty by default so you should prefer +/.append style+ against |
| 1002 |
% +/.style+. Otherwise it may cause strange effects. Remind that you can use \cs{usemetrixvar} |
| 1003 |
% to access a variable. |
| 1004 |
% \begin{variable}{every metrix symbol, every metrix big symbol, every metrix symbol node} |
| 1005 |
% These three styles define the apperance of the metric symbols. They define the line width, |
| 1006 |
% the color, the basis vectors and other things. |
| 1007 |
% \end{variable} |
| 1008 |
% \begin{variable}{every metrix syllable node,every metrix break node} |
| 1009 |
% These styles defines the +node+s in which a syllable or a break symbol (the ones spanning across |
| 1010 |
% the symbol and the syllable line) is typeset, e.g. it aligns these +node+s at their base line. |
| 1011 |
% \end{variable} |
| 1012 |
% \begin{variable}{every metrix ictus node} |
| 1013 |
% This style defines the apperance of accents above symbols (ictus, e.g. +/u+). |
| 1014 |
% \end{variable} |
| 1015 |
% \begin{variable}{every metrix accent} |
| 1016 |
% This style defines the apperance of accents created by \cs{lng} and \cs{brv}. |
| 1017 |
% \end{variable} |
| 1018 |
% \begin{variable}{every metrix bow} |
| 1019 |
% This style defines the apperance of bows below symbols. |
| 1020 |
% \end{variable} |
| 1021 |
% \begin{variable}{bold highlight,colored highlight,dashed highlight,filled highlight,superscript} |
| 1022 |
% These styles can be used to highlight a certain symbol. |
| 1023 |
% \end{variable} |
| 1024 |
% \begin{variable}{every superscript picture,every superscript node,every superscript label} |
| 1025 |
% These styles are used to define the +superscript+ highlighting style. |
| 1026 |
% \end{variable} |
| 1027 |
% \begin{variable}{every metrix added text} |
| 1028 |
% This style is used for text added to a symbol with the +add text+ highlighting. |
| 1029 |
% \end{variable} |
| 1030 |
% |
| 1031 |
% \end{documentation} |
| 1032 |
% |
| 1033 |
% \begin{implementation} |
| 1034 |
% |
| 1035 |
% \section{Implementation} |
| 1036 |
% |
| 1037 |
% \begin{macrocode} |
| 1038 |
%<*package> |
| 1039 |
% \end{macrocode} |
| 1040 |
% |
| 1041 |
% \begin{macrocode} |
| 1042 |
%<@@=metrix> |
| 1043 |
% \end{macrocode} |
| 1044 |
% |
| 1045 |
% \begin{macrocode} |
| 1046 |
\ProvidesExplPackage |
| 1047 |
{\metrixFileName}{\metrixFileDate}{\metrixFileVersion}{\metrixFileDescription} |
| 1048 |
% \end{macrocode} |
| 1049 |
% |
| 1050 |
% \subsection{Required packages} |
| 1051 |
% \begin{macrocode} |
| 1052 |
\RequirePackage{xparse} |
| 1053 |
\RequirePackage{xpatch} |
| 1054 |
\RequirePackage{tikz} |
| 1055 |
\ExplSyntaxOff |
| 1056 |
\usetikzlibrary{calc} |
| 1057 |
\ExplSyntaxOn |
| 1058 |
\RequirePackage{textcomp} |
| 1059 |
% \end{macrocode} |
| 1060 |
% |
| 1061 |
% \subsection{Constants and internal variables} |
| 1062 |
% These constants variables are for internal use only and can't be changed/accessed by the user. |
| 1063 |
% \subsubsection{Constants} |
| 1064 |
% \begin{variable}[internal]{\c_@@_acute_accent_tl} |
| 1065 |
% Constant holding an acute accent char. |
| 1066 |
% \begin{macrocode} |
| 1067 |
\tl_const:Nn \c_@@_acute_accent_tl { / } |
| 1068 |
% \end{macrocode} |
| 1069 |
% \end{variable} |
| 1070 |
% \begin{variable}[internal]{\c_@@_acute_accent_tl} |
| 1071 |
% Constant holding an grave accent char. |
| 1072 |
% \begin{macrocode} |
| 1073 |
\tl_const:Nn \c_@@_grave_accent_tl { * } |
| 1074 |
% \end{macrocode} |
| 1075 |
% \end{variable} |
| 1076 |
% \subsubsection{Variables} |
| 1077 |
% \begin{variable}[internal]{\l_@@_words_tl} |
| 1078 |
% This list stores the words of the \cs{metrics} macro. |
| 1079 |
% \begin{macrocode} |
| 1080 |
\tl_new:N \l_@@_words_tl |
| 1081 |
% \end{macrocode} |
| 1082 |
% \end{variable} |
| 1083 |
% \begin{variable}[internal]{\l_@@_syllables_seq} |
| 1084 |
% This list stores the words of the \cs{l_@@_words_tl} list. |
| 1085 |
% \begin{macrocode} |
| 1086 |
\seq_new:N \l_@@_syllables_seq |
| 1087 |
% \end{macrocode} |
| 1088 |
% \end{variable} |
| 1089 |
% \begin{variable}[internal]{\l_@@_symbols_seq} |
| 1090 |
% This list stores the metric symbols of \cs{metrics} and \cs{metricsymbols}. |
| 1091 |
% \begin{macrocode} |
| 1092 |
\seq_new:N \l_@@_symbols_seq |
| 1093 |
% \end{macrocode} |
| 1094 |
% \end{variable} |
| 1095 |
% \begin{variable}[internal]{\l_@@_short_breaks_seq,\l_@@_foot_breaks_seq} |
| 1096 |
% This list stores the short and foot breaks of \cs{metrics}. |
| 1097 |
% \begin{macrocode} |
| 1098 |
\seq_new:N \l_@@_short_breaks_seq |
| 1099 |
\seq_new:N \l_@@_foot_breaks_seq |
| 1100 |
% \end{macrocode} |
| 1101 |
% \end{variable} |
| 1102 |
% \begin{variable}[internal]{\l_@@_highlights_prop} |
| 1103 |
% This list stores the higlighting styles of \cs{metrics} and \cs{metricsymbols}. |
| 1104 |
% \begin{macrocode} |
| 1105 |
\prop_new:N \l_@@_highlights_prop |
| 1106 |
% \end{macrocode} |
| 1107 |
% \end{variable} |
| 1108 |
% \begin{variable}[internal]{\l_@@_highlight_seq,\l_@@_highlight_pos_seq} |
| 1109 |
% This lists are used to evaluate a higlight style. |
| 1110 |
% \begin{macrocode} |
| 1111 |
\seq_new:N \l_@@_highlight_seq |
| 1112 |
\seq_new:N \l_@@_highlight_pos_seq |
| 1113 |
% \end{macrocode} |
| 1114 |
% \end{variable} |
| 1115 |
% \begin{variable}[internal]{\q_@@_space_marker} |
| 1116 |
% This is the marker for spaces inside of the \cs{l_@@_words_tl} list. |
| 1117 |
% \begin{macrocode} |
| 1118 |
\quark_new:N \q_@@_space_marker |
| 1119 |
% \end{macrocode} |
| 1120 |
% \end{variable} |
| 1121 |
% \begin{variable}[internal]{\l_@@_process_int} |
| 1122 |
% This process counter is used to combine the symbols and syllables. |
| 1123 |
% \begin{macrocode} |
| 1124 |
\int_new:N \l_@@_process_int |
| 1125 |
% \end{macrocode} |
| 1126 |
% \end{variable} |
| 1127 |
% \begin{variable}[internal]{\l_@@_short_syllable_bool,\l_@@_syllable_box,\g_@@_variable_shortsyllablelimit_tl} |
| 1128 |
% This boolean can be used to store that a syllable is short, e.g. \emph{li} will be defined |
| 1129 |
% as short wheras \emph{man} is long. That will be used to shorten the |_| symbol. Furthermore |
| 1130 |
% we'll need a box to measure the length of a syllable and a variable to save the limit for |
| 1131 |
% short syllables. |
| 1132 |
% \begin{macrocode} |
| 1133 |
\bool_new:N \l_@@_short_syllable_bool |
| 1134 |
\box_new:N \l_@@_syllable_box |
| 1135 |
\tl_new:N \g_@@_variable_shortsyllablelimit_tl |
| 1136 |
\tl_set:Nn \g_@@_variable_shortsyllablelimit_tl { 0.8em } |
| 1137 |
% \end{macrocode} |
| 1138 |
% \end{variable} |
| 1139 |
% \begin{variable}[internal]{\l_@@_current_symbol_tl} |
| 1140 |
% Variable holding the current symbol abbreviation. |
| 1141 |
% \begin{macrocode} |
| 1142 |
\tl_new:N \l_@@_current_symbol_tl |
| 1143 |
% \end{macrocode} |
| 1144 |
% \end{variable} |
| 1145 |
% \begin{variable}[internal]{\l_@@_current_symbol_head_tl} |
| 1146 |
% Variable holding firt char of the current symbol abbreviation. |
| 1147 |
% \begin{macrocode} |
| 1148 |
\tl_new:N \l_@@_current_symbol_head_tl |
| 1149 |
% \end{macrocode} |
| 1150 |
% \end{variable} |
| 1151 |
% \begin{variable}[internal]{\l_@@_has_acute_accent_bool} |
| 1152 |
% Bool for switching on an acute accent of a symbol. |
| 1153 |
% \begin{macrocode} |
| 1154 |
\bool_new:N \l_@@_has_acute_accent_bool |
| 1155 |
% \end{macrocode} |
| 1156 |
% \end{variable} |
| 1157 |
% \begin{variable}[internal]{\l_@@_has_grave_accent_bool} |
| 1158 |
% Bool for switching on an grave accent of a symbol. |
| 1159 |
% \begin{macrocode} |
| 1160 |
\bool_new:N \l_@@_has_grave_accent_bool |
| 1161 |
% \end{macrocode} |
| 1162 |
% \end{variable} |
| 1163 |
% |
| 1164 |
% \subsection{User variables} |
| 1165 |
% These variables save things, the user can change via \cs{setmetrixvar} and use |
| 1166 |
% via \cs{usemetrixvar}. |
| 1167 |
% \begin{variable}[internal]{\g_@@_variable_symbollinewidth_tl} |
| 1168 |
% This variable stores the line width for all metric symbols above (or below) syllables. |
| 1169 |
% \begin{macrocode} |
| 1170 |
\tl_new:N \g_@@_variable_symbollinewidth_tl |
| 1171 |
\tl_set:Nn \g_@@_variable_symbollinewidth_tl { 0.04em } |
| 1172 |
% \end{macrocode} |
| 1173 |
% \end{variable} |
| 1174 |
% \begin{variable}[internal]{\g_@@_variable_bigsymbollinewidth_tl} |
| 1175 |
% This variable stores the line width for all stand alone metric symbols. |
| 1176 |
% \begin{macrocode} |
| 1177 |
\tl_new:N \g_@@_variable_bigsymbollinewidth_tl |
| 1178 |
\tl_set:Nn \g_@@_variable_bigsymbollinewidth_tl { 0.06em } |
| 1179 |
% \end{macrocode} |
| 1180 |
% \end{variable} |
| 1181 |
% \begin{variable}[internal]{\g_@@_variable_accentlinewidth_tl} |
| 1182 |
% This variable stores the line width of the accent like symbols. |
| 1183 |
% \begin{macrocode} |
| 1184 |
\tl_new:N \g_@@_variable_accentlinewidth_tl |
| 1185 |
\tl_set:Nn \g_@@_variable_accentlinewidth_tl { 0.04em } |
| 1186 |
% \end{macrocode} |
| 1187 |
% \end{variable} |
| 1188 |
% \begin{variable}[internal]{\g_@@_variable_bowlinewidth_tl} |
| 1189 |
% This variable stores the line width of the bow. |
| 1190 |
% \begin{macrocode} |
| 1191 |
\tl_new:N \g_@@_variable_bowlinewidth_tl |
| 1192 |
\tl_set:Nn \g_@@_variable_bowlinewidth_tl { 0.04em } |
| 1193 |
% \end{macrocode} |
| 1194 |
% \end{variable} |
| 1195 |
% \begin{variable}[internal]{\g_@@_variable_symbolsep_tl} |
| 1196 |
% This variable stores the gap between two or more stand alone metric symbols. |
| 1197 |
% \begin{macrocode} |
| 1198 |
\tl_new:N \g_@@_variable_symbolsep_tl |
| 1199 |
\tl_set:Nn \g_@@_variable_symbolsep_tl { 0.4em } |
| 1200 |
% \end{macrocode} |
| 1201 |
% \end{variable} |
| 1202 |
% \begin{variable}[internal]{\g_@@_variable_baseunit_tl} |
| 1203 |
% This variable stores the length of the basis vector for all metric symbols above (or below) |
| 1204 |
% syllables and accent like symbols. |
| 1205 |
% \begin{macrocode} |
| 1206 |
\tl_new:N \g_@@_variable_baseunit_tl |
| 1207 |
\tl_set:Nn \g_@@_variable_baseunit_tl { 0.9em } |
| 1208 |
% \end{macrocode} |
| 1209 |
% \end{variable} |
| 1210 |
% \begin{variable}[internal]{\g_@@_variable_bigbaseunit_tl} |
| 1211 |
% This variable stores the length of the basis vector for all stand alone metric symbols. |
| 1212 |
% \begin{macrocode} |
| 1213 |
\tl_new:N \g_@@_variable_bigbaseunit_tl |
| 1214 |
\tl_set:Nn \g_@@_variable_bigbaseunit_tl { 1.4em } |
| 1215 |
% \end{macrocode} |
| 1216 |
% \end{variable} |
| 1217 |
% \begin{variable}[internal]{\g_@@_variable_gap_tl} |
| 1218 |
% Length for small gaps in the symbols, e.g. the gap between the two bows of an elementum biceps. |
| 1219 |
% \begin{macrocode} |
| 1220 |
\tl_new:N \g_@@_variable_gap_tl |
| 1221 |
\tl_set:Nn \g_@@_variable_gap_tl { 0.09em } |
| 1222 |
% \end{macrocode} |
| 1223 |
% \end{variable} |
| 1224 |
% \begin{variable}[internal]{\g_@@_variable_symbolshift_tl} |
| 1225 |
% This variable stores the value to shift metric symbols above (or below) syllables. |
| 1226 |
% Set this variable to approx +1.1em+ to draw the symbols above the syllable and to +-0.6em+ |
| 1227 |
% to draw them below. |
| 1228 |
% \begin{macrocode} |
| 1229 |
\tl_new:N \g_@@_variable_symbolshift_tl |
| 1230 |
\tl_set:Nn \g_@@_variable_symbolshift_tl { 1.1em } |
| 1231 |
% \end{macrocode} |
| 1232 |
% \end{variable} |
| 1233 |
% \begin{variable}[internal]{\g_@@_variable_lngshift_tl} |
| 1234 |
% This variable stores the value to shift the longa accent. |
| 1235 |
% \begin{macrocode} |
| 1236 |
\tl_new:N \g_@@_variable_lngshift_tl |
| 1237 |
\tl_set:Nn \g_@@_variable_lngshift_tl { 0.15em } |
| 1238 |
% \end{macrocode} |
| 1239 |
% \end{variable} |
| 1240 |
% \begin{variable}[internal]{\g_@@_variable_lngshortening_tl} |
| 1241 |
% This variable stores the value to shorten the longa accent. |
| 1242 |
% \begin{macrocode} |
| 1243 |
\tl_new:N \g_@@_variable_lngshortening_tl |
| 1244 |
\tl_set:Nn \g_@@_variable_lngshortening_tl { 0.075em } |
| 1245 |
% \end{macrocode} |
| 1246 |
% \end{variable} |
| 1247 |
% \begin{variable}[internal]{\g_@@_variable_lngminlength_tl} |
| 1248 |
% This variable stores the value to shorten the longa accent. |
| 1249 |
% \begin{macrocode} |
| 1250 |
\tl_new:N \g_@@_variable_lngminlength_tl |
| 1251 |
\tl_set:Nn \g_@@_variable_lngminlength_tl { 0.25em } |
| 1252 |
% \end{macrocode} |
| 1253 |
% \end{variable} |
| 1254 |
% \begin{variable}[internal]{\g_@@_variable_brvshift_tl} |
| 1255 |
% This variable stores the value to shift the brevis accent. |
| 1256 |
% \begin{macrocode} |
| 1257 |
\tl_new:N \g_@@_variable_brvshift_tl |
| 1258 |
\tl_set:Nn \g_@@_variable_brvshift_tl { 0.25em } |
| 1259 |
% \end{macrocode} |
| 1260 |
% \end{variable} |
| 1261 |
% \begin{variable}[internal]{\g_@@_variable_dotshift_tl} |
| 1262 |
% This variable stores the value to shift the brevis accent. |
| 1263 |
% \begin{macrocode} |
| 1264 |
\tl_new:N \g_@@_variable_dotshift_tl |
| 1265 |
\tl_set:Nn \g_@@_variable_dotshift_tl { -0.15em } |
| 1266 |
% \end{macrocode} |
| 1267 |
% \end{variable} |
| 1268 |
% \begin{variable}[internal]{ |
| 1269 |
% \g_@@_variable_itcorrection_tl, |
| 1270 |
% \l_@@_internal_itcorrection_tl, |
| 1271 |
% \g_@@_internal_itcorrection_zero_tl} |
| 1272 |
% These variables are used to set the italic correction of accents. |
| 1273 |
% \begin{macrocode} |
| 1274 |
\tl_new:N \g_@@_variable_itcorrection_tl |
| 1275 |
\tl_set:Nn \g_@@_variable_itcorrection_tl { 0.11em } |
| 1276 |
\tl_new:N \l_@@_internal_itcorrection_tl |
| 1277 |
\tl_set:Nn \l_@@_internal_itcorrection_tl { 0em } |
| 1278 |
\tl_new:N \g_@@_internal_itcorrection_zero_tl |
| 1279 |
\tl_set:Nn \g_@@_internal_itcorrection_zero_tl { 0em } |
| 1280 |
% \end{macrocode} |
| 1281 |
% \end{variable} |
| 1282 |
% \begin{variable}[internal]{\g_@@_variable_accentxshift_tl} |
| 1283 |
% This variable ise used to shift the accents horizontally. |
| 1284 |
% \begin{macrocode} |
| 1285 |
\tl_new:N \g_@@_variable_accentxshift_tl |
| 1286 |
\tl_set:Nn \g_@@_variable_accentxshift_tl { -0.025em } |
| 1287 |
% \end{macrocode} |
| 1288 |
% \end{variable} |
| 1289 |
% \begin{variable}[internal]{\g_@@_variable_bowshift_tl} |
| 1290 |
% This variable stores the value to shift the bow. |
| 1291 |
% \begin{macrocode} |
| 1292 |
\tl_new:N \g_@@_variable_bowshift_tl |
| 1293 |
\tl_set:Nn \g_@@_variable_bowshift_tl { -0.15em } |
| 1294 |
% \end{macrocode} |
| 1295 |
% \end{variable} |
| 1296 |
% \begin{variable}[internal]{\g_@@_variable_bowshortening_tl} |
| 1297 |
% This variable stores the value to shrink the bow. |
| 1298 |
% \begin{macrocode} |
| 1299 |
\tl_new:N \g_@@_variable_bowshortening_tl |
| 1300 |
\tl_set:Nn \g_@@_variable_bowshortening_tl { 0.15em } |
| 1301 |
% \end{macrocode} |
| 1302 |
% \end{variable} |
| 1303 |
% \begin{variable}[internal]{\g_@@_variable_bowlooseness_tl} |
| 1304 |
% This variable stores the value to shrink the bow. |
| 1305 |
% \begin{macrocode} |
| 1306 |
\tl_new:N \g_@@_variable_bowlooseness_tl |
| 1307 |
\tl_set:Nn \g_@@_variable_bowlooseness_tl { 0.75 } |
| 1308 |
% \end{macrocode} |
| 1309 |
% \end{variable} |
| 1310 |
% \begin{variable}[internal] |
| 1311 |
% {\g_@@_variable_symbolcolor_tl,\g_@@_variable_accentcolor_tl,g_@@_variable_bowcolor_tl} |
| 1312 |
% \changes{v1.4}{2016/03/29}{Changed symbol and accent color to current color.} |
| 1313 |
% These variables store the color of symbols, accents and bows. |
| 1314 |
% \begin{macrocode} |
| 1315 |
\tl_new:N \g_@@_variable_symbolcolor_tl |
| 1316 |
\tl_set:Nn \g_@@_variable_symbolcolor_tl { . } |
| 1317 |
\tl_new:N \g_@@_variable_accentcolor_tl |
| 1318 |
\tl_set:Nn \g_@@_variable_accentcolor_tl { . } |
| 1319 |
\tl_new:N \g_@@_variable_bowcolor_tl |
| 1320 |
\tl_set:Nn \g_@@_variable_bowcolor_tl { . } |
| 1321 |
% \end{macrocode} |
| 1322 |
% \end{variable} |
| 1323 |
% \begin{variable}[internal] |
| 1324 |
% {\g_@@_variable_highlightcolor_tl} |
| 1325 |
% These variable stores the color used in the +colored highlight+ style. |
| 1326 |
% \begin{macrocode} |
| 1327 |
\tl_new:N \g_@@_variable_highlightcolor_tl |
| 1328 |
\tl_set:Nn \g_@@_variable_highlightcolor_tl { red } |
| 1329 |
% \end{macrocode} |
| 1330 |
% \end{variable} |
| 1331 |
% \begin{variable}[internal] |
| 1332 |
% {\g_@@_variable_fillcolor_tl} |
| 1333 |
% These variable stores the color used in the +filled highlight+ style. |
| 1334 |
% \begin{macrocode} |
| 1335 |
\tl_new:N \g_@@_variable_fillcolor_tl |
| 1336 |
\tl_set:Nn \g_@@_variable_fillcolor_tl { yellow } |
| 1337 |
% \end{macrocode} |
| 1338 |
% \end{variable} |
| 1339 |
% \begin{variable}[internal] |
| 1340 |
% {\g_@@_variable_arrow_tl} |
| 1341 |
% \changes{v1.3}{2016/03/21}{New variable for arrow} |
| 1342 |
% These variable stores the color used in the +filled highlight+ style. |
| 1343 |
% \begin{macrocode} |
| 1344 |
\tl_new:N \g_@@_variable_arrow_tl |
| 1345 |
\tl_set:Nn \g_@@_variable_arrow_tl { $\downarrow$ } |
| 1346 |
% \end{macrocode} |
| 1347 |
% \end{variable} |
| 1348 |
% \begin{variable}[internal]{\g_@@_variable_breakgap_tl} |
| 1349 |
% This variable stores the width of the gap around the two break symbols. |
| 1350 |
% \begin{macrocode} |
| 1351 |
\tl_new:N \g_@@_variable_breakgap_tl |
| 1352 |
\tl_set:Nn \g_@@_variable_breakgap_tl { 0.6em } |
| 1353 |
% \end{macrocode} |
| 1354 |
% \end{variable} |
| 1355 |
% \begin{variable}[internal]{\g_@@_variable_emptywidth_tl} |
| 1356 |
% This variable stores the width of the gap caused by an empty symbol (abbreviation +e+). |
| 1357 |
% \begin{macrocode} |
| 1358 |
\tl_new:N \g_@@_variable_emptywidth_tl |
| 1359 |
\tl_set:Nn \g_@@_variable_emptywidth_tl { 1em } |
| 1360 |
% \end{macrocode} |
| 1361 |
% \end{variable} |
| 1362 |
% \begin{variable}[internal]{\g_@@_variable_acute_tl} |
| 1363 |
% This variable stores acute symbol. |
| 1364 |
% \begin{macrocode} |
| 1365 |
\tl_new:N \g_@@_variable_acute_tl |
| 1366 |
\tl_set:Nn \g_@@_variable_acute_tl { \textasciiacute } |
| 1367 |
% \end{macrocode} |
| 1368 |
% \end{variable} |
| 1369 |
% \begin{variable}[internal]{\g_@@_variable_grave_tl} |
| 1370 |
% This variable stores grave symbol. |
| 1371 |
% \begin{macrocode} |
| 1372 |
\tl_new:N \g_@@_variable_grave_tl |
| 1373 |
\tl_set:Nn \g_@@_variable_grave_tl { \textasciigrave } |
| 1374 |
% \end{macrocode} |
| 1375 |
% \end{variable} |
| 1376 |
% |
| 1377 |
% \subsection{Variants} |
| 1378 |
% Later we'll need the following variant. |
| 1379 |
% \begin{macrocode} |
| 1380 |
\cs_generate_variant:Nn \prop_item:Nn { No , Nf , NV , Nx } |
| 1381 |
\cs_generate_variant:Nn \prop_put:Nnn { Nnx , Nxx , Nff , Noo } |
| 1382 |
\cs_generate_variant:Nn \seq_item:Nn { Nf , NV , Nx } |
| 1383 |
\cs_generate_variant:Nn \seq_set_split:Nnn { Nnf , NnV , Nnx } |
| 1384 |
\cs_generate_variant:Nn \tl_remove_once:Nn { NV } |
| 1385 |
% \end{macrocode} |
| 1386 |
% |
| 1387 |
% \subsection{Internal main macros} |
| 1388 |
% \begin{macro}[internal,updated=2014/07/02]{\@@_metrics:nn} |
| 1389 |
% \changes{v1.1}{2014/07/02}{Made short breaks available} |
| 1390 |
% \changes{v1.3}{2016/03/16}{Extended short breaks feature} |
| 1391 |
% This macro processes the two lists of \cs{metrics} and combines the symbols |
| 1392 |
% and syllables.\footnote{The framing of this macro was provided by Enrico Gregorio at |
| 1393 |
% \url{http://tex.stackexchange.com/q/124528/4918}, a follow up question |
| 1394 |
% was \url{http://tex.stackexchange.com/q/124698/4918}. David Carlisle and Bruno Le Floch |
| 1395 |
% lead me to the implementation of the highlighting mechanism, see |
| 1396 |
% \url{http://tex.stackexchange.com/q/124782/4918}} |
| 1397 |
% \begin{macrocode} |
| 1398 |
\cs_new_protected:Npn \@@_metrics:nn #1 #2 |
| 1399 |
{ |
| 1400 |
\tl_set:Nx \l_@@_words_tl { \tl_trim_spaces:n { #2 } } |
| 1401 |
% \end{macrocode} |
| 1402 |
% First replace the spaces by a special marker \cs{q_@@_space_marker} and add |
| 1403 |
% hyphens: a space becomes a syllable. |
| 1404 |
% \begin{macrocode} |
| 1405 |
\tl_replace_all:Nnn \l_@@_words_tl { ~ } { - \q_@@_space_marker - } |
| 1406 |
% \end{macrocode} |
| 1407 |
% Then split the word list at hypens. |
| 1408 |
% \begin{macrocode} |
| 1409 |
\seq_set_split:NnV \l_@@_syllables_seq { - } \l_@@_words_tl |
| 1410 |
% \end{macrocode} |
| 1411 |
% Split the symbol list at spaces. |
| 1412 |
% \begin{macrocode} |
| 1413 |
\seq_set_split:Nnx \l_@@_symbols_seq { ~ } { \tl_trim_spaces:n { #1 } } |
| 1414 |
% \end{macrocode} |
| 1415 |
% Search for the short and foot breaks and remove them afterwards. |
| 1416 |
% \begin{macrocode} |
| 1417 |
\int_zero:N \l_@@_process_int |
| 1418 |
\seq_clear:N \l_@@_short_breaks_seq |
| 1419 |
\seq_clear:N \l_@@_foot_breaks_seq |
| 1420 |
\seq_map_inline:Nn \l_@@_symbols_seq { |
| 1421 |
\int_incr:N \l_@@_process_int |
| 1422 |
\tl_if_eq:nnT { ##1 } { ' } { |
| 1423 |
\seq_put_right:Nx \l_@@_short_breaks_seq { \int_use:N \l_@@_process_int } |
| 1424 |
\int_decr:N \l_@@_process_int |
| 1425 |
} |
| 1426 |
\tl_if_eq:nnT { ##1 } { , } { |
| 1427 |
\seq_put_right:Nx \l_@@_foot_breaks_seq { \int_use:N \l_@@_process_int } |
| 1428 |
\int_decr:N \l_@@_process_int |
| 1429 |
} |
| 1430 |
} |
| 1431 |
\seq_remove_all:Nn \l_@@_symbols_seq { , } |
| 1432 |
\seq_remove_all:Nn \l_@@_symbols_seq { ' } |
| 1433 |
% \end{macrocode} |
| 1434 |
% Test whether both lists got the same length: |
| 1435 |
% \begin{macrocode} |
| 1436 |
\int_zero:N \l_@@_process_int |
| 1437 |
\seq_map_inline:Nn \l_@@_syllables_seq |
| 1438 |
{ |
| 1439 |
\tl_if_eq:nnT { ##1 } { \q_@@_space_marker } |
| 1440 |
{ \int_incr:N \l_@@_process_int } |
| 1441 |
} |
| 1442 |
\int_compare:nTF |
| 1443 |
{ |
| 1444 |
\seq_count:N \l_@@_syllables_seq - |
| 1445 |
\seq_count:N \l_@@_symbols_seq = \l_@@_process_int |
| 1446 |
} |
| 1447 |
{ |
| 1448 |
% \end{macrocode} |
| 1449 |
% continue with list processing, if the numbers are equal: |
| 1450 |
% \begin{macrocode} |
| 1451 |
\int_zero:N \l_@@_process_int |
| 1452 |
\seq_map_inline:Nn \l_@@_syllables_seq |
| 1453 |
{ |
| 1454 |
\int_incr:N \l_@@_process_int |
| 1455 |
\tl_if_eq:nnTF { ##1 } { \q_@@_space_marker } |
| 1456 |
{ |
| 1457 |
% \end{macrocode} |
| 1458 |
% If the syllable is a space the process counter must be decremented and |
| 1459 |
% a space is typeset. |
| 1460 |
% \begin{macrocode} |
| 1461 |
\int_add:Nn \l_@@_process_int { -1 } |
| 1462 |
\c_space_token |
| 1463 |
} |
| 1464 |
{ |
| 1465 |
% \end{macrocode} |
| 1466 |
% Finally typeset the syllable and it's symbol. |
| 1467 |
% \changes{v1.1a}{2015/07/23}{Replaced deprecated \cs{str_case:nnn} with \cs{str_case:nnF}.} |
| 1468 |
% \begin{macrocode} |
| 1469 |
\str_case:nnF { ##1 } |
| 1470 |
{ |
| 1471 |
{ | } |
| 1472 |
{ |
| 1473 |
\@@_break_node:n { \@@_l_break: } |
| 1474 |
} |
| 1475 |
{ || } |
| 1476 |
{ |
| 1477 |
\@@_break_node:n { \@@_ll_break: } |
| 1478 |
} |
| 1479 |
} |
| 1480 |
{ |
| 1481 |
\@@_print_syllable:n { ##1 } |
| 1482 |
} |
| 1483 |
} |
| 1484 |
} |
| 1485 |
% \end{macrocode} |
| 1486 |
% And add the short break symbols if necessary: |
| 1487 |
% \begin{macrocode} |
| 1488 |
\seq_if_empty:NF \l_@@_short_breaks_seq { |
| 1489 |
\seq_map_inline:Nn \l_@@_short_breaks_seq { |
| 1490 |
\int_set:Nn \l_tmpa_int { ##1 - 1 } |
| 1491 |
\bool_if:nF { |
| 1492 |
\int_compare_p:n |
| 1493 |
{ 0 = \l_tmpa_int } |
| 1494 |
|| |
| 1495 |
\int_compare_p:n |
| 1496 |
{ \seq_count:N \l_@@_symbols_seq = \l_tmpa_int } |
| 1497 |
} { |
| 1498 |
\tikz [remember~picture, overlay] { |
| 1499 |
\node [every~metrix~symbol~node] at |
| 1500 |
($(l_@@_symbol_node_\int_use:N \l_tmpa_int.east)! |
| 1501 |
0.5!(l_@@_symbol_node_##1.west)$) |
| 1502 |
{ \@@_short_break: }; |
| 1503 |
} |
| 1504 |
} |
| 1505 |
} |
| 1506 |
} |
| 1507 |
% \end{macrocode} |
| 1508 |
% And add the foot break symbols if necessary: |
| 1509 |
% \begin{macrocode} |
| 1510 |
\seq_if_empty:NF \l_@@_foot_breaks_seq { |
| 1511 |
\seq_map_inline:Nn \l_@@_foot_breaks_seq { |
| 1512 |
\int_set:Nn \l_tmpa_int { ##1 - 1 } |
| 1513 |
\bool_if:nF { |
| 1514 |
\int_compare_p:n |
| 1515 |
{ 0 = \l_tmpa_int } |
| 1516 |
|| |
| 1517 |
\int_compare_p:n |
| 1518 |
{ \seq_count:N \l_@@_symbols_seq = \l_tmpa_int } |
| 1519 |
} { |
| 1520 |
\tikz [remember~picture, overlay] { |
| 1521 |
\coordinate (l_@@_tmp_coord) at |
| 1522 |
($(l_@@_syllable_node_\int_use:N \l_tmpa_int.east)! |
| 1523 |
0.5!(l_@@_syllable_node_##1.west)$); |
| 1524 |
\node [every~metrix~symbol~node] at |
| 1525 |
($(l_@@_symbol_node_\int_use:N \l_tmpa_int.east)! |
| 1526 |
(l_@@_tmp_coord)!(l_@@_symbol_node_##1.west)$) |
| 1527 |
{ \@@_foot_break: }; |
| 1528 |
} |
| 1529 |
} |
| 1530 |
} |
| 1531 |
} |
| 1532 |
} |
| 1533 |
% \end{macrocode} |
| 1534 |
% Send an error, else. |
| 1535 |
% \begin{macrocode} |
| 1536 |
{ |
| 1537 |
\@@_error_msg:n |
| 1538 |
{ |
| 1539 |
Numbers~of~symbols~(\seq_count:N \l_@@_symbols_seq)~and~syllables~ |
| 1540 |
(\int_eval:n |
| 1541 |
{ |
| 1542 |
\seq_count:N \l_@@_syllables_seq - \l_@@_process_int |
| 1543 |
} |
| 1544 |
)~mismatch. |
| 1545 |
} |
| 1546 |
} |
| 1547 |
} |
| 1548 |
% \end{macrocode} |
| 1549 |
% \end{macro} |
| 1550 |
% |
| 1551 |
% \begin{macro}[internal]{\@@_metricsymbols:n} |
| 1552 |
% This macro works like \cs{\__metrix_metrics} but is used to print stand alone metric |
| 1553 |
% symbols via \cs{metricsymbols}. |
| 1554 |
% \changes{v1.1a}{2015/07/23}{Replaced deprecated \cs{str_case:nnn} with \cs{str_case:nnF}.} |
| 1555 |
% \begin{macrocode} |
| 1556 |
\cs_new_protected:Npn \@@_metricsymbols:n #1 |
| 1557 |
{ |
| 1558 |
\seq_set_split:Nnx \l_@@_symbols_seq { ~ } { \tl_trim_spaces:n { #1 } } |
| 1559 |
\int_zero:N \l_@@_process_int |
| 1560 |
\seq_map_inline:Nn \l_@@_symbols_seq |
| 1561 |
{ |
| 1562 |
\int_incr:N \l_@@_process_int |
| 1563 |
\int_compare:nT { \l_@@_process_int > 1 } |
| 1564 |
{ |
| 1565 |
\hspace { \usemetrixvar{symbolsep} } |
| 1566 |
} |
| 1567 |
\str_case:nnF { ##1 } |
| 1568 |
{ |
| 1569 |
{ , } |
| 1570 |
{ |
| 1571 |
\@@_break_gap: |
| 1572 |
\@@_align_symbol:n { \@@_l_bigmark: } |
| 1573 |
\@@_break_gap: |
| 1574 |
} |
| 1575 |
{ ' } |
| 1576 |
{ |
| 1577 |
\@@_break_gap: |
| 1578 |
\@@_align_symbol:n { \@@_l_bigmark: } |
| 1579 |
\@@_break_gap: |
| 1580 |
} |
| 1581 |
{ | } |
| 1582 |
{ |
| 1583 |
\@@_break_gap: |
| 1584 |
\@@_align_symbol:n { \@@_l_bigmark: } |
| 1585 |
\@@_break_gap: |
| 1586 |
} |
| 1587 |
{ '' } |
| 1588 |
{ |
| 1589 |
\@@_break_gap: |
| 1590 |
\@@_align_symbol:n { \@@_ll_bigmark: } |
| 1591 |
\@@_break_gap: |
| 1592 |
} |
| 1593 |
{ || } |
| 1594 |
{ |
| 1595 |
\@@_break_gap: |
| 1596 |
\@@_align_symbol:n { \@@_ll_bigmark: } |
| 1597 |
\@@_break_gap: |
| 1598 |
} |
| 1599 |
} |
| 1600 |
{ |
| 1601 |
\@@_align_symbol:n { \@@_print_symbol: } |
| 1602 |
} |
| 1603 |
} |
| 1604 |
} |
| 1605 |
% \end{macrocode} |
| 1606 |
% \end{macro} |
| 1607 |
% \begin{macro}[internal,updated=2014/07/02]{\@@_print_syllable:n} |
| 1608 |
% \changes{v1.1}{2014/07/02}{Symbol nodes get individual names now.} |
| 1609 |
% This macro combines a single syllable and the corrosponding metric symbol |
| 1610 |
% taken frome the symbol list index with the process counter. |
| 1611 |
% \begin{macrocode} |
| 1612 |
\cs_new_protected:Npn \@@_print_syllable:n #1 |
| 1613 |
{ |
| 1614 |
\group_begin: |
| 1615 |
% \end{macrocode} |
| 1616 |
% Check wether the current syllable is short or long and set the corresponding bbol. |
| 1617 |
% \begin{macrocode} |
| 1618 |
\hbox_set:Nn \l_@@_syllable_box { #1 } |
| 1619 |
\dim_compare:nTF |
| 1620 |
{ \box_wd:N \l_@@_syllable_box < \g_@@_variable_shortsyllablelimit_tl } |
| 1621 |
{ \bool_set_true:N \l_@@_short_syllable_bool } |
| 1622 |
{ \bool_set_false:N \l_@@_short_syllable_bool } |
| 1623 |
% \end{macrocode} |
| 1624 |
% Set up the currend highlight is it is definded |
| 1625 |
% \begin{macrocode} |
| 1626 |
\cs_set:Npx \@@_current_highlight: { |
| 1627 |
\prop_item:NV \l_@@_highlights_prop \l_@@_process_int |
| 1628 |
} |
| 1629 |
\expandafter\tikzset\expandafter{\@@_current_highlight:} |
| 1630 |
% \end{macrocode} |
| 1631 |
% Finally print the syllable and the symbol above. Use +{pgfinterruptboundingbox}+ |
| 1632 |
% so that the symbol doesn't takes space ad doesn't cause gaps between the syllables. |
| 1633 |
% \begin{macrocode} |
| 1634 |
\hbox_set:Nn \l_tmpa_box { \@@_print_symbol: } |
| 1635 |
\begin{tikzpicture} |
| 1636 |
[ |
| 1637 |
remember~picture, |
| 1638 |
baseline=(l_@@_syllable_node_\int_use:N \l_@@_process_int.base), |
| 1639 |
] |
| 1640 |
\node [every~metrix~syllable~node] |
| 1641 |
(l_@@_syllable_node_\int_use:N \l_@@_process_int) |
| 1642 |
{ #1 }; |
| 1643 |
\begin{pgfinterruptboundingbox} |
| 1644 |
\node [every~metrix~symbol~node] |
| 1645 |
(l_@@_symbol_node_\int_use:N \l_@@_process_int) |
| 1646 |
at ($ |
| 1647 |
(l_@@_syllable_node_\int_use:N \l_@@_process_int.base) |
| 1648 |
+ |
| 1649 |
(0,\usemetrixvar{symbolshift}) |
| 1650 |
+ |
| 1651 |
(\tl_use:N \l_@@_internal_itcorrection_tl,0) |
| 1652 |
$) |
| 1653 |
{ \box_use:N \l_tmpa_box }; |
| 1654 |
\end{pgfinterruptboundingbox} |
| 1655 |
\end{tikzpicture} |
| 1656 |
\group_end: |
| 1657 |
} |
| 1658 |
% \end{macrocode} |
| 1659 |
% \end{macro} |
| 1660 |
% \begin{macro}[internal]{\@@_print_symbol:} |
| 1661 |
% This command selects the right symbol by it's abbreviation. |
| 1662 |
% \begin{macrocode} |
| 1663 |
\cs_new_protected:Npn \@@_print_symbol: |
| 1664 |
{ |
| 1665 |
\tl_set:Nx \l_@@_current_symbol_tl |
| 1666 |
{ |
| 1667 |
\seq_item:Nn \l_@@_symbols_seq { \l_@@_process_int } |
| 1668 |
} |
| 1669 |
\tl_set:Nx \l_@@_current_symbol_head_tl |
| 1670 |
{ |
| 1671 |
\tl_head:N \l_@@_current_symbol_tl |
| 1672 |
} |
| 1673 |
\tl_case:NnT \l_@@_current_symbol_head_tl |
| 1674 |
{ |
| 1675 |
\c_@@_acute_accent_tl { \bool_set_true:N \l_@@_has_acute_accent_bool } |
| 1676 |
\c_@@_grave_accent_tl { \bool_set_true:N \l_@@_has_grave_accent_bool } |
| 1677 |
} |
| 1678 |
{ |
| 1679 |
\tl_remove_once:NV \l_@@_current_symbol_tl \l_@@_current_symbol_head_tl |
| 1680 |
} |
| 1681 |
\cs_if_exist_use:cF |
| 1682 |
{ |
| 1683 |
@@_ |
| 1684 |
\tl_use:N \l_@@_current_symbol_tl |
| 1685 |
_mark: |
| 1686 |
} |
| 1687 |
{ |
| 1688 |
\@@_error_msg:n |
| 1689 |
{ |
| 1690 |
Unknown~symbol~abbreviation~'\tl_use:N \l_@@_current_symbol_tl'. |
| 1691 |
} |
| 1692 |
} |
| 1693 |
} |
| 1694 |
% \end{macrocode} |
| 1695 |
% \end{macro} |
| 1696 |
% |
| 1697 |
% \subsection{Internal auxiliary macros} |
| 1698 |
% \begin{macro}[internal]{\@@_error_msg:n} |
| 1699 |
% An abbreviation to throw an error message. |
| 1700 |
% \begin{macrocode} |
| 1701 |
\cs_new_protected:Npn \@@_error_msg:n #1 |
| 1702 |
{ |
| 1703 |
\PackageError{ \metrixFileName } { #1 } |
| 1704 |
{ |
| 1705 |
Please~take~a~look~at~the~manual~or~send~an~email. |
| 1706 |
} |
| 1707 |
} |
| 1708 |
% \end{macrocode} |
| 1709 |
% \end{macro} |
| 1710 |
% \begin{macro}[internal]{\@@_warning_msg:n} |
| 1711 |
% An abbreviation to throw an error message. |
| 1712 |
% \begin{macrocode} |
| 1713 |
\cs_new_protected:Npn \@@_warning_msg:n #1 |
| 1714 |
{ |
| 1715 |
\PackageWarning{ \metrixFileName } { #1 } |
| 1716 |
} |
| 1717 |
% \end{macrocode} |
| 1718 |
% \end{macro} |
| 1719 |
% \begin{macro}[internal]{\@@_align_symbol:n} |
| 1720 |
% This macro alings the metric symbols in a stand alone list. |
| 1721 |
% \begin{macrocode} |
| 1722 |
\cs_new_protected:Npn \@@_align_symbol:n #1 |
| 1723 |
{ |
| 1724 |
\group_begin: |
| 1725 |
\cs_set:Npx \@@_current_highlight: { |
| 1726 |
\prop_item:NV \l_@@_highlights_prop \l_@@_process_int |
| 1727 |
} |
| 1728 |
\expandafter\tikzset\expandafter{\@@_current_highlight:} |
| 1729 |
\begin{tikzpicture} |
| 1730 |
[ |
| 1731 |
baseline={(0,-0.25*\usemetrixvar{baseunit})}, |
| 1732 |
] |
| 1733 |
\node [every~metrix~symbol~node] {#1}; |
| 1734 |
\end{tikzpicture} |
| 1735 |
\group_end: |
| 1736 |
} |
| 1737 |
% \end{macrocode} |
| 1738 |
% \end{macro} |
| 1739 |
% \begin{macro}[internal]{\@@_break_gap:} |
| 1740 |
% This macro typesets the gap around the two break symbols. |
| 1741 |
% \begin{macrocode} |
| 1742 |
\cs_new_protected:Npn \@@_break_gap: |
| 1743 |
{ |
| 1744 |
\hspace { \usemetrixvar { breakgap } } |
| 1745 |
} |
| 1746 |
% \end{macrocode} |
| 1747 |
% \end{macro} |
| 1748 |
% \begin{macro}[internal]{\@@_break_node:n} |
| 1749 |
% This macro typsets the gap around the two break symbols. |
| 1750 |
% \begin{macrocode} |
| 1751 |
\cs_new:Npn \@@_break_node:n #1 |
| 1752 |
{ |
| 1753 |
\group_begin: |
| 1754 |
\cs_set:Npx \@@_current_highlight: { |
| 1755 |
\prop_item:NV \l_@@_highlights_prop \l_@@_process_int |
| 1756 |
} |
| 1757 |
\expandafter\tikzset\expandafter{\@@_current_highlight:} |
| 1758 |
\tikz[baseline=(l_@@_break_node.base)] |
| 1759 |
\node (l_@@_break_node) [every~metrix~break~node] { #1 } |
| 1760 |
; |
| 1761 |
\group_end: |
| 1762 |
} |
| 1763 |
% \end{macrocode} |
| 1764 |
% \end{macro} |
| 1765 |
% \begin{macro}[internal]{\@@_e_gap:} |
| 1766 |
% This macro typsets the gap around the two break symbols. |
| 1767 |
% \begin{macrocode} |
| 1768 |
\cs_new_protected:Npn \@@_e_gap: |
| 1769 |
{ |
| 1770 |
\hspace* { \usemetrixvar { emptywidth } } |
| 1771 |
} |
| 1772 |
% \end{macrocode} |
| 1773 |
% \end{macro} |
| 1774 |
% \begin{macro}[internal]{\@@_evaluate_higlights:N} |
| 1775 |
% This macro evaluates and prints the highlighting options. |
| 1776 |
% \begin{macrocode} |
| 1777 |
\cs_new_protected:Npn \@@_evaluate_higlights:n #1 |
| 1778 |
{ |
| 1779 |
% \end{macrocode} |
| 1780 |
% Start with clearing the property list, otherwise the highlights from |
| 1781 |
% the last time will survive. |
| 1782 |
% \begin{macrocode} |
| 1783 |
\prop_clear:N \l_@@_highlights_prop |
| 1784 |
% \end{macrocode} |
| 1785 |
% Then spilt and process the argument as a comma separated list. |
| 1786 |
% \begin{macrocode} |
| 1787 |
\clist_map_inline:nn { #1 } |
| 1788 |
{ |
| 1789 |
% \end{macrocode} |
| 1790 |
% The result is a sequence of key value pairs that we store in |
| 1791 |
% \cs{l_@@_highlight_seq}. The first part of this sequence must |
| 1792 |
% be split again at the plus sign---store it in \cs{l_@@_highlight_pos_seq}. |
| 1793 |
% \begin{macrocode} |
| 1794 |
\seq_set_split:Nnn \l_@@_highlight_seq { = } { ##1 } |
| 1795 |
\seq_set_split:Nnf \l_@@_highlight_pos_seq { + } |
| 1796 |
{ |
| 1797 |
\seq_item:Nn \l_@@_highlight_seq { 1 } |
| 1798 |
} |
| 1799 |
% \end{macrocode} |
| 1800 |
% Process the \cs{l_@@_highlight_pos_seq} list and set up the property list: |
| 1801 |
% \begin{macrocode} |
| 1802 |
\seq_map_inline:Nn \l_@@_highlight_pos_seq |
| 1803 |
{ |
| 1804 |
\prop_put:Nnx \l_@@_highlights_prop |
| 1805 |
% \end{macrocode} |
| 1806 |
% The key is the current item of \cs{l_@@_highlight_pos_seq}. |
| 1807 |
% \begin{macrocode} |
| 1808 |
{ |
| 1809 |
####1 |
| 1810 |
} |
| 1811 |
{ |
| 1812 |
% \end{macrocode} |
| 1813 |
% The value is the second item of \cs{l_@@_highlight_seq}. |
| 1814 |
% \begin{macrocode} |
| 1815 |
\seq_item:Nn \l_@@_highlight_seq { 2 } |
| 1816 |
} |
| 1817 |
} |
| 1818 |
} |
| 1819 |
} |
| 1820 |
% \end{macrocode} |
| 1821 |
% \end{macro} |
| 1822 |
% |
| 1823 |
% \subsection{Patching font macros} |
| 1824 |
% To apply the italic correction of the accents we need to patch the font switches. |
| 1825 |
% \begin{macrocode} |
| 1826 |
\xpretocmd { \itshape } |
| 1827 |
{ |
| 1828 |
\tl_set_eq:NN |
| 1829 |
\l_@@_internal_itcorrection_tl |
| 1830 |
\g_@@_variable_itcorrection_tl |
| 1831 |
} |
| 1832 |
{ } |
| 1833 |
{ |
| 1834 |
\@@_warning_msg:n { Could~not~patch~\string\itshape. } |
| 1835 |
} |
| 1836 |
\xpretocmd { \slshape } |
| 1837 |
{ |
| 1838 |
\tl_set_eq:NN |
| 1839 |
\l_@@_internal_itcorrection_tl |
| 1840 |
\g_@@_variable_itcorrection_tl |
| 1841 |
} |
| 1842 |
{ } |
| 1843 |
{ |
| 1844 |
\@@_warning_msg:n { Could~not~patch~\string\slshape. } |
| 1845 |
} |
| 1846 |
\xpretocmd { \upshape } |
| 1847 |
{ |
| 1848 |
\tl_set_eq:NN |
| 1849 |
\l_@@_internal_itcorrection_tl |
| 1850 |
\g_@@_internal_itcorrection_zero_tl |
| 1851 |
} |
| 1852 |
{ } |
| 1853 |
{ |
| 1854 |
\@@_warning_msg:n { Could~not~patch~\string\upshape. } |
| 1855 |
} |
| 1856 |
\xpretocmd { \normalfont } |
| 1857 |
{ |
| 1858 |
\tl_set_eq:NN |
| 1859 |
\l_@@_internal_itcorrection_tl |
| 1860 |
\g_@@_internal_itcorrection_zero_tl |
| 1861 |
} |
| 1862 |
{ } |
| 1863 |
{ |
| 1864 |
\@@_warning_msg:n { Could~not~patch~\string\normalfont. } |
| 1865 |
} |
| 1866 |
% \end{macrocode} |
| 1867 |
% |
| 1868 |
% \subsection{Internal macros for metric symbols} |
| 1869 |
% |
| 1870 |
% \begin{macro}[internal]{\@@_e_mark:} |
| 1871 |
% The empty symbol. |
| 1872 |
% \begin{macrocode} |
| 1873 |
\cs_new:Npn \@@_e_mark: { \@@_e_gap: } |
| 1874 |
% \end{macrocode} |
| 1875 |
% \end{macro} |
| 1876 |
% \begin{macro}[internal]{\@@_u_mark:} |
| 1877 |
% The brevis symbol \metricsymbols*{u}. |
| 1878 |
% \begin{macrocode} |
| 1879 |
\cs_new:Npn \@@_u_mark: |
| 1880 |
{ |
| 1881 |
\begin{tikzpicture}[every~metrix~symbol] |
| 1882 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.225]; |
| 1883 |
\bool_if:NT \l_@@_has_acute_accent_bool |
| 1884 |
{ |
| 1885 |
\node [every~metrix~ictus~node] at (0.225,0) { \usemetrixvar { acute } }; |
| 1886 |
} |
| 1887 |
\bool_if:NT \l_@@_has_grave_accent_bool |
| 1888 |
{ |
| 1889 |
\node [every~metrix~ictus~node] at (0.225,0) { \usemetrixvar { grave } }; |
| 1890 |
} |
| 1891 |
\end{tikzpicture} |
| 1892 |
} |
| 1893 |
% \end{macrocode} |
| 1894 |
% \end{macro} |
| 1895 |
% \begin{macro}[internal]{\@@___mark:} |
| 1896 |
% The longa symbol \MakePrivateLetters\metricsymbols*{_}. |
| 1897 |
% \begin{macrocode} |
| 1898 |
\cs_new:Npn \@@___mark: |
| 1899 |
{ |
| 1900 |
\bool_if:NTF \l_@@_short_syllable_bool |
| 1901 |
{ |
| 1902 |
\begin{tikzpicture}[every~metrix~symbol] |
| 1903 |
\draw (0,0) -- ++(0.4,0); |
| 1904 |
\bool_if:NT \l_@@_has_acute_accent_bool |
| 1905 |
{ |
| 1906 |
\node [every~metrix~ictus~node] at (0.2,0) { \usemetrixvar { acute } }; |
| 1907 |
} |
| 1908 |
\bool_if:NT \l_@@_has_grave_accent_bool |
| 1909 |
{ |
| 1910 |
\node [every~metrix~ictus~node] at (0.2,0) { \usemetrixvar { grave } }; |
| 1911 |
} |
| 1912 |
\end{tikzpicture} |
| 1913 |
} |
| 1914 |
{ |
| 1915 |
\begin{tikzpicture}[every~metrix~symbol] |
| 1916 |
\draw (0,0) -- ++(0.75,0); |
| 1917 |
\bool_if:NT \l_@@_has_acute_accent_bool |
| 1918 |
{ |
| 1919 |
\node [every~metrix~ictus~node] at (0.375,0) { \usemetrixvar { acute } }; |
| 1920 |
} |
| 1921 |
\bool_if:NT \l_@@_has_grave_accent_bool |
| 1922 |
{ |
| 1923 |
\node [every~metrix~ictus~node] at (0.375,0) { \usemetrixvar { grave } }; |
| 1924 |
} |
| 1925 |
\end{tikzpicture} |
| 1926 |
} |
| 1927 |
} |
| 1928 |
% \end{macrocode} |
| 1929 |
% \end{macro} |
| 1930 |
% \begin{macro}[internal]{\@@_uu_mark:} |
| 1931 |
% The biceps symbol \MakePrivateLetters\metricsymbols*{uu_}. |
| 1932 |
% \begin{macrocode} |
| 1933 |
\cs_new:Npn \@@_uu_mark: |
| 1934 |
{ |
| 1935 |
\begin{tikzpicture}[every~metrix~symbol] |
| 1936 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2]; |
| 1937 |
\draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc |
| 1938 |
[start~angle=0, end~angle=180, radius=-0.2]; |
| 1939 |
\end{tikzpicture} |
| 1940 |
} |
| 1941 |
% \end{macrocode} |
| 1942 |
% \end{macro} |
| 1943 |
% \begin{macro}[internal]{\@@_uu__mark:} |
| 1944 |
% The biceps symbol \MakePrivateLetters\metricsymbols*{uu_}. |
| 1945 |
% \begin{macrocode} |
| 1946 |
\cs_new:Npn \@@_uu__mark: |
| 1947 |
{ |
| 1948 |
\begin{tikzpicture}[every~metrix~symbol] |
| 1949 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2]; |
| 1950 |
\draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc |
| 1951 |
[start~angle=0, end~angle=180, radius=-0.2]; |
| 1952 |
\draw ($(0,-0.2)+(-0.5\pgflinewidth,-\pgflinewidth)-(0,\usemetrixvar{gap})$) -- |
| 1953 |
($(0.8,-0.2)+(1.5\pgflinewidth,-\pgflinewidth) |
| 1954 |
+(\usemetrixvar{gap},-\usemetrixvar{gap})$); |
| 1955 |
\end{tikzpicture} |
| 1956 |
} |
| 1957 |
% \end{macrocode} |
| 1958 |
% \end{macro} |
| 1959 |
% \begin{macro}[internal]{\@@__uu_mark:} |
| 1960 |
% Another biceps symbol \MakePrivateLetters\metricsymbols*{_uu}. |
| 1961 |
% \begin{macrocode} |
| 1962 |
\cs_new:Npn \@@__uu_mark: |
| 1963 |
{ |
| 1964 |
\begin{tikzpicture}[every~metrix~symbol] |
| 1965 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2]; |
| 1966 |
\draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc |
| 1967 |
[start~angle=0, end~angle=180, radius=-0.2]; |
| 1968 |
\draw ($(0,0)+(-0.5\pgflinewidth,0.5\pgflinewidth)+(0,\usemetrixvar{gap})$) -- |
| 1969 |
($(0.8,0)+(1.5\pgflinewidth,0.5\pgflinewidth) |
| 1970 |
+(\usemetrixvar{gap},\usemetrixvar{gap})$); |
| 1971 |
\end{tikzpicture} |
| 1972 |
} |
| 1973 |
% \end{macrocode} |
| 1974 |
% \end{macro} |
| 1975 |
% \begin{macro}[internal]{\@@_u_uu_mark:} |
| 1976 |
% An another biceps symbol \MakePrivateLetters\metricsymbols*{u_uu}. |
| 1977 |
% \begin{macrocode} |
| 1978 |
\cs_new:Npn \@@_u_uu_mark: |
| 1979 |
{ |
| 1980 |
\begin{tikzpicture}[every~metrix~symbol] |
| 1981 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2]; |
| 1982 |
\draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc |
| 1983 |
[start~angle=0, end~angle=180, radius=-0.2]; |
| 1984 |
\draw ($(0,0)+(-0.5\pgflinewidth,0.5\pgflinewidth)+(0,\usemetrixvar{gap})$) -- |
| 1985 |
($(0.8,0)+(1.5\pgflinewidth,0.5\pgflinewidth) |
| 1986 |
+(\usemetrixvar{gap},\usemetrixvar{gap})$); |
| 1987 |
\draw ($(0.2,0.2)+(0.5\pgflinewidth,1.5\pgflinewidth) |
| 1988 |
+(0.5*\usemetrixvar{gap},2*\usemetrixvar{gap})$) |
| 1989 |
arc [start~angle=0, end~angle=180, radius=-0.2]; |
| 1990 |
\end{tikzpicture} |
| 1991 |
} |
| 1992 |
% \end{macrocode} |
| 1993 |
% \end{macro} |
| 1994 |
% \begin{macro}[internal]{\@@_x_mark:} |
| 1995 |
% The anceps symbol \metricsymbols*{x}. |
| 1996 |
% \begin{macrocode} |
| 1997 |
\cs_new:Npn \@@_x_mark: |
| 1998 |
{ |
| 1999 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2000 |
\draw (-0.2,0.2) -- (0.2,-0.2); |
| 2001 |
\draw (-0.2,-0.2) -- (0.2,0.2); |
| 2002 |
\end{tikzpicture} |
| 2003 |
} |
| 2004 |
% \end{macrocode} |
| 2005 |
% \end{macro} |
| 2006 |
% \begin{macro}[internal]{\@@_v_mark:} |
| 2007 |
% \changes{v1.4}{2019/05/04}{Added \texttt{v} symbol.} |
| 2008 |
% The (yet) unnamed symbol \metricsymbols*{v}. |
| 2009 |
% \begin{macrocode} |
| 2010 |
\cs_new:Npn \@@_v_mark: |
| 2011 |
{ |
| 2012 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2013 |
\draw (0,0) -- (0.225,-0.225) -- (0.45,0); |
| 2014 |
\end{tikzpicture} |
| 2015 |
} |
| 2016 |
% \end{macrocode} |
| 2017 |
% \end{macro} |
| 2018 |
% \begin{macro}[internal]{\@@_A_mark:} |
| 2019 |
% \changes{v1.4}{2019/05/04}{Added \texttt{A} symbol.} |
| 2020 |
% The (yet) unnamed symbol \metricsymbols*{A}. |
| 2021 |
% \begin{macrocode} |
| 2022 |
\cs_new:Npn \@@_A_mark: |
| 2023 |
{ |
| 2024 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2025 |
\draw (0,0) -- (0.225,0.225) -- (0.45,0); |
| 2026 |
\end{tikzpicture} |
| 2027 |
} |
| 2028 |
% \end{macrocode} |
| 2029 |
% \end{macro} |
| 2030 |
% \begin{macro}[internal]{\@@_o_mark:} |
| 2031 |
% \changes{v1.4}{2019/05/04}{Added \texttt{o} symbol.} |
| 2032 |
% The (yet) unnamed symbol \metricsymbols*{o}. |
| 2033 |
% \begin{macrocode} |
| 2034 |
\cs_new:Npn \@@_o_mark: |
| 2035 |
{ |
| 2036 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2037 |
\draw (0,0) circle [radius=0.2]; |
| 2038 |
\end{tikzpicture} |
| 2039 |
} |
| 2040 |
% \end{macrocode} |
| 2041 |
% \end{macro} |
| 2042 |
% \begin{macro}[internal,added=2019/05/04]{\@@_oo_mark:} |
| 2043 |
% The aeolic symbol \metricsymbols*{oo}. |
| 2044 |
% \begin{macrocode} |
| 2045 |
\cs_new:Npn \@@_oo_mark: |
| 2046 |
{ |
| 2047 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2048 |
\draw (0,0) circle [radius=0.2]; |
| 2049 |
\draw ($(0.4,0)+(1\pgflinewidth,0)+(\usemetrixvar{gap},0)$) circle [radius=0.2]; |
| 2050 |
\end{tikzpicture} |
| 2051 |
} |
| 2052 |
% \end{macrocode} |
| 2053 |
% \end{macro} |
| 2054 |
% \begin{macro}[internal,updated=2014/07/02]{\@@_u__mark:} |
| 2055 |
% \changes{v1.1}{2014/07/02}{Removed red dot.} |
| 2056 |
% The indifferent symbol \MakePrivateLetters\metricsymbols*{u_}. |
| 2057 |
% \begin{macrocode} |
| 2058 |
\cs_new:Npn \@@_u__mark: |
| 2059 |
{ |
| 2060 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2061 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2]; |
| 2062 |
\draw ($(0,-0.2)+(-0.5\pgflinewidth,-\pgflinewidth)-(0,\usemetrixvar{gap})$) -- |
| 2063 |
($(0.4,-0.2)+(0.5\pgflinewidth,-\pgflinewidth) |
| 2064 |
+(0,-\usemetrixvar{gap})$); |
| 2065 |
\end{tikzpicture} |
| 2066 |
} |
| 2067 |
% \end{macrocode} |
| 2068 |
% \end{macro} |
| 2069 |
% \begin{macro}[internal,added=2019/10/09]{\@@__u_mark:} |
| 2070 |
% \changes{v1.5}{2019/10/09}{Added.} |
| 2071 |
% The indifferent symbol \MakePrivateLetters\metricsymbols*{_u}. |
| 2072 |
% \begin{macrocode} |
| 2073 |
\cs_new:Npn \@@__u_mark: |
| 2074 |
{ |
| 2075 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2076 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2]; |
| 2077 |
\draw ($(0,0)+(-0.5\pgflinewidth,0.5\pgflinewidth)+(0,\usemetrixvar{gap})$) -- |
| 2078 |
($(0.4,0)+(0.5\pgflinewidth,0.5\pgflinewidth) |
| 2079 |
+(0,\usemetrixvar{gap})$); |
| 2080 |
\end{tikzpicture} |
| 2081 |
} |
| 2082 |
% \end{macrocode} |
| 2083 |
% \end{macro} |
| 2084 |
% \begin{macro}[internal]{\@@_n_mark:} |
| 2085 |
% An alternative indifferent symbol \metricsymbols*{n}. |
| 2086 |
% \begin{macrocode} |
| 2087 |
\cs_new:Npn \@@_n_mark: |
| 2088 |
{ |
| 2089 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2090 |
\draw (0,0) arc [start~angle=0, end~angle=180, radius=0.225]; |
| 2091 |
\fill (-0.225,0.75*\usemetrixvar{symbollinewidth}) |
| 2092 |
circle [radius=0.7\pgflinewidth]; |
| 2093 |
\end{tikzpicture} |
| 2094 |
} |
| 2095 |
% \end{macrocode} |
| 2096 |
% \end{macro} |
| 2097 |
% \begin{macro}[internal]{\@@_p_mark:} |
| 2098 |
% \changes{v1.4}{2019/05/04}{Added primary stress symbol.} |
| 2099 |
% The primary stress symbol \metricsymbols*{p}. |
| 2100 |
% \begin{macrocode} |
| 2101 |
\cs_new:Npn \@@_p_mark: |
| 2102 |
{ |
| 2103 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2104 |
\draw (-0.2,-0.2) -- (0.2,0.2); |
| 2105 |
\end{tikzpicture} |
| 2106 |
} |
| 2107 |
% \end{macrocode} |
| 2108 |
% \end{macro} |
| 2109 |
% \begin{macro}[internal]{\@@_s_mark:} |
| 2110 |
% \changes{v1.4}{2019/05/04}{Added secondary stress symbol.} |
| 2111 |
% The secondary stress symbol \metricsymbols*{s}. |
| 2112 |
% \begin{macrocode} |
| 2113 |
\cs_new:Npn \@@_s_mark: |
| 2114 |
{ |
| 2115 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2116 |
\draw (-0.2,0.2) -- (0.2,-0.2); |
| 2117 |
\end{tikzpicture} |
| 2118 |
} |
| 2119 |
% \end{macrocode} |
| 2120 |
% \end{macro} |
| 2121 |
% \begin{macro}[internal]{\@@_l_mark:} |
| 2122 |
% The simple break symbol \metricsymbols*{|} (above syllables). |
| 2123 |
% \begin{macrocode} |
| 2124 |
\cs_new:Npn \@@_l_mark: |
| 2125 |
{ |
| 2126 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2127 |
\draw (0,0) -- (0,0.5); |
| 2128 |
\end{tikzpicture} |
| 2129 |
} |
| 2130 |
% \end{macrocode} |
| 2131 |
% \end{macro} |
| 2132 |
% \begin{macro}[internal]{\@@_ll_mark:} |
| 2133 |
% The verse break symbol \metricsymbols*{||} (above syllables). |
| 2134 |
% \begin{macrocode} |
| 2135 |
\cs_new:Npn \@@_ll_mark: |
| 2136 |
{ |
| 2137 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2138 |
\draw (0,0) -- (0,0.5); |
| 2139 |
\draw ($(\pgflinewidth,0)+(1.5*\usemetrixvar{gap},0)$) -- ++(0,0.5); |
| 2140 |
\end{tikzpicture} |
| 2141 |
} |
| 2142 |
% \end{macrocode} |
| 2143 |
% \end{macro} |
| 2144 |
% \begin{macro}[internal]{\@@_l_bigmark:} |
| 2145 |
% The simple break symbol \metricsymbols*{|} (stand alone version). |
| 2146 |
% \begin{macrocode} |
| 2147 |
\cs_new:Npn \@@_l_bigmark: |
| 2148 |
{ |
| 2149 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2150 |
\draw (0,0) -- (0,0.8); |
| 2151 |
\end{tikzpicture} |
| 2152 |
} |
| 2153 |
% \end{macrocode} |
| 2154 |
% \end{macro} |
| 2155 |
% \begin{macro}[internal]{\@@_ll_bigmark:} |
| 2156 |
% The verse break symbol \metricsymbols*{||} (stand alone version). |
| 2157 |
% \begin{macrocode} |
| 2158 |
\cs_new:Npn \@@_ll_bigmark: |
| 2159 |
{ |
| 2160 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2161 |
\draw (0,0) -- (0,0.8); |
| 2162 |
\draw ($(\pgflinewidth,0)+(1.5*\usemetrixvar{gap},0)$) -- ++(0,0.8); |
| 2163 |
\end{tikzpicture} |
| 2164 |
} |
| 2165 |
% \end{macrocode} |
| 2166 |
% \end{macro} |
| 2167 |
% \begin{macro}[internal,updated=2014/07/02]{\@@_l_break} |
| 2168 |
% \changes{v1.1}{2014/07/02}{Made line slightly longer} |
| 2169 |
% The simple break symbol \metricsymbols*{|} (between syllables with symbols). |
| 2170 |
% \begin{macrocode} |
| 2171 |
\cs_new:Npn \@@_l_break: |
| 2172 |
{ |
| 2173 |
\begin{tikzpicture}[every~metrix~symbol,baseline=0.05em] |
| 2174 |
\draw (0,\usemetrixvar{symbolshift}+0.325em) |
| 2175 |
-- (0,-0.05em) -- (0,0.8em) -- (0,\usemetrixvar{symbolshift}); |
| 2176 |
\end{tikzpicture} |
| 2177 |
} |
| 2178 |
% \end{macrocode} |
| 2179 |
% \end{macro} |
| 2180 |
% \begin{macro}[internal,updated=2014/07/02]{\@@_ll_break} |
| 2181 |
% \changes{v1.1}{2014/07/02}{Made lines slightly longer} |
| 2182 |
% The verse break symbol \metricsymbols*{||} (between syllables with symbols). |
| 2183 |
% \begin{macrocode} |
| 2184 |
\cs_new:Npn \@@_ll_break: |
| 2185 |
{ |
| 2186 |
\begin{tikzpicture}[every~metrix~symbol,baseline=0.05em] |
| 2187 |
\draw (0,\usemetrixvar{symbolshift}+0.325em) |
| 2188 |
-- (0,-0.05em) -- (0,0.8em) -- (0,\usemetrixvar{symbolshift}); |
| 2189 |
\draw |
| 2190 |
[ |
| 2191 |
shift={($(\pgflinewidth,0)+(1.5*\usemetrixvar{gap},0)$)}, |
| 2192 |
] |
| 2193 |
(0,\usemetrixvar{symbolshift}+0.325em) -- (0,-0.05em) -- (0,0.8em) |
| 2194 |
-- (0,\usemetrixvar{symbolshift}); |
| 2195 |
\end{tikzpicture} |
| 2196 |
} |
| 2197 |
% \end{macrocode} |
| 2198 |
% \end{macro} |
| 2199 |
% \begin{macro}[internal]{\@@_short_break:} |
| 2200 |
% The shorter break symbol. |
| 2201 |
% \begin{macrocode} |
| 2202 |
\cs_new:Npn \@@_short_break: |
| 2203 |
{ |
| 2204 |
\begin{tikzpicture}[every~metrix~symbol] |
| 2205 |
\draw (0,0.3) -- (0,-0.3); |
| 2206 |
\end{tikzpicture} |
| 2207 |
} |
| 2208 |
% \end{macrocode} |
| 2209 |
% \end{macro} |
| 2210 |
% \begin{macro}[internal]{\@@_foot_break:} |
| 2211 |
% The shorter break symbol for foot breakt is the same as |
| 2212 |
% the regular short break. |
| 2213 |
% \begin{macrocode} |
| 2214 |
\cs_set_eq:NN \@@_foot_break: \@@_short_break: |
| 2215 |
% \end{macrocode} |
| 2216 |
% \end{macro} |
| 2217 |
% |
| 2218 |
% \subsection{User level macros} |
| 2219 |
% |
| 2220 |
% \begin{macro}{\setmetrixvar} |
| 2221 |
% This macro saves the value to an internal variable. |
| 2222 |
% \begin{macrocode} |
| 2223 |
\NewDocumentCommand{ \setmetrixvar }{ m m } |
| 2224 |
{ |
| 2225 |
\tl_if_exist:cTF { g_@@_variable_#1_tl } { |
| 2226 |
\tl_set:cn { g_@@_variable_#1_tl } { #2 } |
| 2227 |
} |
| 2228 |
{ |
| 2229 |
\@@_error_msg:n { Unknown~variable~'#1'. } |
| 2230 |
} |
| 2231 |
} |
| 2232 |
% \end{macrocode} |
| 2233 |
% \end{macro} |
| 2234 |
% \begin{macro}{\usemetrixvar} |
| 2235 |
% With this command one can access the value of an internal variable.\footnote{Marco Daniel |
| 2236 |
% showed me this hint at \url{http://tex.stackexchange.com/q/124600/4918}.} |
| 2237 |
% \begin{macrocode} |
| 2238 |
\DeclareExpandableDocumentCommand{ \usemetrixvar }{ m } |
| 2239 |
{ |
| 2240 |
\tl_if_exist:cTF { g_@@_variable_#1_tl } { |
| 2241 |
\tl_use:c { g_@@_variable_#1_tl } |
| 2242 |
} |
| 2243 |
{ |
| 2244 |
\@@_error_msg:n { Unknown~variable~'#1'. } |
| 2245 |
} |
| 2246 |
} |
| 2247 |
% \end{macrocode} |
| 2248 |
% \end{macro} |
| 2249 |
% \begin{macro}{\metrics} |
| 2250 |
% This user macro calls \cs{\@@_metrics} to typset syllables with symbols. |
| 2251 |
% \begin{macrocode} |
| 2252 |
\NewDocumentCommand { \metrics } { O{} m m } |
| 2253 |
{ |
| 2254 |
\@@_evaluate_higlights:n { #1 } |
| 2255 |
\@@_metrics:nn { #2 } { #3 } |
| 2256 |
} |
| 2257 |
% \end{macrocode} |
| 2258 |
% \end{macro} |
| 2259 |
% \begin{macro}{\metricsymbols} |
| 2260 |
% This command typesets stand alone symbols. The starred version prints smaller versions. |
| 2261 |
% \begin{macrocode} |
| 2262 |
\NewDocumentCommand { \metricsymbols } { s O{} m } |
| 2263 |
{ |
| 2264 |
\group_begin: |
| 2265 |
\IfBooleanF { #1 } { \tikzset{every~metrix~symbol/.style={every~metrix~big~symbol}} } |
| 2266 |
\@@_evaluate_higlights:n { #2 } |
| 2267 |
\@@_metricsymbols:n { #3 } |
| 2268 |
\group_end: |
| 2269 |
} |
| 2270 |
% \end{macrocode} |
| 2271 |
% \end{macro} |
| 2272 |
% \begin{macro}[updated=2015/09/02]{\lng} |
| 2273 |
% \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{lng}.} |
| 2274 |
% This macro prints the longa accent above its argument. |
| 2275 |
% \begin{macrocode} |
| 2276 |
\NewDocumentCommand { \lng } { D(){0,0} O{0pt} m O{0pt} } |
| 2277 |
{ |
| 2278 |
\begin{tikzpicture}[ |
| 2279 |
baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base), |
| 2280 |
every~metrix~accent |
| 2281 |
] |
| 2282 |
\node [every~metrix~syllable~node] |
| 2283 |
(l_@@_syllable_node_\int_use:N \l_@@_process_int) |
| 2284 |
{ #3 }; |
| 2285 |
\begin{pgfinterruptboundingbox} |
| 2286 |
\draw [shorten~< = -#2, shorten~> = -#4] |
| 2287 |
($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north) |
| 2288 |
- (\usemetrixvar{lngminlength}/2,0) |
| 2289 |
+(\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) |
| 2290 |
+ (\tl_use:N \l_@@_internal_itcorrection_tl,0) |
| 2291 |
+ (#1)$) |
| 2292 |
-- |
| 2293 |
($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north) |
| 2294 |
+ (\usemetrixvar{lngminlength}/2,0) |
| 2295 |
+(\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) |
| 2296 |
+ (\tl_use:N \l_@@_internal_itcorrection_tl,0) |
| 2297 |
+ (#1)$) |
| 2298 |
; |
| 2299 |
\draw [shorten~< = -#2, shorten~> = -#4] |
| 2300 |
($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north~west) |
| 2301 |
+(\usemetrixvar{lngshortening}+\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) |
| 2302 |
+ (\tl_use:N \l_@@_internal_itcorrection_tl,0) |
| 2303 |
+ (#1)$) |
| 2304 |
-- |
| 2305 |
($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north~east) |
| 2306 |
+(-\usemetrixvar{lngshortening}+\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) |
| 2307 |
+ (\tl_use:N \l_@@_internal_itcorrection_tl,0) |
| 2308 |
+ (#1)$) |
| 2309 |
; |
| 2310 |
\end{pgfinterruptboundingbox} |
| 2311 |
\end{tikzpicture}% |
| 2312 |
} |
| 2313 |
% \end{macrocode} |
| 2314 |
% \end{macro} |
| 2315 |
% \begin{macro}[updated=2015/09/02]{\brv} |
| 2316 |
% \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{brv}.} |
| 2317 |
% This macro prints the brevis accent above its argument. |
| 2318 |
% \begin{macrocode} |
| 2319 |
\NewDocumentCommand { \brv } { D(){0,0} m } |
| 2320 |
{ |
| 2321 |
\begin{tikzpicture}[ |
| 2322 |
baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base), |
| 2323 |
every~metrix~accent |
| 2324 |
] |
| 2325 |
\node [every~metrix~syllable~node] |
| 2326 |
(l_@@_syllable_node_\int_use:N \l_@@_process_int) |
| 2327 |
{ #2 }; |
| 2328 |
\begin{pgfinterruptboundingbox} |
| 2329 |
\draw ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north) |
| 2330 |
+ (-0.15,0) |
| 2331 |
+ (\usemetrixvar{accentxshift},\usemetrixvar{brvshift}) |
| 2332 |
+ (\tl_use:N \l_@@_internal_itcorrection_tl,0) |
| 2333 |
+ (#1)$) |
| 2334 |
arc [start~angle=0, end~angle=180, radius=-0.15]; |
| 2335 |
\end{pgfinterruptboundingbox} |
| 2336 |
\end{tikzpicture} |
| 2337 |
} |
| 2338 |
% \end{macrocode} |
| 2339 |
% \end{macro} |
| 2340 |
% \begin{macro}[updated=2015/09/02]{\acct} |
| 2341 |
% \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{acct}.} |
| 2342 |
% This macro prints the dot accent below its argument. |
| 2343 |
% \begin{macrocode} |
| 2344 |
\NewDocumentCommand { \acct } { D(){0,0} m } |
| 2345 |
{ |
| 2346 |
\begin{tikzpicture}[ |
| 2347 |
baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base), |
| 2348 |
every~metrix~accent |
| 2349 |
] |
| 2350 |
\node [every~metrix~syllable~node] |
| 2351 |
(l_@@_syllable_node_\int_use:N \l_@@_process_int) |
| 2352 |
{ #2 }; |
| 2353 |
\begin{pgfinterruptboundingbox} |
| 2354 |
\fill ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.south) |
| 2355 |
+ (0,\usemetrixvar{dotshift}) |
| 2356 |
+ (#1)$) |
| 2357 |
circle [radius=1.25\pgflinewidth]; |
| 2358 |
\end{pgfinterruptboundingbox} |
| 2359 |
\end{tikzpicture} |
| 2360 |
} |
| 2361 |
% \end{macrocode} |
| 2362 |
% \end{macro} |
| 2363 |
% \begin{macro}[updated=2015/09/02]{\bow} |
| 2364 |
% \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{bow}.} |
| 2365 |
% This macro prints the bow below it's argument. |
| 2366 |
% \begin{macrocode} |
| 2367 |
\NewDocumentCommand { \bow } { O{0pt} m O{0pt} } |
| 2368 |
{ |
| 2369 |
\begin{tikzpicture}[ |
| 2370 |
baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base), |
| 2371 |
every~metrix~bow |
| 2372 |
] |
| 2373 |
\node [every~metrix~syllable~node] |
| 2374 |
(l_@@_syllable_node_\int_use:N \l_@@_process_int) |
| 2375 |
{ #2 }; |
| 2376 |
\draw [shorten~< = #1, shorten~> = #3] |
| 2377 |
($(l_@@_syllable_node_\int_use:N \l_@@_process_int.base~west)+ |
| 2378 |
(\usemetrixvar{bowshortening},\usemetrixvar{bowshift})$) |
| 2379 |
to [out=-45, in=225,looseness=\usemetrixvar{bowlooseness}] |
| 2380 |
($(l_@@_syllable_node_\int_use:N \l_@@_process_int.base~east)+ |
| 2381 |
(-\usemetrixvar{bowshortening},\usemetrixvar{bowshift})$); |
| 2382 |
\end{tikzpicture} |
| 2383 |
} |
| 2384 |
% \end{macrocode} |
| 2385 |
% \end{macro} |
| 2386 |
% |
| 2387 |
% \subsection{\TikZ/ styles} |
| 2388 |
% The \metrix/ package uses several \TikZ/ sytles to draw the macros. |
| 2389 |
% \begin{macrocode} |
| 2390 |
\ExplSyntaxOff |
| 2391 |
\tikzset { |
| 2392 |
every metrix symbol/.style={ |
| 2393 |
line width=\usemetrixvar{symbollinewidth}, |
| 2394 |
color=\usemetrixvar{symbolcolor}, |
| 2395 |
x=\usemetrixvar{baseunit},y=\usemetrixvar{baseunit}, |
| 2396 |
}, |
| 2397 |
every metrix big symbol/.style={ |
| 2398 |
line width=\usemetrixvar{bigsymbollinewidth}, |
| 2399 |
color=\usemetrixvar{symbolcolor}, |
| 2400 |
x=\usemetrixvar{bigbaseunit},y=\usemetrixvar{bigbaseunit}, |
| 2401 |
}, |
| 2402 |
every metrix symbol node/.style={ |
| 2403 |
inner sep=0pt, anchor=center, |
| 2404 |
}, |
| 2405 |
every metrix ictus node/.style={ |
| 2406 |
overlay, |
| 2407 |
}, |
| 2408 |
every metrix break node/.style={ |
| 2409 |
inner sep=0pt, anchor=base, |
| 2410 |
}, |
| 2411 |
every metrix syllable node/.style={ |
| 2412 |
inner sep=0pt, anchor=base, |
| 2413 |
}, |
| 2414 |
every metrix bow/.style={ |
| 2415 |
line width=\usemetrixvar{bowlinewidth}, |
| 2416 |
color=\usemetrixvar{bowcolor}, |
| 2417 |
x=\usemetrixvar{baseunit},y=\usemetrixvar{baseunit}, |
| 2418 |
}, |
| 2419 |
every metrix accent/.style={ |
| 2420 |
line width=\usemetrixvar{accentlinewidth}, |
| 2421 |
color=\usemetrixvar{accentcolor}, |
| 2422 |
x=\usemetrixvar{baseunit},y=\usemetrixvar{baseunit}, |
| 2423 |
}, |
| 2424 |
bold highlight/.style={ |
| 2425 |
every metrix symbol/.append style={line width=2\pgflinewidth}, |
| 2426 |
every metrix syllable node/.append style={font=\bfseries}, |
| 2427 |
every superscript node/.append style={font/.expand once=\tikz@textfont\bfseries}, |
| 2428 |
}, |
| 2429 |
colored highlight/.style={ |
| 2430 |
every metrix symbol/.append style={draw=#1}, |
| 2431 |
every metrix syllable node/.append style={text=#1}, |
| 2432 |
every superscript node/.append style={text=#1}, |
| 2433 |
}, |
| 2434 |
colored highlight/.default={ |
| 2435 |
\usemetrixvar{highlightcolor} |
| 2436 |
}, |
| 2437 |
dashed highlight/.style={ |
| 2438 |
every metrix symbol/.append style={dash pattern=on 1pt off 0.4pt}, |
| 2439 |
}, |
| 2440 |
filled highlight/.style={ |
| 2441 |
every metrix symbol node/.append style={inner sep=2pt,fill=#1}, |
| 2442 |
}, |
| 2443 |
filled highlight/.default={ |
| 2444 |
\usemetrixvar{fillcolor}, |
| 2445 |
}, |
| 2446 |
every superscript picture/.style={ |
| 2447 |
baseline=-3ex, |
| 2448 |
}, |
| 2449 |
every superscript node/.style={ |
| 2450 |
inner sep=0pt, |
| 2451 |
font=\scriptsize, |
| 2452 |
}, |
| 2453 |
every superscript label/.style={ |
| 2454 |
inner xsep=0pt, |
| 2455 |
inner ysep=-3ex, |
| 2456 |
label distance=0.5pt, |
| 2457 |
}, |
| 2458 |
add superscript/.style={ |
| 2459 |
label={[every superscript label]right:{% |
| 2460 |
\tikz[every superscript picture]\node at (0,0) [every superscript node] {#1};% |
| 2461 |
}}, |
| 2462 |
}, |
| 2463 |
superscript/.style={ |
| 2464 |
every metrix symbol node/.append style={ |
| 2465 |
add superscript=#1, |
| 2466 |
}, |
| 2467 |
every metrix break node/.append style={ |
| 2468 |
add superscript=#1, |
| 2469 |
}, |
| 2470 |
}, |
| 2471 |
superscript/.value required, |
| 2472 |
add arrow/.style={ |
| 2473 |
every metrix symbol node/.append style={ |
| 2474 |
label=90:\usemetrixvar{arrow}, |
| 2475 |
}, |
| 2476 |
}, |
| 2477 |
add text/.style={ |
| 2478 |
every metrix symbol node/.append style={ |
| 2479 |
label={[every metrix added text]#1}, |
| 2480 |
}, |
| 2481 |
}, |
| 2482 |
every metrix added text/.style = { |
| 2483 |
font = \scriptsize\itshape, |
| 2484 |
}, |
| 2485 |
add text/.value required, |
| 2486 |
} |
| 2487 |
\ExplSyntaxOn |
| 2488 |
% \end{macrocode} |
| 2489 |
% |
| 2490 |
% \subsection{Environments} |
| 2491 |
% \begin{macro}{symbolline} |
| 2492 |
% Environment to display stand alone symbols. |
| 2493 |
% \begin{macrocode} |
| 2494 |
\NewDocumentEnvironment{symbolline} { } |
| 2495 |
{ |
| 2496 |
\par\addvspace{\baselineskip} |
| 2497 |
\centering |
| 2498 |
} |
| 2499 |
{ |
| 2500 |
\par\vspace{\baselineskip} |
| 2501 |
\noindent\ignorespacesafterend |
| 2502 |
} |
| 2503 |
% \end{macrocode} |
| 2504 |
% \end{macro} |
| 2505 |
% \begin{macro}[internal]{\@@_print_vers_ref:n} |
| 2506 |
% The internal macro to print the verse reference inside of +{metricvers}+ |
| 2507 |
% \begin{macrocode} |
| 2508 |
\cs_new:Npn \@@_print_vers_ref:n #1 |
| 2509 |
{ |
| 2510 |
\hspace*{\fill}\nolinebreak[1] \quad \hspace*{\fill} \mbox{\footnotesize #1} |
| 2511 |
} |
| 2512 |
% \end{macrocode} |
| 2513 |
% \end{macro} |
| 2514 |
% \begin{macro}{metricverses,\verseref} |
| 2515 |
% Environment to display a verse with metric symbols and a source. And a macro to print |
| 2516 |
% a right aligned reference. |
| 2517 |
% \begin{macrocode} |
| 2518 |
\NewDocumentCommand { \verseref } { m } |
| 2519 |
{ |
| 2520 |
\@@_error_msg:n { |
| 2521 |
\string\verseref\space can~only~be~used~in~{metricverses}~env. |
| 2522 |
} |
| 2523 |
} |
| 2524 |
\NewDocumentEnvironment { metricverses } { } |
| 2525 |
{ |
| 2526 |
\RenewDocumentCommand { \verseref } { m } |
| 2527 |
{ |
| 2528 |
\@@_print_vers_ref:n { ##1 } |
| 2529 |
} |
| 2530 |
\par |
| 2531 |
\addvspace { 0.7\baselineskip } |
| 2532 |
\fp_compare:nT { \usemetrixvar { symbolshift } < 0.0 } |
| 2533 |
{ |
| 2534 |
\vspace { \usemetrixvar { symbolshift } } |
| 2535 |
} |
| 2536 |
\addtolength { \baselineskip } { 0.6\baselineskip } |
| 2537 |
} |
| 2538 |
{ |
| 2539 |
\par |
| 2540 |
\addtolength { \baselineskip } { -0.6\baselineskip } |
| 2541 |
\vspace { \baselineskip } |
| 2542 |
\noindent \ignorespacesafterend |
| 2543 |
} |
| 2544 |
% \end{macrocode} |
| 2545 |
% \end{macro} |
| 2546 |
% |
| 2547 |
% \begin{macrocode} |
| 2548 |
%</package> |
| 2549 |
% \end{macrocode} |
| 2550 |
% |
| 2551 |
% \end{implementation} |
| 2552 |
% |
| 2553 |
% \PrintChanges^^A use makeindex -s gglo.ist -o metrix-doc.gls metrix-doc.glo |
| 2554 |
% ^^A use updated=YYYY-MM-DD or new=YYY-MM-DD in {documentation} section |
| 2555 |
% \changes{v1.0}{2013/08/12}{Initial version} |
| 2556 |
% \changes{v1.2a}{2016/01/21}{Replaced deprecated \cs{prop_get} variants (Thanks to J. Wright).} |
| 2557 |
% \changes{v1.3}{2016/03/21}{New highlight styles: \texttt{add text} and \texttt{add arrow}.} |
| 2558 |
% \changes{v1.4}{2019/05/04}{Added docs for \texttt{l} and \texttt{ll} symbol.} |
| 2559 |
% \changes{v1.4}{2019/05/05}{Added possibility to add accents/icutus above symbols.} |
| 2560 |
% \changes{v1.4a}{2019/05/13}{Now loads \pkg{textcomp}.} |
| 2561 |
% \changes{v1.4a}{2019/05/13}{Fix: Icuts/accents didn't work with unicode.} |
| 2562 |
% \changes{v1.4a}{2019/05/13}{New style: \texttt{every metrix ictus node}} |
| 2563 |
% |
| 2564 |
% \PrintIndex^^A use: makeindex -s l3doc.ist -o metrix-doc.ind metrix-doc.idx |