emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: nicholas.dokos@hp.com
Cc: Richard Stanton <stanton@haas.berkeley.edu>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: org + beamer: How to get @Š@ to create \alert?
Date: Wed, 02 May 2012 13:39:24 +0200	[thread overview]
Message-ID: <87lilarevn.fsf@gmail.com> (raw)
In-Reply-To: <28711.1335922639@alphaville> (Nick Dokos's message of "Tue, 01 May 2012 21:37:19 -0400")

Hello,

Nick Dokos <nicholas.dokos@hp.com> writes:

> Richard Stanton <stanton@haas.berkeley.edu> wrote:
>
>> I've just started using orgmode to create Beamer presentations, and have a
>> question.
>> 
>> In the worg documentation
>> (http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.html), it gives
>> an example of how enclosing text in "@" signs is supposed to result in
>> highlighted red text. When I try it, I get text surrounded by two "@"
>> signs...
>> 
>> Following suggestions from this list back in 2010, I tried customizing
>> org-export-latex-emphasis-alist to
>> 
>> Value: (("*" "\\textbf{%s}" nil)
>>  ("/" "\\emph{%s}" nil)
>>  ("_" "\\underline{%s}" nil)
>>  ("+" "\\st{%s}" nil)
>>  ("=" "\\protectedtexttt" t)
>>  ("~" "\\verb" t)
>>  ("@" "\\alert{%s}" nil))
>> 
>> 
>> but this doesn't seem to help either.
>> 
>> Can anyone tell me how to get this working?
>> 
>
> You also need to customize org-emphasis-alist.
>
> <soapbox>
>
> Not sure whether this qualifies as a bug or not. It probably does but
> even so, it's unlikely to be fixed and that's probably a *good* thing:
> IMNSHO, these interfaces are about the clunkiest to be found in org: they
> are very "heavy" for the result they produce.
>
> I hope the new exporter will clean up this area, even at the price of
> backward incompatibility (says he, knowing that any such will not affect
> him :-])

More or less. Markers are hard coded in the parser. For example, *text*
is parsed as (bold (... some properties...) "text") without looking at
`org-emphasis-alist'.

Then, it's up to each exporter to produce something meaningful with
`bold', `italic' `underline', `strike-through', `code' and `verbatim'
markup. For a beamer back-end (which is not written yet), I'd suggest to
treat `bold' as "\\alert{%s}", for example.

Unfortunately, the parser assumes `org-emph-re' is a defconst. I'd like
to remove dependency on that variable anyway, but it's difficult to
create a perfect test. For example, the following one is a bit naive:

#+begin_src emacs-lisp
(and (save-excursion
       (if (bolp) (looking-at "\\*\\w")
         (backward-char)
         (looking-at "\\W\\*\\w")))
     (save-excursion
       (re-search-forward "\\w\\*\\(\\W\\|$\\)" paragraph-limit t)))
#+end_src


Regards,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2012-05-02 11:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 16:57 make fails on current version Richard Stanton
2012-04-23 17:24 ` Bastien
2012-05-01 23:24   ` org + beamer: How to get @Š@ to create \alert? Richard Stanton
2012-05-02  1:37     ` Nick Dokos
2012-05-02  9:39       ` Sebastien Vauban
2012-05-02 14:03         ` Nick Dokos
2012-05-02 11:39       ` Nicolas Goaziou [this message]
2012-05-02 19:06         ` Sporadic problems pasting Richard Stanton
2012-05-02 19:28           ` Emacs occasionally hangs using org-mode Richard Stanton
2012-05-02 20:11           ` Sporadic problems pasting Bastien
2012-04-23 17:28 ` make fails on current version Toby Cubitt

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=87lilarevn.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.com \
    --cc=stanton@haas.berkeley.edu \
    /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).