Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{book}
- usepackage{fontspec}
- defaultfontfeatures{Ligatures=TeX}
- usepackage{unicode-math}%
- setmonofont[Path = ./Fonts/ ,
- UprightFont= Iosevka ,]{Iosevka}
- usepackage{textcomp,xcolor,MNsymbol}
- usepackage{listings}
- lstdefinestyle{mypyscriptstyle}{%
- upquote=true,
- language=Python,
- % Basic style
- basicstyle=ttfamilysmall,
- commentstyle=ttfootnotesize, %rmfamily
- stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
- % Line numbers
- %numbers=left,
- %numberstyle=footnotesize,
- %numbersep=1em,
- %stepnumber=3,
- % Margins and box
- framextopmargin=2em,
- framexbottommargin=2em,
- frame=l,
- backgroundcolor=color{black!10},
- xleftmargin=1em,
- tabsize=4,
- % Show spaces
- showspaces=false,
- showtabs=false,
- showstringspaces=false,
- columns=fullflexible,
- breaklines=true,
- postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
- % Comments
- morecomment=[s]{"""}{"""},
- morecomment=[s]{'''}{'''},
- morecomment=[l]{#},
- % Keywords
- keywordstyle=bfseries,
- keywords={},
- sensitive=true,
- string=[b]',
- morestring=[b]",
- escapechar={§},
- alsoletter={_, .},
- % Built-in
- emphstyle=color{black!15}bfseries,
- emph={assert, break, class, continue, def, del, elif, else, except, finally, for, global, help, in, lambda, not, or, pass, raise, return, try, while, with, yield, exec, Ellipsis, None, NotImplemented, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, Exception, FloatingPointError, ImportError, IndentationError, IndexError, IOError, KeyboardInterrupt, KeyError, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, ReferenceError, RuntimeError, StandardError, StopIteration, SyntaxError, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, ValueError, WindowsError, ZeroDivisionError, Warning, UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, OverflowWarning, RuntimeWarning, FutureWarning, abs, any, bin, bool, callable, chr, classmethod, compile, complex, delattr, dict, dir, divmod, enumerate, eval, filter, float, format, frozenset, getattr, globals, hasattr, hash, hex, id, input, int, isinstance, issubclass, iter, len, list, locals, map, max, min, object, oct, open, ord, pow, property, range, repr, reversed, round, setattr, set, slice, sorted, staticmethod, str, sum, super, tuple, type, vars, zip, apply, basestring, buffer, cmp, coerce, execfile, file, intern, long, , reduce, reload, unichr, unicode, xrange, import, __import__, print, match, search, readline, rstrip, group, VERBOSE, finditer, findall,
- join, upper, lower, replace, find, count, strip, split, append, copy, clear, index, pop, sort, reverse, get, items, keys, values, update, intersection, union, symmetric_difference, difference, issubset, issuperset, if, name, mode, encoding, write, writelines, close, as, seek, whos, deepcopy, start, end, dimension, shape, ndim, size, mean, std, sqrt, exp, array, zeros, ones, arange, reshape, random, loadtxt, re, who, from, imread, imshow, loc, iloc, drop, median, hist, email, esearch, efetch, parse, description, id, seq, alignments, read }
- }
- lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}
- begin{document}
- begin{testermcode}
- In [1]: 2 + 2 # addition of integers
- Out[1]: 4
- In [2]: 2 * 2 # multiplication
- Out[2]: 4
- In [3]: 3 / 2 # division (returns floating-point real value)
- Out[3]: 1.5
- In [4]: 3 // 2 # integer division
- Out[4]: 1
- In [5]: 2 > 3 # logical operators return a Boolean value
- Out[5]: False
- In [6]: 2 == 2 # equals
- Out[6]: True
- In [7]: 2 != 2 # is different
- Out[7]: False
- In [8]: "my string" # quotes define strings
- Out[8]: 'my string'
- end{testermcode}
- end{document}
Add Comment
Please, Sign In to add comment