0

I would like to add a statement only included in LaTeX export. I know I can use the #+LATEX: prefix, but what if the statement is inlined, like this?

\hfill Systemübersicht \hfill

This centers the text easily in PDF exports via LaTeX, but these instructions plainly stay in an html export, too :/

1 Answer 1

2

You can use @@latex: \hfil@@ Systemübersicht @@latex: \hfil@@ and similarly @@html: ... @@ for HTML. See the Quoting sections in the Exporting chapter in the manual:

BTW, I'd use a macro for centering text. Here's one that centers text for both LaTeX and HTML exports:

#+MACRO: center @@latex:\hfil $1\hfil@@ @@html: <p style="text-align: center;">$1</p>@@

* Test

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.

{{{center(Some centered text)}}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.

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.