Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using LuaLaTeX and wonder why I cannot label theorems with words containing umlauts. For example:

\documentclass[a4paper,12pt]{article}
\usepackage{luatextra}
\usepackage[utf8]{luainputenc}
\usepackage{amsthm}
\newtheorem{thm}{Theorem}
\begin{document}
    \begin{thm} {\bf Exämple's_theorem}
             %\label{Exämple's theorem} % does not work
              \label{Exaemple's_theorem} % does work

        Lorem ipsum etc.
    \end{thm}
\end{document}

Has anyone a clue why this is and - maybe how to resolve this ? I'm just curious for the underlying reason. Writing 'ae' instead of 'ä' is not a hard thing to do, so no solution is no problem.

Additionally lacheck says you shouldn't use spaces in labels, but there occurred no errors during compilation - another white spot in my knowing latex/luatex map.

share|improve this question
    
With "normal" LaTeX umlauts are usually active characters, i.e. macros, which are fragile and can't be written without issues into auxiliary files. No idea, if LuaLaTeX is any better here. –  Martin Scharrer Oct 12 '11 at 11:30

2 Answers 2

up vote 4 down vote accepted

The package luainputenc can be useful to convert legacy documents to LuaLaTeX use and should not be used in new documents.

The following document works:

\documentclass[a4paper,12pt]{article}
\usepackage{amsthm}
\usepackage{fontspec} % don't forget it with lualatex
\newtheorem{thm}{Theorem}

\begin{document}
\begin{thm}[Exämple's theorem]\label{Exämple's theorem}
Lorem ipsum etc.
\end{thm}
\end{document}

Note that amsthm should be loaded before fontspec and _ can't be used in normal text without protection. Also, theorem names or attributions should be given as optional argument to the environment.

share|improve this answer
    
thanks for your answer, but when i call lualatex test.tex - the compiler asks for XeTeX. additionally thanks for noting the luainputenc - is not necessary –  epsilonhalbe Oct 12 '11 at 17:56
    
could it be an error due to the fact that i use texlive-2009 (I'm on a debian machine) –  epsilonhalbe Oct 12 '11 at 18:56
    
i had a not so brief look on the fontspec documentation and found "fontspec needs an up to date texlive 2011 installation" so no fontspecfun for me (for now) –  epsilonhalbe Oct 12 '11 at 21:03
    
@epsilonhalbe There's fontspec also in TeX Live 2009, but I believe it doesn't work with LuaLaTeX. Actually it's not necessary; but the best is to upgrade to TeX Live 2011. –  egreg Oct 12 '11 at 21:11
    
i tried to upgrade a few packages - but nothing is working the way i want - i'll upgrade as soon as i can afford some time for it. thanks anyway and good night ;-) –  epsilonhalbe Oct 12 '11 at 22:57

You have some misstakes in your code:

  • the command \bf is obsolete. For more details see l2tabu
  • every theorem-environment has an optional argument with the title of the theorem
  • the underscore needs special handling.
  • don't use special characters like German umlaut in labels.

Some information are provided in my earlier answer: Despite using backslash dollar sign, error persists

share|improve this answer
    
+1 for the l2tabu document - very insightful –  epsilonhalbe Oct 12 '11 at 17:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.