Coder Social home page Coder Social logo

tk-21st / latex-to-myst Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.66 MB

LaTeX to MyST parser

Home Page: https://tk-21st.github.io/latex-to-myst/

License: BSD 3-Clause "New" or "Revised" License

Python 87.05% TeX 7.92% Makefile 5.03%
latex myst pandoc-filter python

latex-to-myst's Introduction

latex-to-myst's People

Contributors

tk-21st avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

latex-to-myst's Issues

Some Known Issues as of now

  • Figure environment's caption is not always captured. Specifically when the content of the figure environment is not just a single includegraphics (instead is tabular or subfloat or multiple includegraphics).
  • Some Divs are not parsed
    • IEEEeqnarray
    • array
    • figure*

Improve filter organization

Filter organization would be organized such that each file takes care of one type of elements. CLI should support running selected or all filters.

TypeError: unhashable type: 'Image'

  • Latex-to-Myst version: 0.0.1 (but latex2myst --version does not work)
  • Python version: 3.10
  • Pandoc version: 2.19.2
  • Panflute version: 2.2.3
  • Operating System: Ubuntu 22.04

Description

latex2myst course.tex course.md
Traceback (most recent call last):
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/main.py", line 186, in <module>
    main()
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/main.py", line 182, in main
    return pf.run_filter(action, doc=doc, finalize=finalize, prepare=prepare)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/io.py", line 227, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/io.py", line 203, in run_filters
    prepare(doc)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/main.py", line 161, in prepare
    doc.walk(get_level)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/base.py", line 274, in walk
    child = child.walk(action, doc, stop_if)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/containers.py", line 85, in walk
    ans = list(chain.from_iterable(ans))
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/containers.py", line 83, in <genexpr>
    ans = ((item,) if type(item) is not list else item for item in ans)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/containers.py", line 81, in <genexpr>
    ans = (item.walk(action, doc, stop_if) for item in self)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/base.py", line 274, in walk
    child = child.walk(action, doc, stop_if)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/containers.py", line 85, in walk
    ans = list(chain.from_iterable(ans))
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/containers.py", line 83, in <genexpr>
    ans = ((item,) if type(item) is not list else item for item in ans)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/containers.py", line 81, in <genexpr>
    ans = (item.walk(action, doc, stop_if) for item in self)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/panflute/base.py", line 282, in walk
    altered = action(self, doc)
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/main.py", line 159, in get_level
    block_levels[e] = level
TypeError: unhashable type: 'Image'
Error running filter /home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/main.py:
Filter returned error status 1
Traceback (most recent call last):
  File "/home/pierre/.pyenv/versions/3.10.7/bin/latex2myst", line 8, in <module>
    sys.exit(main())
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/cli.py", line 106, in main
    subprocess.run(
  File "/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pandoc', '/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/macros.tex', 'courseM1_PA_instabilities_turbulence.tex', '-o', 'course.md', '--filter', '/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/main.py', '-t', 'markdown+latex_macros', '--markdown-headings=atx', '--highlight-style', '/home/pierre/.pyenv/versions/3.10.7/lib/python3.10/site-packages/latex_to_myst/pygments.theme', '--standalone']' returned non-zero exit status 83.

Generic directive block writer

As title. Should support any generic directive block.

Provide API for special rules (like macros) for specifying how each directive should be named

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.