(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
(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"))))
exam.org
Description: Lotus Organizer
\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}