emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Klein <kleinrob@mpip-mainz.mpg.de>
To: emacs-orgmode@gnu.org
Subject: Re: Help with new exporter
Date: Wed, 10 Jul 2013 21:37:45 +0200	[thread overview]
Message-ID: <51DDB809.8050001@mpip-mainz.mpg.de> (raw)
In-Reply-To: <28c5d705dc41bc66d5a17e23d5dc9324@johnrakestraw.com>

Hi John.

thank you for the example org file.

I made two kinds of changes, one in the org-latex-classes definition and
one in the .org-file itself:


I changed the class definition for org-latex-classes to

#+begin_src emacs-lisp
        ("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}"))
#+end_src


Note the {%s} after the each opening clause.  I left the unnumbered part
of questions and parts out in my version, as I didn't see a difference
(no "unnumbered" \begin{questions} / \begin{parts} in the exam class?).

The documentation of org-latex-classes in ox-latex.el seems to be
confusing; at one place it says "A %s formatter is mandatory in each
section string and will be replaced by the title of the section." an at
another "The opening clause should have a %s to represent the section
title.".  Probably the "should have" in the second place ought to be a
"must have".


Anyway, in the .org file I added a space character to all empty
headings, e.g.

****

Without the space I first for a log of "\textbf{**}" in the output.


After both changes the resulting document looks like something you might
have wanted in the first place.


I got some weird numberings throughout the document, but this may be a
result of my setup.  Could you please check this, and describe anything
weird in your results?

Best regards
Robert





On 07/10/2013 06:32 PM, John Rakestraw wrote:
> Greetings, list --
> 
> I've been using Philip Hirschhorn's exam documentclass
> (http://www-math.mit.edu/~psh/#ExamCls) for several years to produce my
> exams. I've been writing the exams in org-mode and using the exporter to
> produce the pdf.
> 
> I've recently moved to org 8.0. (I like it!) I've successfully converted
> all of my other export class definitions, but I can't figure out how to
> define the exam class so that I can export my exams. I've pasted below
> the class definition that worked with the previous exporter (I know it's
> clumsy, but it worked) and also a sample version of what I need in the
> tex file.
> 
> (I know I could just write the tex file directly, but it's nice to have
> all of the course materials included in human-readable form in the
> course org file.)
> 
> My problem is that I can't get the exporter to produce chunks like this:
> 
> \begin{questions}
> \question
> A paragraph describing how the students should answer the following
> questions.
> \begin{parts}
> \part
> A multi-line question
> \part
> Another multi-line question
> \end{parts}
> \end{questions}
> 
> Thanks for whatever advice anyone can offer.
> 
> --John
> 
> 
> Old template:
> --8<---------------cut here---------------start------------->8---
>       (setq org-export-latex-classes (cons '("exam"
>     ### I know that in the new exporter I need to change this variable to
>     "org-latex-classes" ###
>       "% BEGIN exam Defaults
>       [NO-DEFAULT-PACKAGES]
>       [PACKAGES]
>       \\documentclass[12pt]{exam}
>       \\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}" "\\end{questions}"
> "\\begin{questions}" "\\end{questions}")
>              ("\\question" . "\\question*")
>              ("\\begin{parts}" "\\end{parts}" "\\begin{parts}"
> "\\end{parts}")
>              ("\\part" . "\\part*"))
> 
>       org-export-latex-classes))
> 
> --8<---------------cut here---------------end--------------->8---
> 
> An example of what I need the exporter to produce:
> 
> --8<---------------cut here---------------start------------->8---
> \documentclass[letterpaper]{exam}
> \extrawidth{.5in}
> \extraheadheight[.3in]{-.75in}
> \extrafootheight{-.25in}
> \raggedright
> \renewcommand\thequestion{\Roman{question}}
> \renewcommand\thepartno{\arabic{partno}}
> \renewcommand\partlabel{\thepartno.}
> \firstpageheader{Name: \enspace\makebox[3in]{\hrulefill}\\Exam
> 1\\}{}{Introductory Class \\May 7, 2013\\}
> \begin{document}
> 
> \begin{coverpages}
> text describing how the exam should be printed and prepared for
> distribution.
> \end{coverpages}
> 
> 
> 
> \begin{questions}
> \question
> A paragraph here describes this section and tells students how many
> terms to
> identify.
> \begin{parts}
> \part
> term 1
> \vspace*{\fill}
> \part
> term 2
> \vspace*{\fill}
> \part
> term 3
> \vspace*{\fill}
> \part
> term 4
> \vspace*{\fill}
> \part
> term 5
> \vspace*{\fill}
> \part
> term 6
> \vspace*{\fill}
> \part
> term 7
> \vspace*{\fill}
> \part
> term 7
> \vspace*{\fill}
> \part
> term 8
> \end{parts}
> \end{questions}
> \newpage
> \fillwithdottedlines{\fill}
> \newpage
> \begin{questions}
> \question
> Short Answer. A paragraph describing how I want students to respond to the
> following questions. I want to leave vertical space filled with dotted
> lines
> between the questions, and I want two questions on each page.
> \begin{parts}
> \part
> This is the first question. It will be several lines long, so I'm
> writing enough
> filler here to add at least a second line.
> \fillwithdottedlines{\fill}
> \part
> This is the second question. It will also be several lines long, so I need
> filler enough to get to the second line for this example.
> \fillwithdottedlines{\fill}
> 
> \newpage
> \fillwithdottedlines{\fill}
> \newpage
> \part
> This is the 3d question.
> \fillwithdottedlines{\fill}
> \end{parts}
> \end{questions}
> \newpage
> \fillwithdottedlines{\fill}
> \newpage
> \begin{questions}
> \question
> Essay Question. This is a section of essay questions. Students will
> answer only
> one of these questions, so I don't need to leave space between the two
> questions.
> \begin{parts}
> \part
> The first of the essay questions goes here. It will be several lines
> long, so I
> want enough text in the example to provide a line break.
> \part
> The second essay question. It is also several lines long, so I'll add some
> rambling text here for the second line.
> \end{parts}
> \end{questions}
> \fillwithdottedlines{\fill}
> \newpage
> \fillwithdottedlines{\fill}
> \end{document}
> 
> --8<---------------cut here---------------end--------------->8---
> 
> 

  parent reply	other threads:[~2013-07-10 19:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 16:32 Help with new exporter John Rakestraw
2013-07-10 16:58 ` Robert Klein
2013-07-10 17:27   ` John Rakestraw
2013-07-10 19:37 ` Robert Klein [this message]
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
     [not found] <51DFEC7B.7050504@mpip-mainz.mpg.de>
2013-07-12 11:47 ` 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
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

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=51DDB809.8050001@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).