LaTeX forum ⇒ GeneralAccessing a previous LaTeX \def Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
JeffR
Posts: 9
Joined: Thu Aug 29, 2013 6:39 pm

Accessing a previous LaTeX \def

Postby JeffR » Tue Mar 25, 2014 3:37 pm

Hello, I am trying to sort out a minor but awkward LaTeX issue. The command \L is defined in LaTeX to be an L with a line through it. But I frequently need a caligraphic L, so my papers normally begin with "\def\L{{\cal L}". Unfortunately, I occasionally need to refer to a Polish author whose name begins with \L. So, I would like to still define \L to be {\cal L} since I am so used to that, but be able to somehow access the original \L definition on occasion. I suppose I could enclose all the rest of my paper in { } and thus limit the scope of my redefined \L, but I would rather not have to do that. What I want is something like:
\def\linedL{{\L}}
\def\L{{\cal L}}
and then access the two macros separately. But of course this doesn't work correctly, since the second definition automatically modifies the first definition too. Any suggestions of how to make this work the way I want? Thanks! (And, sorry if this is already covered somewhere -- I coudln't think of what keywords to search for.)

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Postby esdd » Tue Mar 25, 2014 6:23 pm

You can use \let or \edef to save the old definition in \linedL

  1. \documentclass{scrartcl}
  2. \usepackage{xspace}
  3. \edef\linedL{\L\noexpand\xspace}
  4. \def\L{\mathcal{L}}
  5.  
  6. \begin{document}
  7. \linedL and $\L$
  8. \end{document}


Best regards
Elke

JeffR
Posts: 9
Joined: Thu Aug 29, 2013 6:39 pm

Postby JeffR » Tue Mar 25, 2014 10:38 pm

Thanks, that's great -- thanks very much Elke!


Return to “General”

Who is online

Users browsing this forum: No registered users and 11 guests