From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Hofer Subject: Re: [PATCH] latex export - title placement Date: Thu, 02 Jun 2011 10:12:07 +0200 Message-ID: <871uzcmz3c.wl%sebhofer@gmail.com> References: <87wrhbdmjk.wl%sebhofer@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS31A-0007yK-Rq for emacs-orgmode@gnu.org; Thu, 02 Jun 2011 04:12:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QS314-0000fh-Ba for emacs-orgmode@gnu.org; Thu, 02 Jun 2011 04:12:36 -0400 Received: from lo.gmane.org ([80.91.229.12]:45891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS313-0000fD-N0 for emacs-orgmode@gnu.org; Thu, 02 Jun 2011 04:12:30 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QS30x-0005HI-W0 for emacs-orgmode@gnu.org; Thu, 02 Jun 2011 10:12:23 +0200 Received: from ahgate1.aei.uni-hannover.de ([130.75.117.49]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2011 10:12:23 +0200 Received: from sebhofer by ahgate1.aei.uni-hannover.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2011 10:12:23 +0200 In-Reply-To: <11174.1306965928@alphaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org At Wed, 01 Jun 2011 18:05:28 -0400, Nick Dokos wrote: > > Thomas S. Dye wrote: > > > Sebastian Hofer writes: > > > > > Hi all, > > > > > > This patch addresses the problem of ambiguous conventions for the > > > placement of the title related macros (\author, \date,...) with > > > respect to the main document body in different latex classes. It > > > introduces the following changes: > > > > > > * org-exp.el: > > > - added the following options: > > > - title-position (tpos) > > > - with-title (wtitle) > > > - with-author (wauth) > > [This is mostly addressed to Sebastian even though I'm replying to Tom's > reply.] > > An empty > > #+AUTHOR: > > disables the insertion of author (assuming that TITLE is not empty - > see below.) > > > > > - with-date (wdate) > > An empty > > #+DATE: > > disables the insertion of date (same assumption.) > > > > - with-maketitle (wmtitle) > > An empty > > #+TITLE: > > disables the insertion of \maketitle. To be honest, I didn't try setting empty author and date (which of course makes sense) I just tried not setting them at all, which gives default values. The main reason I submitted this patch, however, is having better control of \maketitle. Personally I would like to be able to have the title and author at the beginning of the file, just for the looks, and still be able to produce a customized title. Of course it is highly debatable if this is a sound reason to introduce new options (I would argue yes). > So if TITLE is not empty, you can get what you want with existing > machinery. I could not find a way to make the title empty and still > have author and/or date fields. > > Given all this, I think the only things you need is title-position and > with-title, the latter in the unlikely event that you want a title page > with author or date but without a title. Personally, I'd consider this > last one unimportant and not worry about it, but you may disagree. I agree concerning the author but no title case, this also does not seem interesting to me. > > > > > > * org-latex.el: > > > - implemented handling of new options (see above): > > > - title-position controls placement of \title, \author, \date; > > > possible values are "b" = before \begin{document}, > > > any other values default to after \begin{document} > > > - with-* controls if the corresponding macro is exported at all > > > this can be convenient for more complex titles (e.g. several > > > authors including affiliations,...) > > > > > > The patch seems to work for me so far. What do you all think? IMO it > > > would be useful to integrate this, as it gives slightly more control > > > over the export process. Of course one might want to think about > > > better option names. The diff is done against commit > > > bc161ded3693f752616dcd247fc9d638789025ee. > > > > > > Let me briefly describe my current use case: > > > I disable all commands except \title, use babel to created a title.tex > > > file (including several authors and affiliations) by tangling latex > > > code and then include the file (into the main body of the document, > > > not the preamble). That's the only decent way I've found to do this, > > > if anyone knows an easier way (I have the feeling that I might be > > > overlooking an obvious solution) please let me know! > > > > > I'm not sure what problem you are trying to solve here: can you explain? > It seems to me that all this can be done in standard ways. > I'm using revtex4-1 at the moment. I need a title which looks like this (within the document environment): \begin{abstract} some blabla \end{abstract} \author{First author} \affiliation{First affiliation} \affiliation{Second affiliation} \author{Second author} \affiliation{Third affiliation} ... \keywords{optional keywords} \pacs{optional pacs} \maketitle How would you solve this problem? > > > Cheers > > > Sebastian > > > > > > > > Aloha Sebastian, > > > > Your patch should prove useful in the situation where one has to use a > > particular class file that requires \title and friends to be declared in > > the body of the document rather than the preamble. That functionality > > is a welcome addition to the LaTeX exporter, IMO. > > > > 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? > > Has anybody researched the prevalence of these bugs? Are there lots of > classes in one or the other of the buggy categories? > > Be that as it may, it seems that org needs a patch to work around these > bugs. Personally, since it is a class problem, I'd rather have this > kind of information in the class template. You set it once for each > class that needs it and you forget about it. Assuming the maintainers > agree, any chance of reworking the patch along these lines? Maybe make > it extensible as well: a property list that can accumulate all the junk > in one place perhaps. That way the RevTeX class can be configured > appropriately and the rest of the world can live in blissful ignorance > of the problem. You might detect a bias here: I prefer these things in > the preamble by default. Last time this topic came up (because of Suvayu Ali's thesis) I posted something along these lines (http://article.gmane.org/gmane.emacs.orgmode/41129), wondering what's the best place to fix this problem. I never got any replies (maybe also because the thread was already a month old by that time). Back then I concluded that the class templates are not the best place to handle this, as they are only concerned with the preamble, but not with the body of the document. And I still don't see how this should fit in exactly. I agree of course that it would be the nicest thing to set this on a per class basis. > > Another way to achieve your current use case, IIUC, which might or might > > not seem easier, is to redefine \maketitle along the lines suggested by > > Nick Dokos (see > > http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-11_2). > > > > As I mentioned, I'm not really sure what Sebastian is looking for, so I > can't really say whether the above would help, but if it can be done > this way, I think it would be preferable to introducing new user options > for the exlusive use of the org latex exporter. There are legitimate uses > for user options but working around bugs in downstream packages is > not one of them. IMO, of course. > > Nick > Thanks for the detailed response, I'm hopeful that we can finally find a solution to this problem. I have some other comments to your later post about revtex, I will reply to this separately. Sebastian