Re: [Orgmode] Re: [org-beamer] \alert
Hi, i just catched up reading the org list, and I think I can contribute to this: Carsten Dominik carsten.domi...@gmail.com writes: 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. The LaTeX Command \providecommand behaves exactly like \newcommand iff the command does not already exist, so one (untested) solution would be \providecommand{\alert}[1]{\emph{#1}} I think this would be the cleanest way, but keep in mind that the special beamer parameters are not supported by standard latex command creation commands. Yours Karsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
This is also a very nice solution, thank you, I will be using it. - Carsten On Feb 3, 2010, at 9:31 AM, Karsten Heymann wrote: Hi, i just catched up reading the org list, and I think I can contribute to this: Carsten Dominik carsten.domi...@gmail.com writes: 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. The LaTeX Command \providecommand behaves exactly like \newcommand iff the command does not already exist, so one (untested) solution would be \providecommand{\alert}[1]{\emph{#1}} I think this would be the cleanest way, but keep in mind that the special beamer parameters are not supported by standard latex command creation commands. Yours Karsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
Hi all I have been away for a week. Thanks for implementing this. Haven't tried it yet. Greetings Sven Carsten Dominik carsten.domi...@gmail.com writes: This is also a very nice solution, thank you, I will be using it. - Carsten On Feb 3, 2010, at 9:31 AM, Karsten Heymann wrote: Hi, i just catched up reading the org list, and I think I can contribute to this: Carsten Dominik carsten.domi...@gmail.com writes: 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. The LaTeX Command \providecommand behaves exactly like \newcommand iff the command does not already exist, so one (untested) solution would be \providecommand{\alert}[1]{\emph{#1}} I think this would be the cleanest way, but keep in mind that the special beamer parameters are not supported by standard latex command creation commands. Yours Karsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode -- Mit freundlichen Grüßen Sven Bretfeld ___ Prof. Dr. Sven Bretfeld \ CEntrum für CERES \ REligionswissenschaftliche \_Studien__ Ruhr-Universität Bochum Universitätsstraße 150 D-44780 Bochum http://www.ruhr-uni-bochum.de/ceres/de/organisation/beteiligte/sven_bretfeld.html ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
On Jan 29, 2010, at 4:36 PM, Sébastien Vauban wrote: Hi Eric, Tim, Carsten and all, Eric S Fraga wrote: 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 \ifxcommand\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. Thanks to all. This is great stuff... 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=. Could this somehow made part of Org-mode, so that one does not need to repeat this one-liner in every file that could be exported to pure LaTeX and/or Beamer? Yes - this is in there now. Let's see if someone complains. - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
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. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
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 \ifxcommand\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. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
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 \ifxcommand\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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: [org-beamer] \alert
Hi Eric, Tim, Carsten and all, Eric S Fraga wrote: 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 \ifxcommand\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. Thanks to all. This is great stuff... 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=. Could this somehow made part of Org-mode, so that one does not need to repeat this one-liner in every file that could be exported to pure LaTeX and/or Beamer? Best regards, Seb -- Sébastien Vauban ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
On Jan 26, 2010, at 5:22 PM, Eric S Fraga wrote: At Tue, 26 Jan 2010 16:06:27 +0100, Sébastien Vauban wrote: Eric S Fraga wrote: At 24 Jan 2010 20:10:03 +0100, Sven Bretfeld wrote: Is there any Symbol in org-beamer for \alert{Text}? In presentations \alert [...] org-export-latex-emphasis-alist (quote ((* \\textbf{%s} nil) (/ \\emph{%s} nil) (_ \\underline{%s} nil) (+ \\texttt{%s} nil) (= \\verb=%s= nil) (~ \\verb~%s~ t) (@ \\alert{%s} nil That's what I'm using as well, but the problem is that it's not compatible anymore with non-beamer LaTeX, the alert macro being unknown. Very true. I've never thought about this as my presentations are for presentation only etc. However, it would definitely be nice to have a more general solution. Would there be a way to conditionally translate @...@ to alert (if beamer) or to emph (if not-beamer), so that we can still easily compile a document to one or the other LaTeX back-end, without having to customize variables in Emacs, prior to a compilation to the other back-end? The alist structure doesn't allow for embedded lisp code, as far as I can tell. It would obviously be easier if this structure could be evaluated on the fly. I must admit I do not have clear specifications on how to tell Org about such a config... The only suggestion I can come up with would be to modify this variable using, for instance, the org-export-later-after-initial- vars-hook? 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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: [org-beamer] \alert
Hi Eric and Sven, Eric S Fraga wrote: (mistakenly sent this only to the OP... resending to list as well) At 24 Jan 2010 20:10:03 +0100, Sven Bretfeld wrote: Is there any Symbol in org-beamer for \alert{Text}? In presentations \alert is recommended instead of italics. We could even think of translating text enclosed in slashes / ... / to \alert{} by default in the beamer class. Essentially, you can add this functionality yourself: (setq org-emphasis-alist (quote ((* bold b /b) (/ italic i /i) (_ underline span style=\text-decoration:underline;\ /span) (= org-code code /code verbatim) (~ org-verbatim code /code verbatim) (+ (:strike-through t) del /del) (@ org-warning b /b))) org-export-latex-emphasis-alist (quote ((* \\textbf{%s} nil) (/ \\emph{%s} nil) (_ \\underline{%s} nil) (+ \\texttt{%s} nil) (= \\verb=%s= nil) (~ \\verb~%s~ t) (@ \\alert{%s} nil That's what I'm using as well, but the problem is that it's not compatible anymore with non-beamer LaTeX, the alert macro being unknown. Would there be a way to conditionally translate @...@ to alert (if beamer) or to emph (if not-beamer), so that we can still easily compile a document to one or the other LaTeX back-end, without having to customize variables in Emacs, prior to a compilation to the other back-end? I must admit I do not have clear specifications on how to tell Org about such a config... Best regards, Seb -- Sébastien Vauban ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: [org-beamer] \alert
At Tue, 26 Jan 2010 16:06:27 +0100, Sébastien Vauban wrote: Eric S Fraga wrote: At 24 Jan 2010 20:10:03 +0100, Sven Bretfeld wrote: Is there any Symbol in org-beamer for \alert{Text}? In presentations \alert [...] org-export-latex-emphasis-alist (quote ((* \\textbf{%s} nil) (/ \\emph{%s} nil) (_ \\underline{%s} nil) (+ \\texttt{%s} nil) (= \\verb=%s= nil) (~ \\verb~%s~ t) (@ \\alert{%s} nil That's what I'm using as well, but the problem is that it's not compatible anymore with non-beamer LaTeX, the alert macro being unknown. Very true. I've never thought about this as my presentations are for presentation only etc. However, it would definitely be nice to have a more general solution. Would there be a way to conditionally translate @...@ to alert (if beamer) or to emph (if not-beamer), so that we can still easily compile a document to one or the other LaTeX back-end, without having to customize variables in Emacs, prior to a compilation to the other back-end? The alist structure doesn't allow for embedded lisp code, as far as I can tell. It would obviously be easier if this structure could be evaluated on the fly. I must admit I do not have clear specifications on how to tell Org about such a config... The only suggestion I can come up with would be to modify this variable using, for instance, the org-export-later-after-initial-vars-hook? eric ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode