Re: [O] Custom title page in org-mode
John Hendy jw.he...@gmail.com writes: Neat tip about just doing #+title: ; hadn't realized a blank would do the same as the bind entry! Thanks -- I've added a FAQ in worg/org-faq.org about this. -- Bastien
Re: [O] Custom title page in org-mode
Steve Prud'Homme sprud...@gmail.com wrote: Ok so i use emacs for school work. I was trying to make a custom title page because, the default latex custom page do not respect my teacher standard So my org-file look like that : French comment : Exemple de page titre de l'UQAM int=E9gr=E9e dans un fichi= er.org #+LaTeX_CLASS: report #+LaTeX: \renewcommand{\baselinestretch}{1.5} #+latex_header: \usepackage[french]{babel} #+LaTeX: \begin{document} #+LaTeX:\begin{center} #+LaTeX:\thispagestyle{empty} #+LaTeX:\textbf {Universit=E9 du Qu=E9bec =E0 Montr=E9al} \\ #+LaTeX:\vspace*{\fill} #+LaTeX:Travail =E9crit : Mon m=E9tier d'hier =E0 aujourd'hui\\ #+LaTeX:\vspace*{\fill} #+LaTeX:Travail pr=E9sent=E9 =E0\\ #+LaTeX:Mme Sophie Grossman\\ #+LaTeX:\vspace*{\fill} #+LaTeX:Dans le cadre du cours\\ #+LaTeX:FPT 1402, groupe 20, R=E9flexion critique sur le m=E9tier, la techn= ique\\ #+LaTeX:\vspace*{\fill} #+LaTeX:Par\\ #+LaTeX:\textbf{Joseph Beno=EEt Steve Prud'Homme}\\ #+LaTeX:PRUS28108006\\ #+LaTeX:\vspace*{\fill} #+LaTeX:Programme\\ #+LaTeX:Baccalaur=E9at d'enseignement en formation professionnelle et techn= ique #+LaTeX:Concentration en formation professionnelle au secondaire\\ #+LaTeX:\vspace*{\fill} #+LaTeX:25 octobre 2010\\ #+LaTeX:\vspace*{\fill} #+LaTeX:\end{center} * Introduction et compr=E9hension de la th=E9matique (...) Ugh. The problem it is possible to cancel the default latex title page in my org-file. It is possible te place the table of content after the custom title page. I know that is latex question but i want to rest in my .org file and not edit my .tex file. This is actually not a latex question: the org latex exporter does these things in a standard way. It may be possible to override some or all of this behavior, but I haven't checked because I think there is a better method. If I were you, what I would do is make my own LaTeX class. Start from the one closest to the desired result (probably article), incorporate whatever changes you want from report.cls (in particular, the page breaks you want), make whatever changes you want to the \title, \author etc. macros, save the result as myarticle.cls in the same directory as your org file, and add an entry for it to org-export-latex-classes. Then add a #+LaTeX_CLASS: myarticle to your org file and off you go. In more detail: 1) I copied the official article.cls to myarticle.cls in the current directory with cp $(kpsewhich article.cls) myarticle.cls 2) In myarticle.cls, I changed \@titlepagefalse to \@titlepagetrue in order to get a separate title page, and I added a \newpage at the end of the \tableofcontents macro (btw, report.cls does the latter in a subtler way, but never mind about that) and just for the heck of it, I also changed the baselinestretch - but I think this last is better done in a different way [fn:1]: --8---cut here---start-8--- $ diff -u $(kpsewhich article.cls) myarticle.cls --- /usr/share/texmf-texlive/tex/latex/base/article.cls 2009-09-28 11:31:27.0 -0400 +++ myarticle.cls 2011-12-21 16:50:18.150992695 -0500 @@ -58,7 +58,7 @@ \newcommand\@ptsize{} \newif\if@restonecol \newif\if@titlepage -\@titlepagefalse +\@titlepagetrue \if@compatibility\else \DeclareOption{a4paper} {\setlength\paperheight {297mm}% @@ -123,7 +123,7 @@ \input{size1\@ptsize.clo} \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} -\renewcommand\baselinestretch{} +\renewcommand\baselinestretch{1.3} \setlength\parskip{0\p@ \@plus \p@} \@lowpenalty 51 \@medpenalty 151 @@ -514,6 +514,7 @@ \@mkboth{% \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}% \@starttoc{toc}% +\newpage% } \newcommand*\l@part[2]{% \ifnum \c@tocdepth -2\relax --8---cut here---end---8--- 3) I added a stanza to org-export-latex-classes (I did that temporarily in my *scratch* buffer, but you can add it to .emacs if you want): --8---cut here---start-8--- (add-to-list 'org-export-latex-classes '(myarticle \\documentclass[11pt]{myarticle} (\\section{%s} . \\section*{%s}) (\\subsection{%s} . \\subsection*{%s}) (\\subsubsection{%s} . \\subsubsection*{%s}) (\\paragraph{%s} . \\paragraph*{%s}) (\\subparagraph{%s} . \\subparagraph*{%s}))) --8---cut here---end---8--- 4) I added the LaTeX_CLASS line to my org file: --8---cut here---start-8--- #+LaTeX_CLASS: myarticle --8---cut here---end---8--- That's all that's needed to produce separate title and TOC pages and keep the rest of the article class intact. If you don't like the titlepage format, you can modify it to your heart's content: you will need to figure out the LaTeX
Re: [O] Custom title page in org-mode
On Wed, Dec 21, 2011 at 4:15 PM, Nick Dokos nicholas.do...@hp.com wrote: Steve Prud'Homme sprud...@gmail.com wrote: Ok so i use emacs for school work. I was trying to make a custom title page because, the default latex custom page do not respect my teacher standard So my org-file look like that : [...] If I were you, what I would do is make my own LaTeX class. Start from the one closest to the desired result (probably article), incorporate whatever changes you want from report.cls (in particular, the page breaks you want), make whatever changes you want to the \title, \author etc. macros, save the result as myarticle.cls in the same directory as your org file, and add an entry for it to org-export-latex-classes. Then add a #+LaTeX_CLASS: myarticle [...] That's all that's needed to produce separate title and TOC pages and keep the rest of the article class intact. If you don't like the titlepage format, you can modify it to your heart's content: you will need to figure out the LaTeX part to do that, but that's not as difficult as you might think it is at first sight - and I guarantee that you will have an easier time this way than fighting the org latex exporter, a fight that you will probably lose :-) IMO, of course. I just did this and took a different method. I simply added: --- #+text: \input{./title.tex} --- to the beginning of my document. Then I created a separate .tex file with the title. If something is recurring, maybe it's worth the separate article class file. If not, I think it *might* be simpler to just define a custom title page and do as above. I think I just followed this: http://en.wikibooks.org/wiki/LaTeX/Title_Creation#Custom_Title_Pages Up to you! I can't guarantee this is right; I'm on a work computer and did this on my home one. John Nick Footnotes: [fn:1] Bastien is right that redefining \baselinestretch is better than mucking around with the \baselineskip as I suggested (see e.g. http://www.tex.ac.uk/cgi-bin/texfaq2html?label=linespace ) It's probably even better to do it like this however: --8---cut here---start-8--- #+LaTeX_HEADER: \usepackage{setspace}\doublespacing --8---cut here---end---8--- or --8---cut here---start-8--- #+LaTeX_HEADER: \usepackage{setspace}\onehalfspacing --8---cut here---end---8--- or if you don't like the built-in factors, choose your own: --8---cut here---start-8--- #+LaTeX_HEADER: \usepackage{setspace}\setstretch{1.3} --8---cut here---end---8--- BTW, I think the factors are logarithmic: doublespacing is about 1.66 and onehalfspacing is 1.25 or so (depending on the font size).
Re: [O] Custom title page in org-mode
John Hendy jw.he...@gmail.com wrote: That's all that's needed to produce separate title and TOC pages and keep the rest of the article class intact. If you don't like the titlepage format, you can modify it to your heart's content: you will need to figure out the LaTeX part to do that, but that's not as difficult as you might think it is at first sight - and I guarantee that you will have an easier time this way than fighting the org latex exporter, a fight that you will probably lose :-) IMO, of course. I just did this and took a different method. I simply added: --- #+text: \input{./title.tex} --- to the beginning of my document. Then I created a separate .tex file with the title. If something is recurring, maybe it's worth the separate article class file. If not, I think it *might* be simpler to just define a custom title page and do as above. I think I just followed this: http://en.wikibooks.org/wiki/LaTeX/Title_Creation#Custom_Title_Pages Up to you! I can't guarantee this is right; I'm on a work computer and did this on my home one. ... but you have to do something (or perhaps *not* do something) in order to convince the org latex exporter not to produce a title page, right? Is it something simple like omitting #+TITLE and #+AUTHOR? Nick
Re: [O] Custom title page in org-mode
Nick Dokos nicholas.do...@hp.com wrote: John Hendy jw.he...@gmail.com wrote: That's all that's needed to produce separate title and TOC pages and keep the rest of the article class intact. If you don't like the titlepage format, you can modify it to your heart's content: you will need to figure out the LaTeX part to do that, but that's not as difficult as you might think it is at first sight - and I guarantee that you will have an easier time this way than fighting the org latex exporter, a fight that you will probably lose :-) IMO, of course. I just did this and took a different method. I simply added: --- #+text: \input{./title.tex} --- to the beginning of my document. Then I created a separate .tex file with the title. If something is recurring, maybe it's worth the separate article class file. If not, I think it *might* be simpler to just define a custom title page and do as above. I think I just followed this: http://en.wikibooks.org/wiki/LaTeX/Title_Creation#Custom_Title_Pages Up to you! I can't guarantee this is right; I'm on a work computer and did this on my home one. ... but you have to do something (or perhaps *not* do something) in order to convince the org latex exporter not to produce a title page, right? Is it something simple like omitting #+TITLE and #+AUTHOR? One has to either a) explicitly have an empty #+TITLE: or b) set org-export-latex-title-command to . The in-file setting for the latter is #+BIND: org-export-latex-title-command but #+TITLE: is easier :-) Nick PS. BTW, there's plenty o' stuff on the mailing list about such problems: http://thread.gmane.org/gmane.emacs.orgmode/38156 http://thread.gmane.org/gmane.emacs.orgmode/28138 http://thread.gmane.org/gmane.emacs.orgmode/40596 http://thread.gmane.org/gmane.emacs.orgmode/32081 and probably much more...
Re: [O] Custom title page in org-mode
On Wed, Dec 21, 2011 at 5:25 PM, Nick Dokos nicholas.do...@hp.com wrote: John Hendy jw.he...@gmail.com wrote: That's all that's needed to produce separate title and TOC pages and keep the rest of the article class intact. If you don't like the titlepage format, you can modify it to your heart's content: you will need to figure out the LaTeX part to do that, but that's not as difficult as you might think it is at first sight - and I guarantee that you will have an easier time this way than fighting the org latex exporter, a fight that you will probably lose :-) IMO, of course. I just did this and took a different method. I simply added: --- #+text: \input{./title.tex} --- to the beginning of my document. Then I created a separate .tex file with the title. If something is recurring, maybe it's worth the separate article class file. If not, I think it *might* be simpler to just define a custom title page and do as above. I think I just followed this: http://en.wikibooks.org/wiki/LaTeX/Title_Creation#Custom_Title_Pages Up to you! I can't guarantee this is right; I'm on a work computer and did this on my home one. ... but you have to do something (or perhaps *not* do something) in order to convince the org latex exporter not to produce a title page, right? Is it something simple like omitting #+TITLE and #+AUTHOR? Good point. Yes. Now that I'm back at home I looked at the document and the header stuff in the document in which I used this technique is: #+OPTIONS: toc:nil TeX:t LaTeX:t H:4 f:t todo:nil num:nil tags:nil #+BIND: org-export-latex-title-command #+text: \input{./title-page.tex} * first headline Neat tip about just doing #+title: ; hadn't realized a blank would do the same as the bind entry! John Nick
Re: [O] Custom title page in org-mode
John Hendy jw.he...@gmail.com wrote: Neat tip about just doing #+title: ; hadn't realized a blank would do the same as the bind entry! Carsten pointed that out in one of the threads that I referred to in my other email. I hadn't realized it back then and I didn't remember it now until I found that thread. Time to get a new brain... Nick PS. ... and thank goodness for the mailing list archives.