10

Is there a switch on org-mode I can use on export to ODT (or other format) to format my source file of

This is a paragraph this is a paragraph this is a paragraph this is a paragraph this is a paragraph this is a paragraph this is a paragraph this is a paragraph this is a paragraph.

This is another paragraph this is another paragraph this is another paragraph this is another paragraph this is another paragraph this is another paragraph this is another paragraph this is another paragraph.

into:

     This is a paragraph this is a paragraph this is a paragraph this is a
paragraph this is a paragraph this is a paragraph this is a paragraph
this is a paragraph this is a paragraph.
     This is another paragraph this is another paragraph this is another
paragraph this is another paragraph this is another paragraph this is
another paragraph this is another paragraph this is another paragraph.
3

Since you mentioned "other format" also, here's a solution for LaTex:

#+LaTeX_HEADER: \setlength{\parindent}{1cm} % Default is 15pt.

Insert the above line at the top of your org file and use the LaTex back-engine to print.

  • This is promising, but I'd still love an avenue to get me to an ODT file. If I export to LaTex, I can continue on to a PDF, but is there a way to get from LaTeX to ODT? – Steven Arntson Jun 13 '15 at 18:37
  • Sure there are several tools that can get you from TEX->ODT depending on your OS. TeX2Word, GrindEQ, Latex2RTF, TeX4HT and others like that come to mind. Some of these may require an intermediate step of creating html, doc, or rtf formats. But with a little scripting this entire workflow can be automated. mk4ht on ubuntu is a popular solution as well. If you don't mind loading additional development tools, consider a modern solution like pandoc, which is the swiss army knife of conversion tools between various markup languages. – Emacs User Jun 13 '15 at 19:39
  • I looked at pandoc, and that seems like a great utility. Would you be willing to add a strategy above that used pandoc to get from LaTeX to ODT? It would be a huge help to me, and I'd elect it as my answer. Thank you! – Steven Arntson Jun 14 '15 at 0:38
  • I think you already have your answer here. But you're looking for a specific implementation solution for which you should investigate other mechanisms instead of wrongfully dangling a carrot that your'd elect my answer. If you had already accepted and then asked for additional assistance, I would have considered. No thanks. – Emacs User Jun 14 '15 at 1:04
  • 1
    You can use pandoc directly on the org-mode file. Paragraphs get marked up with a particular style which you could then customise. – Andrew Swann Jun 15 '15 at 12:58
0

http://orgmode.org/manual/Applying-custom-styles.html#Applying-custom-styles

^^ This is what I did. The page has instructions to generate an empty ODT template. Then you can go into LibreOffice, edit the Text Body paragraph style to set the first-line indent, and save the template.

Then add #+ODT_STYLES_FILE: "/path/to/my-stylesheet.odt" (or ott, depending how you saved it) into your org document. The exported ODT file will use the style definitions from your template, instead of the defaults.

Worked for me.

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.