##// END OF EJS Templates
Added key distinction between Notebook app and notebook documents via capitalization. Added info on different cell types and sketch of plotting
David P. Sanders -
Show More
@@ -86,7 +86,7 b' class LatexExporter(Exporter):'
86 86 def default_config(self):
87 87 c = Config({
88 88 'NbConvertBase': {
89 'display_data_priority' : ['latex', 'png', 'jpg', 'svg', 'jpeg', 'text']
89 'display_data_priority' : ['latex', 'svg', 'png', 'jpg', 'jpeg', 'text']
90 90 },
91 91 'ExtractFigureTransformer': {
92 92 'enabled':True
@@ -28,7 +28,7 b' from .convertfigures import ConvertFiguresTransformer'
28 28 #-----------------------------------------------------------------------------
29 29
30 30 INKSCAPE_COMMAND = 'inkscape --without-gui --export-pdf="{to_filename}" "{from_filename}"'
31 INKSCAPE_OSX_COMMAND = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape --without-gui --export-pdf="{to_filename}" "{from_filename}"'
31 #INKSCAPE_OSX_COMMAND = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape --without-gui --export-pdf="{to_filename}" "{from_filename}"'
32 32
33 33
34 34 #-----------------------------------------------------------------------------
@@ -1,6 +1,5 b''
1 1 .. _htmlnotebook:
2 2
3 ====================
4 3 The IPython Notebook
5 4 ====================
6 5
@@ -8,12 +7,17 b' The IPython Notebook'
8 7
9 8 :ref:`Installation requirements <installnotebook>` for the Notebook.
10 9
11 The IPython Notebook consists of two related components:
10 The IPython Notebook consists of two components:
11
12 * A web application, called the *IPython Notebook web app*, for interactive authoring of literate computations, in which explanatory text, mathematics, computations and rich media output may be combined. Input and output are stored in persistent cells that may be edited in-place.
13
14 * Plain text documents, called *notebook documents*, or *notebooks*, for recording and distributing the results of the rich computations.
15
16 In the documentation, the distinction between the *N*otebook app and *n*otebook documents is made by capitalization.
12 17
13 * A web application for interactive authoring of literate computations, combining explanatory text, mathematics, computations and rich media output. Input and output are stored in persistent cells that may be edited in-place.
18 The Notebook app automatically saves the current state of the computation in the web browser to the corresponding notebook, which is just a standard text file with the extension ``.ipynb``, stored in a working directory on your computer. This file can be easily put under version control and shared with colleagues.
14 19
15 * Notebook documents for recording and distributing
16 the results.
20 Despite the fact that the notebook documents are plain text files, they use the JSON format in order to store a *complete*, *reproducible* copy of the state of the computation as it is inside the Notebook app.
17 21
18 22
19 23 Features of the IPython Notebook web app
@@ -94,11 +98,10 b' This server uses a two-process kernel architecture based on ZeroMQ, as well as T'
94 98
95 99
96 100 Basic workflow
97 ------------------------
101 --------------
98 102
99
100 Once in a notebook, your browser tab will reflect the name of that notebook (prefixed with "IPy").
101 The URL for that notebook is currently not meant to be human-readable and is not persistent across invocations of the notebook server; however, this will change soon.
103 When you open or create a new notebook, your browser tab will reflect the name of that notebook, prefixed with "IPy".
104 The URL is currently not meant to be human-readable and is not persistent across invocations of the notebook server; however, this will change in a future version of IPython.
102 105
103 106 The normal workflow in a notebook is quite similar to a normal IPython
104 107 session, with the difference that you can edit a cell in-place multiple
@@ -109,7 +112,7 b' organizing related pieces into cells and moving forward as previous'
109 112 parts work correctly. This is much more convenient for interactive exploration than breaking up a computation into scripts that must be
110 113 executed together, especially if parts of them take a long time to run
111 114
112 The only significant limitation that the notebook currently has, compared to the qt console, is that it can not run any code that
115 The only significant limitation that the notebook currently has, compared to the qt console, is that it cannot run any code that
113 116 expects input from the kernel (such as scripts that call
114 117 :func:`raw_input`). Very importantly, this means that the ``%debug``
115 118 magic does *not* currently work in the notebook! This limitation will
@@ -142,16 +145,56 b' started kernel if there is more than one). You can also request this'
142 145 connection data by typing ``%connect_info``; this will print the same
143 146 file information as well as the content of the JSON data structure it contains.
144 147
145
146 Text input
148 Cell types
147 149 ----------
148 150
149 In addition to code cells and the output they produce (such as figures), you
150 can also type text not meant for execution. To type text, change the type of a
151 cell from ``Code`` to ``Markdown`` by using the button or the :kbd:`Ctrl-m m`
152 keybinding (see below). You can then type any text in Markdown_ syntax, as
153 well as mathematical expressions if you use ``$...$`` for inline math or
154 ``$$...$$`` for displayed math.
151 Each IPython input cell has a cell type.
152 There is a limited number of possible cell types, which may be set by using the cell type dropdown on the toolbar, or via the following keyboard shortcuts:
153
154 * code :kbd:`Ctrl-m y`
155 * markdown :kbd:`Ctrl-m m`
156 * raw :kbd:`Ctrl-m t`
157 * heading :kbd:`Ctrl-m 1` - :kbd:`Ctrl-m 6`
158
159
160 Code cells
161 ----------
162 Code cells contain code, which is Python by default. This code is executed when :kbd:`Shift-Enter` is typed, and the result of running the code will then be displayed as its output just below the cell. For example, the output may be a figure, which can be displayed inline (see below).
163
164 Code may be edited inline in the cell, with full syntax highlighting.
165
166
167 Rich text using markdown
168 -------------------------
169
170 The computational process may be documented using rich text by using a markdown cell. Rich text is entered using Markdown_ syntax, allowing for italics, bold, ordered and unordered lists, etc.
171
172
173 Mathematics using LaTeX
174 -----------------------
175
176 You can write mathematics by including LaTeX code in markdown cells.
177 Use ``$...$`` for inline math and ``$$...$$`` for displayed math. Standard LaTeX environments, such as ``\begin{equation}...\end{equation}`` also work.
178 New commands may be defined using standard LaTeX commands, placed anywhere in a markdown cell.
179
180 Raw cells
181 ---------
182
183 Raw cells provide a place to put additional information which is not evaluated by the Notebook. This can be used, for example, for extra information to be used when the notebook is exported to a certain format.
184
185
186 Plotting
187 --------
188
189 The Notebook allows
190
191 `%matplotlib` and `%pylab` magics
192
193 Inline versus non inline
194
195 %config
196
197 Test!
155 198
156 199
157 200 Exporting a notebook and importing existing scripts
@@ -193,11 +236,12 b' notebook format.'
193 236 Importing or executing a notebook as a normal Python file
194 237 ---------------------------------------------------------
195 238
196 The native format of the notebook, a file with a ``.ipynb`` extension, is a
239 The native format of the notebook, a file with a ``.ipynb`` `extension, is a
197 240 JSON container of all the input and output of the notebook, and therefore not
198 valid Python by itself. This means that by default, you can not import a
199 notebook or execute it as a normal python script. But if you want use
200 notebooks as regular Python files, you can start the notebook server with::
241 valid Python by itself. This means that by default, you cannot directly
242 import a notebook from Python, nor execute it as a normal python script.
243
244 But if you want to be able to use notebooks also as regular Python files, you can start the notebook server with::
201 245
202 246 ipython notebook --script
203 247
@@ -206,9 +250,9 b' or you can set this option permanently in your configuration file with::'
206 250 c.NotebookManager.save_script=True
207 251
208 252 This will instruct the notebook server to save the ``.py`` export of each
209 notebook adjacent to the ``.ipynb`` at every save. These files can be
253 notebook, in addition to the ``.ipynb``, at every save. These are standard ``.py`` files, and so they can be
210 254 ``%run``, imported from regular IPython sessions or other notebooks, or
211 executed at the command-line as normal Python files. Since we export the raw
255 executed at the command-line. Since we export the raw
212 256 code you have typed, for these files to be importable from other code you will
213 257 have to avoid using syntax such as ``%magics`` and other IPython-specific
214 258 extensions to the language.
@@ -235,15 +279,14 b' Configuration'
235 279 -------------
236 280
237 281 The IPython notebook server can be run with a variety of command line arguments.
238 To see a list of available options enter:
282 To see a list of available options enter::
239 283
240 284 $ ipython notebook --help
241 285
242 286 Defaults for these options can also be set by creating a file named
243 ipython_notebook_config.py in your IPython profile folder. The profile folder is
244 a subfolder of your IPython directory (`ipython locate` will show you where that
245 is). To create default configuration files (with lots of info on available
246 options) use:
287 ``ipython_notebook_config.py`` in your IPython profile folder. The profile folder is a subfolder of your IPython directory; ``ipython locate`` will show you where it is located.
288
289 To create a new set of default configuration files, with lots of information on available options, use::
247 290
248 291 $ ipython profile create
249 292
@@ -252,8 +295,8 b' options) use:'
252 295 :ref:`config_overview`, in particular :ref:`Profiles`.
253 296
254 297
255 Keyboard use
256 ------------
298 Keyboard shortcuts
299 ------------------
257 300
258 301 All actions in the notebook can be achieved with the mouse, but we have also
259 302 added keyboard shortcuts for the most common ones, so that productive use of
General Comments 0
You need to be logged in to leave comments. Login now