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 executing subprocess.CalledProcessError dvisvgm #48

Open
juanmf opened this issue May 26, 2022 · 3 comments
Open

Error executing subprocess.CalledProcessError dvisvgm #48

juanmf opened this issue May 26, 2022 · 3 comments

Comments

@juanmf
Copy link

juanmf commented May 26, 2022

I'm not sure what's wrong, tried with sudo in case my user didn't have permissions, same outcome.

$ python3 -m readme2tex --output README1.md README.md 
'$n * T_i | n\in \Bbb N + \{0\}$' has warnings during compilation. See /var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/01c646718a35875ea8195cf0865d9375
ERROR: can't open file '/var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/01c646718a35875ea8195cf0865d9375.dvi' for reading
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/readme2tex/__main__.py", line 147, in <module>
    render(
  File "/usr/local/lib/python3.9/site-packages/readme2tex/render.py", line 167, in render
    svg, dvi, name = rendertex(engine, equation, packages, temp_dir, block)
  File "/usr/local/lib/python3.9/site-packages/readme2tex/render.py", line 43, in rendertex
    svg = check_output(
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dvisvgm', '-v0', '-a', '-n', '-s', '/var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/01c646718a35875ea8195cf0865d9375.dvi']' returned non-zero exit status 252.
$ cat /var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/01c646718a35875ea8195cf0865d9375.tex 
% processed with readme2tex
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\pagestyle{empty}
\geometry{paperwidth=250mm, paperheight=16383pt, left=0pt, top=0pt, textwidth=426pt, marginparsep=20pt, marginparwidth=100pt, textheight=16263pt, footskip=40pt}
\begin{document}
a$n * T_i | n\in \Bbb N + \{0\}$
\end{document}
@juanmf
Copy link
Author

juanmf commented May 26, 2022

$ dvisvgm -v0 -a -n -s /var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/01c646718a35875ea8195cf0865d9375.dvi
ERROR: can't open file '/var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/01c646718a35875ea8195cf0865d9375.dvi' for reading

Looks like the file /var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/01c646718a35875ea8195cf0865d9375.dvi is never created?

but folder is not empty.

$ ls /var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-srbuc3i1/
01c646718a35875ea8195cf0865d9375.tex

@juanmf
Copy link
Author

juanmf commented May 26, 2022

brew had issues installing macTex with basicTex (plus adding latex to PATH /usr/local/texlive/2022basic/bin/universal-darwin/) it still dies but now the directory gets filled with more files

/var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-k4fwye3c:
01c646718a35875ea8195cf0865d9375.aux	01c646718a35875ea8195cf0865d9375.dvi	01c646718a35875ea8195cf0865d9375.log	01c646718a35875ea8195cf0865d9375.tex

error (STDERR) this time:

$ python3 -m readme2tex --output README1.md README.md
warning: kpathsea: /opt/local/share/texmf-local/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/etc/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/var/db/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/share/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/share/texmf-texlive/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/readme2tex/__main__.py", line 147, in <module>
    render(
  File "/usr/local/lib/python3.9/site-packages/readme2tex/render.py", line 167, in render
    svg, dvi, name = rendertex(engine, equation, packages, temp_dir, block)
  File "/usr/local/lib/python3.9/site-packages/readme2tex/render.py", line 43, in rendertex
    svg = check_output(
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dvisvgm', '-v0', '-a', '-n', '-s', '/var/folders/3w/b2_16tq53jnfq2kn92fg4mdh0000gs/T/readme2tex-k4fwye3c/01c646718a35875ea8195cf0865d9375.dvi']' returned non-zero exit status 254.

dvisvgm -> exit status 254. before it was 252

@juanmf
Copy link
Author

juanmf commented May 26, 2022

Moving one step fwd:
had to fill in ls_R files:

# Not sure what gets generated here:
$ sudo mktexlsr --verbose /opt/local/share/texmf-local/ /opt/local/share/texmf/ /opt/local/share/texmf-texlive/ /opt/local/share/texmf-local/ /opt/local/share/texmf/ /opt/local/share/texmf-texlive/ /opt/local/etc/texmf/ /opt/local/var/db/texmf/


$ sudo dvisvgm -v7 -a -n -s /tmp/readme2tex-lxljvqh_/86f95c3e869aa898be7b87e55b766c65.dvi 
WARNING: map file ps2pk.map not found
WARNING: map file pdftex.map not found
WARNING: map file dvipdfm.map not found
WARNING: map file psfonts.map not found
WARNING: none of the default map files could be found
pre-processing DVI file (format version 2)
WARNING: PostScript header file tex.pro not found
WARNING: PostScript header file texps.pro not found
WARNING: PostScript header file special.pro not found
WARNING: PostScript header file color.pro not found
PostScript error: undefined in TeXDict

$ echo $?
254.  # same as when called from python

Now I don't get errors for ls-R, dvisvgm still fails.

Where am I supposed to get ps2pk.map and the rest?

Edit: Seems this is connected but I can't make it work on Mac.
With TexMaker I could render after removing some illegal markup symbols like "#"

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