Formatting Python code

Rich Shepard rshepard at appl-ecosys.com
Mon May 30 13:38:06 UTC 2022


Here's an issue that's appeared twice (so far) in the document and I cannot
find the reason.

The *.lyx code in a Program Listing environment looks like this:
-----
\begin_layout Plain Layout

         self.sheet = Sheet(self.frame,
\end_layout

\begin_layout Plain Layout

                           data = [[f"Row {r},
\end_layout

\begin_layout Plain Layout

                           Column {c}
\backslash
nnewline1
\backslash
nnewline2"
\end_layout

\begin_layout Plain Layout

                           for c in range(50)]
\end_layout

\begin_layout Plain Layout

                           for r in range(500)]) 
\end_layout
-----
The same code in the *.tex file is:
         self.sheet = Sheet(self.frame,
                           data = [[f"Row {r},
                           Column {c}\nnewline1\nnewline2"
                           for c in range(50)]
                           for r in range(500)]) 
------
So why does the pdflatex *.pdf display the attached with small space symbols?

Rich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lyx-spacing.png
Type: image/png
Size: 18039 bytes
Desc: 
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20220530/cee962c8/attachment.png>


More information about the lyx-users mailing list