What is the ConTeXt way to handle this \vbox trick?
Dear gang, Consider the following MWE (for a sequential multiple-choice exam), using some old and ugly TeX code: ======= \setupbodyfont[schola] \noheaderandfooterlines \setupwhitespace[big] \def\CHOICE#1#2{\leavevmode\vbox{\tabskip=0pt\everycr={} \halign{\strut\hfil##\hfil\cr#1\cr#2\cr}}} \starttext (Religion * Biology * Cosmology * Physics) is part of the subject matter of World Philosophies. (Religion * Biology * Cosmology * Physics) is part of the subject matter of World Philosophies. (\CHOICE{1}{Religion}\ * \CHOICE{X}{Biology} * \CHOICE{2}{Cosmology}\ * \CHOICE{X}{Physics}) is part of the subject matter of World Philosophies. \stoptext ======= Result is attached. Question: What is the most elegant ConTeXt way to get the same result as the above code, with equal or better control? Thank you in advance. Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
On 5/8/2021 10:05 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
Dear gang,
Consider the following MWE (for a sequential multiple-choice exam), using some old and ugly TeX code:
======= \setupbodyfont[schola] \noheaderandfooterlines \setupwhitespace[big]
\def\CHOICE#1#2{\leavevmode\vbox{\tabskip=0pt\everycr={} \halign{\strut\hfil##\hfil\cr#1\cr#2\cr}}}
\starttext (Religion * Biology * Cosmology * Physics) is part of the subject matter of World Philosophies.
(Religion * Biology * Cosmology * Physics) is part of the subject matter of World Philosophies.
(\CHOICE{1}{Religion}\ * \CHOICE{X}{Biology} * \CHOICE{2}{Cosmology}\ * \CHOICE{X}{Physics}) is part of the subject matter of World Philosophies. \stoptext =======
Result is attached. Question:
What is the most elegant ConTeXt way to get the same result as the above code, with equal or better control? Thank you in advance. you can use some old, probaly never really used, mechanism ...
\defineruby[auto] [align=auto,color=darkred] \defineruby[left] [align=flushleft,color=darkred] \defineruby[right] [align=flushright,color=darkred] \defineruby[spread][stretch=yes] \setupinterlinespace[22pt] \starttext \startbuffer \dorecurse{20}{\ruby{XYZ}{a|bc|d} }\par \dorecurse{20}{\ruby{PQR}{p|q|r} }\par \dorecurse{20}{\ruby{XYZ}{1|22|333} }\par \dorecurse{20}{\ruby{XYZ}{111|222|333} }\par \dorecurse{20}{\ruby{XYZ}{foobar} }\par \dorecurse{20}{\ruby{XYZ}{fooledbar} }\par \dorecurse{20}{\ruby[spread]{XYZ}{fooledbar} }\par \dorecurse{20}{\ruby{extremely}{wide} }\par \dorecurse{20}{\ruby{wide}{extremely} }\par stopbuffer \testfeatureonce{1}{\start \setupinterlinespace[16pt] \setupruby[location=none] \getbuffer \stop \page} \testfeatureonce{1}{\start \setupinterlinespace[16pt] \setupruby[location=right] \getbuffer \stop \page} \testfeatureonce{1}{\start \setupinterlinespace[28pt] \setupruby[align=auto,color=darkred] \getbuffer \stop \page} \testfeatureonce{1}{\start \setupinterlinespace[28pt] \setupruby[align=flushleft,color=darkgreen] \getbuffer \stop \page} \testfeatureonce{1}{\start \setupinterlinespace[28pt] \setupruby[align=flushright,color=darkblue] \getbuffer \stop \page} \testfeatureonce{1}{\start \setupinterlinespace[28pt] \setupruby[align=middle,color=darkyellow] \getbuffer \stop \page} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Idris Samawi Hamid ادريس سماوي ح امد