Commits

Philipp Gesang  committed bad9807

[examples] further Context demo

  • Participants
  • Parent commits 27cd630

Comments (0)

Files changed (2)

File doc/context/third/enigma/examples/enigma-example-context.tex

 \usetypescript [iwona]
 \setupbodyfont [iwona,20pt]
 
+\defineenigma [nilsettings]
+\setupenigma  [nilsettings] [ %% a machine with vanilla settings
+  other_chars = no,
+  day_key = B I II III 01 01 01,
+  rotor_setting = aaa,
+  verbose = 3,
+]
+
+\defineenigma [othernilsettings] [nilsettings]
+
 \defineenigma [secretmessage]
 \setupenigma  [secretmessage] [
   other_chars = yes,
 
 \starttext
 
+\placefigure{Enigma output and its reversal using nil settings}{
+  \framed [width=.7\hsize,frame=off,align=middle]{
+    \startnilsettings
+      aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aa
+    \stopnilsettings
+
+    \startothernilsettings
+      bdzgo wcxlt ksbtm cdlpb muqof xyhcx tgyjf linhn xs
+    \stopothernilsettings
+  }
+}
+
 \startsecretmessage
   føo bąr baž
 \stopsecretmessage

File tex/context/third/enigma/t-enigma.mkvi

 
 \def\do_do_define_enigma#id{%
   \edef\enigmaid{#id}%
-  \expandafter\gdef\csname start\enigmaid\endcsname{%
+  \expandafter\gdef\csname \v!start\enigmaid\endcsname{%
     \endgraf
     \bgroup
     \ctxlua{
     }%
   }%
   %
-  \expandafter\gdef\csname stop\enigmaid\endcsname{%
+  \expandafter\gdef\csname \v!stop\enigmaid\endcsname{%
     \endgraf%% We need to force a paragraph here for the callback to be
             %% applied.
     \ctxlua{