Markdown Files¶
Whether you write your book’s content in Jupyter Notebooks (.ipynb
) or
in regular markdown files (.md
), you’ll write in the same flavor of markdown
called MyST Markdown.
What is MyST?¶
MyST stands for “Markedly Structured Text”. It is a slight variation on a flavor of markdown called “CommonMark” markdown, with small syntax extensions to allow you to write roles and directives in the Sphinx ecosystem.
What are roles and directives?¶
Roles and directives are two of the most powerful tools in Jupyter Book. They are kind of like functions, but written in a markup language. They both serve a similar purpose, but roles are written in one line, whereas directives span many lines. They both accept different kinds of inputs, and what they do with those inputs depends on the specific role or directive that is being called.
Using a directive¶
At its simplest, you can insert a directive into your book’s content like so:
```{mydirectivename}
My directive content
```
This will only work if a directive with name mydirectivename
already exists
(which it doesn’t). There are many pre-defined directives associated with
Jupyter Book. For example, to insert a note box into your content, you can
use the following directive:
```{note}
Here is a note
```
This results in:
Note
Here is a note
In your built book.
For more information on writing directives, see the MyST documentation.
Using a role¶
Roles are very similar to directives, but they are less-complex and written entirely on one line. You can insert a role into your book’s content with this pattern:
Some content {rolename}`and here is my role's content!`
Again, roles will only work if rolename
is a valid role’s name. For example,
the doc
role can be used to refer to another page in your book. You can
refer directly to another page by its relative path. For example, the
role syntax {doc}`intro`
will result in: Welcome to your Jupyter Book.
For more information on writing roles, see the MyST documentation.
Adding a citation¶
You can also cite references that are stored in a bibtex
file. For example,
the following syntax: {cite}`holdgraf_evidence_2014`
will render like
this: [].
Moreover, you can insert a bibliography into your page with this syntax:
The {bibliography}
directive must be used for all the {cite}
roles to
render properly.
For example, if the references for your book are stored in references.bib
,
then the bibliography is inserted with:
```{bibliography}
```
Resulting in a rendered bibliography that looks like:
- Ack89
Russell L Ackoff. From data to wisdom. Journal of applied systems analysis, 16(1):3–9, 1989.
- Bal11
Badi H. Baltagi. Econometrics –Springer Texts in Business and Econometrics. Springer, New York, 5th edition, 2011. ISBN 978-3642200588.
- BLK09
Stephen P Borgatti and Virginie Lopez-Kidwell. Network Theory. Science, 6(3):1–14, 2009. doi:10.1287/orsc.1100.0641.
- Dam13
Aswath Damodaran. Valuing Financial Services Firms. Journal of Financial Perspectives, 2013.
- DLT18
Kersten Christian Droste, Martin Lamm, and Jonas Tritschler. Journal Entry Testing. Idw-Verlag GmbH, 2018. ISBN 3802121406.
- DSchuler15
Jochen Drukarczyk and Andreas Schüler. Unternehmensbewertung. Vahlen, 7th edition, 2015. ISBN 978-3800647774.
- EST17
Dietmar Ernst, Sonja Schneider, and Bjoern Thielen. Unternehmensbewertungen erstellen und verstehen: ein Praxisleitfaden. Vahlen, 2017.
- FHK+16
Ludwig Fahrmeier, Christian Heumann, Rita Künstler, Iris Pigeot, and Gerhard Tutz. Statistik - Der Weg zur Datenanalyse. Springer-Verlag Berlin Heidelberg, 2016. ISBN 9783662503713.
- FKL09
Ludwig Fahrmeir, Thomas Kneib, and Stefan Lang. Regression - Modelle, Methoden und Anwendungen. Springer, Berlin, 1st edition, 2009. ISBN 978-3540339328.
- Gan18
Thushan Ganegedara. Natural Language Processing with TensorFlow: Teach language to machines using Python's deep learning library. Packt Publishing Ltd, 2018.
- Gre12
William H. Greene. Econometric Analysis. Pearson Education, 7th edition, 2012. ISBN 0273753568.
- Gro07
Stephanie Gross. Banks and shareholder value: An overview of bank valuation and empirical evidence on shareholder value for banks. Springer Science & Business Media, 2007.
- HKP12
Jiawei Han, Micheline Kamber, and Jian Pei. Additional Topics Regarding Classification. In Data Mining: Concepts and Techniques, pages 429ff. 2012. URL: http://dx.doi.org/10.1016/B978-0-12-381479-1.00016-2{\%}5Cnhttp://www.sciencedirect.com/science/article/pii/B9780123814791000150, arXiv:arXiv:1011.1669v3, doi:10.1016/B978-0-12-381479-1.00016-2.
- HSIH02
Jonathan Himmelfarb, Peter Stenvinkel, T. Alp Ikizler, and Raymond M. Hakim. Perspectives in renal medicine: The elephant in uremia: Oxidant stress as a unifying concept of cardiovascular disease in uremia. Kidney International, 62(5):1524–1538, 2002. doi:10.1046/j.1523-1755.2002.00600.x.
- Kle14
missing journal in klein2014unternehmenssteuerung
- KGCW15
T. Koller, M. Goedhart, M. Cichello, and D. Wessels. Valuation Workbook: Step-by-Step Exercises and Tests to Help You Master Valuation. John Wiley & Sons, 6th edition, 2015. ISBN 978-1-118-87387-8.
- LDM13
Rushi Longadge, S Snehlata Dongre, and Latesh Malik. Class imbalance problem in data mining: review. International Journal of Computer Science and Network, 2(1):83–87, 2013. arXiv:1305.1707, doi:10.1109/SIU.2013.6531574.
- Mat16
Mathworks. Machine Learning Challenges: Choosing the Best Model and Avoiding Overfitting. 2016.
- MP06
Hyungsik Roger Moon and Benoit Perron. Seemingly unrelated regressions. The New Palgrave Dictionary of Economics, 2006.
- NSV15
Thien Hai Nguyen, Kiyoaki Shirai, and Julien Velcin. Sentiment analysis on social media for stock movement prediction. Expert Systems with Applications, 42(24):9603–9611, 2015.
- RF16
W.-D. Richter and Dominik Fischer. Journal Entry Testing - Ein praxisorientierter Ansatz unter Verwendung der Netzwerkstruktur. In Georg Herde, editor, GoBD und Big Data - Neue Herausforderungen für die digitale Datenanalyse, 85–106. Erich Schmidt Verlag Berlin, 2016.
- Row07
Jennifer Rowley. The wisdom hierarchy: Representations of the DIKW hierarchy. Journal of Information Science, 33(2):163–180, 2007. doi:10.1177/0165551506070706.
- Sch07
missing title in schreiner2007equity
- SS07
missing journal in schreiner2007multiples
- SIZ18
Dev Shah, Haruna Isah, and Farhana Zulkernine. Predicting the effects of news sentiments on the stock market. In 2018 IEEE International Conference on Big Data (Big Data), 4705–4708. IEEE, 2018.
- SSBD14a
Shai Shalev-Shwartz and Shai Ben-David. Decision Trees. In Understanding Machine Learning: From Theory to Algorithms, chapter 18, pages 258ff. Cambridge University, Cambridge, 2014.
- SSBD14b
Shai Shalev-Shwartz and Shai Ben-David. Nearest Neighbor. In Understanding Machine Learning: From Theory to Algorithms, chapter 19, pages 258ff. Cambridge University, Cambridge, 2014.
- SSBD14c
Shai Shalev-Shwartz and Shai Ben-David. Support Vector Machines. In Understanding Machine Learning: From Theory to Algorithms, chapter 15, pages 202ff. Cambridge University, Cambridge, 2014.
- Wer17
Sebastian Wernicke. Bauch oder Zahl ? – Entscheidungsfindung in einer datengetriebenen Welt. In LMU Ringvorlesung: Big Data & Data Ethics, number November, 1–43. München, 2017.
- Woo12
Jeffrey M. Wooldridge. Introdutory Econometrics - A Modern Approach. Thomson South-Western, 5th edition, 2012.
- DrNVollmersABerghammer18
Dr. Nora Vollmers, Andreas Berghammer. Nutzerbindung durch verhaltensbasierte Big Data Analyse. WI-Symposium, TH Deggendorf, 2018.
- ProfDrBElser18
Prof. Dr. Bendedikt Elser. Konzeption der digitalen Wagenreihung bei der Deutschen Bahn. WI-Symposium, TH Deggendorf, 2018.
Executing code in your markdown files¶
If you’d like to include computational content inside these markdown files, you can use MyST Markdown to define cells that will be executed when your book is built. Jupyter Book uses jupytext to do this.
First, add Jupytext metadata to the file. For example, to add Jupytext metadata to this markdown page, run this command:
jupyter-book myst init markdown.md
Once a markdown file has Jupytext metadata in it, you can add the following directive to run the code at build time:
```{code-cell}
print("Here is some code to execute")
```
When your book is built, the contents of any {code-cell}
blocks will be
executed with your default Jupyter kernel, and their outputs will be displayed
in-line with the rest of your content.
For more information about executing computational content with Jupyter Book, see The MyST-NB documentation.