0

I read many posts but I found nothing.

I have a legacy project which I used to run in an old ubuntu 14 with its tex packages. Now, I want to rebuild the old project with a modern texlive suite (archlinux). The problem is the amount of code, impossible to put a small snippet to show you.

This is the minimal example of using my "legacy library".

\documentclass[twoside,a4paper,12pt]{article}
\input{/mnt/repositories/latex/latex-my/imports/latex-doc/headers_begin.tex}
\setlang{en}
\renewcommand{\docOwner}{owner}
\renewcommand{\docDate}{TODAY}
\renewcommand{\docVersion}{version}
\renewcommand{\docEmail}{email}
\renewcommand{\docTitle}{title}
\newcommand{\docAuthors}{authors}
\renewcommand{\docCopyright}{2016-2017}
\renewcommand{\docListingFont}{dejavu}
\renewcommand{\structnextlength}{\shortnext}
\renewcommand{\tocWithContents}{book}
\renewcommand{\tocWithTables}{simple}
\renewcommand{\tocWithFigures}{simple}
\renewcommand{\tocWithListings}{book}
\renewcommand{\tocWithInject}{book}
\renewcommand{\tocWithInjectAck}{book}
\renewcommand{\tocWithInjectSummary}{book}
\renewcommand{\tocWithTitle}{blank}
\renewcommand{\tocWithSpace}{book}
\renewcommand{\headersLayout}{normal}
\renewcommand{\docHeader}{header}
\renewcommand{\snippets}{styled}
\input{/mnt/repositories/latex/latex-my/imports/latex-doc/headers_end.tex}
\begin{document}
\setlang{en}
\begin{primary}[Introduction]{Introduction}
\label{sec-4}
\phantomsection
The introduction.
\end{primary}\clearpage
\end{document}

It depends if I set \setLang{en} or \setLang{es}, I get two different errors:

With \setLang{en}

❯ pdflatex semi.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Arch Linux) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./semi.tex
LaTeX2e <2016/03/31> patch level 3

... I need to cut some lines because of stackexchange limits...

(/usr/share/texmf-dist/tex/latex/eso-pic/eso-pic.sty)
(/usr/share/texmf-dist/tex/latex/pdfpages/pppdftex.def)))

Package csquotes Warning: Load 'inputenc' before 'csquotes' on input line 26.

(./semi.aux) (/usr/share/texmf-dist/tex/latex/pxfonts/omlpxmi.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/omspxsy.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/omxpxex.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxexa.fd)
(/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/t1pxr.fd)
(/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/ucs/ucsencs.def)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
ABD: EveryShipout initializing macros
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(/usr/share/texmf-dist/tex/generic/oberdiek/se-pdfdoc.def)
(/usr/share/texmf-dist/tex/generic/oberdiek/se-utf8.def)
(/usr/share/texmf-dist/tex/latex/fmtcount/fc-spanish.def)
! Undefined control sequence.
\fc@orddef@ult #1->\fc@textsuperscript
                                       {#1}
l.26 \begin{document}

? q
OK, entering \batchmode%

With \setLang{es}

❯ pdflatex semi.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Arch Linux) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./semi.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size12.clo))
(/mnt/repositories/latex/latex-my/imports/latex-doc/headers_begin.tex
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty)

... I need to cut some lines because of stackexchange limits...

) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/ucs/ucsencs.def)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
ABD: EveryShipout initializing macros
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(/usr/share/texmf-dist/tex/generic/oberdiek/se-pdfdoc.def)
(/usr/share/texmf-dist/tex/generic/oberdiek/se-utf8.def)
(/usr/share/texmf-dist/tex/latex/pxfonts/ot1pxr.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxmia.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxsya.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxsyb.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxsyc.fd)
! Missing \endcsname inserted.
<to be read again>
                   \<let>-command
l.26 \begin{document}

Any clue how to debug the error here? Any guess from the output/log/error messages? I am completely lost with this type of debugging info.

I tried comment some "\input" that I have in the legacy library, but some parts are related to others and is hard as hell to "remove parts".

Is there any type of backtrace mechanism to find the original line of my library that is creating this errors at the beginning? Or at least the package (amsmath, etc).

Update 07/04/2017

More info with the \tracingall (last lines):

\@empty ->
{\noexpand}

\@gobble #1->
#1<-\getrefbykeydefault {##1}{}{??}

\def #1#2{->\<def>-command \expandafter \noexpand \csname \expandafter \@gobble
 \string #1\@empty \endcsname \@gobble {
#1<-\pageref
#2<-##1
{\expandafter}
{\csname}
{\expandafter}
{\string}

\@gobble #1->
#1<-\

\@empty ->
{\noexpand}

\@gobble #1->
#1<-\getrefbykeydefault {##1}{page}{0}

\NROrg@ifthenelse #1#2#3->\let \bbl@temp@pref \pageref \let \pageref \org@pager
ef \let \bbl@temp@ref \ref \let \ref \org@ref \@safe@activestrue \org@ifthenels
e {#1}{\let \pageref \bbl@temp@pref \let \ref \bbl@temp@ref \@safe@activesfalse
 #2}{\let \pageref \bbl@temp@pref \let \ref \bbl@temp@ref \@safe@activesfalse #
3}
#1<-\equal {\docSubtitle }{}
#2<- \large {\ }\\
#3<- \large {\docSubtitle }\\

\let #1->\expandafter \expandafter \expandafter \HyPsd@@LetCommand \expandafter
 \expandafter \expandafter {\expandafter \@gobble \string #1\@empty }
#1<-\bbl@temp@pref
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\string}
{\expandafter}
{\expandafter}

\@gobble #1->
#1<-\

\HyPsd@@LetCommand #1->\expandafter \ifx \csname #1\expandafter \endcsname \csn
ame iftrue\endcsname \pdfstringdefWarn \let \expandafter \@gobble \else \expand
after \ifx \csname #1\expandafter \endcsname \csname iffalse\endcsname \pdfstri
ngdefWarn \let \expandafter \expandafter \expandafter \@gobble \else \<let>-com
mand \expandafter \noexpand \csname #1\expandafter \expandafter \expandafter \e
ndcsname \fi \fi
#1<-bbl@temp@pref\@empty
{\expandafter}
{\csname}

\@empty ->
{\expandafter}
{\csname}
{changing \bbl@temp@pref=undefined}
{into \bbl@temp@pref=\relax}
{\ifx: (level 5) entered on line 27}
{false}
{\else: \ifx (level 5) entered on line 27}
{\expandafter}
{\csname}

\@empty ->
{\expandafter}
{\csname}
{\ifx: (level 6) entered on line 27}
{false}
{\else: \ifx (level 6) entered on line 27}
{\expandafter}
{\csname}

\@empty ->
{\expandafter}
{\expandafter}
{\fi: \ifx (level 6) entered on line 27}
{\expandafter}
{\fi: \ifx (level 5) entered on line 27}
{\noexpand}

\pageref #1->\HyPsd@@pageref #1*\END
#1<-\let

\HyPsd@@pageref #1*#2\END ->\ifx \\#2\\\HyPsd@@@pageref {#1}\else \expandafter
\HyPsd@@@pageref \fi
#1<-\let
#2<-
{\ifx: (level 5) entered on line 27}
{true}

\HyPsd@@@pageref #1->\expandafter \ifx \csname r@#1\endcsname \relax ??\else \e
xpandafter \expandafter \expandafter \expandafter \expandafter \expandafter \ex
pandafter \@car \expandafter \expandafter \expandafter \@gobble \csname r@#1\en
dcsname {}\@nil \fi
#1<-\let
{\expandafter}
{\csname}

\let #1->\expandafter \expandafter \expandafter \HyPsd@@LetCommand \expandafter
 \expandafter \expandafter {\expandafter \@gobble \string #1\@empty }
#1<-\endcsname
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\string}
{\expandafter}
{\expandafter}

\@gobble #1->
#1<-\

\HyPsd@@LetCommand #1->\expandafter \ifx \csname #1\expandafter \endcsname \csn
ame iftrue\endcsname \pdfstringdefWarn \let \expandafter \@gobble \else \expand
after \ifx \csname #1\expandafter \endcsname \csname iffalse\endcsname \pdfstri
ngdefWarn \let \expandafter \expandafter \expandafter \@gobble \else \<let>-com
mand \expandafter \noexpand \csname #1\expandafter \expandafter \expandafter \e
ndcsname \fi \fi
#1<-endcsname\@empty
{\expandafter}
{\csname}

\@empty ->
{\expandafter}
{\csname}
{\ifx: (level 6) entered on line 27}
{false}
{\else: \ifx (level 6) entered on line 27}
{\expandafter}
{\csname}

\@empty ->
{\expandafter}
{\csname}
{\ifx: (level 7) entered on line 27}
{false}
{\else: \ifx (level 7) entered on line 27}
! Missing \endcsname inserted.
<to be read again>
                   \<let>-command
\HyPsd@@LetCommand ...gobble \else \<let>-command
                                                  \expandafter \noexpand \cs...

\HyPsd@@@pageref ...r \ifx \csname r@#1\endcsname
                                                  \relax ??\else \expandafte...

\HyPsd@@pageref ...ifx \\#2\\\HyPsd@@@pageref {#1}
                                                  \else \expandafter \HyPsd@...

\NROrg@ifthenelse ...\bbl@temp@pref \pageref \let
                                                  \pageref \org@pageref \let...

\@title ...ge {\ }\\ }{ \large {\docSubtitle }\\ }
                                                   \vspace {0.1in} \ifthenel...

\pdfstringdef ... \HyPsd@LetCommand \Hy@temp #1{#2
                                                  }\endgroup \ifx #1\@empty ...

\KVS@ProcessorDefault ...e KV@#1@#2\endcsname {#3}
                                                  \fi \fi
\KVS@Parse ...#1}{}{\KVS@Process #1=\KVS@Nil {#3}}
                                                  \KVS@MaybeBreak \KVS@IfEmp...
<argument> ...se \hypersetup {pdftitle={\@title }}
                                                  \fi \fi \ifx \@pdfauthor \...

\@firstoftwo #1#2->#1

\@begindocumenthook ... be\MessageBreak disabled}}
                                                  \ifx \ttl@Hy@steplink \@un...

\document ...ent \@firstofone \@begindocumenthook
                                                  \ifdim \topskip <1sp\globa...
l.27 \begin{document}

I upload the legacy + minimal file (pdflatex testit.tex). I needed to remove plenty of things, rename images,... for almost 1 hour and half, but I hope it helps. Just replace the two \setLang{es} with \setLang{en} to see the other error. Uploaded here: box test.zip.

14
  • 1
    the example can not be run at all \input{/mnt/repositories/latex/latex-my/imports/latex-doc/headers_begin.tex} is not likely to work anywhere other than your machine Apr 6, 2017 at 22:01
  • 1
    Welcome! Unfortunately, that is not a minimal example. First, we cannot use it to reproduce the error you are getting. Second, it is not at all minimal. So it is both too much (irrelevant extras) and too little (missing stuff required to reproduce). This is going to make it hard to help. But \<let> looks odd. You can use e.g. \tracingall but you will get a lot of output unless you minimise first. In the first case, \fc@textsuperscript appears to be undefined.
    – cfr
    Apr 6, 2017 at 22:01
  • I updated the last lines of tracingall. Also, I uploaded the code + legacy library in the same zip. pdflatex testit.tex and change the 2 es with en to see the other error. This should be compiled in both ways (es, en). @cfr Apr 10, 2017 at 17:14
  • @DavidCarlisle I updated the post with the code. Now you shouldn't have problems when importing the legacy library. Apr 10, 2017 at 17:15
  • People tend to be rather wary of downloading .zip files from unknown sources. You'd be better off using a pastebin site if you really can't come up with something sufficiently minimal to post here.
    – cfr
    Apr 10, 2017 at 18:15

1 Answer 1

2

I'm posting this partial answer because the discussion in the comments is getting rather long.

I should start by pointing out that it is quite hard to reduce the example provided by the OP. It's a problem with a complicated document template. Now, the document works for me with my installation of TeXLive2015, but not 2016. Both of these are installed on a Mac (not that this is likely to matter), and the versions are

 3.14159265-2.6-1.40.17 (TeX Live 2016) 

and

 3.14159265-2.6-1.40.16 (TeX Live 2015)

With en as the argument to \setLang (and using TeXLive2016), I get the error

! Undefined control sequence.
\fc@orddef@ult #1->\fc@textsuperscript

I think this is somehow related to the fcprefix package, which is loaded by the fmtcount package. However, the relevant files in the 2015 and 2016 distributions seem to be the same. Near the end of fmtcount.sty, I found the following:

\AtBeginDocument{%                                                                                                                                                                                       
   \ifcsundef{FBsupR}{\let\fc@textsuperscript\textsuperscript}{\let\fc@textsuperscript\fup}%                                                                                                             
}

In view of the error, I tried adding

\makeatletter
\let\fc@textsuperscript\textsuperscript
\makeatother 

to the OP's preamble. This produced a different error:

! Missing \endcsname inserted.
<to be read again> 
                   \<let>-command 
l.32 \begin{document}

I'll be offline for a few days, and will look at this again when I return. Meanwhile if anyone can shed any light on this, please feel free to edit the above.

EDIT

It's probably worth noting that the installation of TeXLive2015 on my machine was probably set up around the time of its release, so changes to the distribution during its lifetime will mean that new downloads will have some updated files. The OP can't get the document to work with TL2015, so it might be worth trying TL2014.

2
  • Did you try adding it after \BeginDocument?
    – cfr
    Apr 15, 2017 at 2:10
  • Hi! I tried the previous weekend again.. but with wrong results. Do you know how to proceed (at least in general steps) from your point? Apr 27, 2017 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .