ラテックス:鋳造パッケージを使用して - どのように私はそれがテキスト(改行= true)をラップ作るのですか

StackOverflow https://stackoverflow.com/questions/2051383

  •  20-09-2019
  •  | 
  •  

質問

イムはたくさんのためのPygmentsを使用して、そして私も、ラテックスレポートでこれを使用したいと思います。私はPygmentsと相互作用し、パッケージMintedを見つけましたが、コメントの一部とコードの一部は、右マージンをオーバーフローします。私は過去にlstlistings' breaklines=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}
役に立ちましたか?

解決

を残念ながら、申し訳ありませんが、現時点でまたは予見可能な将来のためにminted以内に解決策はありません。 breaklines機能を実装することは非常に困難です。 listingsを使用する代わりに、ここにあなたの最善の解決策かもしれません。

鋳造は今breaklinesオプションを持っています。

他のヒント

鋳造され、あなたがそれをbreaklinesオプションを与える場合は2.0(リリースされたばかりの)ライン壊すん:

\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}

改行の存在が出力に示される方法を制御するための様々な関連オプションもあります。 鋳造のドキュメントにセクション6.3を参照してください。

それはLaTeXのでPygmentsの蛍光ペンを使用するためであるとして、

あなたはtexmentsを見ている必要があります。 http://www.ctan.org/tex-archive/macros /ラテックスに/ contrib / texments /

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top