Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. ((= IPython input/output style =))
  2.  
  3. ((*- extends 'base.tplx' -*))
  4.  
  5. %===============================================================================
  6. % Custom definitions
  7. %===============================================================================
  8. ((* block definitions *))
  9. ((( super() )))
  10.  
  11. % Pygments definitions
  12. ((( resources.latex.pygments_definitions )))
  13.  
  14. % Exact colors from NB
  15. \definecolor{incolor}{rgb}{0.0, 0.0, 0.5}
  16. \definecolor{outcolor}{rgb}{0.545, 0.0, 0.0}
  17.  
  18. % Don't number sections
  19. \renewcommand{\thesection}{\hspace*{-0.5em}}
  20. \renewcommand{\thesubsection}{\hspace*{-0.5em}}
  21.  
  22. ((* endblock definitions *))
  23.  
  24. % No title
  25. ((* block maketitle *))((* endblock maketitle *))
  26.  
  27. %===============================================================================
  28. % Input
  29. %===============================================================================
  30.  
  31. ((* block input scoped *))
  32. ((( '\n' )))
  33. ((*- if cell.metadata.hide_input -*))
  34. ((*- else -*))
  35. ((( add_prompt(cell.source | highlight_code(strip_verbatim=True), cell, '', 'incolor') )))
  36. ((*- endif -*))
  37. ((* endblock input *))
  38.  
  39.  
  40. %===============================================================================
  41. % Output
  42. %===============================================================================
  43.  
  44. ((* block execute_result scoped *))
  45. ((( '\n' )))
  46. ((*- if cell.metadata.hide_output -*))
  47. ((*- else -*))
  48. ((( super() )))
  49. ((*- endif -*))
  50. ((* endblock execute_result *))
  51.  
  52. %==============================================================================
  53. % Support Macros
  54. %==============================================================================
  55.  
  56.  
  57.  
  58. % Name: draw_prompt
  59. % Purpose: Renders an output/input prompt
  60. ((* macro add_prompt(text, cell, prompt, prompt_color) -*))
  61. ((*- if cell.execution_count is defined -*))
  62. ((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
  63. ((*- else -*))
  64. ((*- set execution_count = " " -*))
  65. ((*- endif -*))
  66. ((*- set indention = " " * (execution_count | length + 4) -*))
  67. \begin{Verbatim}[commandchars=\\\{\}]
  68. ((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
  69. \end{Verbatim}
  70. ((*- endmacro *))
  71.  
  72.  
  73.  
  74. %===============================================================================
  75. % Latex Article
  76. %===============================================================================
  77.  
  78. ((* block docclass *))
  79. % !TeX spellcheck = de_DE
  80. % !TeX encoding = UTF-8
  81. \documentclass{scrreprt}
  82. \usepackage{ngerman}
  83. ((* endblock docclass *))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement