Bug#840700: g-brief2: 'Command \c@blockzahl already defined' on multiple inclusions
Dear Michael,
here at Debian we got a bug report for g-brief2 concerning multiple letters
in the same document, and a very simple fix for it.
Could you please check that and maybe upload a new package to CTAN?
Thanks a lot
Norbert
On Fri, 14 Oct 2016, Julius Seemayer wrote:
> Hi,
>
>
> g-brief2 currently does not support multiple inclusions. This would be helpful
> for bulk letters and is trivial to fix.
>
> Reproducing the issue:
>
> > $ cat simple.tex
> > \documentclass[ngerman]{g-brief2}
> > \Gruss {}{1cm} % this can't be left out due to a potential another bug
> > \begin{document}
> >
> > \begin{g-brief}
> > page one
> > \end{g-brief}
> >
> > %\newpage
> > %\begin{g-brief}
> > %page two
> > %\end{g-brief}
> >
> > \end{document}
> > $ pdflatex simple.tex; echo $?
> > ...
> > 0
> > $ sed -i 's/^%//' simple.tex
> > $ cat simple.tex
> > \documentclass[ngerman]{g-brief2}
> > \Gruss {}{1cm} % this can't be left out due to a potential another bug
> > \begin{document}
> >
> > \begin{g-brief}
> > page one
> > \end{g-brief}
> >
> > \newpage
> > \begin{g-brief}
> > page two
> > \end{g-brief}
> >
> > \end{document}
> > $ pdflatex simple.tex; echo $?
> > ...
> >
> > ! LaTeX Error: Command \c@blockzahl already defined.
> > Or name \end... illegal, see p.192 of the manual.
> >
> > See the LaTeX manual or LaTeX Companion for explanation.
> > Type H <return> for immediate help.
> > ...
> >
> > l.14 \end{document}
> >
> > ? ^\Quit
> > 131
> > $
>
> A trivial patch ensures that the counter is not defined multiple times and
> reset if needed:
>
> > --- /usr/share/texlive/texmf-dist/tex/latex/g-brief/g-brief2.cls 2016-10-13 23:10:26.630778157 +0200
> > +++ /usr/share/texlive/texmf-dist/tex/latex/g-brief/g-brief2.cls 2016-10-13 23:10:31.726871803 +0200
> > @@ -333,7 +333,7 @@
> > \unitlength1mm
> > \begin{picture}(0,0)
> > \put(-9,0){\parbox{180mm}{
> > - \tiny \newcounter{blockzahl} \def\@blockbreite{170mm}
> > + \tiny \ifdef{\theblockzahl}{\setcounter{blockzahl}{0}}{\newcounter{blockzahl}} \def\@blockbreite{170mm}
> > \iftrennlinien \rule{180mm}{0.5pt} \fi
> > \ifthenelse{
> > \equal{\namezeilea}{\empty} \and \equal{\namezeileb}{\empty} \and
>
> Please include that patch. Thanks!
>
>
> All the best,
>
> Julius
>
--
PREINING Norbert + TeX Live & Debian Developer + http://www.preining.info
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
Reply to: