sailist / marktex Goto Github PK
View Code? Open in Web Editor NEWconvert markdown to latex code perfectly, support chinese
convert markdown to latex code perfectly, support chinese
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'
ModuleNotFoundError: No module named 'requests'
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'
print
should be converted to \lstlisting{print}
一些 bug 和建议,希望能够帮助你们。
错误代码位置:marktex/markast/utils.py#L578
import matplotlib.pyplot as plt
这句 import 写在 try 里,如果 import 失败会跳转到 except。except 不会对异常类型进行检察,会直接报 time out 错误。希望把所有 import 加到文件开头,并且在 install_requires 中加上 matplotlib 。
我使用的操作系统是 macOS ,通过 pip install marktex -i https://pypi.python.org/pypi
安装后,无法正常运行。错误原因是 marktex/markenv.tex 不存在。我从 GitHub 上拷贝了该文件后就可以正常运行了。
在跑示例程序 run_example("./output/")
的时候运行失败,原因是 texfile.tex
文件不存在,从 GitHub 上拷贝了该文件后可以正常运行。
Bug2 和 Bug3 应该可以复现,我多次卸载重装后仍然会缺失这两个文件。
生成的 tex 文件使用了 ctex 包和 fontspec 包。所以无法通过 pdflatex、latex 或 lualatex进行编译,需要使用 xelatex 才能编译,希望能够在 readme 中说明(也许可以加一个 FQA)。
因为 latex 的编译器太大,安装麻烦,所以我使用 overleaf 在线编辑 tex 文件。overleaf 的默认编译引擎是 pdflatex ,无法编译 marktex生成的文件。需要点击左上角的“菜单”图标,修改编译器,选择 xelatex 。以及,在 overleaf 上,ctex 的 fontset=windowsnew 参数无法支持,会导致编译超时,如果换成别的或删掉可能会是更好的选择。
以上。
非常喜欢 marktex ,特别好用,而且效果非常好,感谢你们。
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}")
The error I get when running the example:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.