Git Product home page Git Product logo

marktex's Introduction

Hi there 👋

marktex's People

Contributors

sailist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

marktex's Issues

deal with escape chars

If & % $ # _ { } ~ ^ \ these chars are not in code environment(code block or inline code), they should be escaped, substituted by:

\& \% \$ \# \_ \{ \}

\textasciitilde

\textasciicircum

\textbackslash

运行有错误

ubuntu 16.04。
创建了一个文件夹a,测试将 README.md 转换成 pdf。

$ pip install marktex -i https://pypi.python.org/pypi
$ marktex README.md -o "a"
Traceback (most recent call last):
  File "/home/jinbo/anaconda3/bin/marktex", line 7, in <module>
    from marktex.cli import main
  File "/home/jinbo/anaconda3/lib/python3.5/site-packages/marktex/cli.py", line 88
    print(f"[info*]convert finished.")
                                    ^
SyntaxError: invalid syntax

尝试运行 run_example.py 也报错了

$ python3 run_example.py 
Traceback (most recent call last):
  File "run_example.py", line 1, in <module>
    from marktex import api
  File "/home/jinbo/gitme/MarkTex/marktex/api.py", line 2, in <module>
    from marktex.util import config
  File "/home/jinbo/gitme/MarkTex/marktex/util.py", line 38
    newf = os.path.join(fdir, f"{mmd.hexdigest()}.{ext}")

some bugs and recommend

一些 bug 和建议,希望能够帮助你们。

Bug

Bug1

错误代码位置:marktex/markast/utils.py#L578

import matplotlib.pyplot as plt

这句 import 写在 try 里,如果 import 失败会跳转到 except。except 不会对异常类型进行检察,会直接报 time out 错误。希望把所有 import 加到文件开头,并且在 install_requires 中加上 matplotlib 。

Bug2

我使用的操作系统是 macOS ,通过 pip install marktex -i https://pypi.python.org/pypi 安装后,无法正常运行。错误原因是 marktex/markenv.tex 不存在。我从 GitHub 上拷贝了该文件后就可以正常运行了。

Bug3

在跑示例程序 run_example("./output/") 的时候运行失败,原因是 texfile.tex 文件不存在,从 GitHub 上拷贝了该文件后可以正常运行。

Bug2 和 Bug3 应该可以复现,我多次卸载重装后仍然会缺失这两个文件。

建议

说明 latex 文件所需的编译器

生成的 tex 文件使用了 ctex 包和 fontspec 包。所以无法通过 pdflatex、latex 或 lualatex进行编译,需要使用 xelatex 才能编译,希望能够在 readme 中说明(也许可以加一个 FQA)。

增加简单的 overleaf 的使用教程

因为 latex 的编译器太大,安装麻烦,所以我使用 overleaf 在线编辑 tex 文件。overleaf 的默认编译引擎是 pdflatex ,无法编译 marktex生成的文件。需要点击左上角的“菜单”图标,修改编译器,选择 xelatex 。以及,在 overleaf 上,ctex 的 fontset=windowsnew 参数无法支持,会导致编译超时,如果换成别的或删掉可能会是更好的选择。

以上。

非常喜欢 marktex ,特别好用,而且效果非常好,感谢你们。

markdown转换为pdf报错

File "c:\users\dell\appdata\local\programs\python\python37\lib\site-packages\marktex\markast\utils.py", line 78, in analyse
res = xml_dicttagl
KeyError: 'b'

FileNotFoundError

File "D:\Program Files (x86)\Python3\lib\site-packages\marktex\texparser\base.py", line 33, in
with open(os.path.join(os.path.dirname(file), 'sign_to_tex.txt'), 'r', encoding='utf-8') as r:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\Program Files (x86)\Python3\lib\site-packages\marktex\texparser\sign_to_tex.txt'

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.