[FIX] doc: latex building

* add latex support for exercise admonition
* latex freezes/crashes on {HEAVY WIDE-HEADED RIGHTWARDS ARROW} so
  replace them by more manual arrows
* add some preamble configuration, may not even be necessary
* generate WS setup code only in HTML output. WS doc in latex still
  isn't great as it displays all 4 languages one after the other,
  ideally they should be tagged or something, so only one language at a
  time is generated in non-HTML outputs
This commit is contained in:
Xavier Morel 2014-11-17 17:40:38 +01:00
parent 86a6619dc8
commit 5ed0739e73
4 changed files with 60 additions and 49 deletions

View File

@ -15,6 +15,9 @@ def setup(app):
app.add_node(exercise, html=(
lambda self, node: self.visit_admonition(node, 'exercise'),
lambda self, node: self.depart_admonition(node)
), latex=(
lambda self, node: self.visit_admonition(node),
lambda self, node: self.depart_admonition(node)
))
from docutils import nodes

View File

@ -24,6 +24,8 @@ Connection and authentication
.. kinda gross because it duplicates existing bits
.. only:: html
.. rst-class:: setupcode hidden
.. code-block:: python

View File

@ -166,6 +166,12 @@ html_sidebars = {
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
latex_elements = {
'papersize': r'a4paper',
'preamble': u'''\\setcounter{tocdepth}{2}
''',
}
# default must be set otherwise ifconfig blows up
todo_include_todos = False

View File

@ -1241,10 +1241,10 @@ Workflows are also used to track processes that evolve over time.
In the session form, add a (read-only) field to
visualize the state, and buttons to change it. The valid transitions are:
* Draft Confirmed
* Confirmed Draft
* Confirmed Done
* Done Draft
* Draft -> Confirmed
* Confirmed -> Draft
* Confirmed -> Done
* Done -> Draft
.. only:: solutions