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.

When I am trying to redefine \L to be \Lambda, it seems that been undo by hyperref, getting a warning Command \L invalid in math mode and the results is the polish Ł.

\documentclass{article}

\usepackage{amsmath}
\renewcommand{\L}{\Lambda}
\usepackage{hyperref}

\begin{document}
$\L$
\end{document} 
share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

You could redefine it after loading hyperref:

\usepackage{amsmath}
\usepackage{hyperref}
\renewcommand{\L}{\Lambda}

Both pd1enc.def (PDFDocEncoding definition file) and puenc.def (PDF Unicode definition file) define \L:

  • pd1enc.def: \DeclareTextCommand{\L}{PD1}{\225}% U+0141
  • puenc.def: \DeclareTextCommand{\L}{PU}{\81\101}% U+0141

If you make your redefinition later, i.e. after loading hyperref, yours will override the previous ones.

The problem here shows, that it's better to try using unique names, even if they are longer. Short and common names are often already used. Furthermore, you don't need to lose the \L brought by hyperref. Although it's just an \L, I explain this because similar things can happen with other macros you might need.

share|improve this answer
    
even if it works for the op to redefine \L after loading hyperref, it's not a good idea. if this definition is in a file submitted for publication in some journals, where articles are published in both print and electronically, the production procedures require hyperref to be removed or replaced by an automatic process, which will undoubtedly change the order. this only causes problems, resulting in frustration for the production staff and added expense when all the instances of \L must be manually changed to something else. use a 2-letter shorthand, like \gL if you must. –  barbara beeton Dec 19 '11 at 15:04
add comment

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.