How to leave alignment of the whole table in markdowns (pandoc)?

How do you align the entire table in Markdown / Pandoc? I know about different ways of specifying tables and how column alignment is performed, but I can’t find a way to shift the table from the center alignment to the left (I didn’t even try to embed <div style="float: left>..</div> , which didn't work.) Do I have to switch to LaTeX to do this? I will export to pdf later if that matters.

+7
markdown latex pandoc
source share
2 answers

Now I have found a solution to this problem at tex.stackexchange.com . Apparently pandoc inserts \centering for each float in the document. This can be undone by inserting \let\centering\relax into the user preamble for pandoc (as an argument to pandoc -H custompreample.tex ). The link also describes more detailed methods, for example, defining different floats for tables and numbers.

+4
source share

I could not find solutions for work - in LaTeX. I created a new longtable environment to make tables the way I wanted them. It was easier in the end. Here is an example Rmd file.

 --- title: "Custom table" header-includes: - \usepackage{longtable,booktabs} output: pdf_document --- \newenvironment{mylong} {\begin{longtable}[l]{p{.25in}p{3in}p{3in}}Line & Statements & Reasons\\ \toprule\addlinespace } { \addlinespace\bottomrule\end{longtable} } \begin{mylong} 1& $a+b=a+d$ & Given P10, if $b=d$, then 1 is true\\ 2& $a+b=c$ & Given\\ 3& $a+d=c$ & Given P9, if 1 and 2 are true, then 3 is true. QED\\ \end{mylong} 
0
source share

All Articles