0

When I use the \tableofcontents macro in a document where the etoc package is loaded, latex pauses and reports an error. If I let the compilation continue a well formed pdf is generated.

Minimal example that can reproduce the error on my machine.

\listfiles
\documentclass{article}
\usepackage{etoc}

\begin{document}
\tableofcontents‎‎
\end{document}

Output from pdflatex on the minimal example.

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./mwe.tex
LaTeX2e <2018-04-01> patch level 4
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2018/texmf-dist/tex/latex/etoc/etoc.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/tools/multicol.sty)) (./mwe.aux)

! Package inputenc Error: Unicode character ‎ (U+200E)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \tableofcontents‎
                       ‎
? R
OK, entering \nonstopmode...

! Package inputenc Error: Unicode character ‎ (U+200E)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \tableofcontents‎‎

[1{/usr/local/texlive/2018/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./mwe.aux)

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
    etoc.sty    2018/02/23 v1.08n Completely customisable TOCs (JFB)
multicol.sty    2018/04/20 v1.8s multicolumn formatting (FMi)
 ***********

 )
(see the transcript file for additional information)</usr/local/texlive/2018/te
xmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/local/texlive/2018/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on mwe.pdf (1 page, 16281 bytes).
SyncTeX written on mwe.synctex.gz.
Transcript written on mwe.log.
  • 2
    as explained in posted answers you have the Unicode characters in your source. The problem has nothing to do with etoc. – user4686 May 23 '18 at 12:53
  • I should have found that myself ;-) Thanks for the help! – midtiby May 25 '18 at 6:44
3

You have two invisible unicode chars behind your command (the picture is from my editor):

enter image description here

You can give them a definition to make them visible:

\documentclass{article}
%\usepackage{etoc}
\DeclareUnicodeCharacter{200E}{HALLO}
\begin{document}
\tableofcontents‎‎
\end{document}
2

After your \tableofontents there are 2 left to right marks i.e. U+200E. When removing them it should be fine again.

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.