diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-05 21:15:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-05 21:15:48 +0000 |
commit | 37802572d3b3b4ef8329d44629fb01a4ee98d9b3 (patch) | |
tree | f9940140bc5aa453bdb430f7d54e79ba73bea320 /Master/texmf-dist/tex/latex/metrix | |
parent | a9bf24cfbe9b0730dd6e4a4023496aa9505327bc (diff) |
metrix (5may19)
git-svn-id: svn://tug.org/texlive/trunk@51012 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/metrix')
-rw-r--r-- | Master/texmf-dist/tex/latex/metrix/metrix.sty | 131 |
1 files changed, 105 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/latex/metrix/metrix.sty b/Master/texmf-dist/tex/latex/metrix/metrix.sty index b6923b854cf..6148ee53202 100644 --- a/Master/texmf-dist/tex/latex/metrix/metrix.sty +++ b/Master/texmf-dist/tex/latex/metrix/metrix.sty @@ -20,7 +20,7 @@ %% 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-2015 Tobias Weh +%% 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 @@ -44,8 +44,8 @@ } \def\metrixFileName{metrix} \def\metrixFileDescription{Typset prosody/metric symbols.} -\def\metrixFileDate{2016/03/21} -\def\metrixFileVersion{1.3} +\def\metrixFileDate{2019/05/05} +\def\metrixFileVersion{1.4} \ProvidesExplPackage {\metrixFileName}{\metrixFileDate}{\metrixFileVersion}{\metrixFileDescription} \RequirePackage{xparse} @@ -54,6 +54,26 @@ \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 @@ -97,11 +117,11 @@ \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 { black } +\tl_set:Nn \g__metrix_variable_symbolcolor_tl { . } \tl_new:N \g__metrix_variable_accentcolor_tl -\tl_set:Nn \g__metrix_variable_accentcolor_tl { black } +\tl_set:Nn \g__metrix_variable_accentcolor_tl { . } \tl_new:N \g__metrix_variable_bowcolor_tl -\tl_set:Nn \g__metrix_variable_bowcolor_tl { black } +\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 @@ -112,24 +132,15 @@ \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 \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 \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 } } @@ -331,16 +342,32 @@ } \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_\seq_item:Nn \l__metrix_symbols_seq - { \l__metrix_process_int }_mark: + __metrix_ + \tl_use:N \l__metrix_current_symbol_tl + _mark: } { \__metrix_error_msg:n { - Unknown~symbol~abbreviation~'\seq_item:Nn - \l__metrix_symbols_seq { \l__metrix_process_int }'. + Unknown~symbol~abbreviation~'\tl_use:N \l__metrix_current_symbol_tl'. } } } @@ -374,7 +401,6 @@ { \hspace{\usemetrixvar{breakgap}} } - \cs_new:Npn \__metrix_break_node:n #1 { \group_begin: @@ -387,7 +413,6 @@ ; \group_end: } - \cs_new_protected:Npn \__metrix_e_gap: { \hspace*{\usemetrixvar{emptywidth}} @@ -459,6 +484,14 @@ { \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: @@ -467,11 +500,27 @@ { \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} } } @@ -526,6 +575,24 @@ \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] @@ -550,6 +617,18 @@ 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] |