If you delimit the LaTeX commands you can put Markdown between them:
`\begin{center}`{=latex}Markdown *here*`\end{center}`{=latex}
or more realistically with raw blocks:
```{=latex}
\begin{center}
```
Some *Markdown* text goes here!
```{=latex}
\end{center}
```
Or you can use the attached filter (instructions inside!) and just type
:::center
Some *centered* text here
:::
which will allow your source to work for both HTML and LaTeX output.
Den tis 11 okt. 2022 22:15Richard Hu skrev:
> Hi gnpan,
>
> Thanks! Your solution works, but I cannot put text formatted with Markdown
> between the \begin{center} ... \end{center} LaTeX tags.
> It seems like Pandoc understands the HTML (e.g. ...
), but just
> refuses to acknowledge any alignment options specified.
>
>
> On Tue, Oct 11, 2022 at 7:27 PM gnpan wrote:
>
>> Since you are converting to pdf, you could try some LaTeX, e.g.:
>> \begin{center}{Your text here}\end{center}
>>
>>
>> On Tuesday, 11 October 2022 at 17:39:03 UTC+3 richar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>>
>>> Hello!
>>>
>>> I'm trying to center some text in my markdown document. I've tried:
>>> ```
>>> Sample Text
>>> Sample Text
>>> ```
>>> And used `pandoc test.md -o test.pdf` to compile my document. However,
>>> the text shows up as left-aligned and not centered.
>>>
>>> How may I resolve this issue?
>>>
>>> Thank you.
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "pandoc-discuss" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/pandoc-discuss/xP71D6PnL2k/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/2d6fdf96-2731-4970-a9eb-0f0d89e92c37n%40googlegroups.com
>>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/CAPKRM%2BUv6Sg_x6sYRvp0R9xhu77%3DYn3wk%2Bem5hun5xZ4WoWvOQ%40mail.gmail.com
>
> .
>
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhC5qHx9gM9Djy10kVcSukADS6sCZsHXnQw-u2Aiwjx%2BQg%40mail.gmail.com.