Pandoc: allow options in native column div for latex

Created on 13 Dec 2017  ·  7Comments  ·  Source: jgm/pandoc

In beamer, the column environment accepts options, mostly for the vertical alignment of content in the columns. Currently, pandoc's latex writer gives the T option, hardwiring a top alignment. Beamer's default, though, is c unless the global t option is used.

One solution to give more flexibility would be to allow the following syntax in native divs:

::: {.column align=c} 
::: 

There are other options available to that environment though, in the beamer user guide:

The following ⟨options⟩ may be given:
b will cause the bottom lines of the columns to be vertically aligned.
c will cause the columns to be centered vertically relative to each other. Default, unless the global option t is used.
onlytextwidth is the same as totalwidth=textwidth.
t will cause the rst lines of the columns to be aligned. Default if global option t is used.
T is similar to the t option, but T aligns the tops of the rst lines while t aligns the so-called baselines of the rst lines. If strange things seem to happen in conjunction with the t option (for example if a graphic suddenly “drops down” with the t option instead of “going up,”), try using this option instead.
totalwidth=⟨width⟩ will cause the columns to occupy not the whole page width, but only ⟨width⟩, all told. Note that this means that any margins are ignored.

So maybe a syntax of:

::: {.column options=c} 
::: 

I'm not sure how to handle:

  1. multiple options
  2. an option with a value (options=totalwidth=x)
  3. what the default should be if no option is given
LaTeX writer

Most helpful comment

One possibility would be

::: {.column align=c}
:::

That would leave room for other options like totalwidth.

All 7 comments

One possibility would be

::: {.column align=c}
:::

That would leave room for other options like totalwidth.

Please also allow absolute width sizes, i.e. something like {.column width=40mm} ....

Currently (Pandoc 2.1.1) this snippet

::: {.column width=40mm}
:::

would be translated to

\begin{column}{40mm\textwidth}
\end{column}

Relative width (like {.column width="40%"}) works perfectly, but there are cases where absolute measures are much more comfortable.

Any news?

The correct syntax for the column alignment option is yet unclear. Can we please clarfy this?

Note that the inner column environment only accepts a single option: a placement (b,c,t,T) to modify the vertical alignment for a particular column.
The outer columns environment defines the vertical alignment for all columns (unless overwritten for a particular column) and has additional options totalwidth=⟨width⟩ and onlytextwidth (the same as totalwidth=\textwidth).

I usually need columns spanning onlytextwidth instead of the whole page width, for example, when the beamer theme has some decoration in the margins. I do not know how to specify options for the outer columns environment, so I currently cannot use Pandoc's syntax for columns in Beamer.

Yes it would indeed be very practical to be able to add options to the column environment, such as onlytextwidth..

pandoc (2.9.2) writes \begin{columns}[T]. Here is a workaround if you need the columns to span onlytextwidth instead of the whole page:

Add the following to a file, columns.tex, say:

%% configure columns environment to use totalwidth=\textwidth only
\let\origcolumns\columns
\let\endorigcolumns\endcolumns
\renewenvironment{columns}[1][]{\origcolumns[onlytextwidth,#1]}{\endorigcolumns}

Include this file when converting to "beamer", e.g., via pandoc's argument --include-in-header columns.tex.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brainchild0 picture brainchild0  ·  66Comments

dashed picture dashed  ·  107Comments

phyllisstein picture phyllisstein  ·  84Comments

stepht picture stepht  ·  54Comments

jgm picture jgm  ·  117Comments