![MikTeX 및 Windows 7에서 Minted를 어떻게 사용하나요?](https://rvso.com/image/266431/MikTeX%20%EB%B0%8F%20Windows%207%EC%97%90%EC%84%9C%20Minted%EB%A5%BC%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%82%AC%EC%9A%A9%ED%95%98%EB%82%98%EC%9A%94%3F.png)
문서 에 따르면 minted
:
현재 Windows 지원은 대략적이거나 테스트되지 않았습니다. 설치와 사용이라는 두 가지 문제가 있습니다......
이 질문은 다음 사항을 단계별로 자세히 설명하고자 합니다.
minted
Windows에서 MikTeX를 사용하도록 설정하는 방법은 무엇입니까 ?
답변1
minted
파이썬을 사용한다pygments
라이브러리이므로 다음을 수행해야 합니다.
- 설치하다
Python
, 원하는 버전을 선택하세요.x64
또는 버전을x86
선택하는 것이 좋습니다2.7.5
. Python
다음에 추가PATH
:- 을 누른 Win채 누릅니다 Pause.
- 을 클릭합니다
Advanced System Settings
. - 을 클릭합니다
Environment Variables
. ;C:\Python27
변수 에 추가합니다PATH
.
- 설치하다
python-pip
. ;C:\Python27\Scripts
변수 에 추가합니다PATH
.pip install pygments
설치합니다Pygments
(설치한 경우 동일한 이름의 바이너리도 있으므로Perl
전체 경로를pip
지정해야 합니다 ).Perl
옵션이 활성화된 상태 로 컴파일
-shell-escape
:\documentclass{article} \usepackage{minted} \begin{document} \begin{minted}[mathescape, linenos, numbersep=5pt, gobble=2, frame=lines, framesep=2mm]{csharp} string title = "This is a Unicode π in the sky" /* Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter of an $n$-sided regular polygon circumscribing a circle of diameter $d$. */ const double pi = 3.1415926535 \end{minted} \end{document}
결과는 다음과 같습니다.
답변2
설치하다파이썬창문용. 그런 다음 설치설정 도구. 그러면 디렉터리 폴더 easy_install.exe
에 파일이 추가됩니다 (예: 내 컴퓨터에 있음. 사용자마다 다를 수 있음). 사용자 변수를 사용하여 시스템 경로에 추가합니다. 사용자 친화적인 편집기를 사용하고 싶을 수도 있습니다:Scripts
python
C:\Python26\Scripts\
C:\Python26\Scripts
경로 편집기이 목적을 위해.
이제 인터넷이 켜진 상태에서 명령 프롬프트로 이동하여 easy_install pygments
.
이제 컴퓨터를 다시 시작해야 할 수도 있습니다. 그리고 거기 있습니다. 이 테스트 파일을 사용해 보세요:
\documentclass{article}
\usepackage{amsmath}
\usepackage{minted} % loads fancyvrb
\newenvironment{eqnexample}
{\VerbatimOut{\jobname.tmp}}
{\endVerbatimOut
\inputminted{latex}{\jobname.tmp}
\input{\jobname.tmp}}
\begin{document}
\begin{eqnexample}
\begin{align}
d &= \sqrt{ (x'-x)^2 }
\\
e &= 0
\end{align}
\end{eqnexample}
\begin{eqnexample}
\begin{multline}
d = \sqrt{ (x'-x)^2 } \\
= f(x,x')
\end{multline}
\end{eqnexample}
\end{document}