Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

!Undefined control sequence in a NOWEB document

96 views
Skip to first unread message

Sergio Spina

unread,
Aug 29, 2012, 4:43:55 PM8/29/12
to
I'm writing a TeX-noweb document. I compile it with

noweave -tex -filter "elide comment" texcode.nw > documentation.tex

but when I try to compile the resulting file with

xetex -halt-on-error documentation.tex

I obtain the following error message

! Undefined control sequence.
<argument> ...on}\endmoddef \nwstartdeflinemarkup
\nwenddeflinemarkup

It seems that `\nwenddeflinemarkup` is not recognized. If i delete from the document all the sequences

\nwstartdeflinemarkup\nwenddeflinemarkup

the document compile without exceptions.

What can be the problem?

Norman Ramsey

unread,
Aug 29, 2012, 4:47:08 PM8/29/12
to
On Wednesday, August 29, 2012 4:43:58 PM UTC-4, Sergio Spina wrote:
> I'm writing a TeX-noweb document.

It may have been a long time since anyone used noweb with plain TeX and not latex. Send me a short .nw file that exhibits the problem and I'll see if I can reproduce it.


Norman

Sergio Spina

unread,
Aug 30, 2012, 5:12:05 AM8/30/12
to
Many thanks.

Now comes a short test file (atest.nw), commands in the terminal, the derived file doc.tex, the xetex command in the terminal, the final file doc.log with the error message "Undefined control sequence."

System: Linux Mint 13 Maya

file atest.nw
>-------------<

\def\title#1{{\font\zzz=cmr7 scaled \magstep4
\vbox{\hrule\bigskip\centerline{\zzz#1}\bigskip\hrule}}}

@ \title{A TEST}\vskip.5in

\centerline{\it Lorem ipsum adequesque introitat qui eiusmod loquavit.}\break

\chapter{Introduction}
I wrote this format just for a test, taking inspiration from `[[lola.dtx]]' by
John Delmonte and from `[[samantha.dtx]]' by Betty Curtis.

\section{Usage.} To load the format specify [[\input atest]] into
your document.

\chapter{The code}

<<comment>>=
Now comes another piece of the well-known ``Lorem Ipsum'' words flow. Lorem
ipsum est juris vinculum quod necessitate advertimus secundum nostra civitate
legis.

@ Almost every \TeX\ program begins with more or less the same
introductory things.
\bigskip
Version informations in a comfortable place.
<<version>>=
\def\version{2} \def\revision{3} \def\revisiondate{2012/08/28}

@ The sign `@' for the private macros.
<<@ catcode>>=
\chardef\OldAtCatCode=\the\catcode`@
\catcode`@=11

@ Messages form the format to the [[.log]] file. It's nice to let them start
all on a new line.
<<@message>>=
\def\@message#1{{\newlinechar=`§\message{§ATEST.TEX : #1 ::| }}}

@ The first cry of this TeX child.
<<hello world>>=
\@message{Version \version.\revision\space -- revision \revisiondate}

@ Layout definitions
<<layout>>=
\hsize=6in
\vsize=8in
\hoffset=1.5in
\voffset=-.5in

@ That's all.
<<goodbye>>=
\endinput

<<atest.tex>>=
<<version>>
<<@ catcode>>
<<@message>>
<<hello world>>
<<layout>>
<<goodbye>>

\bye

>-------------<

Commands in the terminal
>-------------<

$ notangle -Ratest.tex atest.nw > atest.tex
$ noweave -tex -filter "elide comment" atest.nw > doc.tex

>-------------<

file doc.tex
>-------------<

\input nwmac \nwfilename{atest.nw}\nwbegindocs{0}\nwdocspar% ===> this file was generated automatically by noweave --- better not edit it
\def\title#1{{\font\zzz=cmr7 scaled \magstep4
\vbox{\hrule\bigskip\centerline{\zzz#1}\bigskip\hrule}}}

\nwenddocs{}\nwbegindocs{1}\title{A TEST}\vskip.5in

\centerline{\it Lorem ipsum adequesque introitat qui eiusmod loquavit. Ite autem in culum facere.}\break

\chapter{Introduction}
I wrote this format just for a test, taking inspiration from `{\Tt{}lola.dtx\nwendquote}' by
John Delmonte and from `{\Tt{}samantha.dtx\nwendquote}' by Betty Curtis.

\section{Usage.} To load the format specify {\Tt{}{\nwbackslash}input\ atest\nwendquote} into
your document.

\chapter{The code}

\nwenddocs{}%
%
%
%
%
\nwbegindocs{3}Almost every \TeX\ program begins with more or less the same
introductory things.
\bigskip
Version informations in a comfortable place.
\nwenddocs{}\nwbegincode{4}\moddef{version}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup
\\def\\version\{2\} \\def\\revision\{3\} \\def\\revisiondate\{2012/08/28\}

\nwendcode{}\nwbegindocs{5}The sign `@' for the private macros.
\nwenddocs{}\nwbegincode{6}\moddef{@ catcode}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup
\\chardef\\OldAtCatCode=\\the\\catcode`@
\\catcode`@=11

\nwendcode{}\nwbegindocs{7}Messages form the format to the {\Tt{}.log\nwendquote} file. It's nice to let them start
all on a new line.
\nwenddocs{}\nwbegincode{8}\moddef{@message}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup
\\def\\@message#1\{\{\\newlinechar=`§\\message\{§ATEST.TEX : #1 ::| \}\}\}

\nwendcode{}\nwbegindocs{9}The first cry of this TeX child.
\nwenddocs{}\nwbegincode{10}\moddef{hello world}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup
\\@message\{Version \\version.\\revision\\space -- revision \\revisiondate\}

\nwendcode{}\nwbegindocs{11}Layout definitions
\nwenddocs{}\nwbegincode{12}\moddef{layout}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup
\\hsize=6in
\\vsize=8in
\\hoffset=1.5in
\\voffset=-.5in

\nwendcode{}\nwbegindocs{13}That's all.
\nwenddocs{}\nwbegincode{14}\moddef{goodbye}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup
\\endinput

\nwendcode{}\nwbegincode{15}\moddef{atest.tex}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup
\LA{}version\RA{}
\LA{}@ catcode\RA{}
\LA{}@message\RA{}
\LA{}hello world\RA{}
\LA{}layout\RA{}
\LA{}goodbye\RA{}

\\bye
\nwendcode{}\bye

>-------------<

Command in the terminal
>-------------<

$ xetex -halt-on-error doc.tex

>-------------<

file doc.log
>-------------<

This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012) (format=xetex 2012.7.8) 30 AUG 2012 10:43
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**doc.tex
(./doc.tex (/home/sam/texmf/tex/plain/misc/nwmac.tex
\textsize=\dimen16
\codehsize=\dimen17
\codemargin=\dimen18
\nwdefspace=\dimen19
\equivbox=\box16
\plusequivbox=\box17
\cont=\write0
\listlevel=\count28
\itemwidth=\dimen20
) [1
\openout0 = `doc.toc'.

] [Introduction]
[Usage.] [2] [The code]
! Undefined control sequence.
<argument> ...on}\endmoddef \nwstartdeflinemarkup
\nwenddeflinemarkup
\bchack #1^^M->\relax #1

l.27 ...ef\nwstartdeflinemarkup\nwenddeflinemarkup

Output written on doc.pdf (2 pages).

>-------------<

Sergio

Sergio Spina

unread,
Aug 30, 2012, 11:32:12 AM8/30/12
to
Hi Norman.

Sifting through the code I found that \nwstartdeflinemarkup and \nwenddeflinemarkup are defined in noweb.sty (LaTeX support for noweb) but not in nwmac.tex (plain TeX support for noweb).

If i call noweave with the option "-tex" it wraps the noweb code into a TeX casing with a "\input nwmac.tex" as first instruction.

Maybe this is the root of the problem.

Regards.
0 new messages