131 Commits d4bc5dfe2b ... 92a19f0d0c

Author SHA1 Message Date
  Marc Beninca 92a19f0d0c multicol 1 month ago
  Marc Beninca 7e0a5a1d0e prebuild 1 month ago
  Marc Beninca 6644e0f666 en,fr 1 month ago
  Marc Beninca 619fea03b6 todo 1 month ago
  Marc Beninca 95795a03aa cnam 1 month ago
  Marc Beninca 649b722607 keywords 1 month ago
  Marc Beninca e25a082520 summaries,kw 1 month ago
  Marc Beninca 44d445f92d hypersetup 1 month ago
  Marc Beninca 2c110518a5 todo 1 month ago
  Marc Beninca f336012013 thesis/author,title 1 month ago
  Marc Beninca b1ac98dd17 presentation/metadata 1 month ago
  Marc Beninca 1168c66b44 settings 1 month ago
  Marc Beninca 471d2886a2 title,begin 1 month ago
  Marc Beninca c774ae7a3d institute 1 month ago
  Marc Beninca abcbfd11f0 title 1 month ago
  Marc Beninca 3c99cd5618 date,typeshort 1 month ago
  Marc Beninca 29aaa6c721 author 1 month ago
  Marc Beninca 9992a38f8e typelong 1 month ago
  Marc Beninca cb0dcac270 variables 1 month ago
  Marc Beninca 54e783e19c languages 1 month ago
  Marc Beninca 70682c07ed common 1 month ago
  Marc Beninca fc09361790 results 1 month ago
  Marc Beninca e515181140 proposal 1 month ago
  Marc Beninca 1ec5f6dad6 thoughts 1 month ago
  Marc Beninca f1d793cd7a itmz 1 month ago
  Marc Beninca c557e57ca6 work 1 month ago
  Marc Beninca 4f71a6330e titleshort 1 month ago
  Marc Beninca dbfe0bae43 author 1 month ago
  Marc Beninca 4413d3f0cb title,subtitle 1 month ago
  Marc Beninca 2c532d6bfa date,type 1 month ago
  Marc Beninca e792fa42ce paper 1 month ago
  Marc Beninca 4e40ab1335 logo 1 month ago
  Marc Beninca 1118e07683 theme 1 month ago
  Marc Beninca ab39e1adaf institute 1 month ago
  Marc Beninca 9b9538648b clean 1 month ago
  Marc Beninca 06ea615d30 maketitle 1 month ago
  Marc Beninca 4a464c8201 toc 1 month ago
  Marc Beninca 5854ea4265 framenumber 1 month ago
  Marc Beninca bf1ec423ce nonav 1 month ago
  Marc Beninca 708545baaa beamer 1 month ago
  Marc Beninca 80d15f9175 titlesub 1 month ago
  Marc Beninca 49576b1715 glossary 1 month ago
  Marc Beninca 04b2f4cdc2 debian-handbook 1 month ago
  Marc Beninca a0225d32d4 refs 1 month ago
  Marc Beninca e2f97e24b7 bib 1 month ago
  Marc Beninca 2e59c6bb9e bibpage 1 month ago
  Marc Beninca bca00504d8 name 1 month ago
  Marc Beninca 521fc1b16d makeglossaries 1 month ago
  Marc Beninca 4fc40fb8b9 fix 1 month ago
  Marc Beninca 9ab7a6e829 topic→sujet 1 month ago
  Marc Beninca 86b7e4a5e0 mémoire→thesis 1 month ago
  Marc Beninca 3b62292654 csquotes 1 month ago
  Marc Beninca f0fe4dabb3 todo 1 month ago
  Marc Beninca 01405412c3 appendix 1 month ago
  Marc Beninca c0748678d1 toc 1 month ago
  Marc Beninca 606bb1a03a back 1 month ago
  Marc Beninca fa1f5983c9 tables 1 month ago
  Marc Beninca 4f7c382ea3 summaries 1 month ago
  Marc Beninca c7b1ebcf06 contents 1 month ago
  Marc Beninca d13c5c2d68 gloss 1 month ago
  Marc Beninca bda6eb0bfa acronyms 1 month ago
  Marc Beninca 357b76af65 thanks 1 month ago
  Marc Beninca 23127ba92a main 1 month ago
  Marc Beninca 9f26228257 todo 1 month ago
  Marc Beninca af837d2b38 tocbibind,figures,tables 1 month ago
  Marc Beninca 32e3ca2b9c fix 1 month ago
  Marc Beninca 93183a25d2 fixme 1 month ago
  Marc Beninca 5e7b6bd2fe links 1 month ago
  Marc Beninca 096ad8fb75 todo 1 month ago
  Marc Beninca 9baf0bd3ef os 1 month ago
  Marc Beninca 5d055f42b7 printglossary 1 month ago
  Marc Beninca ea491cce59 acronym,toc 1 month ago
  Marc Beninca 27715e5f86 makeglossaries 1 month ago
  Marc Beninca 5b603bd971 glossaries 1 month ago
  Marc Beninca ee50e9e5a5 acronyms,glossary 1 month ago
  Marc Beninca d554dbef29 comments 1 month ago
  Marc Beninca ef80a0c71f pagebreaks 1 month ago
  Marc Beninca 907cef8eae todo 1 month ago
  Marc Beninca 9bb255df81 spacing 1 month ago
  Marc Beninca 069435aa58 master 1 month ago
  Marc Beninca bd03b2b512 intro,outro 1 month ago
  Marc Beninca c9afad4fda toc/chapters 1 month ago
  Marc Beninca a76b91e817 subtitle 1 month ago
  Marc Beninca d3ca68e846 chapters 1 month ago
  Marc Beninca d9826e012b date 1 month ago
  Marc Beninca d1475dde4c todo 1 month ago
  Marc Beninca f52312bf30 toc 1 month ago
  Marc Beninca 725a1bfb6e back 1 month ago
  Marc Beninca 9ec0b9a3eb subtitle 1 month ago
  Marc Beninca dbf633b0ae tt 1 month ago
  Marc Beninca fafcc5d7d6 first,last,org,role 1 month ago
  Marc Beninca c3c7a56891 cnam/thumb 1 month ago
  Marc Beninca d0dfb8125d front,goal 1 month ago
  Marc Beninca 0e740788d3 title 1 month ago
  Marc Beninca 2fee7f2355 baseline,figures,tables,summaries 1 month ago
  Marc Beninca 246f08fd55 figures,tables 1 month ago
  Marc Beninca 1e172b48c4 todo/toc 1 month ago
  Marc Beninca 86f80cef1b thx 1 month ago
  Marc Beninca bcbce8519b 12,todo 1 month ago
  Marc Beninca a9ee356e01 relsize,todo 1 month ago
  Marc Beninca 2978c45c96 index 1 month ago
  Marc Beninca c74443fe38 size,par,var,goal 1 month ago
  Marc Beninca 763bfbac30 volume 1 month ago
  Marc Beninca f7103914c9 summaries 1 month ago
  Marc Beninca 2849d4871e −sync 1 month ago
  Marc Beninca 29ce80345e wip 1 month ago
  Marc Beninca cac102d49c report,back 1 month ago
  Marc Beninca e4677a039c front 1 month ago
  Marc Beninca 32b3034a20 front,back 1 month ago
  Marc Beninca 9d909b4f70 scripts 1 month ago
  Marc Beninca 90d20ced36 geometry 1 month ago
  Marc Beninca 7b4da954ac toc 1 month ago
  Marc Beninca b18ec2ad01 tidy 1 month ago
  Marc Beninca 213de64181 memoir,warn,skeleton 1 month ago
  Marc Beninca b2538d2932 fonts 1 month ago
  Marc Beninca 1538172cae other languages 1 month ago
  Marc Beninca 59574d623b other languages 1 month ago
  Marc Beninca 3fcb777234 simpler 1 month ago
  Marc Beninca 98676f03af bi 1 month ago
  Marc Beninca a864b4e8ae bi,en,fr 1 month ago
  Marc Beninca 724309bfb6 variables 1 month ago
  Marc Beninca 80d2623d70 languages,comments 1 month ago
  Marc Beninca ac1fee4301 signatures 1 month ago
  Marc Beninca 8c9c317019 fr,en 1 month ago
  Marc Beninca 0d3c1e0278 page 1 month ago
  Marc Beninca ed180e0e37 verify 1 month ago
  Marc Beninca e0bfb62203 builds 1 month ago
  Marc Beninca 641fc45fe0 en,fr 1 month ago
  Marc Beninca 0a2f3cae99 document 1 month ago
  Marc Beninca 53169830ec topic→document 1 month ago
  Marc Beninca 4d0c24acee build 1 month ago

+ 1 - 1
build.py

@@ -6,7 +6,7 @@ import subprocess
 
 import sphinx.cmd.build
 
-TRAVAUX = ['mémoire']
+TRAVAUX = ['thesis']
 INPUT = ['cnam']
 OUTPUT = 'out'
 

+ 1 - 1
cnam/travaux/index.rst

@@ -6,6 +6,6 @@ Travaux
 .. toctree::
    :maxdepth: 1
 
-   mémoire/index
+   thesis/index
    probatoire/index
    blanc/index

+ 0 - 82
cnam/travaux/mémoire/build.py

@@ -1,82 +0,0 @@
-#! /usr/bin/python3 -B
-
-import os
-import shutil
-import subprocess
-import sys
-
-DOCUMENTS = [
-    ('topic', 'sujet'),
-    # ('document', 'mémoire'),
-    # ('présentation', 'présentation'),
-]
-TMP = 'tmp'
-
-
-def run(command):
-    subprocess.call(command)
-
-
-def errun(command):
-    return subprocess.check_output(
-        command, stderr=subprocess.STDOUT)
-
-
-def build(sign):
-    for en, fr in DOCUMENTS:
-        command = ['xelatex', '-output-directory', TMP, en]
-        run(command)
-        run(['makeglossaries', '-d', TMP, en])
-        run(['biber',
-            '--input-directory', TMP,
-            '--output-directory', TMP,
-            en,
-        ])
-        run(command)
-        run(command)
-        pdf = f'{fr}.pdf'
-        os.rename(os.path.join(TMP, f'{en}.pdf'),
-            os.path.join(TMP, pdf))
-        if not sign:
-            os.rename(os.path.join(TMP, pdf), pdf)
-        else:
-            run(['gpg',
-                '--armor',
-                '--detach-sign',
-                os.path.join(TMP, pdf),
-            ])
-            signature = f'{pdf}.asc'
-            for f in [pdf, signature]:
-                os.rename(os.path.join(TMP, f), f)
-            lines = errun(['gpg',
-                '--verify', signature, pdf,
-            ]).decode('u8').splitlines()
-            id = lines[2].index('"')
-            lines = [
-                lines[0],
-                lines[1],
-                lines[2][:id] + lines[4][id:]
-                .replace('@', ' @ ')
-                .replace('.', ' ⋅ ')
-            ] + lines[5:]
-            buffer = os.linesep.join(lines).encode('u8')
-            with open(f'{pdf}.vrf', 'bw') as f:
-                f.write(buffer)
-
-
-def clean():
-    shutil.rmtree(TMP, ignore_errors=True)
-
-
-def main():
-    file = os.path.realpath(__file__)
-    directory = os.path.dirname(file)
-    os.chdir(directory)
-    clean()
-    os.makedirs(TMP)
-    build(len(sys.argv) == 1)
-    clean()
-
-
-if __name__ == '__main__':
-    main()

+ 0 - 7
cnam/travaux/mémoire/index.rst

@@ -1,7 +0,0 @@
-Mémoire
-=======
-
-.. toctree::
-   :numbered: 2
-
-   page

+ 0 - 10
cnam/travaux/mémoire/page.rst

@@ -1,10 +0,0 @@
-Sujet
-=====
-
-* :download:`Sujet <sujet.pdf>`
-
-Livrables
-=========
-
-Signatures numériques
-=====================

cnam/travaux/mémoire/.gitignore → cnam/travaux/thesis/.gitignore


+ 146 - 0
cnam/travaux/thesis/build.py

@@ -0,0 +1,146 @@
+#! /usr/bin/python3 -B
+
+import os
+import shutil
+import subprocess
+import sys
+
+MAIN = 'main'
+TMP = 'tmp'
+
+ENGLISH = 'english'
+FRENCH = 'french'
+LANGUAGES = [ENGLISH, FRENCH]
+
+DOCUMENTS = [
+    {ENGLISH: 'thesis', FRENCH: 'mémoire'},
+    {ENGLISH: 'presentation', FRENCH: 'présentation'},
+]
+
+
+def run(command):
+    subprocess.call(command)
+
+
+def errun(command):
+    return subprocess.check_output(
+        command, stderr=subprocess.STDOUT)
+
+
+def build(directory, sign):
+    # temporary directory
+    tmp = os.path.join(directory, TMP)
+    # for each language
+    for language in LANGUAGES:
+        # languages
+        other_languages = [lang for lang in LANGUAGES if lang is not language]
+        languages = [language, *other_languages]
+        other_languages = ','.join(other_languages)
+        summaries = ''.join(
+            [f'\\summary{{{lang}}}' for lang in languages])
+        # display languages
+        for item in ['', language, other_languages, languages, summaries]:
+            print(item)
+        # for each document
+        for document in DOCUMENTS:
+            # display language
+            print()
+            print(document[language])
+            # clean
+            os.chdir(directory)
+            wipe(tmp)
+            os.makedirs(tmp)
+            # move into document directory
+            os.chdir(document[ENGLISH])
+            # prepare variables
+            variables = {
+                'name': MAIN,
+                'mainlanguage': language,
+                'otherlanguages': other_languages,
+                'summaries': summaries,
+            }
+            # transform variables
+            variables = ''.join([f'\\def\\{k}{{{v}}}'
+                                 for k, v in variables.items()])
+            # prepare build command
+            command = ['xelatex',
+                       '-output-directory', tmp,
+                       f'{variables}\\input{{{MAIN}}}',
+                       ]
+            # pre build
+            run(command)
+            # if it's the main document
+            if document[ENGLISH] == 'thesis':
+                # build glossaries
+                run(['makeglossaries',
+                     '-d', tmp,
+                     MAIN,
+                     ])
+                # build references
+                run(['biber',
+                     '--input-directory', tmp,
+                     '--output-directory', tmp,
+                     MAIN,
+                     ])
+                # re build
+                run(command)
+            # final build
+            run(command)
+            # rename the document
+            pdf = f'{document[language]}.pdf'
+            os.rename(os.path.join(tmp, f'{MAIN}.pdf'),
+                      os.path.join(tmp, pdf),
+                      )
+            # if signature is disabled
+            if not sign:
+                # fetch the document from temporary directory
+                os.rename(os.path.join(tmp, pdf),
+                          os.path.join(directory, pdf),
+                          )
+            # if signature is enabled
+            else:
+                # sign the document
+                run(['gpg',
+                     '--armor',
+                     '--detach-sign',
+                     os.path.join(tmp, pdf),
+                     ])
+                signature = f'{pdf}.asc'
+                # fetch the document and signature from temporary directory
+                for f in [pdf, signature]:
+                    os.rename(os.path.join(tmp, f),
+                              os.path.join(directory, f),
+                              )
+                # verify the document signature
+                lines = errun(['gpg', '--verify',
+                               os.path.join(directory, signature),
+                               os.path.join(directory, pdf),
+                               ]).decode('u8').splitlines()
+                id = lines[2].index('"')
+                lines = [
+                    lines[0],
+                    lines[1],
+                    lines[2][:id] + lines[4][id:]
+                    .replace('@', ' @ ')
+                    .replace('.', ' ⋅ ')
+                ] + lines[5:]
+                # write verification file
+                buffer = os.linesep.join(lines).encode('u8')
+                with open(os.path.join(directory, f'{pdf}.vrf'), 'bw') as f:
+                    f.write(buffer)
+    # clean
+    wipe(tmp)
+
+
+def wipe(directory):
+    shutil.rmtree(directory, ignore_errors=True)
+
+
+def main():
+    file = os.path.realpath(__file__)
+    directory = os.path.dirname(file)
+    build(directory, len(sys.argv) == 1)
+
+
+if __name__ == '__main__':
+    main()

+ 37 - 0
cnam/travaux/thesis/index.rst

@@ -0,0 +1,37 @@
+Mémoire
+=======
+
+:download:`Sujet <sujet.pdf>`
+
+=========================================== ===========================================
+Français                                    English
+=========================================== ===========================================
+:download:`Mémoire <mémoire.pdf>`           :download:`Thesis <thesis.pdf>`
+:download:`Présentation <présentation.pdf>` :download:`Presentation <presentation.pdf>`
+=========================================== ===========================================
+
+.. literalinclude:: mémoire.pdf.vrf
+
+=============================================== ===============================================
+Signatures numériques                           Digital signatures
+=============================================== ===============================================
+:download:`Mémoire <mémoire.pdf.asc>`           :download:`Thesis <thesis.pdf.asc>`
+:download:`Présentation <présentation.pdf.asc>` :download:`Presentation <presentation.pdf.asc>`
+=============================================== ===============================================
+
+.. todo::
+
+ * mémoire
+
+   * vérifier les marges
+   * séparer les chapitres
+   * rédiger l’introduction
+   * rédiger la conclusion
+
+ * présentation
+
+   * couleur des barres
+   * page de garde manuelle
+   * plan
+   * marges
+   * page de fin

+ 7 - 0
cnam/travaux/thesis/presentation/main.tex

@@ -0,0 +1,7 @@
+\documentclass[aspectratio=1610]{beamer}
+
+\input{../settings}
+
+\input{toc}
+
+\end{document}

+ 0 - 0
cnam/travaux/thesis/presentation/settings.tex


Some files were not shown because too many files changed in this diff