emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] LaTex Adjustments for Org-Export


From: Nick Dokos
Subject: Re: [O] LaTex Adjustments for Org-Export
Date: Wed, 31 Jul 2013 10:01:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Jeff Rush <address@hidden> writes:

> I'm trying to export a .org file to .pdf and although I've gotten past
> many formatting hurdles, I am stuck on two problems.
>
> 1) How can I redefine, in my org-export-latex-classes variable, the
> \section definition, such that it includes \pagebreak?
>      My reason is that I would like each of my top-level headings to
> start on a new page, like a new chapter.
>
> 2) How can I change the basic formatting of paragraphs everywhere to
>
>      a) omit the leading indent, and
>      b) have a blank line between paragraphs
>
>     Instead of this strange-looking style:
>
>         This is a test paragraph
>     of the following kind of thing.
>         And so is this one.
>
>     I want it to look like this:
>
>     This is a test paragraph
>     of the following kind of thing.
>       And so is this one.
>
> Thanks for any helpful souls out there.  I'm working on learning LaTeX
> but can't see how the various parts of the "article" base class fit
> together and how to selectively override them.
>

I think the best solution is along these lines:

o use a latex style file to redefine \parindent and \parskip. Also
  define a new command, \psection, to do the page break thingie.

o Add a new class to org-latex-classes which is just like "article"
  except that it uses \psection in place of \section (so I call it
  "particle" :-) )

o Tell org to use particle as your LaTeX class, and also tell it to
  use the latex style from step 1.

In more detail, create a file, foo.sty, in the same directory as your
org file and give it these contents:

--8<---------------cut here---------------start------------->8---
\setlength{\parindent}{0pt}
\setlength{\parskip}{4pt}
\newcommand{\psection}{\newpage\section}
--8<---------------cut here---------------end--------------->8---

Then evaluate the following (or add this to your .emacs if you
want to make it permanent - needs to be added *after* org-latex-classes
is defined, so it might need to be in a hook):

--8<---------------cut here---------------start------------->8---
(add-to-list 'org-latex-classes
             '("particle" "\\documentclass[11pt]{article}"
               ("\\psection{%s}" . "\\psection*{%s}")
               ("\\subsection{%s}" . "\\subsection*{%s}")
               ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
               ("\\paragraph{%s}" . "\\paragraph*{%s}")
               ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
--8<---------------cut here---------------end--------------->8---

and finally your org file should look like this:

--8<---------------cut here---------------start------------->8---
#+LATEX_CLASS: particle
#+LATEX_HEADER: \usepackage{foo}

* foo
This is a long long long long long long long long long long long long
long long long long long long long long long long long long long long
long long long long long long long long long long long long long long
long long long long long long long long long long long long long long
long long long long long long long long long long long long long long
long long long long long long long long long paragraph.

This is another paragraph.

* bar
Who knows?

Who cares?
--8<---------------cut here---------------end--------------->8---

HTH.
-- 
Nick




reply via email to

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