en,fr
This commit is contained in:
parent
0a2f3cae99
commit
641fc45fe0
3 changed files with 46 additions and 43 deletions
|
@ -5,10 +5,12 @@ import shutil
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
ENGLISH='en'
|
||||
FRENCH='fr'
|
||||
LANGUAGES = [ENGLISH, FRENCH]
|
||||
DOCUMENTS = [
|
||||
# ('topic', 'sujet'),
|
||||
('document', 'mémoire'),
|
||||
# ('presentation', 'présentation'),
|
||||
{ENGLISH: 'thesis', FRENCH: 'mémoire'},
|
||||
# {ENGLISH: 'presentation', FRENCH: 'présentation'},
|
||||
]
|
||||
TMP = 'tmp'
|
||||
|
||||
|
@ -23,20 +25,21 @@ def errun(command):
|
|||
|
||||
|
||||
def build(sign):
|
||||
for en, fr in DOCUMENTS:
|
||||
command = ['xelatex', '-output-directory', TMP, en]
|
||||
if en == 'document':
|
||||
for language in LANGUAGES:
|
||||
for document in DOCUMENTS:
|
||||
command = ['xelatex', '-output-directory', TMP, document[ENGLISH]]
|
||||
if document['en'] == 'thesis':
|
||||
run(command)
|
||||
run(['makeglossaries', '-d', TMP, en])
|
||||
run(['makeglossaries', '-d', TMP, document[ENGLISH]])
|
||||
run(['biber',
|
||||
'--input-directory', TMP,
|
||||
'--output-directory', TMP,
|
||||
en,
|
||||
document['en'],
|
||||
])
|
||||
run(command)
|
||||
run(command)
|
||||
pdf = f'{fr}.pdf'
|
||||
os.rename(os.path.join(TMP, f'{en}.pdf'),
|
||||
pdf = f'{document[FRENCH]}.pdf'
|
||||
os.rename(os.path.join(TMP, f'{document[ENGLISH]}.pdf'),
|
||||
os.path.join(TMP, pdf))
|
||||
if not sign:
|
||||
os.rename(os.path.join(TMP, pdf), pdf)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
\newcommand{\import}[1]{\input{document/#1}}
|
||||
\newcommand{\import}[1]{\input{thesis/#1}}
|
||||
|
||||
\import{settings}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue