Closed juh2 closed 8 years ago
The solution would be better if attributes were enabled in Markdown for paragraphs. But anyway, your source code may read
<div class="centered">
Your centered paragraph comes here.
One or many ones
</div>
You should add to your CSS file (file specified in stylesheet
in YAML metadata):
div#centered {
text-align: center;
}
And you should add to your pandoc-xhtml.tex
source (I want to update mine, but I messed my local git repo :cold_sweat:):
\xmlsetsetup{\xmldocument}
{div[@class='centered']}
{xml:centeredblock}
\startxmlsetups xml:centeredblock
\startalign[center]\xmlflush{#1}\stopalign
\stopxmlsetups
Thanks a lot.
In my case the CSS has to be
div.centered p {
text-align: center;
}
I hope you can save your repo.
@juh2, you’re right, it was a newbie mistake.
My selector was for a unique identifier and the code requires a class.
Although this should work too:
div.centered {
text-align: center;
}
That centers the whole block (the division), no matter which elements it contains.
[As not done previously, I have tested the above CSS code myself.]
I don't know how to get centered paragraphs with pandoc and context. Any hints?