diff --git a/latex/yslistings.sty b/latex/yslistings.sty index 9d2f0bc..d65f2d6 100644 --- a/latex/yslistings.sty +++ b/latex/yslistings.sty @@ -86,6 +86,17 @@ \newcommand\lstinputpython[1][]{\leavevmode\lstinputlisting[language={Python3}, frame=single, frameround=tttt, rangeprefix=\#\#\#\ , rangesuffix=\ \#\#\#, #1]} \newcommand\lstinputsql[1][]{\leavevmode\lstinputlisting[language={mysql}, frame=single, frameround=tttt, rangeprefix=---\ , rangesuffix=\ ---, #1]} +%%%% https://tex.stackexchange.com/a/249561/103608 +\makeatletter +\newcommand*{\lstitem}[1][]{% + \setbox0\hbox\bgroup + \patchcmd{\lst@InlineM}{\@empty}{\@empty\egroup\item[\usebox0]\leavevmode\\\ignorespaces}{}{}% + \lstinline[#1]% +} +\makeatother +\newcommand*{\itemcaml}[1][]{\lstitem[language=mycaml, #1]} +\newcommand*{\itempython}[1][]{\lstitem[language=Python3, #1]} + \lstdefinelanguage{algorithme}{% morekeywords={Si, alors, TantQue, faire, PourChaque, FinSi, FinPour, FinTantQue, Fonction, Renvoyer, Sinon},