From: Robert Klein <kleinrob@mpip-mainz.mpg.de>
To: emacs-orgmode@gnu.org
Subject: Re: Help with new exporter
Date: Fri, 12 Jul 2013 13:47:53 +0200 [thread overview]
Message-ID: <51DFECE9.6010209@mpip-mainz.mpg.de> (raw)
In-Reply-To: <51DFEC7B.7050504@mpip-mainz.mpg.de>
[-- Attachment #1: Type: text/plain, Size: 2663 bytes --]
(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
[-- Attachment #2: exam.el --]
[-- Type: text/x-emacs-lisp, Size: 733 bytes --]
(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"))))
[-- Attachment #3: exam.org --]
[-- Type: application/vnd.lotus-organizer, Size: 2450 bytes --]
[-- Attachment #4: exam.tex --]
[-- Type: text/x-tex, Size: 3053 bytes --]
\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}
next parent reply other threads:[~2013-07-12 11:48 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 ` Robert Klein [this message]
2013-07-12 13:41 ` Help with new exporter 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
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=51DFECE9.6010209@mpip-mainz.mpg.de \
--to=kleinrob@mpip-mainz.mpg.de \
--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).