org 모드 코드 블록 내보내기 및 다른 스타일로 결과
문제
Org 모드와 바벨을 사용하여 프리젠 테이션을 준비하고 Beamer PDF로 내보내고 싶습니다.
출력에서 소스 코드와 결과는 동일한 스타일 (verbatim in latex)입니다.따라서 그들을 구별하는 것은 어렵습니다.
다른 스타일로 소스 코드와 결과를 내보낼 수 있습니까 (바람직하게는 다른 색)?
감사합니다!
해결책
minted
LaTeX 패키지를 사용하여 구문으로 소스 코드를 강조 표시 할 수 있습니다.
C-h v org-latex-listings
...
(setq org-latex-listings 'minted)
causes source code to be exported using the minted package as
opposed to listings. If you want to use minted, you need to add
the minted package to `org-latex-packages-alist', for example
using customize, or with
(require 'ox-latex)
(add-to-list 'org-latex-packages-alist '("" "minted"))
In addition, it is necessary to install pygments
(http://pygments.org), and to configure the variable
`org-latex-pdf-process' so that the -shell-escape option is
passed to pdflatex.
The minted choice has possible repercussions on the preview of
latex fragments (see `org-preview-latex-fragment'). If you run
into previewing problems, please consult
http://orgmode.org/worg/org-tutorials/org-latex-preview.html
.
이 INIT 파일에 있습니다.
(require 'ox-latex)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
(setq org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
.
inted와 함께 사용할 수있는 다른 색상 테마가 있습니다. 예를 들어이 옵션을 org 파일에 넣어 "Monokai"를 사용하여
#+LaTeX_HEADER: \usemintedstyle{monokai}
.
피부형 스타일의 목록을 가져옵니다.
pymentize -l 스타일
제휴하지 않습니다 StackOverflow