%% %% This is file `metrix.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% metrix.dtx (with options: `package') %% %% IMPORTANT NOTICE: %% %% For the copyright see the source file. %% %% Any modified versions of this file must be renamed %% with new filenames distinct from metrix.sty. %% %% For distribution of the original source see the terms %% for copying and modification in the file metrix.dtx. %% %% This generated file may be distributed as long as the %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% File: metrix.dtx Copyright (C) 2013-2016 Tobias Weh %% %% It 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 %% \RequirePackage{expl3}[2016/01/03] \@ifpackagelater{expl3}{2016/01/03} {} {% \PackageError{metrix}{Support package l3kernel too old} {% Please install an up to date version of l3kernel\MessageBreak using your TeX package manager or from CTAN.\MessageBreak \MessageBreak Loading xparse will abort!% }% \endinput } \def\metrixFileName{metrix} \def\metrixFileDescription{Typset prosody/metric symbols.} \def\metrixFileDate{2019/05/05} \def\metrixFileVersion{1.4} \ProvidesExplPackage {\metrixFileName}{\metrixFileDate}{\metrixFileVersion}{\metrixFileDescription} \RequirePackage{xparse} \RequirePackage{xpatch} \RequirePackage{tikz} \ExplSyntaxOff \usetikzlibrary{calc} \ExplSyntaxOn \tl_const:Nn \c__metrix_acute_accent_tl { ´ } \tl_const:Nn \c__metrix_grave_accent_tl { ` } \tl_new:N \l__metrix_words_tl \seq_new:N \l__metrix_syllables_seq \seq_new:N \l__metrix_symbols_seq \seq_new:N \l__metrix_short_breaks_seq \seq_new:N \l__metrix_foot_breaks_seq \prop_new:N \l__metrix_highlights_prop \seq_new:N \l__metrix_highlight_seq \seq_new:N \l__metrix_highlight_pos_seq \quark_new:N \q__metrix_space_marker \int_new:N \l__metrix_process_int \bool_new:N \l__metrix_short_syllable_bool \box_new:N \l__metrix_syllable_box \tl_new:N \g__metrix_variable_shortsyllablelimit_tl \tl_set:Nn \g__metrix_variable_shortsyllablelimit_tl { 0.8em } \tl_new:N \l__metrix_current_symbol_tl \tl_new:N \l__metrix_current_symbol_head_tl \bool_new:N \l__metrix_has_acute_accent_bool \bool_new:N \l__metrix_has_grave_accent_bool \tl_new:N \g__metrix_variable_symbollinewidth_tl \tl_set:Nn \g__metrix_variable_symbollinewidth_tl { 0.04em } \tl_new:N \g__metrix_variable_bigsymbollinewidth_tl \tl_set:Nn \g__metrix_variable_bigsymbollinewidth_tl { 0.06em } \tl_new:N \g__metrix_variable_accentlinewidth_tl \tl_set:Nn \g__metrix_variable_accentlinewidth_tl { 0.04em } \tl_new:N \g__metrix_variable_bowlinewidth_tl \tl_set:Nn \g__metrix_variable_bowlinewidth_tl { 0.04em } \tl_new:N \g__metrix_variable_symbolsep_tl \tl_set:Nn \g__metrix_variable_symbolsep_tl { 0.4em } \tl_new:N \g__metrix_variable_baseunit_tl \tl_set:Nn \g__metrix_variable_baseunit_tl { 0.9em } \tl_new:N \g__metrix_variable_bigbaseunit_tl \tl_set:Nn \g__metrix_variable_bigbaseunit_tl { 1.4em } \tl_new:N \g__metrix_variable_gap_tl \tl_set:Nn \g__metrix_variable_gap_tl { 0.09em } \tl_new:N \g__metrix_variable_symbolshift_tl \tl_set:Nn \g__metrix_variable_symbolshift_tl { 1.1em } \tl_new:N \g__metrix_variable_lngshift_tl \tl_set:Nn \g__metrix_variable_lngshift_tl { 0.15em } \tl_new:N \g__metrix_variable_lngshortening_tl \tl_set:Nn \g__metrix_variable_lngshortening_tl { 0.075em } \tl_new:N \g__metrix_variable_lngminlength_tl \tl_set:Nn \g__metrix_variable_lngminlength_tl { 0.25em } \tl_new:N \g__metrix_variable_brvshift_tl \tl_set:Nn \g__metrix_variable_brvshift_tl { 0.25em } \tl_new:N \g__metrix_variable_dotshift_tl \tl_set:Nn \g__metrix_variable_dotshift_tl { -0.15em } \tl_new:N \g__metrix_variable_itcorrection_tl \tl_set:Nn \g__metrix_variable_itcorrection_tl { 0.11em } \tl_new:N \l__metrix_internal_itcorrection_tl \tl_set:Nn \l__metrix_internal_itcorrection_tl { 0em } \tl_new:N \g__metrix_internal_itcorrection_zero_tl \tl_set:Nn \g__metrix_internal_itcorrection_zero_tl { 0em } \tl_new:N \g__metrix_variable_accentxshift_tl \tl_set:Nn \g__metrix_variable_accentxshift_tl { -0.025em } \tl_new:N \g__metrix_variable_bowshift_tl \tl_set:Nn \g__metrix_variable_bowshift_tl { -0.15em } \tl_new:N \g__metrix_variable_bowshortening_tl \tl_set:Nn \g__metrix_variable_bowshortening_tl { 0.15em } \tl_new:N \g__metrix_variable_bowlooseness_tl \tl_set:Nn \g__metrix_variable_bowlooseness_tl { 0.75 } \tl_new:N \g__metrix_variable_symbolcolor_tl \tl_set:Nn \g__metrix_variable_symbolcolor_tl { . } \tl_new:N \g__metrix_variable_accentcolor_tl \tl_set:Nn \g__metrix_variable_accentcolor_tl { . } \tl_new:N \g__metrix_variable_bowcolor_tl \tl_set:Nn \g__metrix_variable_bowcolor_tl { . } \tl_new:N \g__metrix_variable_highlightcolor_tl \tl_set:Nn \g__metrix_variable_highlightcolor_tl { red } \tl_new:N \g__metrix_variable_fillcolor_tl \tl_set:Nn \g__metrix_variable_fillcolor_tl { yellow } \tl_new:N \g__metrix_variable_arrow_tl \tl_set:Nn \g__metrix_variable_arrow_tl { $\downarrow$ } \tl_new:N \g__metrix_variable_breakgap_tl \tl_set:Nn \g__metrix_variable_breakgap_tl { 0.6em } \tl_new:N \g__metrix_variable_emptywidth_tl \tl_set:Nn \g__metrix_variable_emptywidth_tl { 1em } \tl_new:N \g__metrix_variable_acute_tl \tl_set:Nn \g__metrix_variable_acute_tl { ´ } \tl_new:N \g__metrix_variable_grave_tl \tl_set:Nn \g__metrix_variable_grave_tl { \`{} } \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 } \cs_new_protected:Npn \__metrix_metrics:nn #1 #2 { \tl_set:Nx \l__metrix_words_tl { \tl_trim_spaces:n { #2 } } \tl_replace_all:Nnn \l__metrix_words_tl { ~ } { - \q__metrix_space_marker - } \seq_set_split:NnV \l__metrix_syllables_seq { - } \l__metrix_words_tl \seq_set_split:Nnx \l__metrix_symbols_seq { ~ } { \tl_trim_spaces:n { #1 } } \int_zero:N \l__metrix_process_int \seq_clear:N \l__metrix_short_breaks_seq \seq_clear:N \l__metrix_foot_breaks_seq \seq_map_inline:Nn \l__metrix_symbols_seq { \int_incr:N \l__metrix_process_int \tl_if_eq:nnT { ##1 } { ' } { \seq_put_right:Nx \l__metrix_short_breaks_seq { \int_use:N \l__metrix_process_int } \int_decr:N \l__metrix_process_int } \tl_if_eq:nnT { ##1 } { , } { \seq_put_right:Nx \l__metrix_foot_breaks_seq { \int_use:N \l__metrix_process_int } \int_decr:N \l__metrix_process_int } } \seq_remove_all:Nn \l__metrix_symbols_seq { , } \seq_remove_all:Nn \l__metrix_symbols_seq { ' } \int_zero:N \l__metrix_process_int \seq_map_inline:Nn \l__metrix_syllables_seq { \tl_if_eq:nnT { ##1 } { \q__metrix_space_marker } { \int_incr:N \l__metrix_process_int } } \int_compare:nTF { \seq_count:N \l__metrix_syllables_seq - \seq_count:N \l__metrix_symbols_seq = \l__metrix_process_int } { \int_zero:N \l__metrix_process_int \seq_map_inline:Nn \l__metrix_syllables_seq { \int_incr:N \l__metrix_process_int \tl_if_eq:nnTF { ##1 } { \q__metrix_space_marker } { \int_add:Nn \l__metrix_process_int { -1 } \c_space_token } { \str_case:nnF { ##1 } { { | } { \__metrix_break_node:n { \__metrix_l_break: } } { || } { \__metrix_break_node:n { \__metrix_ll_break: } } } { \__metrix_print_syllable:n { ##1 } } } } \seq_if_empty:NF \l__metrix_short_breaks_seq { \seq_map_inline:Nn \l__metrix_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__metrix_symbols_seq = \l_tmpa_int } } { \tikz [remember~picture, overlay] { \node [every~metrix~symbol~node] at ($(l__metrix_symbol_node_\int_use:N \l_tmpa_int.east)! 0.5!(l__metrix_symbol_node_##1.west)$) { \__metrix_short_break: }; } } } } \seq_if_empty:NF \l__metrix_foot_breaks_seq { \seq_map_inline:Nn \l__metrix_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__metrix_symbols_seq = \l_tmpa_int } } { \tikz [remember~picture, overlay] { \coordinate (l__metrix_tmp_coord) at ($(l__metrix_syllable_node_\int_use:N \l_tmpa_int.east)! 0.5!(l__metrix_syllable_node_##1.west)$); \node [every~metrix~symbol~node] at ($(l__metrix_symbol_node_\int_use:N \l_tmpa_int.east)! (l__metrix_tmp_coord)!(l__metrix_symbol_node_##1.west)$) { \__metrix_foot_break: }; } } } } } { \__metrix_error_msg:n { Numbers~of~symbols~(\seq_count:N \l__metrix_symbols_seq)~and~syllables~ (\int_eval:n { \seq_count:N \l__metrix_syllables_seq - \l__metrix_process_int } )~mismatch. } } } \cs_new_protected:Npn \__metrix_metricsymbols:n #1 { \seq_set_split:Nnx \l__metrix_symbols_seq { ~ } { \tl_trim_spaces:n { #1 } } \int_zero:N \l__metrix_process_int \seq_map_inline:Nn \l__metrix_symbols_seq { \int_incr:N \l__metrix_process_int \int_compare:nT { \l__metrix_process_int > 1 } { \hspace{\usemetrixvar{symbolsep}} } \str_case:nnF { ##1 } { { , } { \__metrix_break_gap: \__metrix_align_symbol:n { \__metrix_l_bigmark: } \__metrix_break_gap: } { ' } { \__metrix_break_gap: \__metrix_align_symbol:n { \__metrix_l_bigmark: } \__metrix_break_gap: } { | } { \__metrix_break_gap: \__metrix_align_symbol:n { \__metrix_l_bigmark: } \__metrix_break_gap: } { '' } { \__metrix_break_gap: \__metrix_align_symbol:n { \__metrix_ll_bigmark: } \__metrix_break_gap: } { || } { \__metrix_break_gap: \__metrix_align_symbol:n { \__metrix_ll_bigmark: } \__metrix_break_gap: } } { \__metrix_align_symbol:n { \__metrix_print_symbol: } } } } \cs_new_protected:Npn \__metrix_print_syllable:n #1 { \group_begin: \hbox_set:Nn \l__metrix_syllable_box { #1 } \dim_compare:nTF { \box_wd:N \l__metrix_syllable_box < \g__metrix_variable_shortsyllablelimit_tl } { \bool_set_true:N \l__metrix_short_syllable_bool } { \bool_set_false:N \l__metrix_short_syllable_bool } \cs_set:Npx \__metrix_current_highlight: { \prop_item:NV \l__metrix_highlights_prop \l__metrix_process_int } \expandafter\tikzset\expandafter{\__metrix_current_highlight:} \hbox_set:Nn \l_tmpa_box { \__metrix_print_symbol: } \begin{tikzpicture} [ remember~picture, baseline=(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base), ] \node [every~metrix~syllable~node] (l__metrix_syllable_node_\int_use:N \l__metrix_process_int) { #1 }; \begin{pgfinterruptboundingbox} \node [every~metrix~symbol~node] (l__metrix_symbol_node_\int_use:N \l__metrix_process_int) at ($ (l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base) + (0,\usemetrixvar{symbolshift}) + (\tl_use:N \l__metrix_internal_itcorrection_tl,0) $) { \box_use:N \l_tmpa_box }; \end{pgfinterruptboundingbox} \end{tikzpicture} \group_end: } \cs_new_protected:Npn \__metrix_print_symbol: { \tl_set:Nx \l__metrix_current_symbol_tl { \seq_item:Nn \l__metrix_symbols_seq { \l__metrix_process_int } } \tl_set:Nx \l__metrix_current_symbol_head_tl { \tl_head:N \l__metrix_current_symbol_tl } \tl_case:NnT \l__metrix_current_symbol_head_tl { \c__metrix_acute_accent_tl { \bool_set_true:N \l__metrix_has_acute_accent_bool } \c__metrix_grave_accent_tl { \bool_set_true:N \l__metrix_has_grave_accent_bool } } { \tl_remove_once:NV \l__metrix_current_symbol_tl \l__metrix_current_symbol_head_tl } \cs_if_exist_use:cF { __metrix_ \tl_use:N \l__metrix_current_symbol_tl _mark: } { \__metrix_error_msg:n { Unknown~symbol~abbreviation~'\tl_use:N \l__metrix_current_symbol_tl'. } } } \cs_new_protected:Npn \__metrix_error_msg:n #1 { \PackageError{ \metrixFileName } { #1 } { Please~take~a~look~at~the~manual~or~send~an~email. } } \cs_new_protected:Npn \__metrix_warning_msg:n #1 { \PackageWarning{ \metrixFileName } { #1 } } \cs_new_protected:Npn \__metrix_align_symbol:n #1 { \group_begin: \cs_set:Npx \__metrix_current_highlight: { \prop_item:NV \l__metrix_highlights_prop \l__metrix_process_int } \expandafter\tikzset\expandafter{\__metrix_current_highlight:} \begin{tikzpicture} [ baseline={(0,-0.25*\usemetrixvar{baseunit})}, ] \node [every~metrix~symbol~node] {#1}; \end{tikzpicture} \group_end: } \cs_new_protected:Npn \__metrix_break_gap: { \hspace{\usemetrixvar{breakgap}} } \cs_new:Npn \__metrix_break_node:n #1 { \group_begin: \cs_set:Npx \__metrix_current_highlight: { \prop_item:NV \l__metrix_highlights_prop \l__metrix_process_int } \expandafter\tikzset\expandafter{\__metrix_current_highlight:} \tikz[baseline=(l__metrix_break_node.base)] \node (l__metrix_break_node) [every~metrix~break~node] { #1 } ; \group_end: } \cs_new_protected:Npn \__metrix_e_gap: { \hspace*{\usemetrixvar{emptywidth}} } \cs_new_protected:Npn \__metrix_evaluate_higlights:n #1 { \prop_clear:N \l__metrix_highlights_prop \clist_map_inline:nn { #1 } { \seq_set_split:Nnn \l__metrix_highlight_seq { = } { ##1 } \seq_set_split:Nnf \l__metrix_highlight_pos_seq { + } { \seq_item:Nn \l__metrix_highlight_seq { 1 } } \seq_map_inline:Nn \l__metrix_highlight_pos_seq { \prop_put:Nnx \l__metrix_highlights_prop { ####1 } { \seq_item:Nn \l__metrix_highlight_seq { 2 } } } } } \xpretocmd { \itshape } { \tl_set_eq:NN \l__metrix_internal_itcorrection_tl \g__metrix_variable_itcorrection_tl } { } { \__metrix_warning_msg:n { Could~not~patch~\string\itshape. } } \xpretocmd { \slshape } { \tl_set_eq:NN \l__metrix_internal_itcorrection_tl \g__metrix_variable_itcorrection_tl } { } { \__metrix_warning_msg:n { Could~not~patch~\string\slshape. } } \xpretocmd { \upshape } { \tl_set_eq:NN \l__metrix_internal_itcorrection_tl \g__metrix_internal_itcorrection_zero_tl } { } { \__metrix_warning_msg:n { Could~not~patch~\string\upshape. } } \xpretocmd { \normalfont } { \tl_set_eq:NN \l__metrix_internal_itcorrection_tl \g__metrix_internal_itcorrection_zero_tl } { } { \__metrix_warning_msg:n { Could~not~patch~\string\normalfont. } } \cs_new:Npn \__metrix_e_mark: { \__metrix_e_gap: } \cs_new:Npn \__metrix_u_mark: { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) arc [start~angle=0, end~angle=180, radius=-0.225]; \bool_if:NT \l__metrix_has_acute_accent_bool { \node at (0.225,0) {\usemetrixvar{acute}}; } \bool_if:NT \l__metrix_has_grave_accent_bool { \node at (0.225,0) {\usemetrixvar{grave}}; } \end{tikzpicture} } \cs_new:Npn \__metrix___mark: { \bool_if:NTF \l__metrix_short_syllable_bool { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) -- ++(0.4,0); \bool_if:NT \l__metrix_has_acute_accent_bool { \node at (0.2,0) {\usemetrixvar{acute}}; } \bool_if:NT \l__metrix_has_grave_accent_bool { \node at (0.2,0) {\usemetrixvar{grave}}; } \end{tikzpicture} } { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) -- ++(0.75,0); \bool_if:NT \l__metrix_has_acute_accent_bool { \node at (0.375,0) {\usemetrixvar{acute}}; } \bool_if:NT \l__metrix_has_grave_accent_bool { \node at (0.375,0) {\usemetrixvar{grave}}; } \end{tikzpicture} } } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix__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} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_v_mark: { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) -- (0.225,-0.225) -- (0.45,0); \end{tikzpicture} } \cs_new:Npn \__metrix_A_mark: { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) -- (0.225,0.225) -- (0.45,0); \end{tikzpicture} } \cs_new:Npn \__metrix_o_mark: { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) circle [radius=0.2]; \end{tikzpicture} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_p_mark: { \begin{tikzpicture}[every~metrix~symbol] \draw (-0.2,-0.2) -- (0.2,0.2); \end{tikzpicture} } \cs_new:Npn \__metrix_s_mark: { \begin{tikzpicture}[every~metrix~symbol] \draw (-0.2,0.2) -- (0.2,-0.2); \end{tikzpicture} } \cs_new:Npn \__metrix_l_mark: { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) -- (0,0.5); \end{tikzpicture} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_l_bigmark: { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0) -- (0,0.8); \end{tikzpicture} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_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} } \cs_new:Npn \__metrix_short_break: { \begin{tikzpicture}[every~metrix~symbol] \draw (0,0.3) -- (0,-0.3); \end{tikzpicture} } \cs_set_eq:NN \__metrix_foot_break: \__metrix_short_break: \NewDocumentCommand{ \setmetrixvar }{ m m } { \tl_if_exist:cTF { g__metrix_variable_#1_tl } { \tl_set:cn { g__metrix_variable_#1_tl } { #2 } } { \__metrix_error_msg:n { Unknown~variable~'#1'. } } } \DeclareExpandableDocumentCommand{ \usemetrixvar }{ m } { \tl_if_exist:cTF { g__metrix_variable_#1_tl } { \tl_use:c { g__metrix_variable_#1_tl } } { \__metrix_error_msg:n { Unknown~variable~'#1'. } } } \NewDocumentCommand { \metrics } { O{} m m } { \__metrix_evaluate_higlights:n { #1 } \__metrix_metrics:nn { #2 } { #3 } } \NewDocumentCommand { \metricsymbols } { s O{} m } { \group_begin: \IfBooleanF { #1 } { \tikzset{every~metrix~symbol/.style={every~metrix~big~symbol}} } \__metrix_evaluate_higlights:n { #2 } \__metrix_metricsymbols:n { #3 } \group_end: } \NewDocumentCommand { \lng } { D(){0,0} O{0pt} m O{0pt} } { \begin{tikzpicture}[ baseline = (l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base), every~metrix~accent ] \node [every~metrix~syllable~node] (l__metrix_syllable_node_\int_use:N \l__metrix_process_int) { #3 }; \begin{pgfinterruptboundingbox} \draw [shorten~< = -#2, shorten~> = -#4] ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.north) - (\usemetrixvar{lngminlength}/2,0) +(\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) + (\tl_use:N \l__metrix_internal_itcorrection_tl,0) + (#1)$) -- ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.north) + (\usemetrixvar{lngminlength}/2,0) +(\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) + (\tl_use:N \l__metrix_internal_itcorrection_tl,0) + (#1)$) ; \draw [shorten~< = -#2, shorten~> = -#4] ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.north~west) +(\usemetrixvar{lngshortening}+\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) + (\tl_use:N \l__metrix_internal_itcorrection_tl,0) + (#1)$) -- ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.north~east) +(-\usemetrixvar{lngshortening}+\usemetrixvar{accentxshift},\usemetrixvar{lngshift}) + (\tl_use:N \l__metrix_internal_itcorrection_tl,0) + (#1)$) ; \end{pgfinterruptboundingbox} \end{tikzpicture}% } \NewDocumentCommand { \brv } { D(){0,0} m } { \begin{tikzpicture}[ baseline = (l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base), every~metrix~accent ] \node [every~metrix~syllable~node] (l__metrix_syllable_node_\int_use:N \l__metrix_process_int) { #2 }; \begin{pgfinterruptboundingbox} \draw ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.north) + (-0.15,0) + (\usemetrixvar{accentxshift},\usemetrixvar{brvshift}) + (\tl_use:N \l__metrix_internal_itcorrection_tl,0) + (#1)$) arc [start~angle=0, end~angle=180, radius=-0.15]; \end{pgfinterruptboundingbox} \end{tikzpicture} } \NewDocumentCommand { \acct } { D(){0,0} m } { \begin{tikzpicture}[ baseline = (l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base), every~metrix~accent ] \node [every~metrix~syllable~node] (l__metrix_syllable_node_\int_use:N \l__metrix_process_int) { #2 }; \begin{pgfinterruptboundingbox} \fill ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.south) + (0,\usemetrixvar{dotshift}) + (#1)$) circle [radius=1.25\pgflinewidth]; \end{pgfinterruptboundingbox} \end{tikzpicture} } \NewDocumentCommand { \bow } { O{0pt} m O{0pt} } { \begin{tikzpicture}[ baseline = (l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base), every~metrix~bow ] \node [every~metrix~syllable~node] (l__metrix_syllable_node_\int_use:N \l__metrix_process_int) { #2 }; \draw [shorten~< = #1, shorten~> = #3] ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base~west)+ (\usemetrixvar{bowshortening},\usemetrixvar{bowshift})$) to [out=-45, in=225,looseness=\usemetrixvar{bowlooseness}] ($(l__metrix_syllable_node_\int_use:N \l__metrix_process_int.base~east)+ (-\usemetrixvar{bowshortening},\usemetrixvar{bowshift})$); \end{tikzpicture} } \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 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 \NewDocumentEnvironment{symbolline} { } { \par\addvspace{\baselineskip} \centering } { \par\vspace{\baselineskip} \noindent\ignorespacesafterend } \cs_new:Npn \__metrix_print_vers_ref:n #1 { \hspace*{\fill}\nolinebreak[1] \quad \hspace*{\fill} \mbox{\footnotesize #1} } \NewDocumentCommand { \verseref } { m } { \__metrix_error_msg:n { \string\verseref\space can~only~be~used~in~{metricverses}~env. } } \NewDocumentEnvironment{metricverses} { } { \RenewDocumentCommand { \verseref } { m } { \__metrix_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 } \endinput %% %% End of file `metrix.sty'.