3

I use org-mode basically for handling TODO lists and taking notes. Some time ago, I wrote some documentation using markdown-mode and exported to PDF using pandoc.

Now I am trying to export to PDF from org-mode. I basically write the org-mode file and use org-latex-export-to-pdf function.

I have this org-mode file:

enter image description here

When I export it I get something like this:

enter image description here

How can I get more separation space between paragraphs?

3

The most common way to quickly add spaces between paragraphs in LaTeX is to use the parskip package . You can tell org-mode to include that in the LaTeX header by adding the line

#+LATEX_HEADER: \usepackage{parskip}

to the document preamble at the top of your org-mode file.

Including the parskip package automatically adds separation between paragraphs and removes indentation. If you want the separation and still want paragraphs to be indented, you can set the parindent length back to the default by also adding the line

#+LATEX_HEADER: \setlength{\parindent}{15pt}

Changing the parskip length directly messes up other things like spacing between list items. See this TeX.SX question for more details.

2

PDF output is generated by LaTeX, so you need to add the LaTeX code for increasing paragraph spacing. That's controlled by the \parskip variable, which is set in LaTeX like this:

\setlength{\parindent}{1cm}

To add that to your org source file, place the following line at the top of the file:

    #+LATEX_HEADER:\setlength{\parindent}{1cm}

You can use other units too, including in, pt, etc., and you can use decimal values like 1.2in.

  • Did not work for me. – Felipe Apr 11 '18 at 19:39
  • I'm sorry to hear that @Felipe, but there's not much anyone can do without some details. Perhaps you should open a new question with a minimal reproducible example to show us what you've tried. – Tyler Apr 11 '18 at 20:53
0

Well, I have no idea about LaTeX, but I could found this great Visual LaTeX FAQ, that when clicking in the proper separation paragraph redirect to Zero paragraph indent section. Following those explanations and this blog entry on TeX/LaTeX paragraphs, I could export it as I wanted.

I quoted two lines of LaTeX code. First one:

#+LATEX: \setlength{\parskip}{\baselineskip} \setlength{\parindent}{0pt}

to set a bigger space between paragraphs, since it seems that 0pt is the default value. {12pt} also works instead of {\baselineskip}. Moreover, setting \parindent to 0pt, removes the default paragraph indentation.

And

#+LATEX: \setlength{\parskip}{0pt} \setlength{\parindent}{20pt}

to reset it back, so the following paragraphs have no separation in between. And they have indentation again set to 20pt.

Image from org-mode file with quoted LaTeX:

enter image description here

And exported PDF file:

enter image description here

That's it!

  • 1
    If you just want to add a vertical space once, you can use \vspace{10pt} instead of changing \parskip back and forth – Tyler Jun 4 '16 at 23:57
  • Even better is to use \bigskip which will put in an amount of vertical space appropriate to the Latex class being used. – erikstokes Jun 5 '16 at 2:15
  • Well... I know my solution is not optimal, but it worked... And especially, I attached images to clarify what I wanted to achieve. I am not expecting to be the best answer (since I have zero experience with LaTeX), but at least I think I do not deserve a downvote... Anyway, what do I care what other people think! – nephewtom Jun 6 '16 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.