From 974640d66e61e81cb197ad96fdff7b08343e4c5a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 6 Mar 2021 21:58:15 +0000 Subject: context git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/context/base/mkxl/attr-alt.mkxl | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl (limited to 'Master/texmf-dist/tex/context/base/mkxl/attr-alt.mkxl') 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 -- cgit v1.2.3