emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTex Adjustments for Org-Export
@ 2013-07-31 12:27 Jeff Rush
  2013-07-31 13:44 ` John Hendy
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Jeff Rush @ 2013-07-31 12:27 UTC (permalink / raw)
  To: emacs-orgmode

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.

-Jeff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: John Hendy @ 2013-07-31 13:44 UTC (permalink / raw)
  To: Jeff Rush; +Cc: emacs-orgmode

On Wed, Jul 31, 2013 at 7:27 AM, Jeff Rush <jrush@taupro.com> wrote:
> 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.
>

Can't help with this one.

> 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 have the following in my setupfile, which I think greatly improves
the default look:
#+latex_header: \usepackage[hmargin=2.5cm,vmargin=2.5cm]{geometry}
#+latex_header: \usepackage{paralist}
#+latex_header: \setlength{\parskip}{0.5cm} \setlength{\parindent}{0cm}
#+latex_header: \usepackage{mathpazo}

The \parskip and \parindent options should get you in the ballpark of
what you're looking for (non-indented new paragraphs, white space
between consecutive paragraphs).

The others widen the text space and use a nicer font.

Good luck!


John

>
> -Jeff
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  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
  2013-07-31 16:24 ` Nick Dokos
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Nick Dokos @ 2013-07-31 14:01 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  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
@ 2013-07-31 16:24 ` Nick Dokos
  2013-07-31 18:56   ` Suvayu Ali
  2013-08-03 20:49 ` Brian van den Broek
  2013-08-04 14:51 ` Anthony Lander
  4 siblings, 1 reply; 11+ messages in thread
From: Nick Dokos @ 2013-07-31 16:24 UTC (permalink / raw)
  To: emacs-orgmode

[I thought I sent this before but I don't see it on gmane, so it's
 either hung up somewhere or in the bit bucket. Apologies if you see it
 twice - assuming that it makes it at least this time :-)]

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  2013-07-31 16:24 ` Nick Dokos
@ 2013-07-31 18:56   ` Suvayu Ali
  2013-07-31 21:26     ` Nick Dokos
  0 siblings, 1 reply; 11+ messages in thread
From: Suvayu Ali @ 2013-07-31 18:56 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Jul 31, 2013 at 12:24:35PM -0400, Nick Dokos wrote:
> 
> 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" :-) )

:)

On a serious note, doesn't the report class already do that?

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  2013-07-31 18:56   ` Suvayu Ali
@ 2013-07-31 21:26     ` Nick Dokos
  0 siblings, 0 replies; 11+ messages in thread
From: Nick Dokos @ 2013-07-31 21:26 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Wed, Jul 31, 2013 at 12:24:35PM -0400, Nick Dokos wrote:
>> 
>> 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" :-) )
>
> :)
>
> On a serious note, doesn't the report class already do that?

Not really: the first two levels are mapped to part/chapter which *do*
get a new page; the third level is mapped to section which does not.
-- 
Nick

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  2013-07-31 12:27 LaTex Adjustments for Org-Export Jeff Rush
                   ` (2 preceding siblings ...)
  2013-07-31 16:24 ` Nick Dokos
@ 2013-08-03 20:49 ` Brian van den Broek
  2013-08-04  1:26   ` John Hendy
  2013-08-04 14:51 ` Anthony Lander
  4 siblings, 1 reply; 11+ messages in thread
From: Brian van den Broek @ 2013-08-03 20:49 UTC (permalink / raw)
  To: Jeff Rush; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

On Jul 31, 2013 8:28 AM, "Jeff Rush" <jrush@taupro.com> wrote:
>
> 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.
>

<snip>

>
> 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.

Hi all,

(Catching up on the traffic, so a bit late to the thread.)

I don't use org's export facilities, so I am not sure how and where to
object this into org's export process. But, the LaTeX way is to use the
parskip package.

Please do reconsider, though. Just about every book on my shelves follows
what you label a 'strange style,' for the good reason that the style you
favour can result in ambiguity. (A paragraph that ends a page, takes up the
entire last line and is followed by a new paragraph cannot be distinguished
from a paragraph that spans the page break.)

Best,

Brian vdB

[-- Attachment #2: Type: text/html, Size: 1665 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  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
  0 siblings, 2 replies; 11+ messages in thread
From: John Hendy @ 2013-08-04  1:26 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: emacs-orgmode, Jeff Rush

On Sat, Aug 3, 2013 at 3:49 PM, Brian van den Broek
<brian.van.den.broek@gmail.com> wrote:
>
> On Jul 31, 2013 8:28 AM, "Jeff Rush" <jrush@taupro.com> wrote:
>>
>> 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.
>>
>
> <snip>
>
>>
>> 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.
>
> Hi all,
>
> (Catching up on the traffic, so a bit late to the thread.)
>
> I don't use org's export facilities, so I am not sure how and where to
> object this into org's export process. But, the LaTeX way is to use the
> parskip package.
>
> Please do reconsider, though. Just about every book on my shelves follows
> what you label a 'strange style,' for the good reason that the style you
> favour can result in ambiguity. (A paragraph that ends a page, takes up the
> entire last line and is followed by a new paragraph cannot be distinguished
> from a paragraph that spans the page break.)
>

True, though when it comes to that sort of thing I look at it from a
probability point of view:
- p(what you described happens): perhaps < 1%, if even that high
- p(looking at default LaTeX format will make my eyes bleed): 100%

That was [mostly] a joke. I'm actually not clear from the text above
what is desired. The description says "no leading indent and blank
line between," but the example text shows non-indent on first
paragraph, indent on second (which would void the page-span concern),
and no line break...

I take it you have literary experience, which I'm glad to have on the
list. Your comment made me consider that I often fiddle with "what
seems to look nice," overlooking that some of these things have a very
specific purpose in terms of avoiding ambiguity or what you described
-- I'd never have thought of that!


John

> Best,
>
> Brian vdB

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  2013-08-04  1:26   ` John Hendy
@ 2013-08-04  2:03     ` David Rogers
  2013-08-04  4:16     ` Brian van den Broek
  1 sibling, 0 replies; 11+ messages in thread
From: David Rogers @ 2013-08-04  2:03 UTC (permalink / raw)
  To: emacs-orgmode

John Hendy <jw.hendy@gmail.com> writes:

> That was [mostly] a joke. I'm actually not clear from the text above
> what is desired. The description says "no leading indent and blank
> line between," but the example text shows non-indent on first
> paragraph, indent on second (which would void the page-span concern),
> and no line break...

At first, I didn't understand the original post, but when I took the
original request to mean "no indent *on the first paragraph of the
chapter or section*", then the rest made more sense to me.

My take on the subject:

- indent is good if you want it;

- added blank line is good if you want it;

- both at once is never good; it's necessary to choose between extra
  blank OR indenting, and stick with your choice throughout a work;

- indenting the first paragraph of a chapter, or putting an extra blank
  line directly after the chapter heading, should both be
  eliminated. (Of course chapter headings should have suitable vertical
  space after them depending on the style - I'm talking about not also
  adding extra after that.)

- In either case, this means a special rule is needed: paragraphs should
  begin with indent, or with an added blank line - BUT not if this is
  the first paragraph.

-- 
David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  2013-08-04  1:26   ` John Hendy
  2013-08-04  2:03     ` David Rogers
@ 2013-08-04  4:16     ` Brian van den Broek
  1 sibling, 0 replies; 11+ messages in thread
From: Brian van den Broek @ 2013-08-04  4:16 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, Jeff Rush

[-- Attachment #1: Type: text/plain, Size: 2818 bytes --]

On Aug 3, 2013 9:26 PM, "John Hendy" <jw.hendy@gmail.com> wrote:
>
> On Sat, Aug 3, 2013 at 3:49 PM, Brian van den Broek
> <brian.van.den.broek@gmail.com> wrote:
> >
> > On Jul 31, 2013 8:28 AM, "Jeff Rush" <jrush@taupro.com> wrote:
> >>
> >> 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.
> >>
> >
> > <snip>
> >
> >>
> >> 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.
> >
> > Hi all,
> >
> > (Catching up on the traffic, so a bit late to the thread.)
> >
> > I don't use org's export facilities, so I am not sure how and where to
> > object this into org's export process. But, the LaTeX way is to use the
> > parskip package.
> >
> > Please do reconsider, though. Just about every book on my shelves
follows
> > what you label a 'strange style,' for the good reason that the style you
> > favour can result in ambiguity. (A paragraph that ends a page, takes up
the
> > entire last line and is followed by a new paragraph cannot be
distinguished
> > from a paragraph that spans the page break.)
> >
>

<snip>

> That was [mostly] a joke. I'm actually not clear from the text above
> what is desired. The description says "no leading indent and blank
> line between," but the example text shows non-indent on first
> paragraph, indent on second (which would void the page-span concern),
> and no line break...

Indeed it does. I missed that reading on my phone. I don't see how I can
blame my strange typo on that though, so perhaps I ought just give up :-)

As I said, I don't export from org to latex, but I am puzzled. The style
you describe (and which the OP appears to display) is what LaTeX does for
me by default. I know that no leading indent and inter-paragraph separation
is a common desire, so I guess I let lazy thinking take over.

> I take it you have literary experience, which I'm glad to have on the
> list. Your comment made me consider that I often fiddle with "what
> seems to look nice," overlooking that some of these things have a very
> specific purpose in terms of avoiding ambiguity or what you described
> -- I'd never have thought of that!

I care about typography and have come to embrace that Knuth, Lamport, and
that maintainers of all things TeXnical are rather better at it than am I.
It is hard to resist the urge to fiddle, but I try :-)

Best,

Brian vdB

[-- Attachment #2: Type: text/html, Size: 3851 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: LaTex Adjustments for Org-Export
  2013-07-31 12:27 LaTex Adjustments for Org-Export Jeff Rush
                   ` (3 preceding siblings ...)
  2013-08-03 20:49 ` Brian van den Broek
@ 2013-08-04 14:51 ` Anthony Lander
  4 siblings, 0 replies; 11+ messages in thread
From: Anthony Lander @ 2013-08-04 14:51 UTC (permalink / raw)
  To: Jeff Rush; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1663 bytes --]

Hi Jeff,

I just saw your question about removing paragraph indent, and adding space
between paragraphs. You can do that with the following LaTeX commands:

\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} %% Add space between
paragraphs

\setlength{\parindent}{0pt} %% Do not indent paragraphs


You can put them at the top of your org document like so:


#+LATEX_HEADER: \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} %% Add
space between paragraphs

#+LATEX_HEADER: \setlength{\parindent}{0pt} %% Do not indent paragraphs


I hope this helps!


  -Anthony


On Wed, Jul 31, 2013 at 8:27 AM, Jeff Rush <jrush@taupro.com> wrote:

> 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.
>
> -Jeff
>
>
>

[-- Attachment #2: Type: text/html, Size: 2499 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-08-04 14:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).