LaTeX forum ⇒ Fonts & Character SetsProblem with special characters Topic is solved

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Georg
Posts: 58
Joined: Mon Jan 29, 2018 4:25 pm

Problem with special characters

Postby Georg » Thu Feb 01, 2018 3:10 pm

Hi everyone,
I have such an error message:

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.46 \DeclareUnicodeCharacter{00A4}{\textcurrency}

You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.

! Missing = inserted for \ifnum.
<to be read again>
A
l.46 \DeclareUnicodeCharacter{00A4}{\textcurrency}

I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero.
<to be read again>
A
l.46 \DeclareUnicodeCharacter{00A4}{\textcurrency}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing = inserted for \ifnum.
<to be read again>
A
l.47 \DeclareUnicodeCharacter{00A7}{\textsection}

I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero.
<to be read again>
A
l.47 \DeclareUnicodeCharacter{00A7}{\textsection}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing = inserted for \ifnum.
<to be read again>
A
l.48 ...lareUnicodeCharacter{00AB}{\guillemotleft}

I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero.
<to be read again>
A
l.48 ...lareUnicodeCharacter{00AB}{\guillemotleft}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

What is the solution? Thanks

User avatar
Stefan Kottwitz
Site Admin
Posts: 8952
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Feb 01, 2018 5:44 pm

Can you post your document preamble, until \begin{document}?

The first error message shows, that there's some normal text (no macro) that should be part of the document, not a preamble. This can be a small mistake there. To see that simple text causes this:

  1. \documentclass{article}
  2. text
  3. \begin{document}
  4. text
  5. \end{document}


We get that error, because "text" has to go to the actual document part.

Stefan
Site admin

Georg
Posts: 58
Joined: Mon Jan 29, 2018 4:25 pm

Postby Georg » Thu Feb 01, 2018 10:24 pm

Hi Stefan,
Thank you. This link was also helpful:
https://tex.stackexchange.com/questions ... ontal-mode

User avatar
Stefan Kottwitz
Site Admin
Posts: 8952
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Feb 02, 2018 1:14 pm

Sometimes it's just a small typo in the preamble, so a macro name may become a normal text word, so causing that error.

By the way, the other errors may be because of a character encoding issue, or just errors in consequence of the first one. Often there is a single error, and LaTeX tries to continue compiling but is already in a wrong mode so it cannot recover and throws more errors. Usually I would just check and and fix the first error because of this. For example: if one forgets to end the math mode of an equation, all the other text may be considered as wrong in math mode still, throwing errors, all is fixed after fixing the initially forgotten math mode closing.

Good to see that it's solved.

Stefan
Site admin

Georg
Posts: 58
Joined: Mon Jan 29, 2018 4:25 pm

Postby Georg » Fri Feb 02, 2018 6:26 pm

Thank you Stefan.


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 1 guest