emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
Cc: Sebastian Hofer <sebhofer@gmail.com>,
	nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: [PATCH] latex export - title placement
Date: Wed, 01 Jun 2011 19:55:51 -0400	[thread overview]
Message-ID: <12177.1306972551@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Nick Dokos <nicholas.dokos@hp.com> of "Wed\, 01 Jun 2011 18\:05\:28 EDT." <11174.1306965928@alphaville.dokosmarshall.org>

Nick Dokos <nicholas.dokos@hp.com> 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> \collaboration@sw 
|                              {\advance \c@collab \@ne \@argswap {\CO@grp \CO...
| l.21 \author{nick}
| ...
`----

Basically, \author{nick} got expanded into something involving \collaboration@sw 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 -> \frontmatter@author -> \@author@def -> \move@AU -> \collaboration@sw -> ...

So let's see where the latter is initialized:

,----
| \def\collaboration{% implicit #1
|  \@author@def{\@booleantrue\collaboration@sw}% implicit #2
| }%
| 
| \appdef\frontmatter@init{%
|  \@booleanfalse\collaboration@sw
| }%
| 
| \def\@author@init{%
|  \let\@author\@author@cleared
|  \@booleanfalse\collaboration@sw
| }%
`----


So \collaboration@sw is a boolean (when it is defined) and I gueesed that the most likely place
was the \frontmatter@init 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
\frontmatter@init
\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...

Nick

  parent reply	other threads:[~2011-06-01 23:56 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28 12:42 [PATCH] latex export - title placement Sebastian Hofer
2011-05-28 12:59 ` Sebastian Hofer
2011-05-28 17:27 ` Thomas S. Dye
2011-06-01 22:05   ` Nick Dokos
2011-06-01 23:19     ` Thomas S. Dye
2011-06-01 23:55     ` Nick Dokos [this message]
2011-06-02  8:36       ` Sebastian Hofer
2011-06-02  8:12     ` Sebastian Hofer
2011-06-02 15:57       ` Nick Dokos
2011-06-02 19:05         ` Sebastian Hofer
  -- strict thread matches above, loose matches on Subject: below --
2011-06-03  4:23 Nick Dokos
2011-06-03  8:11 ` Sebastian Hofer
2011-12-01 12:51 [bug] Symbol's function definition is void: org-pop-to-buffer-same-window Sebastien Vauban
2011-12-01 14:40 ` Kenny Meyer
2011-12-01 15:00   ` Nick Dokos
2011-12-01 15:05     ` Nick Dokos
2011-12-02 19:46       ` Kenny Meyer
2011-12-02 20:09         ` Nick Dokos
2011-12-02 20:41           ` Sebastien Vauban
2011-12-02 21:32             ` Nick Dokos
2011-12-06 20:24   ` Shelagh Manton
2011-12-06 21:19     ` Nick Dokos
2011-12-07  7:07       ` Shelagh Manton
2011-12-07  8:23         ` Nick Dokos
2011-12-07  8:34           ` Sebastien Vauban
2011-12-07 11:25             ` shelagh Manton
2011-12-07 20:45             ` Sebastien Vauban
2011-12-21 17:10               ` Gustav Wikström
2012-08-09 21:45 [OT] Current website not very attractive Marcelo de Moraes Serpa
2012-08-09 23:14 ` Jude DaShiell
2012-08-10  0:09   ` Sankalp
2012-08-10  4:02     ` Nick Dokos
2012-08-10  5:27       ` Jambunathan K
2012-08-10  6:30       ` Nick Dokos
2012-08-10 16:43         ` Marcelo de Moraes Serpa
2012-08-10 17:46           ` Nick Dokos
2012-08-11  9:29             ` Bastien
2012-08-10 19:56           ` brian powell
2012-08-11  9:30             ` Bastien
2012-09-13 20:19               ` Marcelo de Moraes Serpa
2012-09-13 20:21                 ` Marcelo de Moraes Serpa
2012-09-13 20:23                   ` Marcelo de Moraes Serpa
2012-09-14  5:41                     ` Bastien
2012-09-21 21:19                       ` Marcelo de Moraes Serpa
2012-09-21 22:50                         ` Nick Dokos
2012-09-21 22:59                           ` Eric Schulte
2012-09-21 23:14                             ` Nick Dokos
2012-09-22  4:06                               ` Nick Dokos
2012-09-22  6:51                               ` Bastien
2012-09-22  7:20                                 ` Nick Dokos
2012-09-22  7:44                                   ` Bastien
2012-09-22 14:13                                 ` Achim Gratz
2012-09-22 13:55                           ` John Hendy
2012-08-11 10:46             ` [ANN] Letter modes in the Groff exporter Luis Anaya
2012-08-11 11:03               ` Suvayu Ali
2012-08-11 15:50                 ` Luis Anaya
2012-08-11 17:00                   ` Bastien
2012-08-11  9:27           ` [OT] Current website not very attractive Bastien
2012-08-10  0:57 ` Ista Zahn
2012-08-10  7:05 ` [Contest] Redesign orgmode.org by the end of august (was: [OT] Current website not very attractive) Bastien
2012-08-10 12:40   ` John Hendy
2012-08-10 16:43     ` [Contest] Redesign orgmode.org by the end of august Thomas S. Dye
2012-08-10 18:04       ` Suvayu Ali
2012-08-11  9:33       ` Bastien
2012-08-11 21:45         ` Thomas S. Dye
2012-08-11 22:01           ` Bastien
2012-08-10 16:13   ` Rémi Letot
2012-08-11  9:25     ` Bastien
2012-08-25 20:18   ` Bastien
2012-08-25 21:11     ` Nick Dokos
2012-09-10 11:00   ` Bastien
2012-09-10 11:04     ` Bastien
2012-09-10 14:43       ` Nick Dokos
2012-09-10 12:01     ` Giovanni Ridolfi
2012-09-10 14:41     ` Nick Dokos
2012-09-10 14:45       ` Bastien
2012-09-11  0:23         ` Takaaki ISHIKAWA
2012-09-13  0:25           ` Bastien
2012-09-20 22:42     ` Brian van den Broek
2012-09-21  7:24       ` Bastien
2012-09-21 11:14         ` Brian van den Broek
2013-01-15 10:02 Logging of work no longer working with emcas24 Im Exil
2013-01-15 10:27 ` Nick Dokos
2013-01-15 10:47   ` Im Exil
2013-01-15 11:17   ` Nick Dokos
2013-01-15 13:55     ` Im Exil
2013-01-15 19:10       ` Achim Gratz
2013-01-16  8:20         ` Im Exil

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=12177.1306972551@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sebhofer@gmail.com \
    /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).