Closed codingyourlife closed 5 months ago
Okay just found a workaround. Maybe this helps someone else (just add empty lstlisting bellow):
\begin{python}
#my python-latex-highlighting with caption bellow because of additional lstlisting
\end{python}
\begin{lstlisting}[frame=none,caption={TEST123},captionpos=b,label=lst:TEST]
\end{lstlisting}
Well, that's a legitimate request, I'll see if that is possible.
+1
not exactly a fix either, but another way of using the package:
\begin{lstlisting}[style=mypython,caption={Test}]
def test(x):
print(x)
\end{lstlisting}
Have you tried to put it into a figure? Is that feasible?
I think the best option is to define the python environment in the same way the original lstlistings is defined in listings.sty.
I created a PR for this #10
The python
environment already offers the possibility to add an optional argument, it would just need to also use this argument to facilitate captions, labels etc
\lstnewenvironment{python}[1][]{\lstset{style=mypython,#1}}{}
Fixed in #10
With lstlisting I can do something like this:
Not with python-latex-highlighting:
Maybe not really a bug, maybe not even a missing feature but I guess this is the best way to contact the author...