Debian Codegraph @

tests/notebooks/complex_outputs_unrun.ipynb

raw
1 {
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": null,
6 "metadata": {
7 "init_cell": true,
8 "slideshow": {
9 "slide_type": "skip"
10 }
11 },
12 "outputs": [],
13 "source": [
14 "import matplotlib.pyplot as plt\n",
15 "import pandas as pd\n",
16 "pd.set_option('display.latex.repr', True)\n",
17 "import sympy as sym\n",
18 "sym.init_printing(use_latex=True)\n",
19 "import numpy as np\n",
20 "from IPython.display import Image, Latex"
21 ]
22 },
23 {
24 "cell_type": "markdown",
25 "metadata": {
26 "ipub": {
27 "slide": true
28 }
29 },
30 "source": [
31 "# Markdown"
32 ]
33 },
34 {
35 "cell_type": "markdown",
36 "metadata": {
37 "ipub": {
38 "slide": true
39 }
40 },
41 "source": [
42 "## General"
43 ]
44 },
45 {
46 "cell_type": "markdown",
47 "metadata": {
48 "ipub": {
49 "slide": true
50 }
51 },
52 "source": [
53 "Some markdown text.\n",
54 "\n",
55 "A list:\n",
56 "\n",
57 "- something\n",
58 "- something else\n",
59 "\n",
60 "A numbered list\n",
61 "\n",
62 "1. something\n",
63 "2. something else\n",
64 "\n",
65 "non-ascii characters TODO"
66 ]
67 },
68 {
69 "cell_type": "markdown",
70 "metadata": {
71 "ipub": {}
72 },
73 "source": [
74 "This is a long section of text, which we only want in a document (not a presentation)\n",
75 "some text\n",
76 "some more text\n",
77 "some more text\n",
78 "some more text\n",
79 "some more text\n",
80 "some more text\n",
81 "some more text\n",
82 "some more text\n",
83 "some more text\n"
84 ]
85 },
86 {
87 "cell_type": "markdown",
88 "metadata": {
89 "ipub": {
90 "slide": true,
91 "slideonly": true
92 }
93 },
94 "source": [
95 "This is an abbreviated section of the document text, which we only want in a presentation\n",
96 "\n",
97 "- summary of document text"
98 ]
99 },
100 {
101 "cell_type": "markdown",
102 "metadata": {
103 "ipub": {
104 "slide": true
105 }
106 },
107 "source": [
108 "## References and Citations"
109 ]
110 },
111 {
112 "cell_type": "markdown",
113 "metadata": {
114 "ipub": {
115 "slide": true
116 }
117 },
118 "source": [
119 "References to \\cref{fig:example}, \\cref{tbl:example}, =@eqn:example_sympy and \\cref{code:example_mpl}.\n",
120 "\n",
121 "A latex citation.\\cite{zelenyak_molecular_2016}\n",
122 "\n",
123 "A html citation.<cite data-cite=\"kirkeminde_thermodynamic_2012\">(Kirkeminde, 2012)</cite> "
124 ]
125 },
126 {
127 "cell_type": "markdown",
128 "metadata": {
129 "ipub": {
130 "slide": true
131 }
132 },
133 "source": [
134 "## Todo notes"
135 ]
136 },
137 {
138 "cell_type": "markdown",
139 "metadata": {
140 "ipub": {
141 "slide": true
142 }
143 },
144 "source": [
145 "\\todo[inline]{an inline todo}\n",
146 "\n",
147 "Some text.\\todo{a todo in the margins}"
148 ]
149 },
150 {
151 "cell_type": "markdown",
152 "metadata": {},
153 "source": [
154 "# Text Output"
155 ]
156 },
157 {
158 "cell_type": "code",
159 "execution_count": null,
160 "metadata": {
161 "ipub": {
162 "text": {
163 "format": {
164 "backgroundcolor": "\\color{blue!10}"
165 }
166 }
167 }
168 },
169 "outputs": [],
170 "source": [
171 "print(\"\"\"\n",
172 "This is some printed text,\n",
173 "with a nicely formatted output.\n",
174 "\"\"\")"
175 ]
176 },
177 {
178 "cell_type": "markdown",
179 "metadata": {},
180 "source": [
181 "# Images and Figures"
182 ]
183 },
184 {
185 "cell_type": "markdown",
186 "metadata": {},
187 "source": [
188 "## Displaying a plot with its code"
189 ]
190 },
191 {
192 "cell_type": "markdown",
193 "metadata": {
194 "ipub": {
195 "caption": "fig:example_mpl"
196 }
197 },
198 "source": [
199 "A matplotlib figure, with the caption set in the markdowncell above the figure."
200 ]
201 },
202 {
203 "cell_type": "markdown",
204 "metadata": {
205 "ipub": {
206 "caption": "code:example_mpl"
207 }
208 },
209 "source": [
210 "The plotting code for a matplotlib figure (\\cref{fig:example_mpl})."
211 ]
212 },
213 {
214 "cell_type": "markdown",
215 "metadata": {
216 "slideshow": {
217 "slide_type": "slide"
218 }
219 },
220 "source": [
221 "# Tables (with pandas)"
222 ]
223 },
224 {
225 "cell_type": "markdown",
226 "metadata": {
227 "ipub": {
228 "caption": "code:example_pd"
229 }
230 },
231 "source": [
232 "The plotting code for a pandas Dataframe table (\\cref{tbl:example})."
233 ]
234 },
235 {
236 "cell_type": "code",
237 "execution_count": null,
238 "metadata": {
239 "ipub": {
240 "code": {
241 "asfloat": true,
242 "caption": "",
243 "label": "code:example_pd",
244 "placement": "H",
245 "widefigure": false
246 },
247 "table": {
248 "alternate": "gray!20",
249 "caption": "An example of a table created with pandas dataframe.",
250 "label": "tbl:example",
251 "placement": "H"
252 }
253 }
254 },
255 "outputs": [],
256 "source": [
257 "np.random.seed(0) \n",
258 "df = pd.DataFrame(np.random.rand(3,4),columns=['a','b','c','d'])\n",
259 "df.a = ['$\\delta$','x','y']\n",
260 "df.b = ['l','m','n']\n",
261 "df.set_index(['a','b'])\n",
262 "df.round(3)"
263 ]
264 },
265 {
266 "cell_type": "markdown",
267 "metadata": {},
268 "source": [
269 "# Equations (with ipython or sympy)"
270 ]
271 },
272 {
273 "cell_type": "code",
274 "execution_count": null,
275 "metadata": {
276 "ipub": {
277 "equation": {
278 "label": "eqn:example_ipy"
279 }
280 }
281 },
282 "outputs": [],
283 "source": [
284 "Latex('$$ a = b+c $$')"
285 ]
286 },
287 {
288 "cell_type": "markdown",
289 "metadata": {
290 "ipub": {
291 "caption": "code:example_sym"
292 }
293 },
294 "source": [
295 "The plotting code for a sympy equation (=@eqn:example_sympy)."
296 ]
297 },
298 {
299 "cell_type": "code",
300 "execution_count": null,
301 "metadata": {
302 "ipub": {
303 "code": {
304 "asfloat": true,
305 "caption": "",
306 "label": "code:example_sym",
307 "placement": "H",
308 "widefigure": false
309 },
310 "equation": {
311 "environment": "equation",
312 "label": "eqn:example_sympy"
313 }
314 }
315 },
316 "outputs": [],
317 "source": [
318 "y = sym.Function('y')\n",
319 "n = sym.symbols(r'\\alpha')\n",
320 "f = y(n)-2*y(n-1/sym.pi)-5*y(n-2)\n",
321 "sym.rsolve(f,y(n),[1,4])"
322 ]
323 }
324 ],
325 "metadata": {
326 "celltoolbar": "Edit Metadata",
327 "hide_input": false,
328 "ipub": {
329 "bibliography": "example.bib",
330 "biboptions": [
331 "super",
332 "sort"
333 ],
334 "bibstyle": "unsrtnat",
335 "language": "portuges",
336 "listcode": true,
337 "listfigures": true,
338 "listtables": true,
339 "pandoc": {
340 "at_notation": true,
341 "use_numref": true
342 },
343 "sphinx": {
344 "bib_title": "My Bibliography"
345 },
346 "titlepage": {
347 "author": "Authors Name",
348 "email": "[email protected]",
349 "institution": [
350 "Institution1",
351 "Institution2"
352 ],
353 "logo": "logo_example.png",
354 "subtitle": "Sub-Title",
355 "supervisors": [
356 "First Supervisor",
357 "Second Supervisor"
358 ],
359 "tagline": "A tagline for the report.",
360 "title": "Main-Title"
361 },
362 "toc": {
363 "depth": 2
364 }
365 },
366 "jupytext": {
367 "notebook_metadata_filter": "ipub"
368 },
369 "kernelspec": {
370 "display_name": "Python 3",
371 "language": "python",
372 "name": "python3"
373 },
374 "language_info": {
375 "codemirror_mode": {
376 "name": "ipython",
377 "version": 3
378 },
379 "file_extension": ".py",
380 "mimetype": "text/x-python",
381 "name": "python",
382 "nbconvert_exporter": "python",
383 "pygments_lexer": "ipython3",
384 "version": "3.6.10"
385 },
386 "latex_envs": {
387 "LaTeX_envs_menu_present": true,
388 "autocomplete": true,
389 "bibliofile": "example.bib",
390 "cite_by": "apalike",
391 "current_citInitial": 1,
392 "eqLabelWithNumbers": true,
393 "eqNumInitial": 1,
394 "hotkeys": {
395 "equation": "Ctrl-E",
396 "itemize": "Ctrl-I"
397 },
398 "labels_anchors": false,
399 "latex_user_defs": false,
400 "report_style_numbering": false,
401 "user_envs_cfg": true
402 },
403 "nav_menu": {},
404 "toc": {
405 "colors": {
406 "hover_highlight": "#DAA520",
407 "navigate_num": "#000000",
408 "navigate_text": "#333333",
409 "running_highlight": "#FF0000",
410 "selected_highlight": "#FFD700",
411 "sidebar_border": "#EEEEEE",
412 "wrapper_background": "#FFFFFF"
413 },
414 "moveMenuLeft": true,
415 "nav_menu": {
416 "height": "161px",
417 "width": "252px"
418 },
419 "navigate_menu": true,
420 "number_sections": true,
421 "sideBar": true,
422 "threshold": 4,
423 "toc_cell": false,
424 "toc_section_display": "block",
425 "toc_window_display": true,
426 "widenNotebook": false
427 },
428 "varInspector": {
429 "cols": {
430 "lenName": 16,
431 "lenType": 16,
432 "lenVar": 40
433 },
434 "kernels_config": {
435 "python": {
436 "delete_cmd_postfix": "",
437 "delete_cmd_prefix": "del ",
438 "library": "var_list.py",
439 "varRefreshCmd": "print(var_dic_list())"
440 },
441 "r": {
442 "delete_cmd_postfix": ") ",
443 "delete_cmd_prefix": "rm(",
444 "library": "var_list.r",
445 "varRefreshCmd": "cat(var_dic_list()) "
446 }
447 },
448 "types_to_exclude": [
449 "module",
450 "function",
451 "builtin_function_or_method",
452 "instance",
453 "_Feature"
454 ],
455 "window_display": false
456 }
457 },
458 "nbformat": 4,
459 "nbformat_minor": 2
460 }