Define tex macro on the context command line
Hi, Is it possible to define a tex macro on the context command line (MkII)? For example: texexec manual.tex --define Title "X99 Operators Manual" so that \Title would expand to the appropriate text? (I know about modes I think) -- John Devereux
On Wed, 11 Nov 2009, John Devereux wrote:
Hi,
Is it possible to define a tex macro on the context command line (MkII)?
For example:
texexec manual.tex --define Title "X99 Operators Manual"
so that
\Title
would expand to the appropriate text?
You can do that with pdftex command, pdftex -progname=context -fmt=cont-en -translate-file=natural.tcx --output-format=pdf --8bit --jobname=filename "\\def\\Title{whatever} \\input filename" but you loose all the goodies of texexec (multiple runs, running bibtex, sorting index, etc.) Alternatively, it is possible to read from console during a tex run \starttext \immediate\write16{What is the title?} \read16 to \Title Title is \Title \stoptext Aditya
Aditya Mahajan wrote:
On Wed, 11 Nov 2009, John Devereux wrote:
Hi,
Is it possible to define a tex macro on the context command line (MkII)?
For example:
texexec manual.tex --define Title "X99 Operators Manual"
so that
\Title
would expand to the appropriate text?
You can do that with pdftex command,
pdftex -progname=context -fmt=cont-en -translate-file=natural.tcx --output-format=pdf --8bit --jobname=filename "\\def\\Title{whatever} \\input filename"
but you loose all the goodies of texexec (multiple runs, running bibtex, sorting index, etc.)
Alternatively, it is possible to read from console during a tex run
\starttext \immediate\write16{What is the title?} \read16 to \Title Title is \Title \stoptext
\starttext test: \env{whatever} \stoptext context --arguments="whatever=Test" ... ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, Nov 11 2009, John Devereux wrote:
Is it possible to define a tex macro on the context command line (MkII)?
Hello, I don't know, if there is something similar in MKII, but with MKIV, the following works very nicely: file.tex: \starttext Value of Title: “\getvariable{environment}{Title}” \stoptext Command line: context "--arguments=Title=X99 Operators Manual" file Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
John Devereux
-
Peter Münster