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

! LaTeX Error: Environment fignos:no-prefix-figure-caption undefined. #88

Open
kleinbottle opened this issue Feb 26, 2021 · 3 comments
Open

Comments

@kleinbottle
Copy link

kleinbottle commented Feb 26, 2021

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?

@bidspells
Copy link

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 jgm/pandoc#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."

@johannesmols
Copy link

I got this error when I forgot to include {#fig:id} behind an image declaration.

@gmarxcc
Copy link

gmarxcc commented Jan 13, 2023

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.

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

No branches or pull requests

4 participants