pandoc-fignos
pandoc-fignos copied to clipboard
! LaTeX Error: Environment fignos:no-prefix-figure-caption undefined.
This issue has been dealt with before here.
I am using a default file that invokes pandoc-eqnos
and pandoc-fignos
ahead of citeproc
. I also have \usepackage{caption}
in my 'header-includes` file.
When I try to generate PDF on a somewhat long file, I get the error message:
! LaTeX Error: Environment fignos:no-prefix-figure-caption undefined.
along with
%% pandoc-fignos: environment to disable figure caption prefixes
\makeatletter
\newcounter{figno}
\newenvironment{fignos:no-prefix-figure-caption}{
\caption@ifcompatibility{}{
\let\oldthefigure\thefigure
\let\oldtheHfigure\theHfigure
\renewcommand{\thefigure}{figno:\thefigno}
\renewcommand{\theHfigure}{figno:\thefigno}
\stepcounter{figno}
\captionsetup{labelformat=empty}
}
}{
\caption@ifcompatibility{}{
\captionsetup{labelformat=default}
\let\thefigure\oldthefigure
\let\theHfigure\oldtheHfigure
\addtocounter{figure}{-1}
}
}
\makeatother
If I copy the above text from makeatletter
to makeatother
and include it in the header-includes
file, I get the required PDF file.
Is this the way it is meant to be? Or is there a cleaner workaround? Or am I doing something wrong?
I believe this behavior is "OK" as it is caused by pandoc. There is a respective note in pandoc-fignos documentation: "A word of warning: Pandoc-fignos's additions to the header-includes are overridden when pandoc's --include-in-header option is used. This is owing to a https://github.com/jgm/pandoc/issues/3139 in pandoc. Users may choose to deliberately override pandoc-fignos's header-includes by providing their own LaTeX through --include-in-header. If a user needs to include other bits of LaTeX in this way, then they will need to do the same for the LaTeX that pandoc-fignos needs."
I got this error when I forgot to include {#fig:id}
behind an image declaration.
I got this error when I forgot to include
{#fig:id}
behind an image declaration.
Yes, I just forgot to add the {#fig:id}
syntax, and the compilation process gives me the same error. After adding the {#fig:id}
to all the instances, the compilation was successful.