Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Right align (an address) in Pandoc

Right alignment comes handy for letter addresses. Unfortunately, according to the author John MacFarlane:

The pandoc document model does not allow for alignment other than in tables, so the alignment information is simply ignored.

We can resort to raw LaTeX.

Upon trial and error (and googling) I found that this TeX syntax works as intended:

\rightline{Address 1}
\rightline{Address 2}
\rightline{etc}

Also the LaTeX equivalent does:

\begin{flushright}

Address 1\\
Address 2\\
etc

\end{flushright}

The less invasive syntax, based on the LaTeX command raggedleft, unfortunately does not work:

{\raggedleft
Address 1\\
Address 2\\
etc\\
}

This is because braces are passed verbatim (\{, \}) and not as raw LaTeX.

With reference to centre alignment, I found a user claiming that markdown supports this native (beautiful) syntax:

-> This is center align <-

but I didn't find an editor/converter supporting it.

Indeed my working examples are all against the John Gruber markdown philosophy:

A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

Can you find a better way?

Particularly is it possible to simply write a Pandoc template to redefine the alignment of a header, say: ###### Right aligned?

like image 852
antonio Avatar asked Nov 02 '13 19:11

antonio


1 Answers

For those that are looking for a similar question here's how to left align/right align on the same line:

**Some bolded text** **\hfill some right aligned on same line bolded text**

You'll have to imagine the result since I'm not sure how to recreate it on SO.

like image 164
Jon49 Avatar answered Sep 18 '22 16:09

Jon49