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

Does not work with pandoc 3.0 released recently #28

Open
hborchew opened this issue Jan 24, 2023 · 11 comments
Open

Does not work with pandoc 3.0 released recently #28

hborchew opened this issue Jan 24, 2023 · 11 comments

Comments

@hborchew
Copy link

Hello,

xnos stopped working with the new release of pandoc 3.0.

Is there an easy fix for this?

Thanks,
Howard

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\hborchew\AppData\Roaming\Python\Python311\Scripts\pandoc-xnos.exe_main
.py", line 7, in
File "C:\Users\hborchew\AppData\Roaming\Python\Python311\site-packages\pandocxnos\main.py", line 38, in main
m.main(stdin, stdout)
File "C:\Users\hborchew\AppData\Roaming\Python\Python311\site-packages\pandoc_fignos.py", line 608, in main
PANDOCVERSION = pandocxnos.init(args.pandocversion, doc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\hborchew\AppData\Roaming\Python\Python311\site-packages\pandocxnos\core.py", line 224, in init
_PANDOCVERSION = _get_pandoc_version(pandocversion, doc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\hborchew\AppData\Roaming\Python\Python311\site-packages\pandocxnos\core.py", line 179, in _get_pandoc_version
raise RuntimeError(msg)
RuntimeError: Cannot understand pandocversion=3.0
Error running filter pandoc-xnos.exe:
Filter returned error status 1

@benmaier
Copy link

Did anyone just try changing the regex here: https://github.com/tomduck/pandoc-xnos/blob/master/pandocxnos/core.py#L174 yet? Curious if the rest of the code would just transfer to 3.0 easily

@benmaier
Copy link

replacing the aforementioned line with

    pattern = re.compile(r'^[1-3]\.[0-9]+(?:\.[0-9]+)?(?:\.[0-9]+)?$')

works at least as much as that the CLI runs without raising errors. As my specific use case doesn't seem to work with pandoc-xnos anyway, I'll just leave this here and drop out of the discussion. Others might try this.

@ShevekUK
Copy link

ShevekUK commented Feb 1, 2023

Thanks for the regex thing, @benmaier. I was having an issue with pandox-secnos and this fixed it for me, for now.

@daviewales
Copy link

Related PR: #29

@TimothyElder
Copy link

I just upgraded to pandoc 3.1.1 and was having the same error. Changing the regular expression where @benmaier suggested immediately fixed it.

@allefeld
Copy link

I have version pandoc-eqnos 2.5.0 installed from PyPI via pipx, and the bug still occurs.

I checked line 174 of pandocxnos/core.py, and the regular expression is like @benmaier proposed.

Pandoc version is 3.1.1.

@ttxtea
Copy link

ttxtea commented Aug 28, 2023

For me the issue also persists despite the "correct" regex

pandoc 3.1.1
Features: +server +lua
Scripting engine: Lua 5.4

pandoc-xnos 2.4.0

If you refer to the figure you get pandoc-fignos: Bad reference:

@TimothyElder
Copy link

TimothyElder commented Sep 14, 2023

@ttxtea if you are getting the error pandoc-fignos: Bad reference: then pandoc-fignos is installed and working but there is likely something wrong with the syntax of your figure label. As far as I understand the issue in this thread, the error in the regex in pandoc-xnos and its associated libraries keeps you from even getting the library to work when compiling documents so your issue is separate from the regex.

The standard syntax for labeling a figure is ![Caption.](image.png){#fig:id} and then it is referenced by @fig:id, or in curly brackets.

I have noticed that the Bad reference error occurs even when the label resolves successfully sometimes.

@moigagoo
Copy link

moigagoo commented Mar 9, 2024

Hi! What's blocking the fix? How can I help?

This issue is quite an inconvenience for my flow.

@Impramine
Copy link

Hi! This fix will help many people work in scientific publications/ Do you need any help?

@Gahia123
Copy link

This libraries are useful for me too, but I don't know the code so deep to change it.

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

10 participants