John Rakestraw <[email protected]> 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.
Untested:
(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.
–Rasmus
--
A page of history is worth a volume of logic