2010-01-12 2 views
21

많은 것을 위해 Pygments을 사용하고 있으며, 이것을 라텍스 보고서에도 사용하고 싶습니다. 나는 Pygments와 상호 작용하는 패키지 Minted을 발견했지만 몇 가지 주석과 일부 코드는 오른쪽 여백을 오버플로합니다. 나는 과거에 lstlistings 'breaklines=true을 사용했지만 발행 아이디어 패키지를 사용하여 그 기능을 얻을 수있는 방법이 보이지 않습니다. 이 유액에 Pygments 형광펜을 사용하는 그대로유액 : 주조 된 패키지 사용 - 텍스트를 줄 바꿈하는 방법 (linebreaks = true)


\documentclass[10pt]{article} 
\usepackage{fancyvrb} 
\usepackage{minted} 

\begin{document} 
\begin{minted}[mathescape, 
linenos, 
numbersep=5pt, 
frame=single, 
numbersep=5pt, 
xleftmargin=0, 
]{python} 
class Run(BaseModel): 
""" 
Run: unique Tool and multiple Inputs 
Status: 
    Running => jobs are pending or runing and not all jobs have been completed 
    Paused => workers querying for 'Running' Runs won't get this Run until we change status again 
    Done => all jobs have completed and have a result_status = 'Done' 
    Incomplete => No results (inputs) have been associated with the Run 
""" 
name = models.CharField(max_length = 150, 
    unique=True) 
tool = models.ForeignKey('Tool') 
tags = models.ManyToManyField(RunTag, related_name="model_set") 
\end{minted} 
\end{document} 

답변

17

불행하게도, 미안, 순간 또는 예측 가능한 미래에 대한 minted 내에 해결책은 없다. breaklines 기능을 구현하는 것은 상당히 어렵습니다. 대신 listings을 사용하면 가장 좋은 해결책이 될 수 있습니다.

작성일 현재 breaklines 옵션이 있습니다.

+0

Konrad의 분명한 답변을 주셔서 감사합니다. 그럼에도 불구하고 제작 된 결과에 너무 만족했으며 결과를 다시 확인해야하는 번거 로움이 없었습니다. – Paddie

+1

당신은 현재 발행 년도에 '브레이크 라인'기능을 구현하는 데 어떤 활동이 있습니까? – eckes

+1

나는 단지 @eckes 질문을 되풀이하고 싶다 –

9

발행 년도 (단지 발표) 2.0 않습니다 라인 당신이 그것에게 breaklines 옵션을 제공하는 경우 깨는 :

줄 바꿈의 존재가 출력에 표시되는 방법을 제어하는 ​​다양한 관련 옵션도 있습니다
\documentclass[10pt]{article} 
\usepackage{fancyvrb} 
\usepackage{minted} 

\begin{document} 
\begin{minted}[% 
breaklines, 
mathescape, 
linenos, 
numbersep=5pt, 
frame=single, 
numbersep=5pt, 
xleftmargin=0pt, 
]{python} 
class Run(BaseModel): 
"'' 
Run: unique Tool and multiple Inputs 
Status: 
    Running => jobs are pending or runing and not all jobs have been completed 
    Paused => workers querying for 'Running' Runs won't get this Run until we change status again 
    Done => all jobs have completed and have a result_status = 'Done' 
    Incomplete => No results (inputs) have been associated with the Run 
"'' 
name = models.CharField(max_length = 150, 
    unique=True) 
tool = models.ForeignKey('Tool') 
tags = models.ManyToManyField(RunTag, related_name=''model_set'') 
\end{minted} 
\end{document} 

. minted 설명서의 6.3 절을 참조하십시오.

관련 문제