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

Error producing PDF related to no-prefix-figure-caption #103

Open
hborchew opened this issue Jun 21, 2022 · 1 comment
Open

Error producing PDF related to no-prefix-figure-caption #103

hborchew opened this issue Jun 21, 2022 · 1 comment

Comments

@hborchew
Copy link

Greetings,

I am migrating to a new Windows 10 PC and setup/duplicated environment with Pandoc/XNOS/MiKTeX

Here is the error message:
...
Error producing PDF.
! Undefined control sequence.
\fignos:no-prefix-figure-caption ...compatibility
{}{ \let \oldthefigure \th...
l.303 \begin{fignos:no-prefix-figure-caption}
...

Any idea? I have put the required fragment of LaTeX code in include-in-header. The commands were working on prior install.

Here are my versions:
$ pandoc -v
pandoc.exe 2.18
$ pandoc-xnos.exe --version
pandoc-xnos 2.4.0
$ miktex --version
One MiKTeX Utility 1.2 (MiKTeX 22.3)

Any ideas?

Thanks,
Howard

@hborchew
Copy link
Author

FYI, I believe I found the root cause for this and a work-around from the caption author.
....
Hallo Howard,

The internal macro \caption@ifcompatibility was dropped in version 3.6 of the caption package. I was not aware that some packages/documents are actually using this internal macro, otherwise I would have replaced it with an emulation of the old behavior instead of dropping it.

I just created an issue, you can track the status here: https://gitlab.com/axelsommerfeldt/caption/-/issues/151

In the meantime you could add the following work-around to your document:

...
\usepackage{caption}
\makeatletter
\providecommand\caption@ifcompatibility{@secondoftwo}
\makeatother
...

HTH,
Axel

On Thu, Jun 23, 2022, at 01:16, Howard Borchew wrote:
Hello Axel,

I am by no measure an expert in LaTeX, but I am getting an error described below.

I have some Tex code as follows from pandoc-fignos

%% pandoc-fignos: required package
\usepackage{cleveref}

%%%% pandoc-fignos: required package
\usepackage{caption}

%% pandoc-fignos: change cref names
\crefname{figure}{Figure}{figs.}

%% 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

And I am getting this error:
Error producing PDF.
! Undefined control sequence.
\fignos:no-prefix-figure-caption ...compatibility
{}{ \let \oldthefigure \th...
l.281 \begin{fignos:no-prefix-figure-caption}

I highlighted the offending line above.

This used to work and I think it started failing in a recent update to caption in MiKTeX.

Any advice?

Thanks,
Howard

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

1 participant