3

I tried to generate plain TeX cyrillic format files using makefmts.sh script from cyrplain package, here is the content of this script:

#!/bin/sh
tex -ini -fmt=cyrtex -progname=tex cyrtex.ini
tex -ini -fmt=cyramstex -progname=amstex cyramstx.ini
tex -ini -fmt=cyrtexinfo -progname=texinfo cyrtxinf.ini
tex -ini -fmt=cyrblue -progname=tex cyrblue.ini

pdftex -ini -fmt=cyrpdftex -progname=pdftex cyrtex.ini
pdftex -ini -fmt=cyrpdftexinfo -progname=pdftexinfo cyrtxinf.ini

Running the script, i've received these error messages (among others):

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/babel/plain.def
! Illegal parameter number in definition of \@yargdef.
<to be read again>
                   \relax
l.144   \let\@hash@\relax

?
! Illegal parameter number in definition of \@yargdef.
<to be read again>
                   \the
l.149     \edef\reserved@a{\reserved@a\@hash@\the
                                                 \@tempcntb}%
?
! Illegal parameter number in definition of \@yargdef.
<to be read again>
                   \l@ngrel@x
l.152   \l@ngrel@x
                  \expandafter\def\expandafter#1\reserved@a}
?

Here are lines 141-152 from plain.def:

\long\def\@yargdef#1#2#3{%
  \@tempcnta#3\relax
  \advance \@tempcnta \@ne
  \let\@hash@\relax
  \edef\reserved@a{\ifx#2\tw@ [\@hash@1]\fi}%
  \@tempcntb #2%
  \@whilenum\@tempcntb <\@tempcnta
  \do{%
    \edef\reserved@a{\reserved@a\@hash@\the\@tempcntb}%
    \advance\@tempcntb \@ne}%
  \let\@hash@##%
  \l@ngrel@x\expandafter\def\expandafter#1\reserved@a}

Can anyone tell me, please, what went wrong?


Here is the content of cyrtex.log up to the first error:

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (INITEX)  7 JUL 2015 12:56
 restricted \write18 enabled.
 %&-line parsing enabled.
**cyrtex.ini
(/usr/local/texlive/2015basic/texmf-dist/tex/plain/cyrplain/cyrtex.ini
(/usr/local/texlive/2015basic/texmf-dist/tex/plain/cyrplain/cyrtex.tex
(/usr/local/texlive/2015basic/texmf-dist/tex/plain/cyrplain/cyrtex.cfg
(/usr/local/texlive/2015basic/texmf-dist/tex/latex/cyrillic/lcydefs.tex))
(/usr/local/texlive/2015basic/texmf-dist/tex/plain/base/plain.tex
Preloading the plain format: codes, registers,
\maxdimen=\dimen10
\hideskip=\skip10
\centering=\skip11
\p@=\dimen11
\z@=\dimen12
\z@skip=\skip12
\voidb@x=\box10
 parameters,
\smallskipamount=\skip13
\medskipamount=\skip14
\bigskipamount=\skip15
\normalbaselineskip=\skip16
\normallineskip=\skip17
\normallineskiplimit=\dimen13
\jot=\dimen14
\interdisplaylinepenalty=\count23
\interfootnotelinepenalty=\count24
 fonts,
(/usr/local/texlive/2015basic/texmf-dist/tex/plain/cyrplain/cyrcmfnt.tex
fonts, more fonts,)
\itfam=\fam4
\slfam=\fam5
\bffam=\fam6
\ttfam=\fam7
 macros,
\strutbox=\box11
\mscount=\count25
\tabs=\box12
\tabsyet=\box13
\tabsdone=\box14
 math definitions,
\rootbox=\box15
\p@renwd=\dimen15
 output routines,
\headline=\toks10
\footline=\toks11
\footins=\insert254
\topins=\insert253
 hyphenation
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/babel/hyphen.cfg
File: hyphen.cfg Babel hyphens 3.9l <2014/09/25>

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/babel/switch.def
File: switch.def Babel switching mechanism 3.9l <2014/09/25>

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/babel/plain.def
\@tempcnta=\count26
\@tempcntb=\count27
))
\l@english=\language0

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyphen/hyphen.tex)
\l@usenglish=\language0
\l@USenglish=\language0
\l@american=\language0
\l@dumylang=\language1

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyphen/dumyhyph.tex)
\l@nohyphenation=\language2

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyphen/zerohyph.tex)
\l@basque=\language3

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-eu.tex EC Basque hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-eu.tex))
\l@bulgarian=\language4

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-bg.tex T2A Bulgarian hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-t2a.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-bg.tex))
\l@czech=\language5

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-cs.tex EC Czech hyphenation patterns (Pavel Sevecek, v3, 1995)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-cs.tex))
\l@danish=\language6

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-da.tex EC Danish hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-da.tex))
\l@dutch=\language7

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-nl.tex EC Dutch hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-nl.tex))
\l@ukenglish=\language8

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-en-gb.tex ASCII Hyphenation patterns for British English
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-en-gb.tex))
\l@british=\language8
\l@UKenglish=\language8
\l@usenglishmax=\language9

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-en-us.tex ASCII Hyphenation patterns for American English
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-en-us.tex))
\l@finnish=\language10

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-fi.tex EC Finnish hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-fi.tex))
\l@french=\language11

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-fr.tex EC French hyphenation patterns (V2.12, 2002/12/11)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-fr.tex))
\l@patois=\language11
\l@francais=\language11
\l@german=\language12

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-de-1901.tex EC German hyphenation patterns (traditional orthography)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyphen/dehypht.tex
German Traditional Hyphenation Patterns `dehypht' Version 3.2a <1999/03/03>
(Formerly known under the name `ghyph31' and `ghyphen'.)))
\l@ngerman=\language13

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-de-1996.tex EC German hyphenation patterns (reformed orthography)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyphen/dehyphn.tex
New German Hyphenation Patterns `dehyphn' Rev.31 <2001-05-07> (WaS)))
\l@swissgerman=\language14

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-de-ch-1901.tex
EC Swiss-German hyphenation patterns (traditional orthography)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-de-ch-1901.tex
Swiss-German Hyphenation Patterns (Traditional Orthography) `dehyphts-x' 2014-0
5-21 (WL)))
\l@hungarian=\language15

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-hu.tex EC Hungarian hyphenation patterns (v20110815)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-hu.tex Huhyphn - hungarian hyphenation patterns v20110815))
\l@italian=\language16

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-it.tex ASCII Italian hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-it.tex))
\l@mongolian=\language17

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-mn-cyrl.tex T2A (New) Mongolian hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-t2a.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-mn-cyrl.tex))
\l@mongolianlmc=\language18

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-mn-cyrl-x-lmc.tex LMC Mongolian hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-lmc.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-mn-cyrl-x-lmc.tex))
\l@bokmal=\language19

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-nb.tex EC Norwegian Bokmal hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-nb.tex
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-no.tex)))
\l@norwegian=\language19
\l@norsk=\language19
\l@nynorsk=\language20

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-nn.tex EC Norwegian Nynorsk hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-nn.tex
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-no.tex)))
\l@polish=\language21

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-pl.tex QX Polish hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-qx.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-pl.tex))
\l@portuguese=\language22

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-pt.tex EC Portuguese hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-pt.tex))
\l@portuges=\language22
\l@brazil=\language22
\l@brazilian=\language22
\l@russian=\language23

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-ru.tex T2A Russian hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ruhyphen/ruhyphen.tex
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ruhyphen/catkoi.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ruhyphen/koi2lcy.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ruhyphen/ruhyphal.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ruhyphen/cyryoal.tex)))
\l@serbian=\language24

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-sr-latn.tex EC Serbian hyphenation patterns in Latin script
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-sh-latn.tex))
\l@serbianc=\language25

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-sr-cyrl.tex T2A Serbian hyphenation patterns in Cyrillic script
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-t2a.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-sh-cyrl.tex))
\l@spanish=\language26

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-es.tex EC Spanish hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-es.tex))
\l@espanol=\language26
\l@swedish=\language27

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-sv.tex EC Swedish hyphenation patterns (Jan Michael Rynning, 1994-03-03)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/conversions/conv
-utf8-ec.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyp
h-sv.tex))
\l@ukrainian=\language28

(/usr/local/texlive/2015basic/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyp
h-uk.tex T2A Ukrainian hyphenation patterns
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ukrhyph/ukrhyph.tex
Ukrainian hyphenation patterns in lcy encoding
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ukrhyph/catlcy.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ukrhyph/lcy2lcy.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ukrhyph/ukrhypmp.tex)))))
(/usr/local/texlive/2015basic/texmf-dist/tex/plain/cyrplain/txxextra.tex)
(/usr/local/texlive/2015basic/texmf-dist/tex/plain/cyrplain/plainenc.tex
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/babel/plain.def
! Illegal parameter number in definition of \@yargdef.
<to be read again>
                   \relax
l.144   \let\@hash@\relax

? q
OK, entering \batchmode...
  • wow! do you actually use all those languages? – erreka Jul 8 '15 at 3:16
  • I just tried to follow instructions from cyrplain. – Alexey Jul 8 '15 at 7:36
5

The file plainenc.tex loads plain.def from babel, but this has already been read as part of the generic hyphenation loader. The file plain.def can be loaded multiple times unless \@yargdef has been executed between those two points. What happens is that \@yargdef does \let\@hash@##, and this means that on the second reading you can't use \@hash@ inside the defintion of \@yargdef. This can be fixed by adding

\let\@hash@\relax

somewhere convenient.

This is arguably a bug in plain.def.

  • I haven't traced through where \@yargdef gets used! – Joseph Wright Jul 7 '15 at 12:59
  • Could you please explain where you mean \let\@hash@\relax should be added? – Alexey Jul 7 '15 at 13:04
  • @Alexey Probably easiest would be to use a copy of plainenc.tex and add it right before \input plain.def. – Joseph Wright Jul 7 '15 at 13:08
  • 1
    plain.def is a component of babel and it is not intended to be loaded separately. No provision has been made for it to work in other contexts. Anyway, I'll have a look at it. – Javier Bezos Jul 7 '15 at 14:24
  • isn't the bug rather in cyrtex.ini, trying to load plain.def again? – erreka Jul 8 '15 at 3:15
4

Since the bug is in \@yargdef, it can be fixed by patching this macro as follows:

\gdef\@my@aaa{*}
\ifx\@my@aaa\@my@bbb
 \immediate\write16{skip redefining yargdef}
\else%
 \gdef\@my@bbb{*}%
 %%--- the original code of \@yargdef goes here ---%%
\fi%

I have ready-to-use solutions with cyrillic (russian) Plain TeX, AmSTeX, and LaTeX 2.09 in MiKTeX 2.4 and in MiKTeX 2.9. They are equipped with step-by-step instructions in Russian and are free for downloading.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.