% \iffalse meta-comment
%
%% File: metrix.dtx Copyright (c) Tobias Weh
%%
%% This file may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
\RequirePackage{expl3}[2016/01/03]
%<package>\@ifpackagelater{expl3}{2016/01/03}
%<package>  {}
%<package>  {%
%<package>    \PackageError{metrix}{Support package l3kernel too old}
%<package>      {%
%<package>        Please install an up to date version of l3kernel\MessageBreak
%<package>        using your TeX package manager or from CTAN.\MessageBreak
%<package>        \MessageBreak
%<package>        Loading xparse will abort!%
%<package>      }%
%<package>    \endinput
%<package>  }
\def\metrixFileName{metrix}
\def\metrixFileDescription{Typeset prosody/metric symbols.}
\def\metrixFileDate{2019/10/09}
\def\metrixFileVersion{1.5}
%</driver|package>
%<*driver>
\documentclass[full,english]{l3doc}

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{etoolbox}

\usepackage{babel}

\usepackage{xparse}
\usepackage{xcolor}
 \definecolor{twred}{HTML}{91031F}

\hypersetup{
	allcolors=twred,
}

\usepackage{metrix}

\usepackage{longtable,tabu,booktabs}
\renewcommand{\arraystretch}{1.3}
\usepackage[bottom]{footmisc}

\usepackage{mdframed}
	\newmdenv[
		backgroundcolor=black!15,
		linecolor=twred,
		linewidth=1.25pt,
		topline=false,
		rightline=false,
		bottomline=false,
		frametitlefont=\sffamily\bfseries,
		frametitle=Example,
	]{example}

\usepackage{microtype}
\usepackage{tgpagella}
\usepackage[scale=0.875]{tgheros}
\usepackage{ascii}

\usepackage{upquote}
   % add \@noligs to the redefinitions made by doc.sty to make upquote work
   \makeatother
   \patchcmd{\verb}{\ttfamily}{\ttfamily\@noligs}{}{}
   \patchcmd{\verbatim}{\frenchspacing}{\frenchspacing\@noligs}{}{}
   \patchcmd{\macrocode}{\frenchspacing}{\frenchspacing\@noligs}{}{}
   \makeatother

\edef\pluschar{+}

\AtBeginDocument{
	\DeleteShortVerb{\|}
	\DeleteShortVerb{\"}
	\MakeShortVerb{\+}
}

\makeatletter
\def\meta@font@select{\itshape\rmfamily}
\makeatother

\IndexPrologue{
	\section*{Index}
	\addcontentsline{toc}{section}{Index}
	The italic numbers denote the pages where the 
	corresponding entry is described, 
	numbers underlined point to the definition, 
	all others indicate the places where it is used.
}
\GlossaryPrologue{
	\section{Change History}
	{\GlossaryParms\ttfamily\hyphenchar\font=`\-}
}
\AtBeginDocument{\renewcommand*{\glossaryname}{Change History}}

\def\metrix/{\textcolor{twred}{\textbf{\textsf{m\u{e}trix}}}}
\def\TikZ/{Ti\emph{k}Z}
\newrobustcmd{\Star}{\meta{\textup{\texttt{*}}}}
\newrobustcmd{\mail}[1]{\href{mailto:#1}{#1}}


\begin{document}
  \DocInput{\metrixFileName.dtx}
\end{document}
%</driver>
% \fi
%
%
% \title{The \metrix/ package}
%
% \author{Tobias Weh\thanks{URL: \url{http://tobiw.de/en}, Mail: \mail{mail@tobiw.de}}}
% \changes{v1.1a}{2015/07/23}{New contact info (mail and URL).}
%
% \date{Version \metrixFileVersion\ -- Released \metrixFileDate}
%
% \maketitle
%
% \begin{documentation}\MakePrivateLetters
%
% \begin{abstract}
% \mbox{}\par
% \begin{center}
% \Large
% \metrics{_  _    _    _  _   | _    u  u  _   u   u _  }
%         {\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}
% \end{center}
% \par\bigskip
% The \metrix/ package can be used to print the prosodics/metrics of (latin) verses.
% It provides macros to typeset the symbols stand alone and in combination with syllables
% (including automatic alignment like seen above). Furthermore it defines a new br\brv{e}vis
% and a l\lng{o}nga accent^^A
%     \footnote{I know that these signs are no accents in the liguistic sense, but
%     they are in the \TeX\ tradition \dots}
% and \bow{a b}ow to contract syllables.
%
% \medskip
% \emph{Thanks to David Carlisle, Marco Daniel, Enrico Gregorio, Bruno Le Floch and
%  Joseph Wright who helped me with starting in \LaTeX3 programming. The verse above
%  is by Ovid in his Tristia~4,10,26.}
% \end{abstract}
%
% \section{Prerequisites}
% \metrix/ relies only on a few packages: \pkg{tikz} (including the +calc+ library), \pkg{xpatch}
% and \pkg{xparse}, which stand for the whole \LaTeX3 bundle.
%
% \section{Package loading}
% Load \metrix/ as usual with +\usepackage{metrix}+. At the moment it has no options.
%
% \changes{v1.0a}{2013/08/14}{Added \texttt{cwl} file for TeXstudio}
% A CWL file +metrix.cwl+ for autocompletition in TeXstudio is available in the
% GitHub repo. To install the CWL file copy it to +~/.config/texstudio/+
% on Linux and OS X and to +C:\Documents and Settings/User/AppData/Roaming/texstudio/+.
% See section 1.5 of the TeXstudio manual for more information.
%
%
% \section{Bugs and feedback}
% \subsection{Known issues}
% \begin{itemize}
%    \item At the moment the escaping of hyphen chars is not that good (see section~\ref{faq:hyphen}).
%    \item Unfortunatly you can't use the active quotes of \pkg{csquotes} inside of
%       \cs{metrics} syllable list (see section~\ref{faq:quotes}).
% \end{itemize}
% I'm sure there are more bugs and issues let me know if you find them \dots
% \subsection{Feedback}
% Any feedback on \metrix/ is appreciated. You may use its GitHub repository at
% \url{https://github.com/tweh/metrix} to request features and report bugs or
% send me an e-mail (\mail{mail@tobiw.de}).
%
% Please note that I don't speak latin myself and forthat the examples in this manual
% may be wrong---as long as they show how to use the package I don't consider such
% errors as bugs +;-)+.
%
% \section{Metric symbols}
% \subsection{Syntax for symbols}\label{sec:syntax}
% \changes{v1.1}{2014/07/02}{New section about the symbol syntax (see \ref{sec:syntax})}
% Before I'll show you the central macros for typesetting the symbols, you need
% to ``learn'' the syntax for the symbols. All symbols are represented by a single
% or a combination of characters. The list with all available abbreviations can
% be found in table~\ref{tab:symbols}. Please keep in mind that \metrix/ uses spaces to
% separate the abbreviations an something like +_'x+ will cause an error, the
% correct input is \verb*|_ ' x| (where \verb*| | indicates a space/blank).
% \subsubsection*{Accents above symbols (ictus)}
% If you want to add an additional accent above a symbol you may precede the symbol with
% an slash +/+ for an acute or a star +*+ for a grave accent. At the moment this only works
% with breve (+/u+ or +*u+) and longum (+/_+ or +*_+).
% \begin{example}
% An ictus (although out of date).
%   \begin{verbatim}
% \metricsymbols{/_ u u /_ _ /_}
%   \end{verbatim}
%   \metricsymbols{/_ u u /_ _ /_}
% \end{example}
%\pagebreak
% \begin{longtabu}to \textwidth {l>{\itshape}lcXl}
%    \caption{Symbol abbreviations\label{tab:symbols}}\\
%    \toprule
%    \rowfont{\bfseries\sffamily} \multicolumn{2}{l}{abbreviation} & symbol & name/explantion & accent/ictus? \\
%    \midrule
% \endfirsthead
%    \caption{Symbol abbreviations (cont.)}\\
%    \toprule
%    \rowfont{\bfseries\sffamily} \multicolumn{2}{l}{abbreviation} & symbol & name/explantion & accent/ictus? \\
%    \midrule
% \endhead
%    \multicolumn{5}{r}{\dots}
% \endfoot
%    \bottomrule
% \endlastfoot
%    +e+ && \metricsymbols{e} & empty (=\,invisible) symbol & \\
%    +u+ && \metricsymbols{u} & elementum breve & yes  \\
%    +_+ & underscore & \metricsymbols{_} & elementum longum & yes \\
%    +uu+ && \metricsymbols{uu} & double breve & \\
%    +uu_+ && \metricsymbols{uu_} & elementum biceps & \\
%    +_uu+ && \metricsymbols{_uu} & elementum biceps & \\
%    +u_uu+ && \metricsymbols{u_uu} & elementum anceps & \\
%    +x+ && \metricsymbols{x} & elementum anceps & \\
%    +n+ && \metricsymbols{n} & elementum indifferens & \\
%    +u_+ && \metricsymbols{u_} & elementum indifferens & \\
%    +_u+ && \metricsymbols{_u} & elementum indifferens & \\
%    +A+ && \metricsymbols{A} & * & \\
%    +v+ && \metricsymbols{v} & * & \\
%    +o+ && \metricsymbols{o} & * & \\
%    +oo+ && \metricsymbols{oo} & aeolic base & \\
%    +l+ && \metricsymbols{l} & caesura or break & \\
%    +ll+ && \metricsymbols{ll} & caesura or end of period & \\
%    +p+ && \metricsymbols{p} & primary stress & \\
%    +s+ && \metricsymbols{s} & secondary stress & \\
%    +|+ & pipe & \metricsymbols{|} & break (see \ref{sec:breaks}) & \\
%    +||+ & two pipes & \metricsymbols{||} & verse break (see \ref{sec:breaks}) & \\
%    +'+ & apostrophe (shift\,\pluschar\,\#) & \metricsymbols{'} &
%       shorter break (see \ref{sec:breaks}) & \\
%    +,+ & comma & \metricsymbols{,} & shorter break (see \ref{sec:breaks}) & \\
% \end{longtabu}
% \par
% {\vspace{-0.5\baselineskip}\itshape\footnotesize\noindent
% * I added these symbols as someone might needs them. If you use them please let me
% know what to add as name/explanation.\par}
% \subsection{Stand alone metric symbols}
% \begin{function}[EXP]{\metricsymbols}
%   \begin{syntax}
%     \cs{metricsymbols}\Star\oarg{highlighting}\Arg{symbols}
%   \end{syntax}
%   This macro typesets stand alone versions of the symbols, i.e. without
%   syllables below (or above) of them. Use the starred version for smaller (in line) symbols
%   and the normal version for bigger symbols. \meta{symbols} must be a list of
%   abbreviations as explained in section~\ref{sec:syntax}; the abbreviations must be
%   separated by one (or more) spaces.
% \end{function}
% \begin{example}
% The \emph{diphilius} can be shown with this code.
%   \begin{verbatim}
% \metricsymbols{_ _uu _ _uu u_ | x _ u u _ x u_}
%   \end{verbatim}
%   \metricsymbols{_ _uu _ _uu u_ | x _ u u _ x u_}
% \end{example}
% \subsection{Metric symbols above (or below) syllables}
% \begin{function}[EXP]{\metrics}
%   \begin{syntax}
%      \cs{metrics}\oarg{highlighting}\Arg{symbols}\Arg{syllables}
%   \end{syntax}
%   This command can be used to align the symbols above (or below)
%   syllables. The first argument works as in \cs{metricsymbols},
%   the second argument \meta{syllables} takes the hyphenated verse.
% \end{function}
% \begin{example}
%   \begin{verbatim}
% \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%         {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
%   \end{verbatim}
%   \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%           {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
% \end{example}
%
%   \medskip\noindent
%   You may use multiple spaces to align the abbreviations above the syllables but this is not mandatory and
%   does not affect the output. But mind that the number of syllables equals the number of symbols. If you
%   use the \metricsymbols*{oo} symbol you may omit the hyphen between the two syllables beloning to this
%   symbol. You can merge multiple words by \emph{embracing} them.
% \begin{example}
%   \begin{verbatim}
% \metrics{_   u  u    _       _   _  _   _  }
%         {mol-ta quo-{que et} bel-lo pas-sus}
%   \end{verbatim}
%   \metrics{_   u  u    _       _   _  _   _  }
%           {mol-ta quo-{que et} bel-lo pas-sus}
% \end{example}
%
%   The macros \cs{metrics} and \cs{metricsymbols} can also be used to typeset
%   single symbols or symbol syllable combinations.
% \begin{example}
%   \begin{verbatim}
% The \metricsymbols*{_uu} shows an \emph{elementum biceps}.
%   \end{verbatim}
%   The \metricsymbols*{_uu} shows an \emph{elementum biceps}.
% \end{example}
% 
% \subsection{Adding symbols for breaks}\label{sec:breaks}
% \changes{v1.1}{2014/07/02}{New section about breaks (see \ref{sec:breaks})}
% As seen in the examples above you can use pipes, i.e. +|+ or +||+, to mark breaks.
% In \cs{metrics} the markers must appear in \meta{symbols} and \meta{syllables}.
% \begin{example}
%   \begin{verbatim}
% \metrics{_    u  u  _   _  _  | _    _  u  u   _  ||}
%         {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}
%   \end{verbatim}
% \metrics{_    u  u  _   _  _  | _    _  u  u   _  ||}
%         {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}
% \end{example}
% If you want the breaks to be shown in the symbol line only you can use the
% shorter break which is represented by an apostrophe (shift\,\pluschar\,\#)
% or a comma. This mark must be used in \meta{symbols} only and is kind of special:
% \begin{itemize}
%    \item It \emph{can't} be highlighted and thus doesn't count for the numbers used
%       for highlights,
%    \item it is ignored at the beginning and the end of \meta{symbols},
%    \item in \cs{metricsymbols} it is treated like the pipe, and
%    \item \TeX\ needs at least one additional run to get the right positions.
% \end{itemize}
% \begin{example}
%   \begin{verbatim}
% \metrics{_  u  u ' _  u   u ' _  _ ' _  _   |  _  u   u  |  _ _   ||}
%         {Ar-ma vi-rum-que ca-no Tro-iae qui | pri-mus ab |  o-ris ||}
%   \end{verbatim}
% \metrics{_  u  u ' _  u   u ' _  _ ' _  _   |  _  u   u  |  _ _   ||}
%         {Ar-ma vi-rum-que ca-no Tro-iae qui | pri-mus ab |  o-ris ||}
% \end{example}
% The difference between +'+ and +,+ is that the break defined with an apostrophe
% is vertically centred between the surrounding symbols while the break set with
% the comma is vertically centred between the corresponding syllables. They both
% align horizontally within the row of symbols.
% \begin{example}
%   \begin{verbatim}
% \emph{apostrophe:}
% \metrics{_  _  '   _          }
%         {au-ra-{r\bow{um e}st}} \qquad
% \emph{comma:}
% \metrics{_  _  ,   _          }
%         {au-ra-{r\bow{um e}st}}
%   \end{verbatim}
% \emph{apostrophe:}
% \metrics{_  _  '   _          }
%         {au-ra-{r\bow{um e}st}} \qquad
% \emph{comma:}
% \metrics{_  _  ,   _          }
%         {au-ra-{r\bow{um e}st}}
% \end{example}
% 
% \subsection{Highlight certain symbols/syllabels}
% As you can see above \cs{metrics} and \cs{metricsymbols} got an optional argument taking
% some options to highlight a certain symbol/syllable. The \meta{highlighting} list must
% contain one or more comma separated pairs of \meta{numbers}+=+\meta{style}, where \meta{numbers}
% is the number of a symbol/syllable (e.g. +3+) or a list of numbers separated by plus signs
% (e.g. \verb.2+3+5.) in the list and \meta{style} is any \TikZ/ style (other \TikZ/ options may not 
% work properly, so you maybe must create your own style, see section~\ref{faq:highlight}.)
%
% \medskip\noindent
% \metrix/ comes with several predefined highlighting styles:
% \DeleteShortVerb{\+}
% \begin{itemize}
%    \item \textbf{\texttt{add arrow}}\\[2ex]
%       \metrics[3+8={add arrow}]{_    u  u  _   _  _  | _    _  u  u   _  ||}
%       {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill
%       \metricsymbols[2={add arrow}]{u u_uu x _ | u _ n ||}
%
%       This style adds an arrow above the metric symbol. To change the arrow symbol, edit
%       the \metrix/ variable \verb+arrow+.
%
%    \item \textbf{\texttt{add text}=}\meta{text}\\[2ex]
%       \metrics[3+8={add text=shout!}]{_    u  u  _   _  _  | _    _  u  u   _  ||}
%       {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill
%       \metricsymbols[2={add text=whisper}]{u u_uu x _ | u _ n ||}
%
%       This style takes a \emph{mandatory} argument to add some text above a symbol.
%       To change the default font change the font of the \TikZ/ node style
%       \verb|every metrix added text|.
%
%    \item \textbf{\texttt{bold highlight}}\\[2ex]
%       \metrics[2+5+9+13={bold highlight}]{_    u  u  _   _  _  | _    _  u  u   _  ||}
%        {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill
%       \metricsymbols[2+3+5+7={bold highlight}]{u u_uu x _ | u _ n ||}
%
%    \item \textbf{\texttt{colored highlight=}\meta{color}}\\[2ex]
%       \metrics[2+5+9+13={colored highlight}]{_    u  u  _   _  _  | _    _  u  u   _  ||}
%        {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill
%       \metricsymbols[2+3+5+7={colored highlight}]{u u_uu x _ | u _ n ||}
%       
%       This style has an \emph{optional} argument to change the highlighting color on the fly.
%       To change the color in general change the value of the variable \verb.highlightcolor..
%
%    \item \textbf{\texttt{dashed highlight}}\\[2ex]
%       \metrics[2+5+9+13={dashed highlight}]{_    u  u  _   _  _  | _    _  u  u   _  ||}
%        {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill
%       \metricsymbols[2+3+5+7={dashed highlight}]{u u_uu x _ | u _ n ||}
%
%    \item \textbf{\texttt{filled highlight=}\meta{color}}\\[2ex]
%       \metrics[2+5+9+13={filled highlight}]{_    u  u  _   _  _  | _    _  u  u   _  ||}
%        {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill
%       \metricsymbols[2+3+5+7={filled highlight}]{u u_uu x _ | u _ n ||}
%
%       This style has an \emph{optional} argument to change the filling color on the fly.
%       To change the color in general change the value of the variable \verb.fillcolor..
%
%    \item \textbf{\texttt{superscript=}\meta{text}}\\[2ex]
%       \metrics[7={superscript=a},13={superscript=b}]{_    u  u  _   _  _  | _    _  u  u   _  ||}
%       {flos ve-te-ris vi-ni | meis na-ri-bus ob ||}\hfill
%       \metricsymbols[5={superscript=a},9={superscript=b}]{u u_uu x _ | u _ n ||}
%
%       This style takes a \emph{mandatory} argument to add a superscript letter or a
%       number to a symbol. It is designed to work with the break symbols, but works with others too.
% \end{itemize}
% \MakeShortVerb{\+}
%
% \medskip\noindent
% \textbf{Sytles with an agrument must be set in braces} (see the examples)\textbf{!}
% \begin{example}
% Higlight some syllables with color.
% \begin{verbatim}
% \metrics
%    [
%       2=colored highlight,
%       4={colored highlight=orange},
%       5={colored highlight=blue},
%       7=colored highlight,
%       11=colored highlight
%   ]
%   {_    u  u  _   _  _  | _    _  u  u   _ }
%   {flos ve-te-ris vi-ni | meis na-ri-bus ob}
% \end{verbatim}
% \metrics
%    [
%       2=colored highlight,
%       4={colored highlight=orange},
%       5={colored highlight=blue},
%       7=colored highlight,
%       11=colored highlight
%   ]
%   {_    u  u  _   _  _  | _    _  u  u   _ }
%   {flos ve-te-ris vi-ni | meis na-ri-bus ob}
% \end{example}
% \begin{example}
% The shorter version using the \verb.+. syntax.
% \begin{verbatim}
% \metrics[2+5+9=bold highlight]
%   {_    u  u  _   _  _  | _    _  u  u   _ }
%   {flos ve-te-ris vi-ni | meis na-ri-bus ob}
% \end{verbatim}
% \DeleteShortVerb{\+}
% \metrics[2+5+9=bold highlight]
%   {_    u  u  _   _  _  | _    _  u  u   _ }
%   {flos ve-te-ris vi-ni | meis na-ri-bus ob}
% \end{example}
% \begin{example}
% Mixing and combining styles is possible too.
% \begin{verbatim}
% \metricsymbols[1+4=bold highlight, 3=colored highlight]
%   {u_uu x _ || u _ n ||} \\
% \metricsymbols[2={bold highlight,colored highlight}]
%   {u_uu x _ || u _ n ||}
% \end{verbatim}
% \DeleteShortVerb{\+}
% \metricsymbols[1+4=bold highlight, 3=colored highlight]
%   {u_uu x _ || u _ n ||}\\
% \metricsymbols[2={bold highlight,colored highlight}]
%   {u_uu x _ || u _ n ||}
% \MakeShortVerb{\+}
% \end{example}
% \begin{example}
% Add some superscripts to the breaks.
% \begin{verbatim}
% \metricsymbols[6={superscript=5},10={colored highlight,superscript=bD}]
%    {_ _uu _ _uu _ | _uu _ _uu || _ uu _ u_}
% \end{verbatim}
% \metricsymbols[6={superscript=5},10={colored highlight,superscript=bD}]
%    {_ _uu _ _uu _ | _uu _ _uu || _ uu _ u_}
% \end{example}
%
% \section{Accents and bows}
% \begin{function}[EXP]{\brv,\lng,\acct}
%    \begin{syntax}
%       \cs{brv}\Arg{vowel}\qquad\cs{lng}\Arg{vowel}\qquad\cs{acct}\Arg{vowel}
%    \end{syntax}
%    The first commands offer an alternative to the standard accent macros +\u+ and +\=+. The difference
%    is that \cs{brv} centers the accent above the vowel or diphthong and \cs{lng} stretches the bar across
%    the whole vowel or diphthong. \cs{acct} adds an accent dot below a vowel or dipthtong.\footnotemark
% \end{function}
% \footnotetext{Actually you can use any vowel, diphtong, syllable or word as \meta{vowel},
% it makes no difference as long as it is text.}
% \begin{example}
% Add accents to all vowels.
% \begin{verbatim}
% \brv{a}m\acct{\lng{i}}c\brv{u}s pr\acct{\brv{o}}f\brv{u}g\brv{u}s
% \end{verbatim}
% \brv{a}m\acct{\lng{i}}c\brv{u}s pr\acct{\brv{o}}f\brv{u}g\brv{u}s
% \end{example}
%
% \metrix/ also tries to do some kind of italic correction, and shifts the accents a little to the
% right when an italic or slanted font is used.
% \par\large\medskip
% \brv{u}\enskip\textit{\brv{u}}\enskip\textsl{\brv{u}}\qquad
% \brv{i}\enskip\textit{\brv{i}}\enskip\textsl{\brv{i}}\qquad
% \brv{ae}\enskip\textit{\brv{ae}}\enskip\textsl{\brv{ae}}\hfill
% {\sffamily
% \brv{u}\enskip\textit{\brv{u}}\enskip\textsl{\brv{u}}\qquad
% \brv{i}\enskip\textit{\brv{i}}\enskip\textsl{\brv{i}}\qquad
% \brv{ae}\enskip\textit{\brv{ae}}\enskip\textsl{\brv{ae}}\hfill\mbox{}}
% \par\medskip
% \lng{u}\enskip\textit{\lng{u}}\enskip\textsl{\lng{u}}\qquad
% \lng{i}\enskip\textit{\lng{i}}\enskip\textsl{\lng{i}}\qquad
% \lng{ae}\enskip\textit{\lng{ae}}\enskip\textsl{\lng{ae}}\hfill
% {\sffamily
% \lng{u}\enskip\textit{\lng{u}}\enskip\textsl{\lng{u}}\qquad
% \lng{i}\enskip\textit{\lng{i}}\enskip\textsl{\lng{i}}\qquad
% \lng{ae}\enskip\textit{\lng{ae}}\enskip\textsl{\lng{ae}}\hfill\mbox{}}
% \par\medskip
% \acct{u}\enskip\textit{\acct{u}}\enskip\textsl{\acct{u}}\qquad
% \acct{i}\enskip\textit{\acct{i}}\enskip\textsl{\acct{i}}\qquad
% \acct{ae}\enskip\textit{\acct{ae}}\enskip\textsl{\acct{ae}}\hfill
% {\sffamily
% \acct{u}\enskip\textit{\acct{u}}\enskip\textsl{\acct{u}}\qquad
% \acct{i}\enskip\textit{\acct{i}}\enskip\textsl{\acct{i}}\qquad
% \acct{ae}\enskip\textit{\acct{ae}}\enskip\textsl{\acct{ae}}\hfill\mbox{}}
% \par\normalsize
%
% \subsubsection*{Fine Tuning}
% To make some fine tuning for a certain accent possible the three macros actually got
% some additional, \emph{optional} arguments:
% {\par\medskip\noindent\ttfamily
% \cs{brv}+(+\meta{coordinate}+)+\Arg{vowel}\\
% \cs{lng}+(+\meta{coordinate}+)+\oarg{left length}\Arg{vowel}\oarg{right length}\\
% \cs{acct}+(+\meta{coordinate}+)+\Arg{vowel}\par}
%
% \medskip
% Where \meta{coordinate} must be a valid \TikZ/ coordinate and can be used to move
% the accent. In addition to that the accent produced by \cs{lng} can be extended
% with \meta{left/right length} by a certain amount.
%
% \begin{example}
% Prevent collision between accent and descender of an \textit{f}.
% \begin{verbatim}
% \itshape somn\acct(-0.05em,-0.45ex){i}fero
% \end{verbatim}
% \itshape somn\acct(-0.05em,-0.45ex){i}fero
% \end{example}
%
% \begin{function}[EXP]{\bow}
%    \begin{syntax}
%       \cs{bow}\Arg{syllables}
%    \end{syntax}
%    \cs{bow} can be used to show the contraction of two vowels or syllables.
% \end{function}
% \begin{example}
%    \begin{verbatim}
% mult\bow{um i}lle or d\bow{ei}nde
%    \end{verbatim}
%    mult\bow{um i}lle or d\bow{ei}nde
% \end{example}
%
% \subsubsection*{Fine Tuning}
% To make some fine tuning for a certain bow possible the macro actually has
% some additional, \emph{optional} arguments:
% {\par\medskip\noindent\ttfamily
% \cs{bow}+(+\meta{coordinate}+)+\oarg{left length}\Arg{syllable}\oarg{right length}\par}
%
% \medskip
% Where \meta{left/right length} can  be used to shorten the bow by a certain amount.
%
% \begin{example}
% Prevent collision between accent and bow.
% \begin{verbatim}
% c\acct{oe}-l\bow{um \acct{e}}[2pt]st
% \end{verbatim}
% c\acct{oe}-l\bow{um \acct{e}}[2pt]st
% \end{example}
%
% \section{Environments}
% \begin{function}{symbolline}
% This environment can be used to display a line of stand alone symbols.
% \end{function}
% \begin{example}
% \begin{verbatim}
% Text text text ...
% \begin{symbolline}
%    \metricsymbols{oo e _ u u _ e u _ e u _ u_}
% \end{symbolline}
% Text text text ...
% \end{verbatim}
% Text text text ...
% \begin{symbolline}
%    \metricsymbols{oo e _ u u _ e u _ e u _ u_}
% \end{symbolline}
% Text text text ...
% \end{example}
% \begin{function}{metricverses}
% \begin{syntax}
%    +\begin{metricverses}+\oarg{source}
%       \meta{content optional \cs{verseref}\Arg{reference}}
%    +\end{metricverses}+
% \end{syntax}
% Use this environment to display a verse with metric symbols, separate
% multiple verses by a blank line.
% \end{function}
% \begin{example}
% \begin{verbatim}
% Text text text ...
% \begin{metricverses}
%    \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%            {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
%
%    \metrics{_  u  u _   u  u  _   |  _             _   u  u
%                                                        _   u  u  _   }
%            {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit
%                                                        per te-ne-bras}
% \end{metricverses}
% Text text text ...
% \end{verbatim}
% Text text text ...
% \begin{metricverses}
%    \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%            {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
%
%    \metrics{_  u  u _   u  u  _   |  _             _   u  u
%                                                   _   u  u  _   }
%            {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit
%                                                   per te-ne-bras}
% \end{metricverses}
% Text text text ...
% \end{example}
% \begin{function}{\verseref}
% \begin{syntax}
%    \cs{verseref}\Arg{reference}
% \end{syntax}
% Inside of +{metricverses}+ you may use \cs{verseref} to print a reference.
% \end{function}
% \begin{example}
% \begin{verbatim}
% Text text text ...
% \begin{metricverses}
%    \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%            {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
%    \verseref{Plaut. \emph{Curc.} 96f}
%
%    \metrics{_  u  u _   u  u  _   |  _             _   u  u
%                                                        _   u  u  _   }
%            {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit
%                                                        per te-ne-bras}
% \end{metricverses}
% Text text text ...
% \end{verbatim}
% Text text text ...
% \begin{metricverses}
%    \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%            {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
%    \verseref{Plaut. \emph{Curc.} 96f}
%
%    \metrics{_  u  u _   u  u  _   |  _             _   u  u   _   u  u  _   }
%            {ei-us a-mor cu-pi-dam | {m\bow{e h}uc} pro-li-cit per te-ne-bras}
% \end{metricverses}
% Text text text ...
% \end{example}
%
% \section{FAQs}\label{sec:faq}
% \subsection{How can I display the symbols below the syllables?}
% Change the variable +symbolshift+ to a negative value.
% \begin{example}
% \begin{verbatim}
% \setmetrixvar{symbolshift}{-0.6em}
% % later ...
% \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%         {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
% \end{verbatim}
% \setmetrixvar{symbolshift}{-0.6em}
% \metrics{_    u  u  _   _  _  | _    _  u  u   _  _   _   }
%         {flos ve-te-ris vi-ni | meis na-ri-bus ob-iec-tust}
% \end{example}
% \subsection{How can I combine two words below one symbol?}
% Use braces +{}+ in the lists to keep them processed as one element.
% \begin{example}
% \begin{verbatim}
% \metrics{u  u  _   |  _             _   u  u   }
%         {cu-pi-dam | {m\bow{e h}uc} pro-li-cit }
% \end{verbatim}
% \metrics{u  u  _   |  _             _   u  u   }
%         {cu-pi-dam | {m\bow{e h}uc} pro-li-cit }
% \end{example}
% \subsection{How can I show a hyphen character?}\label{faq:hyphen}
% To escape a hyphen +-+ put it inside braces, but you must still
% add an unbraced hypen to show \metrix/ where your syllables split.
% \begin{example}
% If you enclose the hyphen in braces together with a syllable, the symbol gets
% centered above both.
% \begin{verbatim}
% \metrics{_    _  }
%         {vi-{-ni}}
% \end{verbatim}
% \metrics{_    _  }
%         {vi-{-ni}}
% \par\smallskip\noindent
% You can enclose only the hyphen in braces and treat it as a syllable
% but then you must add an empty symbol +e+ too.
% \begin{verbatim}
% \metrics{_   e  _ }
%         {vi-{-}-ni}
% \end{verbatim}
% \metrics{_   e  _ }
%         {vi-{-}-ni}
% \end{example}
% \subsection{How can I use quotes in \cs{metrics}?}\label{faq:quotes}
% It should be possible to use all shorthands (or direct input with Unicode) etc.
% for quotation marks except the active
% quotes of \pkg{csquotes}, which won't work inside the \cs{metrics} syllable list. It
% is possible to use \pkg{csquotes} besides \metrix/ though.
% \begin{example}
% \begin{verbatim}
% \metrics{ _   u }{ ``si me'' }
% \metrics{ _   u }{ \glqq si me\grqq }% with \usepackage[<lang>]{babel}
% \metrics{ _   u }{ "`si me"' }% with \usepackage[ngerman]{babel}
% \end{verbatim}
% \metrics{ _   u }{ ``si me'' }\quad
% \metrics{ _   u }{ \glqq si me\grqq }\quad
% \metrics{ _   u }{ \glqq si me\grqq }
% \end{example}
% \subsection{How can I add a superscript letter to a certain symbol?}
% Use the +superscript+ highlighting style as described above.
% \subsection{How can I make subscripts instead of superscripts?}
% The easiest way is to use the +superscript+ style and change a part of
% its definition to shift the superscripts to subscript positions.
% \begin{example}
% \begin{verbatim}
% \metricsymbols[2={superscript=x}]{ u || u } \qquad vs. \qquad
% % ...
% \tikzset{
%    every superscript picture/.style={
%       baseline=1ex,
%    },
% }
% % ...
% \metricsymbols[2={superscript=x}]{ u || u }
% \end{verbatim}
% \metricsymbols[2={superscript=x}]{ u || u } \qquad vs. \qquad
% \tikzset{
%    every superscript picture/.style={
%       baseline=2ex,
%    },
% }
% \metricsymbols[2={superscript=x}]{ u || u }
% 
% \medskip\noindent
% Normally the +\tikzset+ should be part of your preamble, I used it this way to
% show the differences.
% \end{example}
% \subsection{How can I highlight all symbols/syllables?}
% \textbf{Way 1}\qquad Just call your desired highlighting style before using on of the macros 
% \cs{metrics} or \cs{metricsymbols}. You may enclose this in a group to not affect the other following
% sequences. Mind that the higlighting styles must be in a way changing the +every ...+ styles
% to make this way work.
% \begin{example}
% \begin{verbatim}
% {% begin group
%    \tikzset{colored highlight}
%    \metrics{_    u  u  _   _  _ }
%            {flos ve-te-ris vi-ni}
% }% end group
% \end{verbatim}
%    \tikzset{colored highlight}
%    \metrics{_    u  u  _   _  _ }
%            {flos ve-te-ris vi-ni}
% \end{example}
% \par\medskip\noindent
% \textbf{Way 2}\qquad Change the +every metrix ...+ styles.
% \begin{example}
% \begin{verbatim}
% {% begin group
%    \tikzset{every metrix symbol/.append style={red}}
%    \metrics{_    u  u  _   _  _ }
%            {flos ve-te-ris vi-ni}
% }% end group
% \end{verbatim}
%    \tikzset{every metrix symbol/.append style={red}}
%    \metrics{_    u  u  _   _  _ }
%            {flos ve-te-ris vi-ni}
% \end{example}
% Leave out the grouping (and put this to your preamble) if yout want to highlight
% the symbols in your whole document.
% \subsection{How can I change the size of a symbol?}
% Change the two base vector units.\pagebreak
% \begin{example}
% \begin{verbatim}
% \setmetrixvar{baseunit}{1em}
% \setmetrixvar{bigbaseunit}{1.6em}
% \end{verbatim}
% \end{example}
% If you want to change the size of a single symbol to highlight it you must
% create your own highlighting style.
% \begin{example}
% \begin{verbatim}
% \tikzset{
%  bigger highlight/.style={
%   every metrix symbol/.append style={x=2.5em,y=2.5em,line width=1.5pt},
%  },
% }
% % later
% \metricsymbols[2=bigger highlight]{u_uu x _ || u _ n x}
% \end{verbatim}
% \tikzset{
%  bigger highlight/.style={
%   every metrix symbol/.append style={x=2.5em,y=2.5em,line width=1.5pt},
%  },
% }
% \metricsymbols[2=bigger highlight]{u_uu x _ || u _ n x}
% \end{example}
% \subsection{How can I stop highlighting the syllables too?}\label{faq:highlight}
% \textbf{Way 1}\qquad Change the highlight styles (in your preamble).
% \begin{example}
% \begin{verbatim}
% \tikzset{
%    colored highlight/.style={
%       every metrix symbol/.append style={
%          draw=\usemetrixvar{highlightcolor},
%       },
%    },
% }
% % later ...
% \metrics[3=colored highlight]{_    u  u  _   _  _ }
%                              {flos ve-te-ris vi-ni}
% \end{verbatim}
% {\tikzset{
%    colored highlight/.style={
%       every metrix symbol/.append style={draw=\usemetrixvar{highlightcolor}},
%    }
% }
% \metrics[3=colored highlight]{_    u  u  _   _  _ }
%                              {flos ve-te-ris vi-ni}}
% \end{example}
% \par\medskip\noindent
% \textbf{Way 2}\qquad Create your own highlighting style, which is very similar
% to way 1, as the following example shows. Every own style should change the apperance
% by appending the settings to one of the +every ...+ styles.
% \begin{example}
% \begin{verbatim}
% \tikzset{
%    my highlight/.style={
%       every metrix symbol/.append style={draw=blue,line width=0.07em},
%    }
% }
% \metrics[5=my highlight]{_    u  u  _   _  _ }
%                         {flos ve-te-ris vi-ni}
% \end{verbatim}
% \tikzset{
%    my highlight/.style={
%       every metrix symbol/.append style={draw=blue,line width=0.1em},
%    }
% }
% \metrics[5=my highlight]{_    u  u  _   _  _ }
%                         {flos ve-te-ris vi-ni}
% \end{example}
% \subsection{Why got the highlight styles that long names?}
% To prevent conflict with other packages.
% \begin{example}
% If you want to shorten it create your own style as described above or use
% \begin{verbatim}
% \tikzset{
%  hl/.style={colored highlight}
% }
% \end{verbatim}
% to map the style to a shorter name. Then you can use it like in
% \begin{verbatim}
% \metricsymbols[2=hl]{u _ _ u}
% \end{verbatim}
% \end{example}
% \subsection{How can I change the font of all syllables?}
% Extend the +every metrix syllable node+ style
% \begin{example}
% Print all syllables in italic with the following extension.
% \begin{verbatim}
% \tikzset{
%    every metrix syllable node/.append sytle={font=\itshape},
% }
% \end{verbatim}
% \end{example}
%
% \section{Customization}
% Some hints were already given in the FAQ section (see section~\ref{sec:faq}) but here I will
% list all variables and \TikZ/ styles that are in use and can be changed to customize
% \metrix/ easily.
% \subsection{Variables}
% \begin{function}{\setmetrixvar,\usemetrixvar}
% To customize the rendering of the symbols, accents and bow \metrix/ has some variables
% that you can change.
% \begin{syntax}
%    \cs{setmetrixvar}\Arg{variable}\Arg{value}
% \end{syntax}
% Use \cs{setmetrixvar} to change a value. The variables and the default values are listed
% in table~\ref{tab:variables}. To access a value you can use \cs{usemetrixvar}\Arg{variable}.
% \end{function}
% It is highly recommended to use font size depending units, i.e. +em+ or +ex+, for all lengthen
% to keep the symbols usable in different font sizes, for example in headlines or footnotes.
% \begin{example}
% Change the highlighting color to blue.
% \begin{verbatim}
% \setmetrixvar{higlightcolor}{blue}
% % later
% \metrics[5=colored highlight]{_    u  u  _   _  _ }
%                              {flos ve-te-ris vi-ni}
% \end{verbatim}
% \setmetrixvar{highlightcolor}{blue}
% \metrics[5=colored highlight]{_    u  u  _   _  _ }
%                              {flos ve-te-ris vi-ni}
% \end{example}
% \begin{example}
% Create your own highlighting style but use the default highlighting color.
% \begin{verbatim}
% \tikzset{
%    my highlight/.style={
%       every metrix symbol/.append style={
%          draw=\usemetrixvar{highlightcolor},
%          line width=0.15em
%       },
%    },
% }
% \metrics[5=my highlight]{_    u  u  _   _  _ }
%                         {flos ve-te-ris vi-ni}
% \end{verbatim}
% \tikzset{
%    my highlight/.style={
%       every metrix symbol/.append style={
%          draw=\usemetrixvar{highlightcolor},
%          line width=0.15em
%       },
%    },
% }
% \metrics[5=my highlight]{_    u  u  _   _  _ }
%                         {flos ve-te-ris vi-ni}
% \end{example}
%    \begin{longtabu}to \textwidth {ll>{\strut}X}
%       \caption{Variables\label{tab:variables}}\\
%       \toprule
%       \rowfont{\bfseries\sffamily} variable & default & explanation \\
%       \midrule
%    \endfirsthead
%       \caption{Variables (cont.)}\\
%       \toprule
%       \rowfont{\bfseries\sffamily} variable & default & explanation \\
%       \midrule
%    \endhead
%       \multicolumn{3}{r}{\dots}
%    \endfoot
%       \bottomrule
%    \endlastfoot
%       +symbollinewidth+ & +0.04em+ & line width of symbols above syllables and small stand alone symbols \\
%       +bigsymbollinewidth+ & +0.06em+ & line width of big stand alone symbols \\
%       +accentlinewidth+ & +0.03em+ & line width of accents (\cs{lng} and \cs{brv}) \\
%       +bowlinewidth+ & +0.03em+ & line width of bows (\cs{bow}) \\
%       +symbolsep+ & +0.4em+ & gap between symbols in stand alone lists \\
%       +baseunit+ & +0.9em+ & length of the base vector for drawing symbols above
%                              syllables, small stand alone symbols, accents and bows\\
%       +bigbaseunit+ & +1.4em+ & length of the base vector for drawing stand alone symbols \\
%       +shortsyllablelimit+ & +0.8em+ & all syllables shorter than this can be treated specially, e.g.
%                                        they'll get a shorter elementum longum. \\
%       +gap+ & +0.09em+ & small gap between lines of the symbols, e.g. the distance between the
%                          two lines of a verse break \\
%       +symbolshift+ & +1.1em+ & leght to shift the symbols above or below the syllables
%                           (try +-0.6em+ to display the symbols below the base line) \\
%       +lngshift+ & +0.8em+ & length to shift the longa accent \\
%       +lngshortening+ & +0.075em+ & length to shorten the longa accent a little \\
%       +lngminlength+ & +0.25em+ & minimum width of a longa accent \\
%       +brvshift+ & +0.9em+ & length to shift the brevis accent \\
%       +dotshift+ & +-0.15em+ & length to shift the dot accent \\
%       +itcorrection+ & +0.11em+ & length to shift the accents above italic/slanted letters \\
%       +accentxshift+ & +-0.025em+ & length to shift the accents horizontally \\
%       +bowshift+ & +-0.15em+ & length to shift the bow below the base line \\
%       +bowshortening+ & +0.15em+ & length to shrink the bow a little \\
%       +bowlooseness+ & +0.75+ & value to influence the bending of the bow \\
%       +symbolcolor+ & +.+ (curr. color) & color of metric symbols \\
%       +accentcolor+ & +.+ (curr. color) & color of accents (\cs{lng} and \cs{brv}) \\
%       +bowcolor+ & +.+ (curr. color) & color of bows (\cs{bow}) \\
%       +highlightcolor+ & +red+ & color of highlighted symbols and syllabels
%                                 used in +colored highlight+ style \\
%       +fillcolor+ & +yellow+ & color of filled symbol +node+s
%                                 used in +filled highlight+ style \\
%       +arrow+ & +\$+\cs{downarrow}+\$+ & arrow for highlighting \\
%       +breakgap+ & +0.6em+ & gap before and after a (verse) break \\
%       +emptywidth+ & +1em+ & gap replacing an empty symbol (abbreviation +e+) \\
%       +acute+ & +\string\textasciiacute+ & acute accent character/symbol \\
%       +grave+ & +\string\textasciigrave+ & grave accent character/symbol \\
%    \end{longtabu}
%
% \subsection{\TikZ/ styles}\label{sec:styles}
% Beside the variables you may change the \TikZ/ styles used by \metrix/. But please mind
% that all styles are not empty by default so you should prefer +/.append style+ against
% +/.style+. Otherwise it may cause strange effects. Remind that you can use \cs{usemetrixvar}
% to access a variable.
% \begin{variable}{every metrix symbol, every metrix big symbol, every metrix symbol node}
% These three styles define the apperance of the metric symbols. They define the line width,
% the color, the basis vectors and other things.
% \end{variable}
% \begin{variable}{every metrix syllable node,every metrix break node}
% These styles defines the +node+s in which a syllable or a break symbol (the ones spanning across
% the symbol and the syllable line) is typeset, e.g. it aligns these +node+s at their base line.
% \end{variable}
% \begin{variable}{every metrix ictus node}
% This style defines the apperance of accents above symbols (ictus, e.g. +/u+).
% \end{variable}
% \begin{variable}{every metrix accent}
% This style defines the apperance of accents created by \cs{lng} and \cs{brv}.
% \end{variable}
% \begin{variable}{every metrix bow}
% This style defines the apperance of bows below symbols.
% \end{variable}
% \begin{variable}{bold highlight,colored highlight,dashed highlight,filled highlight,superscript}
% These styles can be used to highlight a certain symbol.
% \end{variable}
% \begin{variable}{every superscript picture,every superscript node,every superscript label}
% These styles are used to define the +superscript+ highlighting style.
% \end{variable}
% \begin{variable}{every metrix added text}
% This style is used for text added to a symbol with the +add text+ highlighting.
% \end{variable}
%
% \end{documentation}
%
% \begin{implementation}
%
% \section{Implementation}
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
%    \begin{macrocode}
%<@@=metrix>
%    \end{macrocode}
%
%    \begin{macrocode}
\ProvidesExplPackage
  {\metrixFileName}{\metrixFileDate}{\metrixFileVersion}{\metrixFileDescription}
%    \end{macrocode}
%
% \subsection{Required packages}
%    \begin{macrocode}
\RequirePackage{xparse}
\RequirePackage{xpatch}
\RequirePackage{tikz}
\ExplSyntaxOff
 \usetikzlibrary{calc}
\ExplSyntaxOn
\RequirePackage{textcomp}
%    \end{macrocode}
%
% \subsection{Constants and internal variables}
% These constants variables are for internal use only and can't be changed/accessed by the user.
% \subsubsection{Constants}
% \begin{variable}[internal]{\c_@@_acute_accent_tl}
%    Constant holding an acute accent char.
%    \begin{macrocode}
\tl_const:Nn \c_@@_acute_accent_tl { / }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\c_@@_acute_accent_tl}
%    Constant holding an grave accent char.
%    \begin{macrocode}
\tl_const:Nn \c_@@_grave_accent_tl { * }
%    \end{macrocode}
% \end{variable}
% \subsubsection{Variables}
% \begin{variable}[internal]{\l_@@_words_tl}
%    This list stores the words of the \cs{metrics} macro.
%    \begin{macrocode}
\tl_new:N \l_@@_words_tl
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_syllables_seq}
%    This list stores the words of the \cs{l_@@_words_tl} list.
%    \begin{macrocode}
\seq_new:N \l_@@_syllables_seq
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_symbols_seq}
%    This list stores the metric symbols of \cs{metrics} and \cs{metricsymbols}.
%    \begin{macrocode}
\seq_new:N \l_@@_symbols_seq
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_short_breaks_seq,\l_@@_foot_breaks_seq}
%    This list stores the short and foot breaks of \cs{metrics}.
%    \begin{macrocode}
\seq_new:N \l_@@_short_breaks_seq
\seq_new:N \l_@@_foot_breaks_seq
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_highlights_prop}
%    This list stores the higlighting styles of \cs{metrics} and \cs{metricsymbols}.
%    \begin{macrocode}
\prop_new:N \l_@@_highlights_prop
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_highlight_seq,\l_@@_highlight_pos_seq}
%    This lists are used to evaluate a higlight style.
%    \begin{macrocode}
\seq_new:N \l_@@_highlight_seq
\seq_new:N \l_@@_highlight_pos_seq
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\q_@@_space_marker}
%    This is the marker for spaces inside of the \cs{l_@@_words_tl} list.
%    \begin{macrocode}
\quark_new:N \q_@@_space_marker
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_process_int}
%    This process counter is used to combine the symbols and syllables.
%    \begin{macrocode}
\int_new:N \l_@@_process_int
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_short_syllable_bool,\l_@@_syllable_box,\g_@@_variable_shortsyllablelimit_tl}
%    This boolean can be used to store that a syllable is short, e.g. \emph{li} will be defined
%    as short wheras \emph{man} is long. That will be used to shorten the |_| symbol. Furthermore
%    we'll need a box to measure the length of a syllable and a variable to save the limit for
%    short syllables.
%    \begin{macrocode}
\bool_new:N \l_@@_short_syllable_bool
\box_new:N \l_@@_syllable_box
\tl_new:N \g_@@_variable_shortsyllablelimit_tl
\tl_set:Nn \g_@@_variable_shortsyllablelimit_tl { 0.8em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_current_symbol_tl}
%    Variable holding the current symbol abbreviation.
%    \begin{macrocode}
\tl_new:N \l_@@_current_symbol_tl
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_current_symbol_head_tl}
%    Variable holding firt char of the current symbol abbreviation.
%    \begin{macrocode}
\tl_new:N \l_@@_current_symbol_head_tl
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_has_acute_accent_bool}
%    Bool for switching on an acute accent of a symbol.
%    \begin{macrocode}
\bool_new:N \l_@@_has_acute_accent_bool
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\l_@@_has_grave_accent_bool}
%    Bool for switching on an grave accent of a symbol.
%    \begin{macrocode}
\bool_new:N \l_@@_has_grave_accent_bool
%    \end{macrocode}
% \end{variable}
%
% \subsection{User variables}
% These variables save things, the user can change via \cs{setmetrixvar} and use
% via \cs{usemetrixvar}.
% \begin{variable}[internal]{\g_@@_variable_symbollinewidth_tl}
%    This variable stores the line width for all metric symbols above (or below) syllables.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_symbollinewidth_tl
\tl_set:Nn \g_@@_variable_symbollinewidth_tl { 0.04em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_bigsymbollinewidth_tl}
%    This variable stores the line width for all stand alone metric symbols.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_bigsymbollinewidth_tl
\tl_set:Nn \g_@@_variable_bigsymbollinewidth_tl { 0.06em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_accentlinewidth_tl}
%    This variable stores the line width of the accent like symbols.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_accentlinewidth_tl
\tl_set:Nn \g_@@_variable_accentlinewidth_tl { 0.04em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_bowlinewidth_tl}
%    This variable stores the line width of the bow.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_bowlinewidth_tl
\tl_set:Nn \g_@@_variable_bowlinewidth_tl { 0.04em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_symbolsep_tl}
%    This variable stores the gap between two or more stand alone metric symbols.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_symbolsep_tl
\tl_set:Nn \g_@@_variable_symbolsep_tl { 0.4em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_baseunit_tl}
%    This variable stores the length of the basis vector for all metric symbols above (or below)
%     syllables and accent like symbols.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_baseunit_tl
\tl_set:Nn \g_@@_variable_baseunit_tl { 0.9em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_bigbaseunit_tl}
%    This variable stores the length of the basis vector for all stand alone metric symbols.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_bigbaseunit_tl
\tl_set:Nn \g_@@_variable_bigbaseunit_tl { 1.4em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_gap_tl}
%    Length for small gaps in the symbols, e.g. the gap between the two bows of an elementum biceps.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_gap_tl
\tl_set:Nn \g_@@_variable_gap_tl { 0.09em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_symbolshift_tl}
%    This variable stores the value to shift metric symbols above (or below) syllables.
%    Set this variable to approx +1.1em+ to draw the symbols above the syllable and to +-0.6em+
%    to draw them below.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_symbolshift_tl
\tl_set:Nn \g_@@_variable_symbolshift_tl { 1.1em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_lngshift_tl}
%    This variable stores the value to shift the longa accent.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_lngshift_tl
\tl_set:Nn \g_@@_variable_lngshift_tl { 0.15em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_lngshortening_tl}
%    This variable stores the value to shorten the longa accent.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_lngshortening_tl
\tl_set:Nn \g_@@_variable_lngshortening_tl { 0.075em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_lngminlength_tl}
%    This variable stores the value to shorten the longa accent.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_lngminlength_tl
\tl_set:Nn \g_@@_variable_lngminlength_tl { 0.25em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_brvshift_tl}
%    This variable stores the value to shift the brevis accent.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_brvshift_tl
\tl_set:Nn \g_@@_variable_brvshift_tl { 0.25em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_dotshift_tl}
%    This variable stores the value to shift the brevis accent.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_dotshift_tl
\tl_set:Nn \g_@@_variable_dotshift_tl { -0.15em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{
%  \g_@@_variable_itcorrection_tl,
%  \l_@@_internal_itcorrection_tl,
%  \g_@@_internal_itcorrection_zero_tl}
% These variables are used to set the italic correction of accents.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_itcorrection_tl
\tl_set:Nn \g_@@_variable_itcorrection_tl { 0.11em }
\tl_new:N \l_@@_internal_itcorrection_tl
\tl_set:Nn \l_@@_internal_itcorrection_tl { 0em }
\tl_new:N \g_@@_internal_itcorrection_zero_tl
\tl_set:Nn \g_@@_internal_itcorrection_zero_tl { 0em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_accentxshift_tl}
%    This variable ise used to shift the accents horizontally.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_accentxshift_tl
\tl_set:Nn \g_@@_variable_accentxshift_tl { -0.025em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_bowshift_tl}
%    This variable stores the value to shift the bow.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_bowshift_tl
\tl_set:Nn \g_@@_variable_bowshift_tl { -0.15em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_bowshortening_tl}
%    This variable stores the value to shrink the bow.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_bowshortening_tl
\tl_set:Nn \g_@@_variable_bowshortening_tl { 0.15em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_bowlooseness_tl}
%    This variable stores the value to shrink the bow.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_bowlooseness_tl
\tl_set:Nn \g_@@_variable_bowlooseness_tl { 0.75 }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]
%  {\g_@@_variable_symbolcolor_tl,\g_@@_variable_accentcolor_tl,g_@@_variable_bowcolor_tl}
% \changes{v1.4}{2016/03/29}{Changed symbol and accent color to current color.}
%    These variables store the color of symbols, accents and bows.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_symbolcolor_tl
\tl_set:Nn \g_@@_variable_symbolcolor_tl { . }
\tl_new:N \g_@@_variable_accentcolor_tl
\tl_set:Nn \g_@@_variable_accentcolor_tl { . }
\tl_new:N \g_@@_variable_bowcolor_tl
\tl_set:Nn \g_@@_variable_bowcolor_tl { . }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]
%  {\g_@@_variable_highlightcolor_tl}
%    These variable stores the color used in the +colored highlight+ style.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_highlightcolor_tl
\tl_set:Nn \g_@@_variable_highlightcolor_tl { red }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]
%  {\g_@@_variable_fillcolor_tl}
%    These variable stores the color used in the +filled highlight+ style.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_fillcolor_tl
\tl_set:Nn \g_@@_variable_fillcolor_tl { yellow }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]
%  {\g_@@_variable_arrow_tl}
% \changes{v1.3}{2016/03/21}{New variable for arrow}
%    These variable stores the color used in the +filled highlight+ style.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_arrow_tl
\tl_set:Nn \g_@@_variable_arrow_tl { $\downarrow$ }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_breakgap_tl}
%    This variable stores the width of the gap around the two break symbols.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_breakgap_tl
\tl_set:Nn \g_@@_variable_breakgap_tl { 0.6em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_emptywidth_tl}
%    This variable stores the width of the gap caused by an empty symbol (abbreviation +e+).
%    \begin{macrocode}
\tl_new:N \g_@@_variable_emptywidth_tl
\tl_set:Nn \g_@@_variable_emptywidth_tl { 1em }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_acute_tl}
%    This variable stores acute symbol.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_acute_tl
\tl_set:Nn \g_@@_variable_acute_tl { \textasciiacute }
%    \end{macrocode}
% \end{variable}
% \begin{variable}[internal]{\g_@@_variable_grave_tl}
%    This variable stores grave symbol.
%    \begin{macrocode}
\tl_new:N \g_@@_variable_grave_tl
\tl_set:Nn \g_@@_variable_grave_tl { \textasciigrave }
%    \end{macrocode}
% \end{variable}
%
% \subsection{Variants}
% Later we'll need the following variant.
%    \begin{macrocode}
\cs_generate_variant:Nn \prop_item:Nn { No , Nf , NV , Nx }
\cs_generate_variant:Nn \prop_put:Nnn { Nnx , Nxx , Nff  , Noo }
\cs_generate_variant:Nn \seq_item:Nn { Nf , NV , Nx }
\cs_generate_variant:Nn \seq_set_split:Nnn { Nnf , NnV , Nnx }
\cs_generate_variant:Nn \tl_remove_once:Nn { NV }
%    \end{macrocode}
%
% \subsection{Internal main macros}
% \begin{macro}[internal,updated=2014/07/02]{\@@_metrics:nn}
% \changes{v1.1}{2014/07/02}{Made short breaks available}
% \changes{v1.3}{2016/03/16}{Extended short breaks feature}
%    This macro processes the two lists of \cs{metrics} and combines the symbols
%    and syllables.\footnote{The framing of this macro was provided by Enrico Gregorio at
%    \url{http://tex.stackexchange.com/q/124528/4918}, a follow up question 
%    was \url{http://tex.stackexchange.com/q/124698/4918}. David Carlisle and Bruno Le Floch
%    lead me to the implementation of the highlighting mechanism, see 
%    \url{http://tex.stackexchange.com/q/124782/4918}}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_metrics:nn #1 #2
 {
  \tl_set:Nx \l_@@_words_tl { \tl_trim_spaces:n { #2 } }
%    \end{macrocode}
%    First replace the spaces by a special marker \cs{q_@@_space_marker} and add
%    hyphens: a space becomes a syllable.
%    \begin{macrocode}
  \tl_replace_all:Nnn \l_@@_words_tl { ~ } { - \q_@@_space_marker - }
%    \end{macrocode}
%    Then split the word list at hypens.
%    \begin{macrocode}
  \seq_set_split:NnV \l_@@_syllables_seq { - } \l_@@_words_tl
%    \end{macrocode}
%    Split the symbol list at spaces.
%    \begin{macrocode}
  \seq_set_split:Nnx \l_@@_symbols_seq { ~ } { \tl_trim_spaces:n { #1 } }
%    \end{macrocode}
%    Search for the short and foot breaks and remove them afterwards.
%    \begin{macrocode}
  \int_zero:N \l_@@_process_int
  \seq_clear:N \l_@@_short_breaks_seq
  \seq_clear:N \l_@@_foot_breaks_seq
  \seq_map_inline:Nn \l_@@_symbols_seq {
    \int_incr:N \l_@@_process_int
    \tl_if_eq:nnT { ##1 } { ' } {
      \seq_put_right:Nx \l_@@_short_breaks_seq { \int_use:N \l_@@_process_int }
      \int_decr:N \l_@@_process_int
    }
    \tl_if_eq:nnT { ##1 } { , } {
      \seq_put_right:Nx \l_@@_foot_breaks_seq { \int_use:N \l_@@_process_int }
      \int_decr:N \l_@@_process_int
    }
  }
  \seq_remove_all:Nn \l_@@_symbols_seq { , }
  \seq_remove_all:Nn \l_@@_symbols_seq { ' }
%    \end{macrocode}
%    Test whether both lists got the same length:
%    \begin{macrocode}
  \int_zero:N \l_@@_process_int
  \seq_map_inline:Nn \l_@@_syllables_seq
   {
    \tl_if_eq:nnT { ##1 } { \q_@@_space_marker }
     { \int_incr:N \l_@@_process_int }
   }
  \int_compare:nTF
   {
    \seq_count:N \l_@@_syllables_seq -
      \seq_count:N \l_@@_symbols_seq = \l_@@_process_int
   }
   {
%    \end{macrocode}
%    continue with list processing, if the numbers are equal:
%    \begin{macrocode}
    \int_zero:N \l_@@_process_int
    \seq_map_inline:Nn \l_@@_syllables_seq
     {
      \int_incr:N \l_@@_process_int
      \tl_if_eq:nnTF { ##1 } { \q_@@_space_marker }
       {
%    \end{macrocode}
%    If the syllable is a space the process counter must be decremented and
%    a space is typeset.
%    \begin{macrocode}
        \int_add:Nn \l_@@_process_int { -1 }
        \c_space_token
       }
       {
%    \end{macrocode}
%    Finally typeset the syllable and it's symbol.
% \changes{v1.1a}{2015/07/23}{Replaced deprecated \cs{str_case:nnn} with \cs{str_case:nnF}.}
%    \begin{macrocode}
        \str_case:nnF { ##1 } 
         {
          { | }
           {
            \@@_break_node:n { \@@_l_break: }
           }
          { || }
           {
            \@@_break_node:n { \@@_ll_break: }
           }
         }
         {
          \@@_print_syllable:n { ##1 }
         }
       }
     }
%    \end{macrocode}
%    And add the short break symbols if necessary:
%    \begin{macrocode}
     \seq_if_empty:NF \l_@@_short_breaks_seq {
       \seq_map_inline:Nn \l_@@_short_breaks_seq {
         \int_set:Nn \l_tmpa_int { ##1 - 1 }
         \bool_if:nF {
           \int_compare_p:n
             { 0 = \l_tmpa_int }
           ||
           \int_compare_p:n
             { \seq_count:N \l_@@_symbols_seq = \l_tmpa_int }
         } {
           \tikz [remember~picture, overlay] {
             \node [every~metrix~symbol~node] at
               ($(l_@@_symbol_node_\int_use:N \l_tmpa_int.east)!
                0.5!(l_@@_symbol_node_##1.west)$)
               { \@@_short_break: };
           }
         }
       }
     }
%    \end{macrocode}
%    And add the foot break symbols if necessary:
%    \begin{macrocode}
     \seq_if_empty:NF \l_@@_foot_breaks_seq {
       \seq_map_inline:Nn \l_@@_foot_breaks_seq {
         \int_set:Nn \l_tmpa_int { ##1 - 1 }
         \bool_if:nF {
           \int_compare_p:n
             { 0 = \l_tmpa_int }
           ||
           \int_compare_p:n
             { \seq_count:N \l_@@_symbols_seq = \l_tmpa_int }
         } {
           \tikz [remember~picture, overlay] {
             \coordinate (l_@@_tmp_coord) at
               ($(l_@@_syllable_node_\int_use:N \l_tmpa_int.east)!
                 0.5!(l_@@_syllable_node_##1.west)$);
             \node [every~metrix~symbol~node] at
               ($(l_@@_symbol_node_\int_use:N \l_tmpa_int.east)!
                (l_@@_tmp_coord)!(l_@@_symbol_node_##1.west)$)
               { \@@_foot_break: };
           }
         }
       }
     }
   }
%    \end{macrocode}
%    Send an error, else.
%    \begin{macrocode}
   {
    \@@_error_msg:n
     {
      Numbers~of~symbols~(\seq_count:N \l_@@_symbols_seq)~and~syllables~
      (\int_eval:n
        {
         \seq_count:N \l_@@_syllables_seq - \l_@@_process_int
        }
      )~mismatch.
     }
   }
 }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[internal]{\@@_metricsymbols:n}
%    This macro works like \cs{\__metrix_metrics} but is used to print stand alone metric
%    symbols via \cs{metricsymbols}.
% \changes{v1.1a}{2015/07/23}{Replaced deprecated \cs{str_case:nnn} with \cs{str_case:nnF}.}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_metricsymbols:n #1
 {
  \seq_set_split:Nnx \l_@@_symbols_seq { ~ } { \tl_trim_spaces:n { #1 } }
  \int_zero:N \l_@@_process_int
  \seq_map_inline:Nn \l_@@_symbols_seq
   {
    \int_incr:N \l_@@_process_int
    \int_compare:nT { \l_@@_process_int > 1 }
     {
      \hspace { \usemetrixvar{symbolsep} }
     }
    \str_case:nnF { ##1 } 
     {
      { , }
       {
        \@@_break_gap:
        \@@_align_symbol:n { \@@_l_bigmark:  }
        \@@_break_gap:
       }
      { ' }
       {
        \@@_break_gap:
        \@@_align_symbol:n { \@@_l_bigmark:  }
        \@@_break_gap:
       }
      { | }
       {
        \@@_break_gap:
        \@@_align_symbol:n { \@@_l_bigmark:  }
        \@@_break_gap:
       }
      { '' }
       {
        \@@_break_gap:
        \@@_align_symbol:n { \@@_ll_bigmark: }
        \@@_break_gap:
       }
      { || }
       {
        \@@_break_gap:
        \@@_align_symbol:n { \@@_ll_bigmark: }
        \@@_break_gap:
       }
     }
     {
      \@@_align_symbol:n { \@@_print_symbol: }
     }
   }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal,updated=2014/07/02]{\@@_print_syllable:n}
% \changes{v1.1}{2014/07/02}{Symbol nodes get individual names now.}
%    This macro combines a single syllable and the corrosponding metric symbol
%    taken frome the symbol list index with the process counter.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_syllable:n #1
 {
  \group_begin:
%    \end{macrocode}
%    Check wether the current syllable is short or long and set the corresponding bbol.
%    \begin{macrocode}
   \hbox_set:Nn \l_@@_syllable_box { #1 }
   \dim_compare:nTF
      { \box_wd:N \l_@@_syllable_box < \g_@@_variable_shortsyllablelimit_tl }
      { \bool_set_true:N \l_@@_short_syllable_bool }
      { \bool_set_false:N \l_@@_short_syllable_bool }
%    \end{macrocode}
%    Set up the currend highlight is it is definded
%    \begin{macrocode}
   \cs_set:Npx \@@_current_highlight: {
    \prop_item:NV \l_@@_highlights_prop \l_@@_process_int
   }
   \expandafter\tikzset\expandafter{\@@_current_highlight:}
%    \end{macrocode}
%    Finally print the syllable and the symbol above. Use +{pgfinterruptboundingbox}+
%    so that the symbol doesn't takes space ad doesn't cause gaps between the syllables.
%    \begin{macrocode}
   \hbox_set:Nn \l_tmpa_box { \@@_print_symbol: }
   \begin{tikzpicture}
    [
     remember~picture,
     baseline=(l_@@_syllable_node_\int_use:N \l_@@_process_int.base),
    ]
    \node [every~metrix~syllable~node]
       (l_@@_syllable_node_\int_use:N \l_@@_process_int)
       { #1 };
    \begin{pgfinterruptboundingbox}
     \node [every~metrix~symbol~node]
      (l_@@_symbol_node_\int_use:N \l_@@_process_int)
      at ($
         (l_@@_syllable_node_\int_use:N \l_@@_process_int.base)
         +
         (0,\usemetrixvar{symbolshift})
         +
         (\tl_use:N \l_@@_internal_itcorrection_tl,0)
      $)
      { \box_use:N \l_tmpa_box };
    \end{pgfinterruptboundingbox}
   \end{tikzpicture}
  \group_end:
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_print_symbol:}
%    This command selects the right symbol by it's abbreviation.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_symbol:
 {
  \tl_set:Nx \l_@@_current_symbol_tl
   {
    \seq_item:Nn \l_@@_symbols_seq { \l_@@_process_int }
   }
  \tl_set:Nx \l_@@_current_symbol_head_tl
   {
    \tl_head:N \l_@@_current_symbol_tl
   }
  \tl_case:NnT \l_@@_current_symbol_head_tl
   {
    \c_@@_acute_accent_tl { \bool_set_true:N \l_@@_has_acute_accent_bool }
    \c_@@_grave_accent_tl { \bool_set_true:N \l_@@_has_grave_accent_bool }
   }
   {
    \tl_remove_once:NV \l_@@_current_symbol_tl \l_@@_current_symbol_head_tl
   }
  \cs_if_exist_use:cF
   {
    @@_
    \tl_use:N \l_@@_current_symbol_tl
    _mark:
   }
   {
    \@@_error_msg:n
     {
      Unknown~symbol~abbreviation~'\tl_use:N \l_@@_current_symbol_tl'.
     }
   }
 }
%    \end{macrocode}
% \end{macro}
%
% \subsection{Internal auxiliary macros}
% \begin{macro}[internal]{\@@_error_msg:n}
%    An abbreviation to throw an error message.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_error_msg:n #1
 {
  \PackageError{ \metrixFileName } { #1 }
   {
    Please~take~a~look~at~the~manual~or~send~an~email.
   }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_warning_msg:n}
%    An abbreviation to throw an error message.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_warning_msg:n #1
 {
    \PackageWarning{ \metrixFileName } { #1 }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_align_symbol:n}
%    This macro alings the metric symbols in a stand alone list.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_align_symbol:n #1
 {
  \group_begin:
   \cs_set:Npx \@@_current_highlight: {
    \prop_item:NV \l_@@_highlights_prop \l_@@_process_int
   }
   \expandafter\tikzset\expandafter{\@@_current_highlight:}
   \begin{tikzpicture}
    [
     baseline={(0,-0.25*\usemetrixvar{baseunit})},
    ]
     \node [every~metrix~symbol~node] {#1};
   \end{tikzpicture}
  \group_end:
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_break_gap:}
%    This macro typesets the gap around the two break symbols.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_break_gap: 
 {
  \hspace { \usemetrixvar { breakgap } }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_break_node:n}
%    This macro typsets the gap around the two break symbols.
%    \begin{macrocode}
\cs_new:Npn \@@_break_node:n #1
 {
  \group_begin:
   \cs_set:Npx \@@_current_highlight: {
    \prop_item:NV \l_@@_highlights_prop \l_@@_process_int
   }
   \expandafter\tikzset\expandafter{\@@_current_highlight:}
   \tikz[baseline=(l_@@_break_node.base)]
    \node (l_@@_break_node) [every~metrix~break~node] { #1 }
   ;
  \group_end:
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_e_gap:}
%    This macro typsets the gap around the two break symbols.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_e_gap: 
 {
  \hspace* { \usemetrixvar { emptywidth } }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_evaluate_higlights:N}
%    This macro evaluates and prints the highlighting options.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_evaluate_higlights:n #1
 {
%    \end{macrocode}
% Start with clearing the property list, otherwise the highlights from
% the last time will survive.
%    \begin{macrocode}
  \prop_clear:N \l_@@_highlights_prop
%    \end{macrocode}
% Then spilt and process the argument as a comma separated list.
%    \begin{macrocode}
  \clist_map_inline:nn { #1 }
   {
%    \end{macrocode}
% The result is a sequence of key value pairs that we store in
% \cs{l_@@_highlight_seq}. The first part of this sequence must
% be split again at the plus sign---store it in \cs{l_@@_highlight_pos_seq}.
%    \begin{macrocode}
    \seq_set_split:Nnn \l_@@_highlight_seq { = } { ##1 }
    \seq_set_split:Nnf \l_@@_highlight_pos_seq { + }
     {
      \seq_item:Nn \l_@@_highlight_seq { 1 }
     }
%    \end{macrocode}
% Process the \cs{l_@@_highlight_pos_seq} list and set up the property list:
%    \begin{macrocode}
    \seq_map_inline:Nn \l_@@_highlight_pos_seq
     {
      \prop_put:Nnx \l_@@_highlights_prop
%    \end{macrocode}
% The key is the current item of \cs{l_@@_highlight_pos_seq}.
%    \begin{macrocode}
       {
        ####1
       }
       {
%    \end{macrocode}
% The value is the second item of \cs{l_@@_highlight_seq}.
%    \begin{macrocode}
        \seq_item:Nn \l_@@_highlight_seq { 2 }
       }
     }
   }
 }
%    \end{macrocode}
% \end{macro}
%
% \subsection{Patching font macros}
% To apply the italic correction of the accents we need to patch the font switches.
%    \begin{macrocode}
\xpretocmd { \itshape }
 {
  \tl_set_eq:NN
   \l_@@_internal_itcorrection_tl
   \g_@@_variable_itcorrection_tl
 }
 { }
 {
  \@@_warning_msg:n { Could~not~patch~\string\itshape. }
 }
\xpretocmd { \slshape }
 {
  \tl_set_eq:NN
   \l_@@_internal_itcorrection_tl
   \g_@@_variable_itcorrection_tl
 }
 { }
 {
  \@@_warning_msg:n { Could~not~patch~\string\slshape. }
 }
\xpretocmd { \upshape }
 {
  \tl_set_eq:NN
   \l_@@_internal_itcorrection_tl
   \g_@@_internal_itcorrection_zero_tl
 }
 { }
 {
  \@@_warning_msg:n { Could~not~patch~\string\upshape. }
 }
\xpretocmd { \normalfont }
 {
  \tl_set_eq:NN
   \l_@@_internal_itcorrection_tl
   \g_@@_internal_itcorrection_zero_tl
 }
 { }
 {
  \@@_warning_msg:n { Could~not~patch~\string\normalfont. }
 }
%    \end{macrocode}
%
% \subsection{Internal macros for metric symbols}
%
% \begin{macro}[internal]{\@@_e_mark:}
%    The empty symbol.
%    \begin{macrocode}
\cs_new:Npn \@@_e_mark: { \@@_e_gap: }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_u_mark:}
%    The brevis symbol \metricsymbols*{u}.
%    \begin{macrocode}
\cs_new:Npn \@@_u_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.225];
   \bool_if:NT \l_@@_has_acute_accent_bool
    {
     \node [every~metrix~ictus~node] at (0.225,0) { \usemetrixvar { acute } };
    }
   \bool_if:NT \l_@@_has_grave_accent_bool
    {
     \node [every~metrix~ictus~node] at (0.225,0) { \usemetrixvar { grave } };
    }
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@___mark:}
%    The longa symbol \MakePrivateLetters\metricsymbols*{_}.
%    \begin{macrocode}
\cs_new:Npn \@@___mark:
 {
  \bool_if:NTF \l_@@_short_syllable_bool
   {
    \begin{tikzpicture}[every~metrix~symbol]
     \draw (0,0) -- ++(0.4,0);
     \bool_if:NT \l_@@_has_acute_accent_bool
      {
       \node [every~metrix~ictus~node] at (0.2,0) { \usemetrixvar { acute } };
      }
     \bool_if:NT \l_@@_has_grave_accent_bool
      {
       \node [every~metrix~ictus~node] at (0.2,0) { \usemetrixvar { grave } };
      }
    \end{tikzpicture}
   }
   {
    \begin{tikzpicture}[every~metrix~symbol]
     \draw (0,0) -- ++(0.75,0);
     \bool_if:NT \l_@@_has_acute_accent_bool
      {
       \node [every~metrix~ictus~node] at (0.375,0) { \usemetrixvar { acute } };
      }
     \bool_if:NT \l_@@_has_grave_accent_bool
      {
       \node [every~metrix~ictus~node] at (0.375,0) { \usemetrixvar { grave } };
      }
    \end{tikzpicture}
   }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_uu_mark:}
%    The biceps symbol \MakePrivateLetters\metricsymbols*{uu_}.
%    \begin{macrocode}
\cs_new:Npn \@@_uu_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc
    [start~angle=0, end~angle=180, radius=-0.2];
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_uu__mark:}
%    The biceps symbol \MakePrivateLetters\metricsymbols*{uu_}.
%    \begin{macrocode}
\cs_new:Npn \@@_uu__mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc
    [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0,-0.2)+(-0.5\pgflinewidth,-\pgflinewidth)-(0,\usemetrixvar{gap})$) --
    ($(0.8,-0.2)+(1.5\pgflinewidth,-\pgflinewidth)
    +(\usemetrixvar{gap},-\usemetrixvar{gap})$);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@__uu_mark:}
%    Another biceps symbol \MakePrivateLetters\metricsymbols*{_uu}.
%    \begin{macrocode}
\cs_new:Npn \@@__uu_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc
    [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0,0)+(-0.5\pgflinewidth,0.5\pgflinewidth)+(0,\usemetrixvar{gap})$) --
    ($(0.8,0)+(1.5\pgflinewidth,0.5\pgflinewidth)
    +(\usemetrixvar{gap},\usemetrixvar{gap})$);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_u_uu_mark:}
%    An another biceps symbol \MakePrivateLetters\metricsymbols*{u_uu}.
%    \begin{macrocode}
\cs_new:Npn \@@_u_uu_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0.4,0)+(\pgflinewidth,0)+(\usemetrixvar{gap},0)$) arc
    [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0,0)+(-0.5\pgflinewidth,0.5\pgflinewidth)+(0,\usemetrixvar{gap})$) --
    ($(0.8,0)+(1.5\pgflinewidth,0.5\pgflinewidth)
    +(\usemetrixvar{gap},\usemetrixvar{gap})$);
   \draw ($(0.2,0.2)+(0.5\pgflinewidth,1.5\pgflinewidth)
   +(0.5*\usemetrixvar{gap},2*\usemetrixvar{gap})$)
    arc [start~angle=0, end~angle=180, radius=-0.2];
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_x_mark:}
%    The anceps symbol \metricsymbols*{x}.
%    \begin{macrocode}
\cs_new:Npn \@@_x_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (-0.2,0.2) -- (0.2,-0.2);
   \draw (-0.2,-0.2) -- (0.2,0.2);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_v_mark:}
% \changes{v1.4}{2019/05/04}{Added \texttt{v} symbol.}
%    The (yet) unnamed symbol \metricsymbols*{v}.
%    \begin{macrocode}
\cs_new:Npn \@@_v_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) -- (0.225,-0.225) -- (0.45,0);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_A_mark:}
% \changes{v1.4}{2019/05/04}{Added \texttt{A} symbol.}
%    The (yet) unnamed symbol \metricsymbols*{A}.
%    \begin{macrocode}
\cs_new:Npn \@@_A_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) -- (0.225,0.225) -- (0.45,0);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_o_mark:}
% \changes{v1.4}{2019/05/04}{Added \texttt{o} symbol.}
%    The (yet) unnamed symbol \metricsymbols*{o}.
%    \begin{macrocode}
\cs_new:Npn \@@_o_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) circle [radius=0.2];
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal,added=2019/05/04]{\@@_oo_mark:}
%    The aeolic symbol \metricsymbols*{oo}.
%    \begin{macrocode}
\cs_new:Npn \@@_oo_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) circle [radius=0.2];
   \draw ($(0.4,0)+(1\pgflinewidth,0)+(\usemetrixvar{gap},0)$) circle [radius=0.2];
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal,updated=2014/07/02]{\@@_u__mark:}
% \changes{v1.1}{2014/07/02}{Removed red dot.}
%    The indifferent symbol \MakePrivateLetters\metricsymbols*{u_}.
%    \begin{macrocode}
\cs_new:Npn \@@_u__mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0,-0.2)+(-0.5\pgflinewidth,-\pgflinewidth)-(0,\usemetrixvar{gap})$) --
    ($(0.4,-0.2)+(0.5\pgflinewidth,-\pgflinewidth)
    +(0,-\usemetrixvar{gap})$);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal,added=2019/10/09]{\@@__u_mark:}
% \changes{v1.5}{2019/10/09}{Added.}
%    The indifferent symbol \MakePrivateLetters\metricsymbols*{_u}.
%    \begin{macrocode}
\cs_new:Npn \@@__u_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.2];
   \draw ($(0,0)+(-0.5\pgflinewidth,0.5\pgflinewidth)+(0,\usemetrixvar{gap})$) --
    ($(0.4,0)+(0.5\pgflinewidth,0.5\pgflinewidth)
    +(0,\usemetrixvar{gap})$);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_n_mark:}
%    An alternative indifferent symbol \metricsymbols*{n}.
%    \begin{macrocode}
\cs_new:Npn \@@_n_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) arc [start~angle=0, end~angle=180, radius=0.225];
   \fill (-0.225,0.75*\usemetrixvar{symbollinewidth})
    circle [radius=0.7\pgflinewidth];
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_p_mark:}
% \changes{v1.4}{2019/05/04}{Added primary stress symbol.}
%    The primary stress symbol \metricsymbols*{p}.
%    \begin{macrocode}
\cs_new:Npn \@@_p_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (-0.2,-0.2) -- (0.2,0.2);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_s_mark:}
% \changes{v1.4}{2019/05/04}{Added secondary stress symbol.}
%    The secondary stress symbol \metricsymbols*{s}.
%    \begin{macrocode}
\cs_new:Npn \@@_s_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (-0.2,0.2) -- (0.2,-0.2);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_l_mark:}
%    The simple break symbol \metricsymbols*{|} (above syllables).
%    \begin{macrocode}
\cs_new:Npn \@@_l_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) -- (0,0.5);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_ll_mark:}
%    The verse break symbol \metricsymbols*{||} (above syllables).
%    \begin{macrocode}
\cs_new:Npn \@@_ll_mark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) -- (0,0.5);
   \draw ($(\pgflinewidth,0)+(1.5*\usemetrixvar{gap},0)$) -- ++(0,0.5);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_l_bigmark:}
%    The simple break symbol \metricsymbols*{|} (stand alone version).
%    \begin{macrocode}
\cs_new:Npn \@@_l_bigmark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) -- (0,0.8);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_ll_bigmark:}
%    The verse break symbol \metricsymbols*{||} (stand alone version).
%    \begin{macrocode}
\cs_new:Npn \@@_ll_bigmark:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0) -- (0,0.8);
   \draw ($(\pgflinewidth,0)+(1.5*\usemetrixvar{gap},0)$) -- ++(0,0.8);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal,updated=2014/07/02]{\@@_l_break}
% \changes{v1.1}{2014/07/02}{Made line slightly longer}
%    The simple break symbol \metricsymbols*{|} (between syllables with symbols).
%    \begin{macrocode}
\cs_new:Npn \@@_l_break:
 {
  \begin{tikzpicture}[every~metrix~symbol,baseline=0.05em]
   \draw (0,\usemetrixvar{symbolshift}+0.325em)
    -- (0,-0.05em) -- (0,0.8em) -- (0,\usemetrixvar{symbolshift});
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal,updated=2014/07/02]{\@@_ll_break}
% \changes{v1.1}{2014/07/02}{Made lines slightly longer}
%    The verse break symbol \metricsymbols*{||} (between syllables with symbols).
%    \begin{macrocode}
\cs_new:Npn \@@_ll_break:
 {
  \begin{tikzpicture}[every~metrix~symbol,baseline=0.05em]
   \draw (0,\usemetrixvar{symbolshift}+0.325em)
    -- (0,-0.05em) -- (0,0.8em) -- (0,\usemetrixvar{symbolshift});
   \draw 
    [
     shift={($(\pgflinewidth,0)+(1.5*\usemetrixvar{gap},0)$)},
    ]
    (0,\usemetrixvar{symbolshift}+0.325em) -- (0,-0.05em) -- (0,0.8em)
    -- (0,\usemetrixvar{symbolshift});
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_short_break:}
%    The shorter break symbol.
%    \begin{macrocode}
\cs_new:Npn \@@_short_break:
 {
  \begin{tikzpicture}[every~metrix~symbol]
   \draw (0,0.3) -- (0,-0.3);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_foot_break:}
%    The shorter break symbol for foot breakt is the same as
%    the regular short break.
%    \begin{macrocode}
\cs_set_eq:NN \@@_foot_break: \@@_short_break:
%    \end{macrocode}
% \end{macro}
%
% \subsection{User level macros}
%
% \begin{macro}{\setmetrixvar}
%    This macro saves the value to an internal variable.
%    \begin{macrocode}
\NewDocumentCommand{ \setmetrixvar }{ m m }
 {
  \tl_if_exist:cTF { g_@@_variable_#1_tl } {
   \tl_set:cn { g_@@_variable_#1_tl } { #2 }
  }
  {
   \@@_error_msg:n { Unknown~variable~'#1'. }
  }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\usemetrixvar}
%    With this command one can access the value of an internal variable.\footnote{Marco Daniel
%    showed me this hint at \url{http://tex.stackexchange.com/q/124600/4918}.}
%    \begin{macrocode}
\DeclareExpandableDocumentCommand{ \usemetrixvar }{ m }
 {
  \tl_if_exist:cTF { g_@@_variable_#1_tl } {
   \tl_use:c { g_@@_variable_#1_tl }
  }
  {
   \@@_error_msg:n { Unknown~variable~'#1'. }
  }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\metrics}
%    This user macro calls \cs{\@@_metrics} to typset syllables with symbols.
%    \begin{macrocode}
\NewDocumentCommand { \metrics } { O{} m m }
 {
  \@@_evaluate_higlights:n { #1 }
  \@@_metrics:nn { #2 } { #3 }
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\metricsymbols}
%    This command typesets stand alone symbols. The starred version prints smaller versions.
%    \begin{macrocode}
\NewDocumentCommand { \metricsymbols } { s O{} m }
 {
  \group_begin:
   \IfBooleanF { #1 } { \tikzset{every~metrix~symbol/.style={every~metrix~big~symbol}} }
   \@@_evaluate_higlights:n { #2 }
   \@@_metricsymbols:n { #3 }
  \group_end:
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[updated=2015/09/02]{\lng}
%    \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{lng}.}
%    This macro prints the longa accent above its argument.
%    \begin{macrocode}
\NewDocumentCommand { \lng } { D(){0,0} O{0pt} m O{0pt} }
 {
  \begin{tikzpicture}[
     baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base),
     every~metrix~accent
  ]
   \node [every~metrix~syllable~node]
      (l_@@_syllable_node_\int_use:N \l_@@_process_int)
      { #3 };
   \begin{pgfinterruptboundingbox}
    \draw [shorten~< = -#2, shorten~> = -#4]
     ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north)
     - (\usemetrixvar{lngminlength}/2,0)
     +(\usemetrixvar{accentxshift},\usemetrixvar{lngshift})
     + (\tl_use:N \l_@@_internal_itcorrection_tl,0)
     + (#1)$)
     --
     ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north)
     + (\usemetrixvar{lngminlength}/2,0)
     +(\usemetrixvar{accentxshift},\usemetrixvar{lngshift})
     + (\tl_use:N \l_@@_internal_itcorrection_tl,0)
     + (#1)$)
    ;
    \draw [shorten~< = -#2, shorten~> = -#4]
     ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north~west)
     +(\usemetrixvar{lngshortening}+\usemetrixvar{accentxshift},\usemetrixvar{lngshift})
     + (\tl_use:N \l_@@_internal_itcorrection_tl,0)
     + (#1)$)
     --
     ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north~east)
     +(-\usemetrixvar{lngshortening}+\usemetrixvar{accentxshift},\usemetrixvar{lngshift})
     + (\tl_use:N \l_@@_internal_itcorrection_tl,0)
     + (#1)$)
    ;
   \end{pgfinterruptboundingbox}
  \end{tikzpicture}%
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[updated=2015/09/02]{\brv}
%    \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{brv}.}
%    This macro prints the brevis accent above its argument.
%    \begin{macrocode}
\NewDocumentCommand { \brv } { D(){0,0} m }
 {
  \begin{tikzpicture}[
     baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base),
     every~metrix~accent
  ]
   \node [every~metrix~syllable~node]
      (l_@@_syllable_node_\int_use:N \l_@@_process_int)
      { #2 };
   \begin{pgfinterruptboundingbox}
    \draw ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.north)
     + (-0.15,0)
     + (\usemetrixvar{accentxshift},\usemetrixvar{brvshift})
     + (\tl_use:N \l_@@_internal_itcorrection_tl,0)
     + (#1)$)
     arc [start~angle=0, end~angle=180, radius=-0.15];
   \end{pgfinterruptboundingbox}
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[updated=2015/09/02]{\acct}
%    \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{acct}.}
%    This macro prints the dot accent below its argument.
%    \begin{macrocode}
\NewDocumentCommand { \acct } { D(){0,0} m }
 {
  \begin{tikzpicture}[
     baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base),
     every~metrix~accent
   ]
   \node [every~metrix~syllable~node]
      (l_@@_syllable_node_\int_use:N \l_@@_process_int)
      { #2 };
   \begin{pgfinterruptboundingbox}
    \fill ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.south)
     + (0,\usemetrixvar{dotshift})
     + (#1)$)
     circle [radius=1.25\pgflinewidth];
   \end{pgfinterruptboundingbox}
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[updated=2015/09/02]{\bow}
%    \changes{v1.2}{2015/09/02}{Finetunig for \protect\cs{bow}.}
%    This macro prints the bow below it's argument.
%    \begin{macrocode}
\NewDocumentCommand { \bow } { O{0pt} m O{0pt} }
 {
  \begin{tikzpicture}[
    baseline = (l_@@_syllable_node_\int_use:N \l_@@_process_int.base),
    every~metrix~bow
  ]
   \node [every~metrix~syllable~node]
      (l_@@_syllable_node_\int_use:N \l_@@_process_int)
      { #2 };
   \draw [shorten~< = #1, shorten~> = #3]
    ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.base~west)+
    (\usemetrixvar{bowshortening},\usemetrixvar{bowshift})$)
    to [out=-45, in=225,looseness=\usemetrixvar{bowlooseness}]
    ($(l_@@_syllable_node_\int_use:N \l_@@_process_int.base~east)+
    (-\usemetrixvar{bowshortening},\usemetrixvar{bowshift})$);
  \end{tikzpicture}
 }
%    \end{macrocode}
% \end{macro}
%
% \subsection{\TikZ/ styles}
% The \metrix/ package uses several \TikZ/ sytles to draw the macros.
%    \begin{macrocode}
\ExplSyntaxOff
\tikzset {
 every metrix symbol/.style={
  line width=\usemetrixvar{symbollinewidth},
  color=\usemetrixvar{symbolcolor},
  x=\usemetrixvar{baseunit},y=\usemetrixvar{baseunit},
 },
 every metrix big symbol/.style={
  line width=\usemetrixvar{bigsymbollinewidth},
  color=\usemetrixvar{symbolcolor},
  x=\usemetrixvar{bigbaseunit},y=\usemetrixvar{bigbaseunit},
 },
 every metrix symbol node/.style={
  inner sep=0pt, anchor=center,
 },
 every metrix ictus node/.style={
   overlay,
 },
 every metrix break node/.style={
  inner sep=0pt, anchor=base, 
 },
 every metrix syllable node/.style={
  inner sep=0pt, anchor=base,
 },
 every metrix bow/.style={
  line width=\usemetrixvar{bowlinewidth},
  color=\usemetrixvar{bowcolor},
  x=\usemetrixvar{baseunit},y=\usemetrixvar{baseunit},
 },
 every metrix accent/.style={
  line width=\usemetrixvar{accentlinewidth},
  color=\usemetrixvar{accentcolor},
  x=\usemetrixvar{baseunit},y=\usemetrixvar{baseunit},
 },
 bold highlight/.style={
  every metrix symbol/.append style={line width=2\pgflinewidth},
  every metrix syllable node/.append style={font=\bfseries},
  every superscript node/.append style={font/.expand once=\tikz@textfont\bfseries},
 },
 colored highlight/.style={
  every metrix symbol/.append style={draw=#1},
  every metrix syllable node/.append style={text=#1},
  every superscript node/.append style={text=#1},
 },
 colored highlight/.default={
  \usemetrixvar{highlightcolor}
 },
 dashed highlight/.style={
  every metrix symbol/.append style={dash pattern=on 1pt off 0.4pt},
 },
 filled highlight/.style={
  every metrix symbol node/.append style={inner sep=2pt,fill=#1},
 },
 filled highlight/.default={
  \usemetrixvar{fillcolor},
 },
 every superscript picture/.style={
  baseline=-3ex,
 },
 every superscript node/.style={
  inner sep=0pt,
  font=\scriptsize,
 },
 every superscript label/.style={
  inner xsep=0pt,
  inner ysep=-3ex,
  label distance=0.5pt,
 },
 add superscript/.style={
  label={[every superscript label]right:{%
   \tikz[every superscript picture]\node at (0,0) [every superscript node] {#1};%
  }},
 },
 superscript/.style={
  every metrix symbol node/.append style={
   add superscript=#1,
  },
  every metrix break node/.append style={
   add superscript=#1,
  },
 },
 superscript/.value required,
 add arrow/.style={
  every metrix symbol node/.append style={
   label=90:\usemetrixvar{arrow},
  },
 },
 add text/.style={
  every metrix symbol node/.append style={
   label={[every metrix added text]#1},
  },
 },
 every metrix added text/.style = {
  font = \scriptsize\itshape,
 },
 add text/.value required,
}
\ExplSyntaxOn
%    \end{macrocode}
%
% \subsection{Environments}
% \begin{macro}{symbolline}
% Environment to display stand alone symbols.
%    \begin{macrocode}
\NewDocumentEnvironment{symbolline} { }
 {
  \par\addvspace{\baselineskip}
  \centering
 }
 {
  \par\vspace{\baselineskip}
  \noindent\ignorespacesafterend
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[internal]{\@@_print_vers_ref:n}
% The internal macro to print the verse reference inside of +{metricvers}+
%    \begin{macrocode}
\cs_new:Npn \@@_print_vers_ref:n #1 
 {
     \hspace*{\fill}\nolinebreak[1] \quad \hspace*{\fill} \mbox{\footnotesize #1}
 }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{metricverses,\verseref}
% Environment to display a verse with metric symbols and a source. And a macro to print
% a right aligned reference.
%    \begin{macrocode}
\NewDocumentCommand { \verseref } { m }
 {
  \@@_error_msg:n {
   \string\verseref\space can~only~be~used~in~{metricverses}~env.
  }
 }
\NewDocumentEnvironment { metricverses } { }
 {
  \RenewDocumentCommand { \verseref } { m }
   {
    \@@_print_vers_ref:n { ##1 }
   }
  \par
  \addvspace { 0.7\baselineskip }
  \fp_compare:nT { \usemetrixvar { symbolshift } < 0.0 }
   {
    \vspace { \usemetrixvar { symbolshift } }
   }
  \addtolength { \baselineskip } { 0.6\baselineskip }
 }
 {
  \par
  \addtolength { \baselineskip } { -0.6\baselineskip }
  \vspace { \baselineskip }
  \noindent \ignorespacesafterend
 }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
% \end{implementation}
%
% \PrintChanges^^A use makeindex -s gglo.ist -o metrix-doc.gls metrix-doc.glo
%              ^^A use updated=YYYY-MM-DD or new=YYY-MM-DD in {documentation} section
% \changes{v1.0}{2013/08/12}{Initial version}
% \changes{v1.2a}{2016/01/21}{Replaced deprecated \cs{prop_get} variants (Thanks to J. Wright).}
% \changes{v1.3}{2016/03/21}{New highlight styles: \texttt{add text} and \texttt{add arrow}.}
% \changes{v1.4}{2019/05/04}{Added docs for \texttt{l} and \texttt{ll} symbol.}
% \changes{v1.4}{2019/05/05}{Added possibility to add accents/icutus above symbols.}
% \changes{v1.4a}{2019/05/13}{Now loads \pkg{textcomp}.}
% \changes{v1.4a}{2019/05/13}{Fix: Icuts/accents didn't work with unicode.}
% \changes{v1.4a}{2019/05/13}{New style: \texttt{every metrix ictus node}}
%
% \PrintIndex^^A use: makeindex -s l3doc.ist -o metrix-doc.ind metrix-doc.idx 
