emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: [org-beamer] \alert


From: Tim Burt
Subject: Re: [Orgmode] Re: [org-beamer] \alert
Date: Fri, 29 Jan 2010 06:26:21 -0500

Eric S Fraga writes:
 > At Thu, 28 Jan 2010 18:58:38 +0100,
 > Carsten Dominik wrote:
 > 
 > [...]
 > 
 > > 
 > > Is there a LaTeX command that can figure out if it is running a beamer
 > > class?
 > > If yes, a possible solution would be to redefine \alert in LaTeX when
 > > not doing BEAMER.
 > > 
 > > - Carsten
 > > 
 > 
 > This must be possible but my latex (and tex) programming capabilities
 > are even worse than my elisp... :(
 > 
 > For any LaTeX expert out there, is there an easy way to determine
 > whether a particular macro has been defined?  If so, we wouldn't even
 > need to check for beamer, simply for \alert.

Use the 
  \ifx<command>\undefined ... \else ... \fi 
construct to determine if a command already exists, and then to take
action in the appropriate case.  Test the example below both as-is and
with the first ~\newcommand*{\thisalert}~ commented out to see the
different results.

: \documentclass{article}
: \newcommand*{\thisalert}{Do this.}
: % Test for existence of \thisalert.
: % Create or modify the command accordingly.
: \ifx\thisalert\undefined%
: \newcommand*{\thisalert}{Do that.}%
: \else%
: \renewcommand*{\thisalert}{Do this differently.}
: \fi
: \begin{document}
: 
: \thisalert
: 
: \end{document}

I hope this is of use,
Tim

 > 
 > 
 > _______________________________________________
 > Emacs-orgmode mailing list
 > Please use `Reply All' to send replies to the list.
 > address@hidden
 > http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]