diff options
author | Philipp Gesang <megas.kapaneus@gmail.com> | 2011-12-08 17:00:03 +0100 |
---|---|---|
committer | Philipp Gesang <megas.kapaneus@gmail.com> | 2011-12-08 17:00:03 +0100 |
commit | 10589ad4c4acc186e582d2a7afcc45f4ef1c2515 (patch) | |
tree | 13464b87baa7937a8dcd04452c4cfafdb7b670b0 | |
parent | d16694611525ab959e8f9f623462276f11c27b47 (diff) | |
download | transliterator-10589ad4c4acc186e582d2a7afcc45f4ef1c2515.tar.gz |
macros for conditional expansion (needed e.g. in (lazy) indices)
-rw-r--r-- | tex/context/third/transliterator/t-transliterator.mkiv | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tex/context/third/transliterator/t-transliterator.mkiv b/tex/context/third/transliterator/t-transliterator.mkiv index 2ff4736..e9510e0 100644 --- a/tex/context/third/transliterator/t-transliterator.mkiv +++ b/tex/context/third/transliterator/t-transliterator.mkiv @@ -146,18 +146,17 @@ \unexpanded\def\transliterate{\dosingleempty\dotransliterate} -\def\expandabletransliterate[#1]#2{% +\def\expandabletransliterate#1{% %\bgroup %\setuptransliterate[#1]% %\language[\transliterateparameter{hyphenate}]% \ctxlua{ thirddata.translit.deficient_font = "\transliterateparameter{deficient_font}" - thirddata.translit.transliterate("\transliterateparameter{mode}","#2") + thirddata.translit.transliterate("\transliterateparameter{mode}","#1") }% %\egroup% } - \unexpanded\def\starttransliterate{% \bgroup% \dosingleempty\dostarttransliterate% @@ -174,6 +173,16 @@ \egroup% } +\newconditional\transliterate_useexpanded \setfalse\transliterate_useexpanded + +\def\transliterate_conditional[#1]#2{% + \ifconditional\transliterate_useexpanded + \transliterate[#1]{#2}% + \else + \expandabletransliterate{#2}% + \fi% +} + \protect \endinput % vim:ft=context |