emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: Help with new exporter
Date: Fri, 12 Jul 2013 17:27:36 +0200	[thread overview]
Message-ID: <87wqovdcif.fsf@gmx.us> (raw)
In-Reply-To: <b650a89f7364dfeab5708338223e63b6@johnrakestraw.com> (John Rakestraw's message of "Fri, 12 Jul 2013 11:05:28 -0400")

John Rakestraw <lists@johnrakestraw.com> 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

  reply	other threads:[~2013-07-12 15:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51DFEC7B.7050504@mpip-mainz.mpg.de>
2013-07-12 11:47 ` Help with new exporter Robert Klein
2013-07-12 13:41   ` Nick Dokos
2013-07-12 14:12     ` Rasmus
2013-07-12 14:59       ` Nick Dokos
2013-07-12 15:05         ` John Rakestraw
2013-07-12 15:27           ` Rasmus [this message]
2013-07-12 15:47             ` John Rakestraw
2013-07-12 15:28           ` Nick Dokos
2013-07-12 15:49             ` John Rakestraw
2013-07-12 16:20               ` Nick Dokos
2013-07-10 16:32 John Rakestraw
2013-07-10 16:58 ` Robert Klein
2013-07-10 17:27   ` John Rakestraw
2013-07-10 19:37 ` Robert Klein
2013-07-10 20:46   ` John Rakestraw
2013-07-10 21:04     ` John Rakestraw
2013-07-11  4:04       ` Charles Berry
2013-07-11  5:22     ` Robert Klein
2013-07-11 15:15       ` John Rakestraw
2013-07-11 23:05         ` John Rakestraw
2013-07-12  3:00           ` Thomas S. Dye
2013-07-10 19:56 ` Rasmus

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=87wqovdcif.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --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).