I am writing a text in orgmode that I want to export to pdf. I want to include specific lines from a latex file using #+include:. In fact, I want to include multiple text sections from a single latex file at specific locations in an org file.

Following the documentation I should be able to do so using the :lines argument with export latex. This, however, seems not to be working.

An org file with the following content:

#+TITLE: Some File

* Heading

#+include: "another-file.tex" export latex :lines 3-5

Does not include anything from the latex file.

I also tested whether the order of arguments had an effect, i.e., with #+include: "another-file.tex" :lines 3-5 export latex. This results in the whole .tex-file being included in the exported PDF.

What am I missing here?

  • Please submit a bug report with M-x org-submit-bug-report. I don't think you are missing anything. – NickD May 11 at 17:13
  • Thanks @NickD, I'll file one, and thanks also for bringing that command to my attention. – grszkthfr May 14 at 5:07
  • As the answer points out, it's more of a documentation bug than anything else. OTOH, it's not clear to me that the quotes buy us anything, so it may still be worth asking on the ML. – NickD Jun 7 at 14:08

I've tested your code and when I add quotation marks to the line numbers (as described in the documentation), it works.

Here is the working code:

#+TITLE: Some File

* Heading

#+include: "another-file.tex" export latex :lines "3-5"

Hope this helps.

  • You are right: the regexp for lines is looking for the quotes. But the documentation is inconsistent: section Include file has four examples. the first three with quotes, the fourth without. – NickD Jun 7 at 14:05

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.