1
votes

Since markdown does not have any options for centering text, but does allow html inline, I've added a tag which works fine for converting to html, but not to pdf using the pandoc-convert package in atom. How do I convert this file to pdf using pandoc-convert in atom while preserving the centered text.

---
geometry: margin=1.5cm  
---
<center>
<h1> My name</h1>
My Address   
myemail.com, my2ndemail.com    
+1 (999) 999-9999 (cell)    
</center>

#### Markdown Title
>Some block quoted text.
1
If your objective was just pdf, I would suggest this hackish answer: github.com/jgm/pandoc/issues/2453#issuecomment-219233316 , where you define \Begin and \End latex commands. Then you can set \Begin{center} and \End{center} and they would work fine without having the text in between treated as latex. Since you want to be able to do both, one verbose option is to have \Begin and \End right before and after the div beginning and end. Alternatively, you could write a pandoc filter, which requires coding but solves the problem elegantly.Sergio Correia

1 Answers

1
votes

The advice from the comment above worked. In general, it appears the pandoc-convert in atom-editor works with latex commands for formatting the text. Looks like I need to learn more LaTeX. This is the code that worked for me in the end.

    ---
geometry: margin=1.5cm  
---

\begin{center}
\Huge My Name
\\ \small My Address
\\ myemail.com, my2ndemail.com    
\\ +1 (999) 999-9999 (cell)    
\end{center}

#### Markdown title
>Some block quoted text.