Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow options in native column div for latex #4150

Closed
kbro237 opened this issue Dec 13, 2017 · 7 comments
Closed

allow options in native column div for latex #4150

kbro237 opened this issue Dec 13, 2017 · 7 comments

Comments

@kbro237
Copy link

kbro237 commented Dec 13, 2017

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
@jgm
Copy link
Owner

jgm commented Dec 14, 2017

One possibility would be

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

That would leave room for other options like totalwidth.

@cagix
Copy link
Contributor

cagix commented Feb 21, 2018

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.

@ricpelo
Copy link

ricpelo commented Mar 18, 2019

Any news?

@krishnakumarg1984
Copy link

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

@bastistician
Copy link

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.

@eizanprime
Copy link

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

@bastistician
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants