\NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{yslistings} \RequirePackage{listings} \RequirePackage{lstautogobble} \RequirePackage{fontawesome} \newbox\codebreakbox \setbox\codebreakbox=\hbox{\textcolor[gray]{.75}{\scriptsize\upshape\faChevronCircleRight}} \lstset{upquote=true,basicstyle=\ttfamily\NoAutoSpacing, keepspaces=true, columns=fullflexible, showstringspaces=false, commentstyle=\slshape, mathescape=true, stepnumber = 1, numberstyle=\scriptsize, numbersep=10pt, firstnumber=auto, breaklines=true, breakatwhitespace=true, prebreak={\copy\codebreakbox}, postbreak={\copy\codebreakbox}, autogobble, includerangemarker=false} \lstset{literate= {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1 {ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 {ő}{{\H{o}}}1 {Ő}{{\H{O}}}1 {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1 {€}{{\euro}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1 {»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1 {…}{{\dots}}1 } \lstdefinestyle{numbers}{numbers = left, xleftmargin=2em} \lstdefinestyle{nonumbers}{numbers = none} \let\nm\| \lstdefinelanguage{mybash}[]{bash} { morekeywords={ls, stat}} \lstdefinelanguage{mysql}[]{sql} { } %% Python definition (c) 1998 Michael Weber %% Additional definitions (2013) Alexis Dimitriadis %% \lstdefinelanguage{Python3}{% morekeywords={access, and, as, async, break, class, continue, def, del, elif, else,% except, exec, finally, for, from, global, if, import, in, is, lambda,% nonlocal, not, or, pass, raise, return, try, while, yield},% % Built-ins morekeywords=[2]{abs, all, any, basestring, bin, bool, bytearray,% callable, chr, classmethod, cmp, compile, complex, delattr, dict, dir,% divmod, enumerate, eval, execfile, file, filter, float, format,% frozenset, getattr, globals, hasattr, hash, help, hex, id, input, int,% isinstance, issubclass, iter, len, list, locals, long, map, max,% memoryview, min, next, object, oct, open, ord, pow, property, range,% input, reduce, reload, repr, reversed, round, set, setattr, slice,% sorted, staticmethod, str, sum, super, tuple, type, unichr, unicode,% vars, zip, apply, buffer, coerce, intern, print},% keywordstyle=[2]{\relax}, sensitive=true,% morecomment=[l]\#,% morestring=[b]',% morestring=[b]",% morecomment=[s]{'''}{'''},% used for documentation text % (mulitiline strings) morecomment=[s]{"""}{"""},% added by Philipp Matthias Hahn morestring=[s]{r'}{'},% `raw' strings morestring=[s]{r"}{"},% morestring=[s]{r'''}{'''},% morestring=[s]{r"""}{"""},% morestring=[s]{u'}{'},% unicode strings morestring=[s]{u"}{"},% morestring=[s]{u'''}{'''},% morestring=[s]{u"""}{"""}% }% \lstdefinelanguage{mycaml}[Objective]{caml} { morekeywords={raise}} \def\|{\lstinline[language=Python3, name=inlinepython]|} %| \def\°{\lstinline[language={mycaml}, name=inlinecaml]°} %° \def\§{\lstinline[language=mysql, name=inlinesql]§} %§ \def\>{\lstinline[language=mybash, name=inlineshell]>} %> \def\£{\lstinline[language={[x86masm]Assembler}]£} %£ \lstnewenvironment{lstpython}[1][]{\leavevmode\lstset{language=Python3, frame=single, frameround=tttt, #1}}{} \lstnewenvironment{lstcaml}[1][]{\leavevmode\lstset{language=mycaml, frame=single, frameround=tttt, #1}}{} \lstnewenvironment{lstsql}[1][]{\leavevmode\lstset{language=mysql, frame=single, frameround=tttt, #1}}{} \lstnewenvironment{lstshell}[1][]{\leavevmode\lstset{language=mybash, frame=single, frameround=tttt, #1}}{} \newcommand\lstinputcaml[1][]{\leavevmode\lstinputlisting[language={mycaml}, 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]} \lstdefinelanguage{algorithme}{% morekeywords={Si, alors, TantQue, faire, PourChaque, FinSi, FinPour, FinTantQue, Fonction, Renvoyer, Sinon}, sensitive=true, morestring=[b]", morecomment=[s]{/*}{*/}, literate=*{:=}{{\hbox{\textbf{prend la valeur de}}}}{18}{Créer}{{\hbox{\textbf{Créer}}}}{5}{Définir}{{\hbox{\textbf{Définir}}}}{7}{<-result->}{{\hbox{\textbf{Le résultat est}}}}{15} } \lstnewenvironment{lstalgo}[1][]{\leavevmode\lstset{columns=fullflexible, basicstyle=\rmfamily\NoAutoSpacing, language=algorithme, frame=single, frameround=tttt, #1}}{} \newbox\hoareboxB \newbox\hoareboxC \newbox\hoareboxA %\newenvironment{trhoare}[2]{\setbox\hoarebox=\hbox\begingroup\begin{lstpython}[frame=none, basicstyle=\ttfamily\scriptsize] %}{\end{lstpython}\endgroup}\left\{#1\vphantom{\copy\hoarebox}\right\}\quad\copy\hoarebox\quad\left\{\vphantom{\copy\hoarebox}#3\right\}} %\long\def\trhoare#1\trhcode{\setbox\hoareboxB=\hbox{#1}} \endinput