emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] latex export - title placement


From: Sebastian Hofer
Subject: Re: [O] [PATCH] latex export - title placement
Date: Thu, 02 Jun 2011 10:36:43 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/24.0.50 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Wed, 01 Jun 2011 19:55:51 -0400,
Nick Dokos wrote:
> 
> Nick Dokos <address@hidden> wrote:
> 
> > IIUC, the only remaining thing is the position of the \title etc macros
> > in the preamble or the body (or both).
> > 
> > There are three categories of LaTeX classes: the ones that implement
> > Lamport's dictum that \title etc can come anywhere before \maketitle,
> > the ones like RevTeX that insist on having them in the body and the ones
> > like the thesis document class at Suvayu's university, that insist on
> > having them in the preamble. I consider both of the latter two as buggy:
> > has anybody submitted a bug report on them?
> > 
> 
> I tried an experiment:
> 
> I cannot get at the thesis document class at Suvayu's university but I
> most certainly can get to RevTeX. So I started with a simple org file:
> 
> ,----
> | #+LATEX_CLASS: revtex4-1
> | #+TITLE: foo
> | #+AUTHOR: nick
> | #+DATE:
> | 
> | * foo
> | 
> | bar
> `----
> 
> 
> I then added a definition for the revtex4-1 class to org-export-latex-classes.
> I just copied the article class and renamed appropriately:
> 
> ,----
> |     ...
> |     ("revtex4-1"
> |      "\\documentclass[11pt]{revtex4-1}"
> |      ("\\section{%s}" . "\\section*{%s}")
> |      ("\\subsection{%s}" . "\\subsection*{%s}")
> |      ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
> |      ("\\paragraph{%s}" . "\\paragraph*{%s}")
> |      ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
> |     ...
> `----
> 
> 
> Exporting to latex and compiling gives errors, the first one of which says:
> 
> ,----
> | ...
> | *hyperref using default driver hpdftex*
> | (/usr/share/texmf-texlive/tex/latex/hyperref/hpdftex.def)
> | ! Undefined control sequence.
> | <argument> address@hidden 
> |                              {\advance address@hidden address@hidden 
> address@hidden address@hidden \CO...
> | l.21 \author{nick}
> | ...
> `----
> 
> Basically, \author{nick} got expanded into something involving address@hidden 
> which
> is currently undefined. So off to 
> /usr/share/texmf-texlive/tex/latex/revtex/revtex4-1.cls
> I went and found the following expansion sequence:
> 
>    \author -> address@hidden -> address@hidden@def -> address@hidden -> 
> address@hidden -> ...
> 
> So let's see where the latter is initialized:
> 
> ,----
> | \def\collaboration{% implicit #1
> |  address@hidden@address@hidden@sw}% implicit #2
> | }%
> | 
> | address@hidden
> |  address@hidden@sw
> | }%
> | 
> | address@hidden@init{%
> |  address@hidden@address@hidden
> |  address@hidden@sw
> | }%
> `----
> 
> 
> So address@hidden is a boolean (when it is defined) and I gueesed that the 
> most likely place
> was the address@hidden macro. So what happens if we call the macro in the 
> preamble just before
> the \title, \author and \date junk?
> To do that, create a revtexbug.sty file with the following contents:
> 
> --8<---------------cut here---------------start------------->8---
> \makeatletter
> address@hidden
> \makeatother
> --8<---------------cut here---------------end--------------->8---
> 
> and modify the org file to
> 
> --8<---------------cut here---------------start------------->8---
> #+LATEX_CLASS: revtex4-1
> #+TITLE: foo
> #+AUTHOR: nick
> #+DATE:
> 
> #+LATEX_HEADER: \usepackage{revtexbug}
> 
> * foo
> 
> bar
> --8<---------------cut here---------------end--------------->8---
> 
> Export to latex, process and voilà: no errors.
> 
> I don't want to pretend of course that this solves the problem: it might
> cause more problems than it solves, particularly since I know nothing about
> revtex and all the above is (more-or-less informed) guesswork.
> 
> Nevertheless, it might be worth trying on a real document and seeing if
> it resolves the problem without causing undue misery. If it does, you
> can have a more-or-less permanent solution by just moving the
> revtexbug.sty file to some directory where latex can find it (don't
> forget to run texhash) and use the above as a template. You can probably
> customize the class template to do the \usepackage for you.
> 
> Please report back whether it works or not. If it does, maybe you can
> ask the RevTeX maintainers to fix the package: it's much more likely to
> happen if you tell them how to fix it ;-) And we can add an item to the
> FAQ. I just hope that there are no other classes that misbehave this way...


Unfortunately I couldn't get this to work just right now, also not for
the minimal example you provided. I will probably look into it when I
have more time on my hands. 
The real problem, however, is a different one: I use the revtex class
to submit research papers to the American Physical Society. And I
don't think they will be happy with me providing my own package which
works around one of the "features" of their own class. So unless we
can get them to fix the class, we (or I for that matter) are out of
luck. I haven't consider reporting this to them as I thought it would
be useless, but of course one could always try...
 
I still think that we should implement a way to handle this situation
in org, I'm pretty sure this is not the only class which doesn't
conform to the standards out there.

Sebastian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]