1

I'm using #+INCLUDE: "./file.txt" to organize documents but including files this way is messing with linefeeds on org-mode export to LaTeX/Pdf. Is there a property or attribute that could tell org-mode to read from these included files as is. I've already converted the newlinews to unix standard, but since LaTeX interprets newlines as two lines separated by one blank line, the text is messy.

enter image description here

4
  • Can you give us an example of the text in file.txt and how it looks after export? Is this different than how text in your source .org file is exported?
    – Tyler
    Oct 1, 2021 at 19:03
  • A simple listing dir in Windows exported with pipes: ls > file.txt Oct 1, 2021 at 19:10
  • Does the same text export how you want it if you insert it directly into the org file?
    – Tyler
    Oct 1, 2021 at 19:31
  • No, it's messy also. The linefeeds are ignored, but I think this is the behaviour of LaTeX. Oct 1, 2021 at 19:47

1 Answer 1

1

orgmode exports to pdf using LaTeX. LaTeX ignores single line breaks normally, which can be confusing.

When you're importing a plain text file into org, you can wrap it in an example block to indicate that you want it exported 'as-is', without the normal LaTeX treatment of linebreaks:

#+include: file.txt example

For more details see (org) Include Files and (org) Example blocks in LaTeX export.

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.