emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James Harkins <jamshark70@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Rationale for *text* -> \alert{text} for Beamer export?
Date: Thu, 2 May 2013 02:48:41 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130502T044704-864@post.gmane.org> (raw)
In-Reply-To: CA+M2ft8_NOSBUheAWVvy7nwr1RXuSLwcPb=UGr1wnvN77+1SoA@mail.gmail.com

John Hendy <jw.hendy <at> gmail.com> writes:

> Just wondering about the rationale behind using *bold* markup for
> \textbf{} in LaTeX export and to \alert{} in Beamer. Was this a
> frequently voiced request? I'm sure I can dig into this somewhere and
> change it, but if the majority prefers bold (not saying they do!),
> should that be the default?
> 
> I'd prefer bold, personally. I don't like red table column titles or in 
lists.

I had asked the same question a while back, and I received some quite
amusing replies about \alert being "the Beamer way"... which I
promptly ignored and implemented my own hack to customize the LaTeX
command for beamer to use for *bold text* (pasted as a git patch
below).

I'm reading Marcin's recommendations carefully, since now, for the
first time, I need to learn more about tweaking LaTeX's output. I'm
not sure I agree with all of that line of thought, though.

~~
* Keeping that in mind, \alert{...} is /better/ than \textbf{...}, just
  like \emph{...} is better than \textit{...}: it is semantic, not
  visual markup.
~~

I can understand this rationale if the use case is to export from org
to a LaTeX file, and then continue to work with the LaTeX file. In
that case, you would want the exported LaTeX code to follow best
practices and be "maintainable." I'd guess a more common use case for
org export is to work exclusively with the org markup, and allow the
exporter to use LaTeX as an intermediary, on the way to PDF. At least,
this is how *I* use it; it doesn't really bother me if the LaTeX code
produced by org uses semantic or visual markup. Where I need semantic
markup (and I will, in my next article), I'll write the semantic
markup in org.

I guess I look at this in a way that FAUST [1] uses c++ as an
intermediary. You write the signal-processing graph in FAUST's own
purely-functional language, which the FAUST compiler translates into
c++ (with a variety of headers and wrappers for VST, OSX audio units,
SuperCollider plug-ins etc.). The resulting c++ is a mess, from the
standpoint of reading and maintenance, but you're not supposed to
maintain that code by hand. You're supposed to go back to the FAUST
code to make changes.

org --> LaTeX -- PDF
FAUST --> c++ --> DSP plugin

But, going a step further, if semantic markup is what you need,
wouldn't it be better to define a \newcommand wrapper for \textbf, and
then tell org to export *bold* using the wrapper? That would assume
that you can customize the string org uses for *bold*, which you can't
at present... so maybe my hack has some use after all.

hjh

[1] Functional AUdio STream language: http://faust.grame.fr/


From 8ccbc7cad43b520067b8b29d4660fc99587995fd Mon Sep 17 00:00:00 2001
From: James Harkins <jamshark70@dewdrop-world.net>
Date: Thu, 21 Feb 2013 09:51:02 +0800
Subject: [PATCH] hjh temp: add customize variable for bold/alert style

---
 lisp/ox-beamer.el |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index dc427de..44c1c68 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -206,6 +206,12 @@ You might want to put e.g. \"allowframebreaks=0.9\" 
here."
   :group 'org-export-beamer
   :type '(string :tag "Outline frame options"))
 
+(defcustom org-beamer-bold-macro "alert"
+  "LaTeX macro to insert for bold text (delimited by asterisks in the org 
source file).
+The default \"alert\" renders as red text, normal weight.
+Substitute \"textbf\" to obtain boldface."
+  :group 'org-export-beamer
+  :type '(string :tag "Bold macro"))
 
 \f
 ;;; Internal Variables
@@ -334,7 +340,8 @@ Return overlay specification, as a string, or nil."
   "Transcode BLOCK object into Beamer code.
 CONTENTS is the text being bold.  INFO is a plist used as
 a communication channel."
-  (format "\\alert%s{%s}"
+  (format "\\%s%s{%s}"
+	  org-beamer-bold-macro
 	  (or (org-beamer--element-has-overlay-p bold) "")
 	  contents))
 
-- 
1.7.9.5

  parent reply	other threads:[~2013-05-02  2:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 14:17 Rationale for *text* -> \alert{text} for Beamer export? John Hendy
2013-05-01 15:00 ` Marcin Borkowski
2013-05-01 20:50   ` John Hendy
2013-05-01 21:41     ` Thomas S. Dye
2013-05-01 22:09       ` Marcin Borkowski
2013-05-02 10:44       ` Suvayu Ali
2013-05-02  2:48 ` James Harkins [this message]
2013-05-02  8:20   ` Nicolas Goaziou
2013-05-02 11:44     ` James Harkins
2013-05-02  9:53   ` Marcin Borkowski
2013-05-02 10:28   ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20130502T044704-864@post.gmane.org \
    --to=jamshark70@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).