[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Help with new exporter

From: Rasmus
Subject: Re: [O] Help with new exporter
Date: Fri, 12 Jul 2013 17:27:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

John Rakestraw <address@hidden> writes:

> I cannot figure out why I'm getting the brackets that no one else is
> getting (Rasmus -- my problem is that they're there and I don't want
> them), but I now have a filter that will take them out:

My apology. 

>       (defun jr-org-delete-brackets-from-tex-file
>         (text backend info)
>         (replace-regexp-in-string "\\[\\]" "" text))
>       (add-to-list 'org-export-filter-final-output-functions
>                    'jr-org-delete-brackets-from-tex-file)
> Now to explore how to implement this only when I'm using the exam 
> document
> class, perhaps by using a derived backend. (It may be that it won't 
> cause
> any problems with other classes, but it seems sloppy to have it working
> all the time, no?)

 1. You'd want to check for the backend.
 2. To add a two tests use and and check that the correct document
    class is being used with string-match.  

     (when (and ;; check that it's a LaTeX backend
                (org-export-derived-backend-p backend 'latex)
                (string-match "\\documentclass?[.*?]{exam}" (downcase string)))
       (replace-match "" nil nil headline))
Most document will fail the second test and those that don't are
probably the ones you want to target.


A page of history is worth a volume of logic

reply via email to

[Prev in Thread] Current Thread [Next in Thread]