public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Howto specify the width for columns in slides when using rST to beamer flow (instead of markdown)
@ 2017-12-21 13:27 gokce.aydos-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; only message in thread
From: gokce.aydos-Re5JQEeQqe8AvxtiuMwx3w @ 2017-12-21 13:27 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2514 bytes --]



Pandoc allows creation of columns for slides. The widths for the slides can 
be specified by using the 'width' attribute. See the example from the 
Pandoc user's guide [1]: 


:::::::::::::: {.columns}
::: {.column width="40%"}
contents...
:::
::: {.column width="60%"}
contents...
:::
::::::::::::::

is transformed to the following LaTeX output:

\begin{columns}[T]
\begin{column}{0.40\textwidth}
contents\ldots{}
\end{column}

\begin{column}{0.60\textwidth}
contents\ldots{}
\end{column}
\end{columns}

When using rST instead of Markdown, class directive [2] can be used to assign a block to a class: 

.. class:: columns

    .. class:: column

       contents...

    .. class:: column

       contents...

Unfortunately, there are no directive options available for the class directive. In practice, this means that it is not possible to assign the 'width' attribute to a class. The reason is probably that stylesheets are used for styling the classes, e.g., CSS in HTML.

Although Pandoc accepts CSS for HTML/CSS-to-pdf output, it does not support CSS input along with rST.

My workaround was to use directive options for the class directive even they are not allowed according to the rST spec. Fortunately, rST reader parses every directive option passed to a class [3]. The following block:
.. class:: columns

    .. class:: column
       :width: 40%

       contents...

    .. class:: column
       :width: 60%

       contents...

creates the same LaTeX output as above (with the exception of '...' instead of \ldots{} ).

Do you know a more standard way to format the columns when using rST to beamer flow?

Gökçe


[1] https://pandoc.org/MANUAL.html#columns
[2] http://docutils.sourceforge.net/docs/ref/rst/directives.html#class
[3] https://github.com/jgm/pandoc/blob/5d3573e780d5056c87bb64858ea0890a27bc1686/src/Text/Pandoc/Readers/RST.hs#L756



-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/396f6f4e-00af-4c2c-831e-3a1cdb6b27d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3762 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-21 13:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21 13:27 Howto specify the width for columns in slides when using rST to beamer flow (instead of markdown) gokce.aydos-Re5JQEeQqe8AvxtiuMwx3w

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).