I write a document in Lyx and use a minted environment. I added a python code inside a Tex code box, but after compilation, Lyx "reverses" the order of the words inside the " " marks.
This is the code I wrote:
\begin{minted}[linenos=true, numbersep=5pt, fontsize=\small]{python}
Total = 0
I = 0
while I < 100:
x = int(input("enter a number"))
if x < 0:
continue
Total += x
I += 1
print(Total)
\end{minted}
and this is the result after compilation:
as you can see, the order is reversed. I tried "playing" with the order, to "trick" Lyx to reverse it again, but it's still not perfect.
how can I solve this?
\begin{LTR}
before\begin{minted}
, and\end{LTR}
after\end{minted}
. Usually LyX do it by default if you use the minted environment from the GUI and don't use ERT, but if IRCC you use the latter.