Is there are right aligned text block in Org-mode, like #+begin_center #+end_center? I haven't been able to find any reference in the official docs. on the other hand, this page uses a construct #+begin_right #+end_right but this doesn't work for me in LaTeX and odt export (see my MWE below and its LaTeX export). Is this type of alignment supported in Org-mode? If it is, how can I set it? If not, would it be a large issue to implement this type of text alignment and exporters?

I'm using Org-mode version 9.1.2 with Emacs 25.3.1.

My MWE is:

#+TITLE: Test

* Heading 1

This text is right-aligned.

My LaTeX export is (I've trimmed unnecessary packages and meta-data from the export):

% Created 2017-10-11 Wed 11:24
% Intended LaTeX compiler: pdflatex




\section{Heading 1}

This text is right-aligned.

Edit(): As Simon Fromme suggested in the comments below, I've added my MWE and the output.

  • I can't replicate the issue. #+begin_right #+end_right works for me with Emacs 25.2.1 and Org-mode 8.2.10 for both HTML and Latex export. Can you provide a minimal example of org-mode Markup and generated HTML/Latex? Oct 10, 2017 at 23:30
  • Dear @SimonFromme, I've added the MWE as you've suggested. Unfortunately, my LaTeX won't compile as environment {right} is not defined. I know how to setup this environment but I'm curious if this kind of alignment is officially supported in Org-mode. Oct 11, 2017 at 9:34
  • See my answer. There is no such thing as "official support" for this kind of construct. Oct 12, 2017 at 2:26
  • It seems that my question was a but vague. I've edited the question a bit and I hope it is a bit clearer. Oct 12, 2017 at 7:32

2 Answers 2


Having an org-mode file with a block of the form

some Text

the Latex exporter seems to wrap anything within the block in a new environment named as the lower case version of FOObarBUZZ like:

some Text

the HTML exporter behaves similarly and wraps the block within a div like:

<div class="foobarbuzz">
some Text

Nothing smart going on here!

Since center happens to be a pre-defined environment in Latex and the CSS class center is also part of the default CSS for HTML export in org-mode, it naturally works for both Latex and HTML export.

There is no pre-defined right environment in Latex, yet there is a CSS class right defined in the default CSS for HTML export, so that #+BEGIN_RIGHT works only in the latter case given the default org-mode configuration.

Having this said, you could define a new Latex environment right that does the alignment and reference this in your org-mode file as described here.

  • Dear @SimonFromme, thank you for the answer. I apologize as my question is a bit vague. This was my temporary solution as well but it is LaTeX specific. I was searching for something that will work for a few exporters I use (namely odt, latex and html), similar to the #+begin_center #+end_center block. Oct 12, 2017 at 7:24
  • There is no built-in way to do this as the exporters don't treat the string after #+BEGIN_ in any special way. You can say that center (HTML, Latex) and right (HTML) only happen to work by chance without further definitions of environments/classes. Oct 12, 2017 at 7:35
  • Dear @SimonFromme, thank you for the input and your comment wraps it up. I'll mark your answer as accepted. Oct 12, 2017 at 7:39

I decided to build on @SimonFromme's excellent answer, and extend it with Org-mode's ASCII special blocks for alignment:

Besides #+BEGIN_CENTER blocks (see Paragraphs), ASCII back-end has these two left and right justification blocks:

It's just a jump to the left...

...and then a step to the right.

Since they're also exported to LaTeX as JUSTIFYRIGHT or JUSTIFYLEFT environments (and to HTML as div elements with similarly named class attributes), one could also integrate this for LaTeX export as:

#+LATEX_HEADER: \usepackage{ragged2e}
#+LATEX_HEADER: \newenvironment{JUSTIFYLEFT}{\begin{FlushLeft}}{\end{FlushLeft}}
#+LATEX_HEADER: \newenvironment{JUSTIFYRIGHT}{\begin{FlushRight}}{\end{FlushRight}}

And for HTML export with:

#+HTML_HEAD: <style>.JUSTIFYLEFT {text-align: left;}</style>
#+HTML_HEAD: <style>.JUSTIFYRIGHT {text-align: right;}</style>

So, the previous org markup quoted would be exported to the following when exporting to LaTeX:

It's just a jump to the left...

...and then a step to the right.

And to the following when exporting to HTML:

<div class="JUSTIFYLEFT" id="org0a1b2c3">
It&rsquo;s just a jump to the left&#x2026;


<div class="JUSTIFYRIGHT" id="org4d5e6f7">
&#x2026;and then a step to the right.


And, to the following when exporting to ASCII / UTF-8:

It's just a jump to the left...

                  ...and then a step to the right.

Note: The link from @SimonFromme's answer for the custom environment definition for Block-level markup has moved.

Your Answer

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

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