Discussion:
Faile to compile the https://github.com/wannier-developers/wannier90/tree/develop/doc/solution_booklet with texlive 2020.
(too old to reply)
Hongyi Zhao
2020-06-28 11:32:36 UTC
Permalink
Hi,

On Ubuntu 20.04 with texlive 2020, I try to compile the following document written by LaTex: https://github.com/wannier-developers/wannier90/tree/develop/doc/solution_booklet.

But the compilation failed with the following errors:


***@ubuntu-01:~/Public/hpc/tools/wannier90.git/doc/solution_booklet$ make
pdflatex solution_booklet.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./solution_booklet.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-05-15>
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/size11.clo))
(./newcommands.tex) (./Packages.tex
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/geometry/geometry.
sty
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.st
y)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/generic/iftex/ifvtex.sty
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/generic/iftex/iftex.sty)
))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/mdwtools/footnote.
sty)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.st
y
For additional information on amsmath, use the `?' option.

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.st
y
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty
))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty
))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amssymb.s
ty
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.
sty))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.
sty
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.
sty
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty)

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graph
ics.cfg)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics-def/pdfte
x.def)))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/subfig/subfig.sty
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/caption/caption3.s
ty))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/fancyhdr/fancyhdr.
sty)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/tools/bm.sty)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty)

! Argument of \***@b has an extra }.
<inserted text>
\par
l.20

?



This is a relative huge LaTeX document and I have put a copy of the source code here:

https://github.com/hongyi-zhao/test/raw/master/solution_booklet.tar.xz

Could someone please give me some hints for this problem?

Regards,
HY
Peter Flynn
2020-06-28 22:39:56 UTC
Permalink
Post by Hongyi Zhao
Hi,
On Ubuntu 20.04 with texlive 2020, I try to compile the following document written by LaTex: https://github.com/wannier-developers/wannier90/tree/develop/doc/solution_booklet.
pdflatex solution_booklet.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./solution_booklet.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-05-15>
I compiled this successfully but I'm using an older version of TL:

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)
(preloaded format=pdflatex 2018.12.26) 28 JUN 2020 23:30
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**solution_booklet.tex
(./solution_booklet.tex
LaTeX2e <2017-04-15>

I don't have any line in the log saying "L3 programming layer <2020-05-15>"
Post by Hongyi Zhao
<inserted text>
\par
l.20
When this happens, edit the log file, put your cursor on the line that
says l.20, and the search backwards for an unmatched open-parenthesis.
That should indicate which file the l.20 refers to.

See also
https://tex.stackexchange.com/questions/297390/argument-of-reserveda-has-an-extra-error-when-using-non-english-language-i
which Mr Google thinks has some bearing on the matter.

It may just be that the file was written a long time ago and needs
updating to a new version of LaTeX. I'm afraid looking at the code is
not edifying: there's a huge amount of reinventing the wheel going on,
which I'm afraid is rampant among LaTeX authors.

Peter
Hongyi Zhao
2020-06-28 23:22:02 UTC
Permalink
在 2020年6月29日星期一 UTC+8上午6:40:01,peter写道:
Post by Peter Flynn
Post by Hongyi Zhao
Hi,
On Ubuntu 20.04 with texlive 2020, I try to compile the following document written by LaTex: https://github.com/wannier-developers/wannier90/tree/develop/doc/solution_booklet.
pdflatex solution_booklet.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./solution_booklet.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-05-15>
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)
(preloaded format=pdflatex 2018.12.26) 28 JUN 2020 23:30
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**solution_booklet.tex
(./solution_booklet.tex
LaTeX2e <2017-04-15>
I don't have any line in the log saying "L3 programming layer <2020-05-15>"
Post by Hongyi Zhao
<inserted text>
\par
l.20
When this happens, edit the log file, put your cursor on the line that
says l.20, and the search backwards for an unmatched open-parenthesis.
That should indicate which file the l.20 refers to.
Several lines around/before l.20 are as following in the log file:


(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip66
\bibsep=\skip67
LaTeX Info: Redefining \cite on input line 694.
\***@NAT@ctr=\count197
)
! Argument of \***@b has an extra }.
<inserted text>
\par
l.20

?
! Emergency stop.
<inserted text>
\par
l.20

End of file on the terminal!



Then I checked this file: /home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty and still can find any clue on this problem. The content around line 20 in this file, is as following:



%%
%% This is file `natbib.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% natbib.dtx (with options: `package,all')
%% =============================================
%% IMPORTANT NOTICE:
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%%
%% This is a generated file.
%% It may not be distributed without the original source file natbib.dtx.
%%
%% Full documentation can be obtained by LaTeXing that original file.
%% Only a few abbreviated comments remain here to describe the usage.
%% =============================================
%% Copyright 1993-2010 Patrick W Daly
%% Max-Planck-Institut f\"ur Sonnensystemforschung
%% Max-Planck-Str. 2
%% D-37191 Katlenburg-Lindau
%% Germany
Post by Peter Flynn
See also
https://tex.stackexchange.com/questions/297390/argument-of-reserveda-has-an-extra-error-when-using-non-english-language-i
which Mr Google thinks has some bearing on the matter.
It may just be that the file was written a long time ago and needs
updating to a new version of LaTeX. I'm afraid looking at the code is
not edifying: there's a huge amount of reinventing the wheel going on,
which I'm afraid is rampant among LaTeX authors.
Peter
Peter Flynn
2020-06-28 23:33:45 UTC
Permalink
On 29/06/2020 00:22, Hongyi Zhao wrote:
[...]
Post by Hongyi Zhao
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip66
\bibsep=\skip67
LaTeX Info: Redefining \cite on input line 694.
)
<inserted text>
\par
l.20
NOT natbib.sty, the "(" at the start of the line is closed by ")" under
count197. You need to find the *un*matched open-parenthesis earlier.
Post by Hongyi Zhao
/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
and still can find any clue on this problem. The content around line
NO. It's not natbib.sty. It's line 20 in whatever file has been opened
and not yet closed. You need to search through the parentheses to find
this (any decent editor can do parenthesis-matching)

Peter
Hongyi Zhao
2020-06-29 00:10:21 UTC
Permalink
在 2020年6月29日星期一 UTC+8上午7:33:50,peter写道:
Post by Peter Flynn
[...]
Post by Hongyi Zhao
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip66
\bibsep=\skip67
LaTeX Info: Redefining \cite on input line 694.
)
<inserted text>
\par
l.20
NOT natbib.sty, the "(" at the start of the line is closed by ")" under
count197. You need to find the *un*matched open-parenthesis earlier.
I try to locate this info based on you above instruction but still
failed to do the trick.
The log file is so long but seems messed up. I pasted all of the content here:

--------------
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020)
(preloaded format=pdflatex 2020.5.4) 29 JUN 2020 07:10
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**solution_booklet.tex
(./solution_booklet.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-04-06>
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\***@part=\count167
\***@section=\count168
\***@subsection=\count169
\***@subsubsection=\count170
\***@paragraph=\count171
\***@subparagraph=\count172
\***@figure=\count173
\***@table=\count174
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
)
(./newcommands.tex) (./Packages.tex
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/geometry/geometry.
sty
Package: geometry 2020/01/02 v5.9 Page Geometry

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.st
y
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\***@toks@=\toks15
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/generic/iftex/ifvtex.sty
Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
))
\***@cnth=\count175
\***@cntv=\count176
\***@Gm@tempcnt=\count177
\***@bindingoffset=\dimen135
\***@wd@mp=\dimen136
\***@odd@mp=\dimen137
\***@even@mp=\dimen138
\***@layoutwidth=\dimen139
\***@layoutheight=\dimen140
\***@layouthoffset=\dimen141
\***@layoutvoffset=\dimen142
\***@dimlist=\toks16
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/mdwtools/footnote.
sty
Package: footnote 1997/01/28 1.13 Save footnotes around boxes
\***@notes=\box45
\***@width=\dimen143
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.st
y
Package: amsmath 2020/01/20 v2.17e AMS math features
\@mathmargin=\skip49

For additional information on amsmath, use the `?' option.

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.st
y
Package: amstext 2000/06/29 v2.01 AMS text

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks17
\ex@=\dimen144
))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen145
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\***@bad=\count178
LaTeX Info: Redefining \frac on input line 227.
\uproot@=\count179
\leftroot@=\count180
LaTeX Info: Redefining \overline on input line 389.
\classnum@=\count181
\DOTSCASE@=\count182
LaTeX Info: Redefining \ldots on input line 486.
LaTeX Info: Redefining \dots on input line 489.
LaTeX Info: Redefining \cdots on input line 610.
\Mathstrutbox@=\box46
\strutbox@=\box47
\***@size=\dimen146
LaTeX Font Info: Redeclaring font encoding OML on input line 733.
LaTeX Font Info: Redeclaring font encoding OMS on input line 734.
\***@depth=\count183
\***@MaxMatrixCols=\count184
\dotsspace@=\muskip16
\***@parentequation=\count185
\***@lvl=\count186
\***@help=\toks18
\row@=\count187
\column@=\count188
\maxfields@=\count189
\andhelp@=\toks19
\eqnshift@=\dimen147
\alignsep@=\dimen148
\tagshift@=\dimen149
\tagwidth@=\dimen150
\totwidth@=\dimen151
\lineht@=\dimen152
\@envbody=\toks20
\multlinegap=\skip50
\multlinetaggap=\skip51
\***@stack=\toks21
LaTeX Info: Redefining \[ on input line 2859.
LaTeX Info: Redefining \] on input line 2860.
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amssymb.s
ty
Package: amssymb 2013/01/14 v3.01 AMS font symbols

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.
sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.
sty
Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.
sty
Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graph
ics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics-def/pdfte
x.def
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
))
\***@req@height=\dimen153
\***@req@width=\dimen154
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/subfig/subfig.sty
Package: subfig 2005/06/28 ver: 1.3 subfig package

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/caption/caption3.s
ty
Package: caption3 2020/01/03 v1.8h caption3 kernel (AR)
Package caption3 Info: TeX engine: e-TeX on input line 61.
\captionmargin=\dimen155
\captionmargin@=\dimen156
\captionwidth=\dimen157
\***@tempdima=\dimen158
\***@indent=\dimen159
\***@parindent=\dimen160
\***@hangindent=\dimen161
Package caption Info: Standard document class detected.
)
\***@KVtest=\count190
\***@farskip=\skip52
\***@captopadj=\dimen162
\***@capskip=\skip53
\***@nearskip=\skip54
\***@subfigure=\count191
\***@subfigure@save=\count192
\***@lofdepth=\count193
\***@subtable=\count194
\***@subtable@save=\count195
\***@lotdepth=\count196
\***@top=\skip55
\***@bottom=\skip56
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/fancyhdr/fancyhdr.
sty
Package: fancyhdr 2019/01/31 v3.10 Extensive control of page headers and footer
s
\***@nch@headwidth=\skip57
\***@nch@***@elh=\skip58
\***@nch@***@erh=\skip59
\***@nch@***@olh=\skip60
\***@nch@***@orh=\skip61
\***@nch@***@elf=\skip62
\***@nch@***@erf=\skip63
\***@nch@***@olf=\skip64
\***@nch@***@orf=\skip65
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/tools/bm.sty
Package: bm 2019/07/24 v1.2d Bold Symbol Support (DPC/FMi)
\symboldoperators=\mathgroup6
\symboldletters=\mathgroup7
\symboldsymbols=\mathgroup8
LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 141.
LaTeX Info: Redefining \bm on input line 209.
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip66
\bibsep=\skip67
LaTeX Info: Redefining \cite on input line 694.
\***@NAT@ctr=\count197
)
! Argument of \***@b has an extra }.
<inserted text>
\par
l.20

?
! Emergency stop.
<inserted text>
\par
l.20

End of file on the terminal!


Here is how much of TeX's memory you used:
3806 strings out of 480682
50717 string characters out of 5900248
290866 words of memory out of 5000000
19633 multiletter control sequences out of 15000+600000
533407 words of font info for 26 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
44i,0n,47p,249b,74s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!
--------------
Post by Peter Flynn
Post by Hongyi Zhao
/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
and still can find any clue on this problem. The content around line
NO. It's not natbib.sty. It's line 20 in whatever file has been opened
and not yet closed. You need to search through the parentheses to find
this (any decent editor can do parenthesis-matching)
Peter
Peter Flynn
2020-06-29 12:12:13 UTC
Permalink
On 29/06/2020 01:10, Hongyi Zhao wrote:
[...]
Post by Hongyi Zhao
I try to locate this info based on you above instruction but still
failed to do the trick.
You need to be using an editor that matcvhes parentheses for you.

If I remove all balanced parentheses and their content, I get
Post by Hongyi Zhao
**solution_booklet.tex
(./solution_booklet.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-04-06>
(./Packages.tex
<inserted text>
\par
l.20
?
! Emergency stop.
<inserted text>
\par
l.20
End of file on the terminal!
So it looks like line 20 of Packages.tex is where LaTeX found the error.

Line 14-19 of Packages.tex say
Post by Hongyi Zhao
\usepackage[plainpages=false,breaklinks=true,pdfborder=0 0 0,pdfdisplaydoctitle=true,bookmarksopen=true,bookmarksopenlevel=0,pdftex,%
% Comment the following line if it makes problems (it requires a recent
% LaTeX distribution)
%hidelinks,
pdftitle={\Wannier~\version: Solution booklet},
pdfkeywords={wannier90;postw90;pwscf;tutorial;examples}]{hyperref}
so LaTeX appears to be objecting to that. Try removing all the comments.

Peter
Hongyi Zhao
2020-06-29 13:15:39 UTC
Permalink
在 2020年6月29日星期一 UTC+8下午8:12:17,peter写道:
Post by Peter Flynn
[...]
Post by Hongyi Zhao
I try to locate this info based on you above instruction but still
failed to do the trick.
You need to be using an editor that matcvhes parentheses for you.
If I remove all balanced parentheses and their content, I get
Post by Hongyi Zhao
**solution_booklet.tex
(./solution_booklet.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-04-06>
(./Packages.tex
<inserted text>
\par
l.20
?
! Emergency stop.
<inserted text>
\par
l.20
End of file on the terminal!
So it looks like line 20 of Packages.tex is where LaTeX found the error.
I use awk to find the tex file which cause the problem as follows:

$ awk '
$0 ~ /[^ ]+\.tex/ {a=$0; next } /^l\.20/ && a { print a; exit }' solution_booklet.log
(./newcommands.tex) (./Packages.tex
Post by Peter Flynn
Line 14-19 of Packages.tex say
Post by Hongyi Zhao
\usepackage[plainpages=false,breaklinks=true,pdfborder=0 0 0,pdfdisplaydoctitle=true,bookmarksopen=true,bookmarksopenlevel=0,pdftex,%
% Comment the following line if it makes problems (it requires a recent
% LaTeX distribution)
%hidelinks,
pdftitle={\Wannier~\version: Solution booklet},
pdfkeywords={wannier90;postw90;pwscf;tutorial;examples}]{hyperref}
so LaTeX appears to be objecting to that. Try removing all the comments.
No, see my above notes.
Post by Peter Flynn
Peter
Ulrike Fischer
2020-06-29 08:36:10 UTC
Permalink
Post by Hongyi Zhao
Could someone please give me some hints for this problem?
The problem is in the Packages.tex.

It calls hyperref with the option

pdftitle={\Wannier~\version: Solution booklet},

The definition of \Wannier contains formatting commands and is
basically doing

\usepackage[pdftitle=\mbox{\textsc{...}}]{hyperref}

hyperref don't like the \textsc here at all.

Replace the \Wannier by something more sensible.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Hongyi Zhao
2020-06-29 09:44:34 UTC
Permalink
在 2020年6月29日星期一 UTC+8下午4:36:14,Ulrike Fischer写道:
Post by Ulrike Fischer
Post by Hongyi Zhao
Could someone please give me some hints for this problem?
The problem is in the Packages.tex.
It calls hyperref with the option
pdftitle={\Wannier~\version: Solution booklet},
The definition of \Wannier contains formatting commands and is
basically doing
\usepackage[pdftitle=\mbox{\textsc{...}}]{hyperref}
hyperref don't like the \textsc here at all.
It seems you are right, see the following for more information on the
definition for that command:

$ egrep '\\newcommand\{(\\Wannier|\\myfont)' newcommands.tex
\newcommand{\Wannier}{\myfont{wannier90}}
\newcommand{\myfont}[1]{\mbox{\textsc{#1}}}
Post by Ulrike Fischer
Replace the \Wannier by something more sensible.
Still, I cannot figure how to fix it. Could you please give a more
concrete example for this problem?

Thanks again for your time and help.

Regards.
Ulrike Fischer
2020-06-29 10:07:12 UTC
Permalink
Post by Hongyi Zhao
Post by Ulrike Fischer
Replace the \Wannier by something more sensible.
Still, I cannot figure how to fix it. Could you please give a more
concrete example for this problem?
change in Package.tex

pdftitle={\Wannier~\version: Solution booklet}

to

pdftitle={wannier90~\version: Solution booklet}

or before loading Package.tex do

\renewcommand\Wannier{wannier90}
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Hongyi Zhao
2020-06-29 11:07:38 UTC
Permalink
在 2020年6月29日星期一 UTC+8下午6:07:15,Ulrike Fischer写道:
Post by Ulrike Fischer
Post by Hongyi Zhao
Post by Ulrike Fischer
Replace the \Wannier by something more sensible.
Still, I cannot figure how to fix it. Could you please give a more
concrete example for this problem?
change in Package.tex
pdftitle={\Wannier~\version: Solution booklet}
to
pdftitle={wannier90~\version: Solution booklet}
or before loading Package.tex do
\renewcommand\Wannier{wannier90}
Yes, it does the trick.

But as you have seen, the problem is caused by the following command in the low-level:


\newcommand{\myfont}[1]{\mbox{\textsc{#1}}}


So, is it possible for me to solve the problem in a more robust/elegant way by touching up/fixing/enhancement this command?

Regards.
Ulrike Fischer
2020-06-29 11:45:35 UTC
Permalink
Post by Hongyi Zhao
But as you have seen, the problem is caused by the following
\newcommand{\myfont}[1]{\mbox{\textsc{#1}}}
So, is it possible for me to solve the problem in a more
robust/elegant way by touching up/fixing/enhancement this
command?
\newcommand{\myfont}[1]{\texorpdfstring{\mbox{\textsc{#1}}}{#1}}

could work (if the command is used only after hyperref has been
loaded). But this is untested.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Hongyi Zhao
2020-06-29 13:37:49 UTC
Permalink
在 2020年6月29日星期一 UTC+8下午7:45:38,Ulrike Fischer写道:
Post by Ulrike Fischer
Post by Hongyi Zhao
But as you have seen, the problem is caused by the following
\newcommand{\myfont}[1]{\mbox{\textsc{#1}}}
So, is it possible for me to solve the problem in a more
robust/elegant way by touching up/fixing/enhancement this
command?
\newcommand{\myfont}[1]{\texorpdfstring{\mbox{\textsc{#1}}}{#1}}
Tried this but failed with the following errors:


This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2020.5.4) 29 JUN 2020 21:34
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**solution_booklet.tex
(./solution_booklet.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-04-06>
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\***@part=\count167
\***@section=\count168
\***@subsection=\count169
\***@subsubsection=\count170
\***@paragraph=\count171
\***@subparagraph=\count172
\***@figure=\count173
\***@table=\count174
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
)
(./newcommands.tex) (./Packages.tex
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/geometry/geometry.
sty
Package: geometry 2020/01/02 v5.9 Page Geometry

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.st
y
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\***@toks@=\toks15
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/generic/iftex/ifvtex.sty
Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
))
\***@cnth=\count175
\***@cntv=\count176
\***@Gm@tempcnt=\count177
\***@bindingoffset=\dimen135
\***@wd@mp=\dimen136
\***@odd@mp=\dimen137
\***@even@mp=\dimen138
\***@layoutwidth=\dimen139
\***@layoutheight=\dimen140
\***@layouthoffset=\dimen141
\***@layoutvoffset=\dimen142
\***@dimlist=\toks16
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/mdwtools/footnote.
sty
Package: footnote 1997/01/28 1.13 Save footnotes around boxes
\***@notes=\box45
\***@width=\dimen143
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.st
y
Package: amsmath 2020/01/20 v2.17e AMS math features
\@mathmargin=\skip49

For additional information on amsmath, use the `?' option.

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.st
y
Package: amstext 2000/06/29 v2.01 AMS text

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks17
\ex@=\dimen144
))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen145
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\***@bad=\count178
LaTeX Info: Redefining \frac on input line 227.
\uproot@=\count179
\leftroot@=\count180
LaTeX Info: Redefining \overline on input line 389.
\classnum@=\count181
\DOTSCASE@=\count182
LaTeX Info: Redefining \ldots on input line 486.
LaTeX Info: Redefining \dots on input line 489.
LaTeX Info: Redefining \cdots on input line 610.
\Mathstrutbox@=\box46
\strutbox@=\box47
\***@size=\dimen146
LaTeX Font Info: Redeclaring font encoding OML on input line 733.
LaTeX Font Info: Redeclaring font encoding OMS on input line 734.
\***@depth=\count183
\***@MaxMatrixCols=\count184
\dotsspace@=\muskip16
\***@parentequation=\count185
\***@lvl=\count186
\***@help=\toks18
\row@=\count187
\column@=\count188
\maxfields@=\count189
\andhelp@=\toks19
\eqnshift@=\dimen147
\alignsep@=\dimen148
\tagshift@=\dimen149
\tagwidth@=\dimen150
\totwidth@=\dimen151
\lineht@=\dimen152
\@envbody=\toks20
\multlinegap=\skip50
\multlinetaggap=\skip51
\***@stack=\toks21
LaTeX Info: Redefining \[ on input line 2859.
LaTeX Info: Redefining \] on input line 2860.
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amssymb.s
ty
Package: amssymb 2013/01/14 v3.01 AMS font symbols

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.
sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
))
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.
sty
Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.
sty
Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graph
ics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/graphics-def/pdfte
x.def
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
))
\***@req@height=\dimen153
\***@req@width=\dimen154
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/subfig/subfig.sty
Package: subfig 2005/06/28 ver: 1.3 subfig package

(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/caption/caption3.s
ty
Package: caption3 2020/01/03 v1.8h caption3 kernel (AR)
Package caption3 Info: TeX engine: e-TeX on input line 61.
\captionmargin=\dimen155
\captionmargin@=\dimen156
\captionwidth=\dimen157
\***@tempdima=\dimen158
\***@indent=\dimen159
\***@parindent=\dimen160
\***@hangindent=\dimen161
Package caption Info: Standard document class detected.
)
\***@KVtest=\count190
\***@farskip=\skip52
\***@captopadj=\dimen162
\***@capskip=\skip53
\***@nearskip=\skip54
\***@subfigure=\count191
\***@subfigure@save=\count192
\***@lofdepth=\count193
\***@subtable=\count194
\***@subtable@save=\count195
\***@lotdepth=\count196
\***@top=\skip55
\***@bottom=\skip56
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/fancyhdr/fancyhdr.
sty
Package: fancyhdr 2019/01/31 v3.10 Extensive control of page headers and footer
s
\***@nch@headwidth=\skip57
\***@nch@***@elh=\skip58
\***@nch@***@erh=\skip59
\***@nch@***@olh=\skip60
\***@nch@***@orh=\skip61
\***@nch@***@elf=\skip62
\***@nch@***@erf=\skip63
\***@nch@***@olf=\skip64
\***@nch@***@orf=\skip65
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/tools/bm.sty
Package: bm 2019/07/24 v1.2d Bold Symbol Support (DPC/FMi)
\symboldoperators=\mathgroup6
\symboldletters=\mathgroup7
\symboldsymbols=\mathgroup8
LaTeX Font Info: Redeclaring math alphabet \mathbf on input line 141.
LaTeX Info: Redefining \bm on input line 209.
)
(/home/werner/Public/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip66
\bibsep=\skip67
LaTeX Info: Redefining \cite on input line 694.
\***@NAT@ctr=\count197
)
! Undefined control sequence.
\myfont #1->\texorpdfstring
{\mbox {\textsc {#1}}}{#1}
l.20

?
Post by Ulrike Fischer
could work (if the command is used only after hyperref has been
loaded). But this is untested.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Loading...