0

While using org-mode to export source code to PDF files, the source code is not aligned with the indentation of the text.

The .org file are as follow:

enter image description here

And the output result looks like this:

enter image description here

Would there be a way to align the indentation of the code block, or to center it?

1 Answer 1

2

The line "The following pre" is the first line of its paragraph (it's the only line of its paragraph), and is thus indented. Try a longer paragraph before the source block to see that it does match the indentation of the subsequent lines of the paragraph, just not the first one.

If you don't want the first line of the paragraph indented change it to:

\noindent The following pre

If you don't want any first line of any paragraph to be indented, add this to the top of your Org mode document:

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

If you want the source block horizontally centered, put it inside a center block:

#+begin_center
#+begin_src sql
CREATE TABLE STAT_Asump(
...
#+end_src
#+end_center

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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