Thanks Bastien, Just to clarify: by "LaTeX always places on top of the page full-width figures in a multicolumn environment" you mean that the figure is floated and placed on top of a page, right? (as in the sample tex you give). Using neither the filter (i.e. removing the \end{multicols} and \begin{multicols}{2} that surround the figure) nor the \renenvironment crashes (floats not allowed in multicols). But otherwise I don't see any difference in output between (1) filter alone, (2) filter + renewenvironnment, (3) renewenvironment alone, except that the float may end up in a different page depending on details. I can see that using the renewenvironment alone may be simpler for Loïc's purposes than loading the filter and wrapping the whole doc in ::: columns div. But perhaps a more general solution would be: - to have a filter that handles float placement in LaTeX (per doc, per figure basis). - to make sure the columns filter handles column markup when the doc is in two-columns mode, without the need for a wrapping div. - possibly, to add float placement options in the columns filter? I'll post the last two issues on the columns repo. All best, Julien On Friday, March 26, 2021 at 2:49:48 PM UTC Bastien Dumont wrote: > Hi, > > Thank you for sharing your filter, which is really great. I noticed one > problem though: LaTeX always places on top of the page full-width figures > in a multicolumn environment. It means that the stream will be broken after > the figure, as this document will show: > > \documentclass{article} > \usepackage{multicol} > \usepackage{lipsum} > > \begin{document} > > \begin{multicols}{2} > \lipsum[1-7] > \end{multicols} > > \begin{figure} > \begin{quote} > \lipsum[8] > \end{quote} > \end{figure} > > \begin{multicols}{2} > \lipsum[1-7] > \end{multicols} > > \end{document} > > If you only want to make all figures span the entire width in a two-column > layout, you can simply add this in the metadata block of your document > (without changing anything in the command-line): > > header-includes: | > \renewenvironment{figure}{\begin{figure*}}{\end{figure*}} > > However, the limitation regarding the figures' placement will still apply. > > Hoping that it helps, > > Bastien > > Le Friday 26 March 2021 à 06:34:51AM, Julien Dutant a écrit : > > Hi, > > > > The columns filter might help: https://github.com/jdutant/columns . It > will > > typeset as full width anything wrap within a ::: columns-span DIV. It > doesn't > > have an option to automatically do that for every figure / table, though > you > > could write a small lua filter to add that. Notes: > > > > - the column-span DIVs will only be processed if they are in a ::: > columns DIV. > > Solution: put the entire document in such a DIV (or ::: {.two-columns}, > to be > > on the safe side) > > - the filter will add "\usepackage{multicols}" to your header. > > > > A small Lua filter to put tables in fulll width would like: > > > > ```lua > > function Table (elem) > > return pandoc.Div( elem, {class = 'column-span' } ) > > end > > ``` > > > > Best, > > J > > > > On Friday, March 26, 2021 at 12:33:15 PM UTC houpe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > > Hi all, > > I didn't find a way to easily display my figure in full width in a > > two-column layout document. > > > > I have a markdown document that I convert to pdf with the command below: > > > > pandoc article.md \ > > --citeproc \ > > --from=markdown+tex_math_single_backslash+tex_math_dollars+raw_tex \ > > --to=latex \ > > --output=build/article-print-doublecols.pdf \ > > --pdf-engine=xelatex \ > > --include-in-header="layout/supertabular.tex" \ > > --filter="layout/twocolumns_table_fix.py" \ > > -M classoption=twocolumn > > -M geometry="left=3cm,right=3cm,top=2cm,bottom=2cm" > > > > > > Is there an "easy" way to do that so the figures in my pdf will be full > > width while all the rest of the document stay in a twocolumns layout ? > > (e,g. by adding a specific argument to this command ?) > > > > I didn't find an easy solution to this problem.... > > > > Thank you, > > > > Loïc > > > > > > > > > > -- > > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/ > > pandoc-discuss/1b33b1a0-c0f2-4ffe-aaf1-a9190b5c1a59n%40googlegroups.com. > > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2918620f-f3f3-471b-994e-74a85c9d1b29n%40googlegroups.com.