Commit 6b974123 authored by vincentvigon's avatar vincentvigon
Browse files

3 premier chap de 'alea'

parent a005fb67
Pipeline #2564 failed with stage
in 2 minutes and 59 seconds
......@@ -11779,11 +11779,11 @@ div#notebook {
<h3 id="Master-2-DUAS-Unistra,--2017-2018">Master 2 DUAS Unistra, 2017-2018<a class="anchor-link" href="#Master-2-DUAS-Unistra,--2017-2018">&#182;</a></h3><hr>
<h1 id="Programmer-en-Python">Programmer en Python<a class="anchor-link" href="#Programmer-en-Python">&#182;</a></h1><hr>
<h2 id="Contenu">Contenu<a class="anchor-link" href="#Contenu">&#182;</a></h2><ul>
<li><strong>Le langage (1)</strong> - <a href="02-histogramme_densite.html">html</a> - <a href="02-histogramme_densite.slides.html">diaporama</a></li>
<li><strong>Les généralités</strong> - <a href="04-plusDeLois.html">html</a> - <a href="04-plusDeLois.slides.html">diaporama</a></li>
<li><strong>histogramme</strong> - <a href="02-histogramme_densite.html">html</a> - <a href="02-histogramme_densite.slides.html">diaporama</a></li>
<li><strong>plus de loi</strong> - <a href="04-plusDeLois.html">html</a> - <a href="04-plusDeLois.slides.html">diaporama</a></li>
</ul>
<p><strong>Exécuter en ligne</strong>
<a href="https://mybinder.org/v2/gh/boileaum/cours-python/master"><img style="display: inline" src="https://mybinder.org/badge.svg"></a></p>
<p><strong>Exécuter en ligne</strong></p>
<p><a href="https://mybinder.org/v2/gh/vincentvigon/aleaDataSignal.git/master"><img style="display: inline" src="https://mybinder.org/badge.svg"></a></p>
<p><strong>Télécharger le</strong> <a href="cours-python.pdf"><strong>pdf</strong></a></p>
<p><strong>Sources sur </strong><a href="https://gitlab.math.unistra.fr/mm2act/cours-python"><strong>GitLab</strong></a></p>
<hr>
......
This diff is collapsed.
This diff is collapsed.
"""
Convert notebooks listed in `chapters` into latex and then a PDF.
Note:
- The notebooks are first copied into the build_pdf directory (with a chapter
number prepended).
"""
import re
import subprocess
import os
chapters = ['02-histogramme_densite',
'04-plusDeLois']
# To test a subset, adjust the list of chapters and
# remove the build_pdf directory before running this script.
build_dir = 'build_pdf/'
if not os.path.exists(build_dir):
os.makedirs(build_dir)
# os.system('cp -r exact_solvers '+build_dir)
# os.system('cp -r utils '+build_dir)
# os.system('cp *.html '+build_dir)
# os.system('cp -r figures '+build_dir)
# os.system('cp riemann.tplx '+build_dir)
# os.system('cp *.cls '+build_dir)
# os.system('cp *.css '+build_dir)
# os.system('cp riemann.bib '+build_dir)
# os.system('cp latexdefs.tex '+build_dir)
os.system('cp -r img '+build_dir)
#os.system('cp *.ipynb '+build_dir)
for i, chapter in enumerate(chapters):
filename = chapter + '.ipynb'
output_filename=filename
print(output_filename)
# with open(filename, "r") as source:
# lines = source.readlines()
#output_filename = str(i).zfill(2)+'-'+filename
# with open(build_dir+output_filename, "w") as output:
# for line in lines:
# for j, chapter_name in enumerate(chapters):
# # fix cross references to other chapters
# line = re.sub(chapter_name+'.ipynb',
# str(j).zfill(2)+'-'+chapter_name+'.ipynb', line)
# line = re.sub(r"context = 'notebook'", "context = 'pdf'", line)
# # The next part is deprecated
# line = re.sub(r'from ipywidgets import interact',
# 'from utils.snapshot_widgets import interact', line)
# line = re.sub(r'Widget Javascript not detected. It may not be installed or enabled properly.',
# '', line)
# #line = re.sub(r"#sns.set_context('paper')",
# # r"sns.set_context('paper')", line)
# output.write(line)
args = ["jupyter", "nbconvert", "--to", "notebook", "--execute",
"--ExecutePreprocessor.kernel_name=python3",
"--output", output_filename,
"--ExecutePreprocessor.timeout=60", build_dir+output_filename]
subprocess.check_call(args)
#
# os.chdir(build_dir)
# os.system('python3 -m bookbook.latex --output-file riemann --template riemann.tplx')
# os.system('pdflatex riemann')
# os.system('bibtex riemann')
# os.system('pdflatex riemann')
# os.system('pdflatex riemann')
# os.system('cp riemann.pdf ..')
# os.chdir('..')
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment