From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Help with new exporter Date: Fri, 12 Jul 2013 17:27:36 +0200 Message-ID: <87wqovdcif.fsf@gmx.us> References: <51DFEC7B.7050504@mpip-mainz.mpg.de> <51DFECE9.6010209@mpip-mainz.mpg.de> <87ip0f520a.fsf@gmail.com> <871u73eujy.fsf@gmx.us> <87ehb34ye5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxfG4-0003Fv-M9 for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 11:27:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxfG0-00011K-Dg for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 11:27:44 -0400 Received: from mout.gmx.net ([212.227.17.20]:61123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxfG0-00010l-4m for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 11:27:40 -0400 Received: from pank ([213.23.238.209]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M55BC-1UFM8d1vbC-00zIfE for ; Fri, 12 Jul 2013 17:27:37 +0200 In-Reply-To: (John Rakestraw's message of "Fri, 12 Jul 2013 11:05:28 -0400") 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: emacs-orgmode@gnu.org John Rakestraw 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.=20 > (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=20 > document > class, perhaps by using a derived backend. (It may be that it won't=20 > 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.=20=20 Untested: =20 (when (and ;; check that it's a LaTeX backend (org-export-derived-backend-p backend 'latex) (string-match "\\documentclass?[.*?]{exam}" (downcase strin= g))) (replace-match "" nil nil headline)) =20 Most document will fail the second test and those that don't are probably the ones you want to target. =E2=80=93Rasmus --=20 A page of history is worth a volume of logic