From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Re: [org-beamer] \alert Date: Fri, 29 Jan 2010 12:23:32 +0000 Message-ID: <87aavxrtff.wl%ucecesf@ucl.ac.uk> References: <871vhffhf8.fsf@gmx.ch> <87pr4y1me5.wl%ucecesf@ucl.ac.uk> <877hr4zz0s.fsf@mundaneum.com> <87k4v4omyk.wl%ucecesf@ucl.ac.uk> <91C8F5F5-83A0-4041-B941-5DA51B3CD3C4@gmail.com> <87hbq5z1tg.wl%ucecesf@ucl.ac.uk> <19298.50653.520318.554207@nitrogen.burtket> Reply-To: Eric S Fraga Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Napt3-0006kY-7i for emacs-orgmode@gnu.org; Fri, 29 Jan 2010 07:23:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Napsy-0006hB-OI for emacs-orgmode@gnu.org; Fri, 29 Jan 2010 07:23:44 -0500 Received: from [199.232.76.173] (port=43370 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Napsy-0006h0-Df for emacs-orgmode@gnu.org; Fri, 29 Jan 2010 07:23:40 -0500 Received: from vscane-b.ucl.ac.uk ([144.82.108.141]:40599) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Napsy-0007FN-1U for emacs-orgmode@gnu.org; Fri, 29 Jan 2010 07:23:40 -0500 In-Reply-To: <19298.50653.520318.554207@nitrogen.burtket> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: tcburt@rochester.rr.com Cc: =?UTF-8?B?U8OpYmFzdGll?=, emacs-orgmode@gnu.org, =?UTF-8?B?bg==?= Vauban , Carsten Dominik At Fri, 29 Jan 2010 06:26:21 -0500, Tim Burt wrote: > Eric S Fraga writes: > > 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\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. [...] > I hope this is of use, > Tim Thanks Tim. Very helpful indeed! The following org-mode line does the job for me: #+latex_header: \ifx\alert\undefined\let\alert\textbf\fi If \alert is not defined, I have =alert= behave as =textbf=. Alternatively, something like this also works: #+latex_header: \ifx\alert\undefined\newcommand*{\alert}[1]{\textbf{#1}}\fi in case one wants more control (e.g. could also change the colour to red). eric