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

--filter pandoc-xnos not working #11

Open
vronizor opened this issue Nov 15, 2019 · 18 comments
Open

--filter pandoc-xnos not working #11

vronizor opened this issue Nov 15, 2019 · 18 comments
Labels

Comments

@vronizor
Copy link

Hi all,

I get an error when I try to pass the generic --filter pandoc-xnos, but individual packages work, such as --filter pandoc-secnos.

pandoc-xnos is indeed installed:

pip install pandoc-xnos
Requirement already satisfied: pandoc-xnos in ./.local/lib/python3.7/site-packages (2.3.0)
Requirement already satisfied: pandocfilters<2,>=1.4.2 in ./anaconda3/lib/python3.7/site-packages (from pandoc-xnos) (1.4.2)
Requirement already satisfied: psutil<6,>=4.1.0 in ./anaconda3/lib/python3.7/site-packages (from pandoc-xnos) (5.6.3)

But running the following fails:

pandoc -o 2019-11-18Referee-Report.pdf 2019-11-18Referee-Report.md --pdf-engine=xelatex --filter pandoc-xnos --filter pandoc-citeproc
Error running filter pandoc-xnos:
Could not find executable pandoc-xnos

While running this works:

pandoc -o 2019-11-18Referee-Report.pdf 2019-11-18Referee-Report.md --pdf-engine=xelatex --filter pandoc-secnos --filter pandoc-citeproc

pandoc-secnos: Wrote the following blocks to header-includes.  If you
use pandoc's --include-in-header option then you will need to manually
include these yourself.

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

Any idea what is going on?

Thanks!

@MPvHarmelen
Copy link

I had a similar problem (nothing worked... 😄), used find to find if and where the executable was installed:

$ find / -iname *pandoc-xnos* 2>/dev/null
~/.local/bin/pandoc-xnos

and noticed this location wasn't on my path. Somehow adding that location to my path helped for finding it in bash, but not for pandoc, but linking it from a place I expected pandoc to expect executables worked:

sudo ln -s ~/.local/bin/pandoc-xnos /usr/local/bin/
$ wget -O - https://github.com/raw/tomduck/pandoc-tablenos/master/demos/demo3.md | pandoc --filter pandoc-xnos -t markdown
    Right Left    Center  Default
  ------- ------ -------- ---------
       12 12        12    12
      123 123      123    123
        1 1         1     1

  : Table 1: Demonstration of a simple table.

Tab. [1](#tbl:1) is from the Pandoc User's Guide. A simpler table is
given by Tab. [2](#tbl:2):

  A   B
  --- ---
  0   1

  : Table 2: Even simpler.

@stroobandt
Copy link

Both --filter=pandoc-xnos and --filter='pandoc-xnos' work over here.

@MPvHarmelen
Copy link

What system are you on?

@stroobandt
Copy link

@MPvHarmelen Xubuntu 18.04.4 LTS

@tomduck
Copy link
Owner

tomduck commented Jul 28, 2020

Is anyone still having this problem?

The pandoc-xnos script needs to be on the PATH. For most systems this shouldn't be a problem. If in doubt, you can check that the pandoc-xnos script executes under bash as follows:

$ pandoc-xnos --version
pandoc-xnos 2.2.0

I have added a check that pandoc-xnos is found to the setup script in the nextrelease branch. This will go out in the next release.

@MPvHarmelen
Copy link

I don't have the time to try to break it again on my machine now 😅
Nice that you're testing for it now. I could have a look again in November, hopefully :)

@FrsLry
Copy link

FrsLry commented Aug 15, 2020

Hi!

I have the same problem here. pandoc-xnos is installed: pip install pandoc-xnos returns

Requirement already satisfied: pandoc-xnos in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (2.4.3)
Requirement already satisfied: psutil<6,>=4.1.0 in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pandoc-xnos) (5.7.2)
Requirement already satisfied: pandocfilters<2,>=1.4.2 in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pandoc-xnos) (1.4.2)

Nevertheless, when I call

pandoc manuscript.md -s -o test.tex --filter pandoc-xnos --bibliography=references.json --csl=.assets/templates/ecology-letters.cls --metadata-file=metadata.json --template=.assets/templates/template.tex

I obtain:

Error running filter pandoc-xnos:
Could not find executable pandoc-xnos

On the other hand, pandoc-xnos --version also returns an error message.

Do you think this problem is related to this post?

Thanks!

@tomduck
Copy link
Owner

tomduck commented Aug 17, 2020

Thanks, @FrsLry. Let's see if we can figure this out. What OS are you using? Cheers, Tom

@FrsLry
Copy link

FrsLry commented Aug 17, 2020

Thanks, @FrsLry. Let's see if we can figure this out. What OS are you using? Cheers, Tom

Sorry @tomduck, I'm on windows 10.

Cheers!

@tomduck
Copy link
Owner

tomduck commented Aug 18, 2020

@FrsLry, did you install from PyPI using pip, or some other method? --Tom

@FrsLry
Copy link

FrsLry commented Aug 18, 2020

Yes @tomduck , I used:

pip install pandoc-fignos pandoc-eqnos pandoc-tablenos pandoc-secnos --user

And then I updated it, as it's clearly explained on https://github.com/tomduck/pandoc-xnos.

So now, when I try to get the version of pandoc-xnos or each of these programs (using pandoc-* --version), I obtain this error message:

pandoc-fignos : The term 'pandoc-fignos' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ pandoc-fignos --version
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (pandoc-fignos:String) [], CommandNotFoundExc
   eption
    + FullyQualifiedErrorId : CommandNotFoundException

I tried to reinstall to check (with the same pip install pandoc-fignos pandoc-eqnos pandoc-tablenos pandoc-secnos --user) and now I have:

Requirement already satisfied: pandoc-fignos in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (2.3.1)
Requirement already satisfied: pandoc-eqnos in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (2.3.0)
Requirement already satisfied: pandoc-tablenos in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (2.2.2)
Requirement already satisfied: pandoc-secnos in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (2.2.2)
Requirement already satisfied: pandoc-xnos<3.0,>=2.4.2 in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pandoc-fignos) (2.4.3)
Requirement already satisfied: pandocfilters<2,>=1.4.2 in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pandoc-xnos<3.0,>=2.4.2->pandoc-fignos) (1.4.2)
Requirement already satisfied: psutil<6,>=4.1.0 in .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pandoc-xnos<3.0,>=2.4.2->pandoc-fignos) (5.7.2)

Thanks!

François

@tomduck
Copy link
Owner

tomduck commented Aug 18, 2020

Good, thanks. Could you please provide the output of pip show --files pandoc-xnos? This will allow us to see where the pandoc-xnos script and library are installed on your system. --Tom

Note/edit: This will provide a more detailed account than what you have already provided. The pandoc-xnos script normally gets installed at a different location than the library.

@FrsLry
Copy link

FrsLry commented Aug 18, 2020

Sure! Here it is:

Name: pandoc-xnos
Version: 2.4.3
Summary: Library code for the pandoc-xnos filter suite.
Home-page: https://github.com/tomduck/pandoc-xnos
Author: Thomas J. Duck
Author-email: tomduck@tomduck.ca
License: GPL
Location: .\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages
Requires: psutil, pandocfilters
Required-by: pandoc-tablenos, pandoc-secnos, pandoc-fignos, pandoc-eqnos
Files:
  ..\Scripts\pandoc-xnos.exe
  pandoc_xnos-2.4.3.dist-info\AUTHORS
  pandoc_xnos-2.4.3.dist-info\INSTALLER
  pandoc_xnos-2.4.3.dist-info\LICENSE
  pandoc_xnos-2.4.3.dist-info\METADATA
  pandoc_xnos-2.4.3.dist-info\RECORD
  pandoc_xnos-2.4.3.dist-info\WHEEL
  pandoc_xnos-2.4.3.dist-info\entry_points.txt
  pandoc_xnos-2.4.3.dist-info\top_level.txt
  pandocxnos\__init__.py
  pandocxnos\__pycache__\__init__.cpython-38.pyc
  pandocxnos\__pycache__\core.cpython-38.pyc
  pandocxnos\__pycache__\main.cpython-38.pyc
  pandocxnos\__pycache__\pandocattributes.cpython-38.pyc
  pandocxnos\core.py
  pandocxnos\main.py
  pandocxnos\pandocattributes.py

Cheers!

@tomduck
Copy link
Owner

tomduck commented Nov 10, 2020

I am wondering if the solution to this problem under Windows is to just drop --user from the installation command?

Cheers,
Tom

@dmcnamee
Copy link

dmcnamee commented Feb 19, 2021

hello, I had the same issue as @FrsLry on macOS. Uninstalling then reinstalling without the --user flag worked for me.

@b0g2
Copy link

b0g2 commented Oct 1, 2021

In Windows, I solved it by installing using pip:

pip install pandoc-fignos pandoc-eqnos pandoc-tablenos pandoc-secnos

and then adding the directory containing pandoc-xnos.exe to the path. I run pandoc using a batch script:

SET PATH=%PATH%;D:\ProgramData\Anaconda3\Scripts
pandoc --filter pandoc-xnos -t latex --template=latex.template --listings --number-sections --table-of-contents -o%argout%.tex %argin%

(in my case I am using anaconda).

You can find the directory by

pip show --files pandoc-xnos

as mentioned by @tomduck .

@jankap
Copy link

jankap commented Nov 19, 2021

It's all about the path here. If you start a normal shell, e.g. cmd in Windows and just typing pandoc-xnos or pandoc-fignos returns in a command not found error, it's either not installed or the install folder is not on the Windows path. Try to remove it via pip uninstall, via admin shell. Reinstall and carefully watch where the stuff is installed into. Add this folder to the path and everything is fine.

Tutorial (not mine): https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/#:~:text=The%20most%20used%20environment%20variable,full%20path%20to%20the%20executable.

edit: And don't forget to restart your shell and VSCode if you made changes to the PATH!

@Xezarior
Copy link

I stumbled upon the same problem, but reinstalling (pip uninstall ... then pip install...) without the --user flag did not solve it. I think I did not remove it fully or something like that. Thank you all for the precious debugging information (I didn't know about printing the installation path of python packages), I found the folder and added it to my PATH.

In my case (Windows 11, Python 3.11) the PATH already includes the directory %USERPROFILE%\AppData\Local\Programs\Python\Python311\Scripts\ but pandoc-xnos has been installed into
%USERPROFILE%\AppData\Roaming\Python\Python311\Scripts\ causing it to not being found because that one wasn't on the PATH.

Maybe it could be an approach to hint at this second path during the install script? I think that preserving the option to use the --user flag if desired could be valuable for non-admin environments like schools/shared servers and similar.

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

No branches or pull requests

9 participants