如何使用 Sublime Text 3 的内置包管理器从 ctan 安装包?我正在尝试在 latex 文档类报告中安装和使用 matlab-prettifier。我手动下载、编译(针对 .sty)并将 matlab-prettifier 解压文件夹从 CTAN 放入我的 Mac 上的 ~\user\me\library\texmf。例如(以下代码不起作用)但显示了我正在尝试做的事情:
\documentclass[12pt]{report}
\usepackage{listings}
\usepackage{amsmath}
\usepackage[framed,numbered]{matlab-prettifier}
\usepackage{color} %red, green, blue, yellow, cyan, magenta, black, white
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
\begin{document}
\lstset{language=Matlab,%
%basicstyle=\color{red},
breaklines=true,%
morekeywords={matlab2tikz},
keywordstyle=\color{blue},%
morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},
identifierstyle=\color{black},%
stringstyle=\color{mylilas},
commentstyle=\color{mygreen},%
showstringspaces=false,%without this there will be a symbol in the places where there is a space
numbers=left,%
numberstyle={\tiny \color{black}},% size of the numbers
numbersep=9pt, % this defines how far the numbers are from the text
emph=[1]{for,end,break},emphstyle=[1]\color{red}, %some words to emphasise
%emph=[2]{word1,word2}, emphstyle=[2]{style},
}
\begin{lstlisting}[style=Matlab-editor]
Po(Vo,BWc,BWs,Ro,n,LdB,Rpd) ...
= (Vo/Rpd)*(1/Ro)*(1/(BWc/BWs)*(10^((-(3+2*n)*LdB)/10)));
Po(0.0059,1.6,35,0.01,n,LdB,75)
\end{lstlisting}
\end{document}
以下代码确实有效,但格式不符合预期:
\documentclass[12pt]{report}
\usepackage{listings}
\usepackage{amsmath}
\begin{document}
$Po(Vo,BWc,BWs,Ro,n,LdB,Rpd) ...
= (Vo/Rpd)*(1/Ro)*(1/(BWc/BWs)*(10^((-(3+2*n)*LdB)/10)));
Po(0.0059,1.6,35,0.01,n,LdB,75)$
\end{document}