emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Professional PDF LaTeX templates?


From: Russell Adams
Subject: Re: [O] Professional PDF LaTeX templates?
Date: Thu, 17 Mar 2011 07:06:28 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Mar 16, 2011 at 10:54:18AM -0400, Nick Dokos wrote:
> 'Mash <address@hidden> wrote:
>
> >
> > I suppose by "professional" I really meant "polished", and so it is
> > LaTeX styling I have having trouble with, it may also be laziness on
> > my part. I have tried searching for LaTeX styling which I can
> > translate into a few org-mode header declarations but still can't work
> > out what is or is not compatible with org-mode (LaTeX classes) or how
> > to implement styling correctly.
> >

I understand completely! So here's a few tricks I use.

First, my org-class for latex is "none". This lets me manage my
documentclass and other features in the org export header.

(setq org-export-latex-classes (cons '("none"
                                                                           
"[NO-DEFAULT-PACKAGES][NO-PACKAGES]"
                                                                           
("\\section{%s}" . "\\section*{%s}")
                                                                           
("\\subsection{%s}" . "\\subsection*{%s}")
                                                                           
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                                                                           
("\\paragraph{%s}" . "\\paragraph*{%s}")
                                                                           
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
                                                                         
org-export-latex-classes))

Then, my documents start like this:

----------------------------------------------------------------------
#+OPTIONS:   H:3 num:nil toc:t \n:t @:t ::t |:t ^:nil -:t f:t *:t TeX:t 
LaTeX:nil skip:nil d:nil tags:not-in-toc
#+BIND: org-export-latex-title-command ""
#+LaTeX_CLASS: none
#+LATEX_HEADER: \documentclass[10pt,letterpaper]{article}
#+LATEX_HEADER: 
\usepackage[letterpaper,includeheadfoot,top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry}
#+LATEX_HEADER: \usepackage[utf8]{inputenc}
#+LATEX_HEADER: \usepackage[T1]{fontenc}
#+LATEX_HEADER: \usepackage{lastpage}
#+LATEX_HEADER: \usepackage{fancyhdr}
#+LATEX_HEADER: \pagestyle{fancy}
#+LATEX_HEADER: \usepackage{hyperref}
#+LATEX_HEADER: \hypersetup{colorlinks,linkcolor=blue}
#+LATEX_HEADER: \renewcommand{\headrulewidth}{1pt}
#+LATEX_HEADER: \renewcommand{\footrulewidth}{0.5pt}
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{multicol}
#+LATEX_HEADER: \geometry{headheight=47pt}
#+LATEX_HEADER:
#+LATEX_HEADER: \def\ORGTITLE      {Latex Example}
#+LATEX_HEADER: \def\ORGAUTHOR     {Russell Adams}
#+LATEX_HEADER:
#+LATEX_HEADER: % Header
#+LATEX_HEADER: \fancyhead[L]{\LARGE \ORGTITLE  }
#+LATEX_HEADER: \fancyhead[R]{\bf    \ORGAUTHOR }
#+LATEX_HEADER:
#+LATEX_HEADER: % Footer
#+LATEX_HEADER: \fancyfoot[L]{\small \ORGTITLE\\ \today}
#+LATEX_HEADER: \fancyfoot[C]{\small Revision: \Revision \\ Page \thepage\ of 
\pageref{LastPage}}
#+LATEX_HEADER: \fancyfoot[R]{\small \ORGAUTHOR }

----------------------------------------------------------------------


That way I can control all of the output in the Org file. I intend to
make a custom class eventually for letterhead, but haven't yet.

Other ones to experiment with are:

\setlength{\parindent}{0pt}   - Don't indent each paragraph (pet peeve)
\setlength{\parskip}{10pt}    - Add a small indent between paragraps

Better fonts:

\usepackage[scaled]{helvet}
\renewcommand*\familydefault{\sfdefault}

I also don't export from inside emacs. I use a makefile and call a
separate emacs instance in batch mode.

> > There are a huge amount of LaTeX examples on the web, but they are
> > full documents with inline elements, I wanted to know if anyone has
> > already setup classes that work, with notes on LaTeX dependencies (and
> > how and where to download them from) which they use day to day to
> > produce reports, articles, contracts or client proposals from simple
> > .org files?

I know there are many pre-made classes available for Latex,
unfortunately I haven't found any good "galleries" of sample
output. That makes it difficult to know where to start.

Let me know if you find one!

> Both Eric Fraga and John Hendy have given valid answers to how one goes
> about it: you settle down to *one* kind of document that you want to
> produce (take the simplest one and leave the rest for later), then
> either learn enough LaTeX to be able to produce it or cajole/beg/hire
> somebody to do it for you, and *then* figure out how to use org to produce
> the LaTeX needed to produce that kind of document.
>
> The trouble is that neither org nor LaTeX are black boxes whose insides
> you can afford to ignore. With the approach outlined above, at the end
> of the process, you *will* have a (blackbox-like) almost automatic way of
> going from org to "professional" output, but it is fragile in the sense
> that if you want to change something, you will need to implement the
> change in LaTeX first, and once you are satisfied with the output, you
> will need to go back and tweak the org mechanisms to produce that.
> Then you can shut your eyes again and pretend that it's a black box.
>
> So learn some LaTeX: once you get past the initial hump (the mechanics
> of producing output), then it's not only fairly easy, it also starts
> making sense. Having a desired output (keep it simple!) is going to make
> that an enjoyable journey too. And once you touch down on LaTeX island,
> and become comfortable, you'll either never leave or you'll want to
> visit again and again!

I agree, learn some Latex too. Org's another layer, but much more
convenient.

Good luck!

------------------------------------------------------------------
Russell Adams                            address@hidden

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



reply via email to

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