From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: Help with new exporter Date: Fri, 12 Jul 2013 13:47:53 +0200 Message-ID: <51DFECE9.6010209@mpip-mainz.mpg.de> References: <51DFEC7B.7050504@mpip-mainz.mpg.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040007050400020306070004" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxbpn-0002vw-6n for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 07:48:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxbpl-0001mE-5h for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 07:48:23 -0400 Received: from gate1.mpip-mainz.mpg.de ([194.95.63.248]:31633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxbpk-0001lx-TJ for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 07:48:21 -0400 Received: from [10.20.2.71] (port=33203 helo=vmmail1.mpip-mainz.mpg.de) by gate1.mpip-mainz.mpg.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Uxbpg-0000Ed-2U for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 13:48:16 +0200 Received: from pckr143.mpip-mainz.mpg.de ([10.20.70.83]) by vmmail1.mpip-mainz.mpg.de with esmtp (Exim 4.72) (envelope-from ) id 1UxbpJ-0007H8-SM for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 13:47:53 +0200 In-Reply-To: <51DFEC7B.7050504@mpip-mainz.mpg.de> 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 This is a multi-part message in MIME format. --------------040007050400020306070004 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (sorry, this should've gone to the list the first time) Hi John, sorry, I can't help you with the filters. On the other hand, I don't see any reason why you gt whose square brackets. I tried different versions of org-mode, and never got *empty* square brackets. E.g. I tried with org-mode 8.0.5 release installed in ~/org-8.0.5 (I did a "make" and "make autoloads" in this directory) and used the exam.org file as attached and the attached exam.el for configuration. I started emacs with from the directory exam.org and exam.el are, using the following command: emacs -Q -l exam.el exam.org Exporting to LaTeX file results in the attached exam.tex. I tried emacs version 23.1 and 24.2. (For sure, my latex installation doesn't like the \NoKey and \NumberOfVersions ...) You could try, if you get can get the same results I do and then work through your emacs configuration. I've got no other idea at the moment. Best regards Robert On 07/12/2013 01:05 AM, John Rakestraw wrote: > Hi, list -- > > I understand the value of working on this myself -- what better way to > learn? -- but after a few hours of reading the docs and scouring the > list, I've reached the point of seeking at least a hint for where to go. > (There's much more information higher in this thread, but I'm trying to > focus rather narrowly on the problem here to keep the email relatively > short.) > > I'm trying to export to a pdf, using Phil Hirschhorn's exam.cls. The > document class definition I have (thanks, Robert!) gets me almost to > where I need to be. However, it leaves me with square brackets at > several points in the tex file. I need to delete those brackets. > > That is, I need to change "\begin[]{questions}" to "{\begin{questions}". > > Following Charles's advice, I'm trying to define and use a filter. > However, I know little enough about LaTeX and lisp that I can't figure > out why what I have isn't working. At the risk of making it very clear I > know even less than nothing, here's what I've worked up: > > --8<---------------cut here---------------start------------->8--- > (defun jr-org-delete-brackets-from-tex-file > (text backend info) > (while (re-search-forward "\\[]" nil t) > (replace-match "")) > text) > > (add-to-list 'org-export-filter-final-output-functions > 'jr-org-delete-brackets-from-tex-file) > --8<---------------cut here---------------end--------------->8--- > > This doesn't work. > > Can someone at least give me a hint on what I need to do differently? > > Thanks very much. > -- Robert Klein - Max Planck-Institut für Polymerforschung Ackermannweg 10 55128 Mainz --------------040007050400020306070004 Content-Type: text/x-emacs-lisp; name="exam.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="exam.el" (setq load-path (cons "~/org-8.0.5/lisp" load-path)) (require 'org) (require 'ox) (setq org-latex-classes '(("exam" "\\documentclass[12pt]{exam} % BEGIN exam Defaults [NO-DEFAULT-PACKAGES] [PACKAGES] \\usepackage{palatino} \\extrawidth{.5in} \\extraheadheight{-.75in} \\extrafootheight[-3in]{-.75in} \\pagestyle{headandfoot} \\NoKey \\NumberOfVersions{1} \\renewcommand\\thequestion{\\Roman{question}} \\renewcommand\\thepartno{\\arabic{partno}} \\renewcommand\\partlabel{\\thepartno.} % END exam Defaults " ("\\begin{questions} %% %s" "\\end{questions}") ("\\question %% %s" . "\\question* %% %s") ("\\begin{parts} %% %s" "\\end{parts}") ("\\part %% %s" . "\\part* %% %s")))) --------------040007050400020306070004 Content-Type: application/vnd.lotus-organizer; name="exam.org" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="exam.org" IytMYVRlWF9DTEFTUzogZXhhbQojK0xhVGVYX0NMQVNTX09QVElPTlM6IFsxMHB0XQojK0xB VEVYX0hFQURFUjogXGV4dHJhd2lkdGh7LjVpbn0KIytMQVRFWF9IRUFERVI6IFxleHRyYWhl YWRoZWlnaHRbLjNpbl17LS43NWlufQojK0xBVEVYX0hFQURFUjogXGV4dHJhZm9vdGhlaWdo dHstLjI1aW59CiMrTEFURVhfSEVBREVSOiBccmFnZ2VkcmlnaHQKIytMYVRlWDogXHJlbmV3 Y29tbWFuZFx0aGVxdWVzdGlvbntcUm9tYW57cXVlc3Rpb259fQojK0xhVGVYOiBccmVuZXdj b21tYW5kXHRoZXBhcnRub3tcYXJhYmlje3BhcnRub319CiMrTGFUZVg6IFxyZW5ld2NvbW1h bmRccGFydGxhYmVse1x0aGVwYXJ0bm8ufQojK09QVElPTlM6IHRvYzpuaWwgbnVtOnkgdGlt ZXN0YW1wOm5pbCBjcmVhdG9yOm5pbCBIOjQgdGV4aHQ6bmlsCiMrVElUTEU6CiMrTGFUZVg6 IFxmaXJzdHBhZ2VoZWFkZXJ7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NzYXkg UXVlc3Rpb24qLiBBbnN3ZXIgKm9uZSogb2YgdGhlIGZvbGxvd2luZyBhcyBmdWxseSBhcyB5 b3UgYXJlIGFibGUuCklmIHlvdSBhdHRlbXB0IHRvIGFuc3dlciBtb3JlIHRoYW4gb25lIHdp dGhvdXQgaW5kaWNhdGluZyBjbGVhcmx5IHdoaWNoIG9uZQp5b3UgaW50ZW5kIG1lIHRvIGdy YWRlIEkgd2lsbCBncmFkZSB5b3VyIGZpcnN0IGFuc3dlciAoNDAgcG9pbnRzKS4KKioqIFF1 ZXN0aW9ucwoKKioqKiAKaGVyZSdzIHRoZSBmaXJzdCBlc3NheSBxdWVzdGlvbi4KKioqKiAK aGVyZSdzIHRoZSBzZWNvbmQgZXNzYXkgcXVlc3Rpb24uCiMrTGFUZVg6IFxmaWxsd2l0aGRv dHRlZGxpbmVze1xmaWxsfQoKIytMYVRlWDogXG5ld3BhZ2UKIytMYVRlWDogXGZpbGx3aXRo ZG90dGVkbGluZXN7XGZpbGx9IAo= --------------040007050400020306070004 Content-Type: text/x-tex; name="exam.tex" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="exam.tex" \documentclass[10pt]{exam} % BEGIN exam Defaults \usepackage{palatino} \extrawidth{.5in} \extraheadheight{-.75in} \extrafootheight[-3in]{-.75in} \pagestyle{headandfoot} \NoKey \NumberOfVersions{1} \renewcommand\thequestion{\Roman{question}} \renewcommand\thepartno{\arabic{partno}} \renewcommand\partlabel{\thepartno.} % END exam Defaults \extrawidth{.5in} \extraheadheight[.3in]{-.75in} \extrafootheight{-.25in} \raggedright \author{Robert Klein} \date{\today} \title{} \begin{document} \renewcommand\thequestion{\Roman{question}} \renewcommand\thepartno{\arabic{partno}} \renewcommand\partlabel{\thepartno.} \firstpageheader{Name:\enspace\makebox[3in]{\hrulefill}\\Exam 1\\}{}{Theo 001 -- Rakestraw\\February 14, 2013\\} \begin{coverpages} this is just some text \end{coverpages} \begin{questions} % Meaningless header \label{sec-1} \question % \label{sec-1-1} \textbf{Identification of Terms}. Identify/define and give the significance of \textbf{six} of the following. If you identify/define more than six without indicating clearly which six you want me to grade, I will grade your first six answers (18 points). \begin{parts} % Terms \label{sec-1-1-1} \part % \label{sec-1-1-1-1} term 1 \vspace*{\fill} \part % \label{sec-1-1-1-2} term 2 \vspace*{\fill} \part % \label{sec-1-1-1-3} term 3 \vspace*{\fill} \part % \label{sec-1-1-1-4} term 4 \vspace*{\fill} \part % \label{sec-1-1-1-5} term 5 \vspace*{\fill} \part % \label{sec-1-1-1-6} term 6 \vspace*{\fill} \part % \label{sec-1-1-1-7} term 7 \vspace*{\fill} \part % \label{sec-1-1-1-8} term 8 \vspace*{\fill} \part % \label{sec-1-1-1-9} term 9 \newpage \fillwithdottedlines{\fill} \newpage \end{parts} \question % \label{sec-1-2} \textbf{Short Answer}. Answer \textbf{two} of the following in a paragraph. If you attempt to answer more than two without indicating clearly which two you intend me to grade I will grade your first two answers (36 points). \begin{parts} % Questions \label{sec-1-2-1} \part % \label{sec-1-2-1-1} Question one goes on for more than one line. (I mention that because I want to be clear that I can't put a question in a heading.) \fillwithdottedlines{\fill} \part % \label{sec-1-2-1-2} Question 2 goes here. \fillwithdottedlines{\fill} \newpage \fillwithdottedlines{\fill} \newpage \part % \label{sec-1-2-1-3} Question 3 goes here. \fillwithdottedlines{\fill} \part % \label{sec-1-2-1-4} Question 4 goes here. \fillwithdottedlines{\fill} \newpage \fillwithdottedlines{\fill} \newpage \end{parts} \question % \label{sec-1-3} \textbf{Essay Question}. Answer \textbf{one} of the following as fully as you are able. If you attempt to answer more than one without indicating clearly which one you intend me to grade I will grade your first answer (40 points). \begin{parts} % Questions \label{sec-1-3-1} \part % \label{sec-1-3-1-1} here's the first essay question. \part % \label{sec-1-3-1-2} here's the second essay question. \fillwithdottedlines{\fill} \newpage \fillwithdottedlines{\fill} \end{parts} \end{questions} \end{document} --------------040007050400020306070004--