I use Pandoc to create TeX files as chapter templates that are then fed back into Pandoc to create the final PDF. This sets some limitations, since some of the ways Pandoc writes TeX is hard-coded.
One problem I encountered with this is with figures in two-column
documents. I would like to have figures that span both columns. I know this could be achieved with using figure*
instead of figure
, but since Pandoc writes the figure code, I'm stuck with figure everywhere in the document. Can I globally define that figure
, is replaced by figure*
instead? I've tried various ways of trying to redefine the command, but haven't been able to get them to work.
I found that somebody had change the default settings for figure floats in Pandoc-created documents with the following code:
% Overwrite \begin{figure}[htbp] with \begin{figure}[H]
\usepackage{float}
\let\origfigure=\figure
\let\endorigfigure=\endfigure
\renewenvironment{figure}[1][]{%
\origfigure[H]
}{%
\endorigfigure
}
I tried changing this to
\usepackage{float}
\let\origfigure=\figure
\let\endorigfigure=\endfigure
\renewenvironment{figure}[1][]{%
\origfigure*
}{%
\endorigfigure*
}
But the \renewenvironment
seems to change only the arguments, not the command itself. Is there better solution? Am I simply using the wrong syntax?
\begin{figure*}
not\origfigure*
(which is not the same thing at all) – David Carlisle Jan 22 '16 at 13:26\origfigure*
(and same for the end) – David Carlisle Jan 22 '16 at 17:03