Guest User

Untitled

a guest
Jun 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. documentclass{book}
  2.  
  3. usepackage{fontspec}
  4. defaultfontfeatures{Ligatures=TeX}
  5. usepackage{unicode-math}%
  6.  
  7.  
  8. setmonofont[Path = ./Fonts/ ,
  9. UprightFont= Iosevka ,]{Iosevka}
  10.  
  11. usepackage{textcomp,xcolor,MNsymbol}
  12.  
  13. usepackage{listings}
  14.  
  15. lstdefinestyle{mypyscriptstyle}{%
  16. upquote=true,
  17. language=Python,
  18. % Basic style
  19. basicstyle=ttfamilysmall,
  20. commentstyle=ttfootnotesize, %rmfamily
  21. stringstyle=ttfamilyslshapesmall,%amd remove slshape, add upquote=true
  22. % Line numbers
  23. %numbers=left,
  24. %numberstyle=footnotesize,
  25. %numbersep=1em,
  26. %stepnumber=3,
  27. % Margins and box
  28. framextopmargin=2em,
  29. framexbottommargin=2em,
  30. frame=l,
  31. backgroundcolor=color{black!10},
  32. xleftmargin=1em,
  33. tabsize=4,
  34. % Show spaces
  35. showspaces=false,
  36. showtabs=false,
  37. showstringspaces=false,
  38. columns=fullflexible,
  39. breaklines=true,
  40. postbreak=raisebox{0ex}[0ex][0ex]{ensuremath{rcurvearrowsespace}},
  41. % Comments
  42. morecomment=[s]{"""}{"""},
  43. morecomment=[s]{'''}{'''},
  44. morecomment=[l]{#},
  45. % Keywords
  46. keywordstyle=bfseries,
  47. keywords={},
  48. sensitive=true,
  49. string=[b]',
  50. morestring=[b]",
  51. escapechar={§},
  52. alsoletter={_, .},
  53. % Built-in
  54. emphstyle=color{black!15}bfseries,
  55. 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,
  56. 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 }
  57. }
  58.  
  59. lstnewenvironment{testermcode}{lstset{style=mypyscriptstyle}}{}
  60.  
  61. begin{document}
  62.  
  63. begin{testermcode}
  64. In [1]: 2 + 2 # addition of integers
  65. Out[1]: 4
  66. In [2]: 2 * 2 # multiplication
  67. Out[2]: 4
  68. In [3]: 3 / 2 # division (returns floating-point real value)
  69. Out[3]: 1.5
  70. In [4]: 3 // 2 # integer division
  71. Out[4]: 1
  72. In [5]: 2 > 3 # logical operators return a Boolean value
  73. Out[5]: False
  74. In [6]: 2 == 2 # equals
  75. Out[6]: True
  76. In [7]: 2 != 2 # is different
  77. Out[7]: False
  78. In [8]: "my string" # quotes define strings
  79. Out[8]: 'my string'
  80. end{testermcode}
  81.  
  82. end{document}
Add Comment
Please, Sign In to add comment