Before I resolved a problem to set up a minted
environment in LaTeX.
Now, I would like to add this environment as a LyX layout.
I have tried with
Style MatlabCode
Category MainText
Margin Static
LatexType Environment
LatexName matlabcode
NextNoIndent 1
LeftMargin MMM
RightMargin MMM
ParIndent MM
ParSkip 0
ItemSep 0
TopSep 0.5
BottomSep 0.5
ParSep 0
Align Block
AlignPossible Block, Left, Right, Center
Preamble
\usepackage{minted}
\newminted{matlab}{mathescape,linenos=true}
EndPreamble
End
Everything works and pdflatex gives me a nice PDF. The problem is that, when I use the environment, which is similar to a quotation layout in LyX, in the output I get blank lines, like this
And those weird brackets, since it should be just [2;3]
Does anyone know about this?
Best Answer
You need to add the following lines:
PassThru
tells LyX "don't escape my input. It's not LaTeX".`ParbreakIsNewline tells LyX not to start a new paragraph for line breaks in this layout.
This gives the following layout:
Please read Help > Customization for more information.