![Matlab 美化问题 *](https://linux22.com/image/477646/Matlab%20%E7%BE%8E%E5%8C%96%E9%97%AE%E9%A2%98%20*.png)
我正在尝试使用 matlab-prettifier。以下代码无法编译:
\begin{lstlisting}[
style = Matlab-editor,
basicstyle = \mlttfamily,
]
ro=zeros(length(prec),length(prec)+length(h)-1);
for i=t
ro(i,i:i+length(h)-1)=prec(i) * h;
end
runoff = sum(ro,1);
\end{lstlisting}
只要我删除 *,它就可以正常工作。此外,如果我只使用 lstlisting 环境而不使用
[
style = Matlab-editor,
basicstyle = \mlttfamily,
]
再把 * 放回去,一切正常。我遵循了官方文档:https://github.com/Jubobs/matlab-prettifier/wiki matlab-prettifier 中是否存在错误,或者我做错了什么?
*编辑:接下来你会发现一个MWE:
\documentclass[10pt,a4paper]{report}
\usepackage[a4paper, left=2cm, right=2cm, top=2cm]{geometry}
\usepackage[numbered,framed]{matlab-prettifier}
\begin{document}
\begin{lstlisting}[
style = Matlab-editor,
basicstyle = \mlttfamily,
]
ro=zeros(length(prec),length(prec)+length(h)-1);
for i=t
ro(i,i:i+length(h)-1)=prec(i) * h;
end
runoff = sum(ro,1);
\end{lstlisting}
\end{document}
这是 Texstudio 的输出:
Prozess gestartet: pdflatex.exe -synctex=1 -interaction=nonstopmode "matlabprettifier".tex
Sorry, but miktex-makemf did not succeed. The log file hopefully contains the information to get MiKTeX going again: C:\Users\Karl\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makemf.l
og
Sorry, but miktex-makepk did not succeed. The log file hopefully contains the information to get MiKTeX going again: C:\Users\Karl\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makepk.log
Prozess endete mit Fehler(n)
*EDIT2 接下来,您将发现 makepk 和 makemf 的输出:
makepk:
2019-04-06 17:25:23,589+0200 INFO miktex-makepk - 从命令行启动:miktex-makepk --enable-installer --verbose fvmr8r 510 600 0+510/600 2019-04-06 17:25:23,592+0200 INFO makepk - 尝试以 510 DPI 制作 PK 字体 fvmr8r... 2019-04-06 17:25:23,604+0200 INFO makepk - METFAONT 模式为:ljfour 2019-04-06 17:25:23,614+0200 INFO makepk - 运行 miktex-makemf.exe... 2019-04-06 17:25:23,614+0200 INFO makepk - 正在运行:miktex-makemf.exe --miktex-enable-installer --verbose fvmr8r 2019-04-06 17:25:23,956+0200 INFO makepk - 正在运行 miktex-ttf2pk.exe... 2019-04-06 17:25:23,957+0200 INFO makepk - 正在运行:miktex-ttf2pk.exe --miktex-enable-installer -q -t fvmr8r 2019-04-06 17:25:24,507+0200 FATAL miktex-makepk - 无法创建 PK 字体 fvmr8r。 2019-04-06 17:25:24,507+0200 FATAL miktex-makepk - 无法创建 PK 字体 fvmr8r。2019-04-06 17:25:24,507+0200 FATAL miktex-makepk - 信息:2019-04-06 17:25:24,507+0200 FATAL miktex-makepk - 来源:2019-04-06 17:25:24,507+0200 FATAL miktex-makepk - 行:0
makemf:
2019-04-06 17:25:23,888+0200 INFO miktex-makemf - 从命令行启动:miktex-makemf.exe --miktex-enable-installer --verbose fvmr8r 2019-04-06 17:25:23,899+0200 FATAL miktex-makemf - 找不到 fvmr8r 源文件。 2019-04-06 17:25:23,899+0200 FATAL miktex-makemf - 找不到 fvmr8r 源文件。 2019-04-06 17:25:23,899+0200 FATAL miktex-makemf - 信息:2019-04-06 17:25:23,899+0200 FATAL miktex-makemf - 来源:2019-04-06 17:25:23,899+0200 FATAL miktex-makemf - 行:0