summaryrefslogtreecommitdiff
path: root/tex/context/third
diff options
context:
space:
mode:
authorPhilipp Gesang <megas.kapaneus@gmail.com>2011-12-08 17:00:03 +0100
committerPhilipp Gesang <megas.kapaneus@gmail.com>2011-12-08 17:00:03 +0100
commit10589ad4c4acc186e582d2a7afcc45f4ef1c2515 (patch)
tree13464b87baa7937a8dcd04452c4cfafdb7b670b0 /tex/context/third
parentd16694611525ab959e8f9f623462276f11c27b47 (diff)
downloadtransliterator-10589ad4c4acc186e582d2a7afcc45f4ef1c2515.tar.gz
macros for conditional expansion (needed e.g. in (lazy) indices)
Diffstat (limited to 'tex/context/third')
-rw-r--r--tex/context/third/transliterator/t-transliterator.mkiv15
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