2

I have a verbatim/monospaced block that way:

#+BEGIN_EXAMPLE
                                   _
                                /     \
                               T       H
                             /   \   /   \
                            T     H T     H
#+END_EXAMPLE

On the LaTeX->PDF export I get:

enter image description here

I know that the spaces doesn't matter, but how center it on export? I tried wrap the content with #+BEGIN_CENTER but doesn't works. I tried set \centering before and doesn't works too.

2

You can use raw latex commands in an org-mode document, which we can use to get around not being able to nest BEGIN_CENTER and BEGIN_EXAMPLE:

#+BEGIN_CENTER
\begin{verbatim}
                                   _
                                /     \
                               T       H
                             /   \   /   \
                            T     H T     H
\end{verbatim}

blah blah blahblah blah blahblah blah blahblah blah blahblah blah blah
#+END_CENTER

enter image description here

1

Do you still need this? Have your tried wrapping your diagram with @@latex:...@@. I propose:

@@latex:\begin{center}@@
                                   _
                                /     \
                               T       H
                             /   \   /   \
                            T     H T     H
@@latex:\end{center}@@

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.