2

Mintedが使用されているのように、ラテックス中のコードに美しさを追加します。崇高なテキストは、ラテックスを構築し、鋳造パッケージの問題

\documentclass{article} 
\usepackage{minted} 
\begin{document} 
\begin{minted}{c} 
int main() { 
    printf("hello, world"); 
    return 0; 
} 
\end{minted} 
\end{document} 

私はそれをインストールしていると私は呼んであれば、それは、コマンドラインから、正常に動作します:

pdflatex -shell-escape minimal.tex 

しかし、私はPDFを作るために崇高テキストビルドシステムを使用しています、ここにビルドスクリプトは次のとおりです。

{ 
    "cmd": ["/Library/TeX/texbin/pdflatex","-shell-escape","$file"], 
    "selector": "text.tex.latex" 
} 

私がCtrl+Bにヒットした何らかの理由で、ターミナルのように動作しません。出力パネルでは、私は以下を参照してください。

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex) 
\write18 enabled. 
entering extended mode 
(/Users/user/Downloads/minted/minimal.tex 
LaTeX2e <2016/03/31> 
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. 
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls 
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class 
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size10.clo)) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/minted/minted.sty 
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/kvoptions.sty 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/infwarerr.sty) 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/etexcmds.sty 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ifluatex.sty)))) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty 
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix 
<2008/02/07> (tvz)) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/float/float.sty) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ifthen.sty) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/tools/calc.sty) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/ifplatform/ifplatform.sty 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ifpdf.sty)) 
(/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/catchfile.sty) 
(./minimal.w18)) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/etoolbox/etoolbox.sty) 
(/usr/local/texlive/2016/texmf-dist/tex/generic/xstring/xstring.sty 
(/usr/local/texlive/2016/texmf-dist/tex/generic/xstring/xstring.tex)) 
(/usr/local/texlive/2016/texmf-dist/tex/latex/lineno/lineno.sty)) 
(./_minted-minimal/default.pygstyle)system returned with code 256 


! Package minted Error: You must have `pygmentize' installed to use this packag 
e. 

See the minted package documentation for explanation. 
Type H <return> for immediate help. 
...            

l.3 \begin{document} 

? 

pygmentizeは崇高なテキストを経由して発見されないのはなぜ?

答えて

2

私はOS Xが大好きですが、この全体的な話は単なる苦痛であり、少なくとも私にとっては、すべてのメジャーリリースで再び変わるようです。 Sublime Textを起動すると、シェルからではなく、launchctlツールから$PATH変数(これは基本的にサブプログラムにpdflatexまたはpygmentizeのような外部プログラムを探す必要がある)を継承します。したがって、たとえすべてがシェルで完璧に動作しても、Sublime Text(またはほとんどの他のエディタ)では動作しません。

this question on AskDifferent.SEに記載されているように、これを自分で修正できます。これは、たとえ別のエディタに切り替えたとしても、すべてのアプリケーションのパスを「修正」するという利点があります。これを行うには、あなたがあなたの.bash_profileに以下を追加する必要があります:すべてがで動作するかどうか

export PATH=some_path:another_path 
launchctl setenv PATH $PATH 
this answer

ノートから考えると、あなたはおそらく、最初の行を必要としませんターミナル。すべてのパスを設定したら、launchctlに電話してください。

サブライムテキストの方が好きな場合は、サブライムテキスト2または3にSublimeFixMacPath pluginを使用して、シェルからすべてのパスをサブライムテキストパスに追加することもできます。そのようにして、シェルで動作するものは、サブライムテキストでも動作します。

関連する問題