From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: bold font in org-e-beamer export Date: Fri, 27 Jul 2012 03:13:07 +0200 Message-ID: <20120727011307.GA31823@kuru.dyndns-at-home.com> References: <20120724220410.GA26458@kuru.dyndns-at-home.com> <87a9yo1am9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuZ7D-00004z-K0 for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 21:13:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuZ7C-0001Xi-ET for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 21:13:15 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:64848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuZ7C-0001Xc-76 for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 21:13:14 -0400 Received: by weys10 with SMTP id s10so1932072wey.0 for ; Thu, 26 Jul 2012 18:13:13 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87a9yo1am9.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Emacs Org mode Hi Nicolas, On Wed, Jul 25, 2012 at 10:57:34AM +0200, Nicolas Goaziou wrote: > Hello, > > Suvayu Ali writes: > > > org-e-beamer exports *bold markup* as \alert{..}. I was wondering if > > there is a way to export it as the usual \textbf{..}. I would also like > > to have a convenient markup for \structure{..}, how do I add new > > markup? > > You can't add new markup. > > Though, there are already 4 symbols used for regular text and 2 for > verbatim text. And you have full control over their output with > filters. > Your example below works wonderfully. However I have a question, for the sake of understanding. > So, let's say "*" will produce \textbf{...} and "+" will produce > \structure{...}. > > #+BEGIN_SRC emacs-lisp > (defun suvayu-beamer-bold (contents backend info) > (if (not (eq backend 'e-beamer)) contents > (replace-regexp-in-string "\\`\\\\[A-Za-z0-9]+" "\\\\textbf" contents))) > > (defun suvayu-beamer-structure (contents backend info) > (if (not (eq backend 'e-beamer)) contents > (replace-regexp-in-string "\\`\\\\[A-Za-z0-9]+" "\\\\structure" contents))) I do not understand the above regular expressions. I guess \\` to match the start of string (one extra backslash is required to escape the 2nd). But I don't understand the four backslash sequence; I guess it inserts \\ to the string, but why is that necessary? > > (add-to-list 'org-export-filter-bold-functions 'suvayu-beamer-bold) > (add-to-list 'org-export-filter-strike-through-functions > 'suvayu-beamer-structure) > #+END_SRC > > You can also derive a new back-end from e-beamer that will behave > differently for bold and strike-through object types. > Thanks a lot for the pointers. Cheers, -- Suvayu Open source is the future. It sets us free.