Show More
@@ -86,7 +86,7 b' class LatexExporter(Exporter):' | |||||
86 | def default_config(self): |
|
86 | def default_config(self): | |
87 | c = Config({ |
|
87 | c = Config({ | |
88 | 'NbConvertBase': { |
|
88 | 'NbConvertBase': { | |
89 |
'display_data_priority' : ['latex', 'png', 'jpg |
|
89 | 'display_data_priority' : ['latex', 'svg', 'png', 'jpg', 'jpeg', 'text'] | |
90 | }, |
|
90 | }, | |
91 | 'ExtractFigureTransformer': { |
|
91 | 'ExtractFigureTransformer': { | |
92 | 'enabled':True |
|
92 | 'enabled':True |
@@ -28,7 +28,7 b' from .convertfigures import ConvertFiguresTransformer' | |||||
28 | #----------------------------------------------------------------------------- |
|
28 | #----------------------------------------------------------------------------- | |
29 |
|
29 | |||
30 | INKSCAPE_COMMAND = 'inkscape --without-gui --export-pdf="{to_filename}" "{from_filename}"' |
|
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 | .. _htmlnotebook: |
|
1 | .. _htmlnotebook: | |
2 |
|
2 | |||
3 | ==================== |
|
|||
4 | The IPython Notebook |
|
3 | The IPython Notebook | |
5 | ==================== |
|
4 | ==================== | |
6 |
|
5 | |||
@@ -8,12 +7,17 b' The IPython Notebook' | |||||
8 |
|
7 | |||
9 | :ref:`Installation requirements <installnotebook>` for the Notebook. |
|
8 | :ref:`Installation requirements <installnotebook>` for the Notebook. | |
10 |
|
9 | |||
11 |
The IPython Notebook consists of two |
|
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 |
|
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. | |
16 | the results. |
|
|||
17 |
|
21 | |||
18 |
|
22 | |||
19 | Features of the IPython Notebook web app |
|
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 | Basic workflow |
|
100 | Basic workflow | |
97 |
-------------- |
|
101 | -------------- | |
98 |
|
102 | |||
99 |
|
103 | When you open or create a new notebook, your browser tab will reflect the name of that notebook, prefixed with "IPy". | ||
100 | Once in a 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. | |
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. |
|
|||
102 |
|
105 | |||
103 | The normal workflow in a notebook is quite similar to a normal IPython |
|
106 | The normal workflow in a notebook is quite similar to a normal IPython | |
104 | session, with the difference that you can edit a cell in-place multiple |
|
107 | session, with the difference that you can edit a cell in-place multiple | |
@@ -142,16 +145,56 b' started kernel if there is more than one). You can also request this' | |||||
142 | connection data by typing ``%connect_info``; this will print the same |
|
145 | connection data by typing ``%connect_info``; this will print the same | |
143 | file information as well as the content of the JSON data structure it contains. |
|
146 | file information as well as the content of the JSON data structure it contains. | |
144 |
|
147 | |||
|
148 | Cell types | |||
|
149 | ---------- | |||
|
150 | ||||
|
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: | |||
145 |
|
153 | |||
146 | Text input |
|
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 | |||
147 | ---------- |
|
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 | ||||
148 |
|
172 | |||
149 | In addition to code cells and the output they produce (such as figures), you |
|
173 | Mathematics using LaTeX | |
150 | can also type text not meant for execution. To type text, change the type of a |
|
174 | ----------------------- | |
151 | cell from ``Code`` to ``Markdown`` by using the button or the :kbd:`Ctrl-m m` |
|
175 | ||
152 | keybinding (see below). You can then type any text in Markdown_ syntax, as |
|
176 | You can write mathematics by including LaTeX code in markdown cells. | |
153 | well as mathematical expressions if you use ``$...$`` for inline math or |
|
177 | Use ``$...$`` for inline math and ``$$...$$`` for displayed math. Standard LaTeX environments, such as ``\begin{equation}...\end{equation}`` also work. | |
154 | ``$$...$$`` for displayed math. |
|
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 | Exporting a notebook and importing existing scripts |
|
200 | Exporting a notebook and importing existing scripts | |
@@ -193,11 +236,12 b' notebook format.' | |||||
193 | Importing or executing a notebook as a normal Python file |
|
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 | JSON container of all the input and output of the notebook, and therefore not |
|
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 |
|
241 | valid Python by itself. This means that by default, you cannot directly | |
199 |
notebook or execute it as a normal python script. |
|
242 | import a notebook from Python, nor execute it as a normal python script. | |
200 | notebooks as regular Python files, you can start the notebook server with:: |
|
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 | ipython notebook --script |
|
246 | ipython notebook --script | |
203 |
|
247 | |||
@@ -206,9 +250,9 b' or you can set this option permanently in your configuration file with::' | |||||
206 | c.NotebookManager.save_script=True |
|
250 | c.NotebookManager.save_script=True | |
207 |
|
251 | |||
208 | This will instruct the notebook server to save the ``.py`` export of each |
|
252 | This will instruct the notebook server to save the ``.py`` export of each | |
209 |
notebook |
|
253 | notebook, in addition to the ``.ipynb``, at every save. These are standard ``.py`` files, and so they can be | |
210 | ``%run``, imported from regular IPython sessions or other notebooks, or |
|
254 | ``%run``, imported from regular IPython sessions or other notebooks, or | |
211 |
executed at the command-line |
|
255 | executed at the command-line. Since we export the raw | |
212 | code you have typed, for these files to be importable from other code you will |
|
256 | code you have typed, for these files to be importable from other code you will | |
213 | have to avoid using syntax such as ``%magics`` and other IPython-specific |
|
257 | have to avoid using syntax such as ``%magics`` and other IPython-specific | |
214 | extensions to the language. |
|
258 | extensions to the language. | |
@@ -235,15 +279,14 b' Configuration' | |||||
235 | ------------- |
|
279 | ------------- | |
236 |
|
280 | |||
237 | The IPython notebook server can be run with a variety of command line arguments. |
|
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 | $ ipython notebook --help |
|
284 | $ ipython notebook --help | |
241 |
|
285 | |||
242 | Defaults for these options can also be set by creating a file named |
|
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 |
|
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. | |
244 | a subfolder of your IPython directory (`ipython locate` will show you where that |
|
288 | ||
245 |
|
|
289 | To create a new set of default configuration files, with lots of information on available options, use:: | |
246 | options) use: |
|
|||
247 |
|
290 | |||
248 | $ ipython profile create |
|
291 | $ ipython profile create | |
249 |
|
292 | |||
@@ -252,8 +295,8 b' options) use:' | |||||
252 | :ref:`config_overview`, in particular :ref:`Profiles`. |
|
295 | :ref:`config_overview`, in particular :ref:`Profiles`. | |
253 |
|
296 | |||
254 |
|
297 | |||
255 |
Keyboard us |
|
298 | Keyboard shortcuts | |
256 | ------------ |
|
299 | ------------------ | |
257 |
|
300 | |||
258 | All actions in the notebook can be achieved with the mouse, but we have also |
|
301 | All actions in the notebook can be achieved with the mouse, but we have also | |
259 | added keyboard shortcuts for the most common ones, so that productive use of |
|
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