0

I am writing a paper in Org-mode and I will need a PDF output through LaTeX. Though, I had issues with spacing (had too large gaps), so I checked the .tex file generated by Org-mode. Apparently, it added \\ at the end of every line, which made the gaps huge (probably making it think a new paragraph is created). Plus, it loaded a number of the packages I employed twice. I am sharing both the .org and the .tex files here (a simplified version of the original document).

.tex file that I manually fixed

.org file

produced .pdf

.tex file generated by Org-mode

3
  • 2
    The main question I have is why you are using Org mode in the first place. The file is mostly LaTeX and you modify even the things that Org mode usually provides (like section headers) which makes it more work to do it in Org mode than doing it directly in LaTeX. Either write it completely in LaTeX or define your own class to take care of the details you want to modify and load that class through org-latex-classesand org-latex-default-class. – NickD Apr 15 at 11:51
  • @NickD It's because this is the first document I'm writing in LaTeX and Org-mode helps me with it. I would love to use org-latex-classes but this also just happens to be the first time I'm using Org-mode, so I don't know anything about it besides the things I used in the document (it's still questionable that I am in total control and know what I am doing). – abtoiew Apr 15 at 12:04
  • orgmode is kind of complex, especially when exporting to pdf. LaTeX is very complex, with or without orgmode. Learning both at once is a big challenge, more work than learning either one on their own I think. Looking at your original org file, I think NickD is right. orgmode certainly helps you with some things, but you're also doing a lot of extra work to make up for the things orgmode isn't helping you with. – Tyler Apr 15 at 15:08
1

I couldn't export your org file since I had a lot of LaTeX errors, but I think your questions can be answered without your (not so minimal :-)) working example.

Apparently, it added \ at the end of every line, which made the gaps huge (probably making it think a new paragraph is created).

That's just because you explicitly requested this behaviour with #+OPTIONS: \n:t. Set it to nil to avoid that.

Plus, it loaded a number of the packages I employed twice

The packages added by default by the org exporter can be customized thanks to the variable org-latex-default-packages-alist. It is not recommended to remove them, however (instead, it's probably better not to call them manually in your header, unless you want to specify some options, or you have some package conflicts).

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.