pour faire une description dont les item sont du code

Cette révision appartient à :
Yann Salmon
2019-12-17 09:39:18 +01:00
Parent bcc1e5bd1c
révision 287e81db20

Voir le fichier

@@ -86,6 +86,17 @@
\newcommand\lstinputpython[1][]{\leavevmode\lstinputlisting[language={Python3}, frame=single, frameround=tttt, rangeprefix=\#\#\#\ , rangesuffix=\ \#\#\#, #1]} \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]} \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}{% \lstdefinelanguage{algorithme}{%
morekeywords={Si, alors, TantQue, faire, PourChaque, FinSi, FinPour, FinTantQue, Fonction, Renvoyer, Sinon}, morekeywords={Si, alors, TantQue, faire, PourChaque, FinSi, FinPour, FinTantQue, Fonction, Renvoyer, Sinon},