# How to align the source code block when export to PDF in Org-mode?

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:

And the output result looks like this:

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

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