emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: LaTex Adjustments for Org-Export
Date: Wed, 31 Jul 2013 10:01:08 -0400	[thread overview]
Message-ID: <87siyu96cb.fsf@gmail.com> (raw)
In-Reply-To: 51F902C4.4080902@taupro.com

Jeff Rush <jrush@taupro.com> 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

  parent reply	other threads:[~2013-07-31 23:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 12:27 LaTex Adjustments for Org-Export Jeff Rush
2013-07-31 13:44 ` John Hendy
2013-07-31 14:01 ` Nick Dokos [this message]
2013-07-31 16:24 ` Nick Dokos
2013-07-31 18:56   ` Suvayu Ali
2013-07-31 21:26     ` Nick Dokos
2013-08-03 20:49 ` Brian van den Broek
2013-08-04  1:26   ` John Hendy
2013-08-04  2:03     ` David Rogers
2013-08-04  4:16     ` Brian van den Broek
2013-08-04 14:51 ` Anthony Lander

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=87siyu96cb.fsf@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).