Formatting Python code

Paul A. Rubin parubin73 at gmail.com
Fri May 27 20:20:25 UTC 2022


On 5/27/22 15:01, Rich Shepard wrote:
> I'm trying to format Python code in a document, but cannot properly set
> indentation and long lines without them breaking. The document class 
> is KOMA
> Article.
>
> I've set the code environment to LyX-Code.
>
> Reading the User Guide, I don't find a section on LyX-Code; Section 
> 6.10 is
> TeX Code and the LaTeX Syntax. That's not what I want.
>
> What have I missed?
>
> Rich
Rather than LyX-Code, start with Insert > Program Listing to insert a 
listings widget. Right click the widget, click Settings ..., and on the 
main settings tab use the Language drop-down to select Python. Tweak 
other settings at will.

Paul



More information about the lyx-users mailing list