summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-06 21:58:15 +0000
committerKarl Berry <karl@freefriends.org>2021-03-06 21:58:15 +0000
commit974640d66e61e81cb197ad96fdff7b08343e4c5a (patch)
tree2e1f75f32f312b7f24ba82b4590ae230bcd6f399 /Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl
parentb4fa72e61230aca75f7f6fbf988821f71edfb6b2 (diff)
context
git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl')
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl55
1 files changed, 55 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl b/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl
new file mode 100644
index 00000000000..3881d929e1c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl
@@ -0,0 +1,55 @@
+%D \module
+%D [ file=attr-alt,
+%D version=2007.06.06,
+%D title=\CONTEXT\ Attribute Macros,
+%D subtitle=Alternates,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Attribute Macros / Alternates}
+
+\registerctxluafile{attr-alt}{autosuffix}
+
+%D The main reason for providing this is that we need to make sure we have no
+%D dangling end markers when we cross a page. Public viewers don't seem to support
+%D actual text at all and acrobat has some funny selection issues.
+%D
+%D \starttyping
+%D test
+%D \startalternate[text={A}]
+%D \dorecurse{10}{A }
+%D \startalternate[text={B}]
+%D \dorecurse{10}{B }
+%D \stopalternate
+%D \dorecurse{10}{A }
+%D \stopalternate
+%D test \par
+%D \stoptyping
+%D
+%D \starttyping
+%D test \startalternate[text={e=mc^2}]!$e=mc^2$\stopalternate\par
+%D test \alternate{e=mc^2}{copy:}\nbsp$e=mc^2$\par
+%D \stoptyping
+
+\unprotect
+
+\permanent\protected\def\startalternate[#1]% maybe better/also: [text={...}]
+ {\begingroup
+ \getdummyparameters[\c!text=,#1]%
+ \clf_setalternate text {\dummyparameter\c!text}\relax}
+
+\permanent\protected\def\stopalternate
+ {\endgroup}
+
+\permanent\protected\def\alternate#1%
+ {\groupedcommand{\clf_setalternate text {#1}\relax}{}}
+
+\permanent\protected\def\setalternate #1{\clf_setalternate text {#1}\relax}
+\permanent\protected\def\resetalternate {\clf_resetalternate}
+
+\protect \endinput