Skip to content

Commit 9dc82c8

Browse files
committed
On installe TeXLive Vanilla et les paquets LaTeX à partir de latex-template
- On utilise la dernière version de TeXLive Vanilla (sans passer par les dépôts de Debian) - On installe les paquets LaTeX à partir de latex-template - Quelques modifications cosmétiques
1 parent 52fe08a commit 9dc82c8

File tree

6 files changed

+103
-96
lines changed

6 files changed

+103
-96
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ install:
1616

1717
script:
1818
# run kitchen tests (destroy, create, converge, setup, verify and destroy)
19-
- kitchen test
19+
- travis_wait 30 kitchen test

roles/latex/handlers/main.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
- name: run texhash
22
become: true
33
become_user: zds
4-
shell: texhash $HOME/texmf
4+
shell: "{{ texlive_binaries }}/texhash $HOME/texmf"
55

66
- name: refresh font-config cache
77
shell: fc-cache -f
8+
9+
- name: remove texlive installation files
10+
shell: |
11+
rm -rf ./install-tl-*/
12+
rm ./texlive.profile
13+
args:
14+
executable: /bin/bash
15+
chdir: "{{ workdir }}"

roles/latex/tasks/main.yml

+39-19
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,51 @@
1-
- name: install texlive packages
2-
apt:
3-
pkg:
4-
- texlive
5-
- texlive-luatex
6-
- texlive-lang-french
7-
- texlive-latex-extra
8-
- texlive-fonts-extra
9-
- python-pygments
10-
- xzdec
11-
- wget
12-
cache_valid_time: 3600
1+
- name: download latest texlive
2+
become: true
3+
become_user: zds
4+
unarchive:
5+
src: http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
6+
dest: "{{ workdir }}"
7+
remote_src: yes
138
tags:
149
- bootstrap
1510

16-
- include_tasks: packages.yml
11+
- name: copy texlive.profile
12+
become: true
13+
become_user: zds
14+
template:
15+
src: texlive.profile
16+
dest: "{{ workdir }}/texlive.profile"
1717
tags:
1818
- bootstrap
1919

20-
- name: clone the template
21-
git:
22-
repo: "https://github.com/zestedesavoir/latex-template/"
23-
dest: /opt/zds/texmf/tex/generic/latex-template
24-
notify: run texhash
20+
- name: install latest texlive
21+
become: true
22+
become_user: zds
23+
shell: |
24+
if [ -d "{{ texlive_dir }}/bin" ]; then
25+
echo "TeXLive is already installed"
26+
else
27+
./install-tl*/install-tl -v -profile texlive.profile
28+
fi
29+
args:
30+
executable: /bin/bash
31+
chdir: "{{ workdir }}"
32+
notify: remove texlive installation files
33+
tags:
34+
- bootstrap
35+
36+
- include_tasks: packages.yml
2537
tags:
2638
- bootstrap
2739
- upgrade
2840

41+
- name: install fontconfig
42+
apt:
43+
pkg: fontconfig
44+
state: present
45+
cache_valid_time: 3600
46+
tags:
47+
- bootstrap
48+
2949
- name: create font folders
3050
file:
3151
path: /usr/local/share/fonts/{{ item[0].path }}/{{ item[1].slug }}/
@@ -55,6 +75,6 @@
5575
- Regular
5676
- Semibold
5777
- SemiboldIt
78+
notify: refresh font-config cache
5879
tags:
5980
- bootstrap
60-
notify: refresh font-config cache

roles/latex/tasks/packages.yml

+20-39
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,33 @@
1-
- name: create tlmgr usertree
1+
- name: clone latex template
22
become: true
33
become_user: zds
4-
shell: tlmgr init-usertree
5-
args:
6-
creates: $HOME/texmf
7-
tags:
8-
- bootstrap
9-
10-
- name: create ansible state if non-existant
11-
file:
12-
path: /opt/zds/texmf/ansible-state
13-
state: touch
14-
mode: 0666
15-
tags:
16-
- bootstrap
4+
git:
5+
repo: "https://github.com/zestedesavoir/latex-template/"
6+
dest: "{{ template_dir }}"
7+
notify: run texhash
178

18-
- name: check ansible state
19-
slurp: src=/opt/zds/texmf/ansible-state
20-
register: installed_packages
21-
22-
- name: install packages
9+
- name: install latex packages
2310
become: true
2411
become_user: zds
25-
shell: >
26-
# we make sure that tlmgr repository correspond to texlive annual release
27-
texlive_year=$(tlmgr --version) &&
28-
texlive_year=$(echo -n $texlive_year | tail -c 4) &&
29-
tlmgr option repository http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/$texlive_year/tlnet-final &&
30-
# we tell updmap to go user mode, not system mode
31-
updmap-user &&
32-
# we update and install
33-
tlmgr update --list &&
34-
tlmgr install {{ ' '.join(latex_packages) }} &&
35-
echo {{ ' '.join(latex_packages) }} > $HOME/texmf/ansible-state
36-
when: installed_packages.content|b64decode|trim != latex_packages|join(" ")
37-
tags:
38-
- bootstrap
12+
vars:
13+
packages: "{{ template_dir }}/scripts/packages"
14+
shell: |
15+
packages=$(cat {{ packages }})
16+
{{ texlive_binaries }}/tlmgr update --self
17+
{{ texlive_binaries }}/tlmgr install $packages
18+
args:
19+
executable: /bin/bash
3920

4021
- name: create tabu directory
22+
become: true
23+
become_user: zds
4124
file:
42-
path: /opt/zds/texmf/tex/latex/tabu/
25+
path: "{{ texlive_dir }}/texmf-dist/tex/latex/tabu/"
4326
state: directory
44-
tags:
45-
- bootstrap
4627

4728
- name: install tabu package
29+
become: true
30+
become_user: zds
4831
get_url:
4932
url: https://raw.githubusercontent.com/tabu-issues-for-future-maintainer/tabu/master/tabu.sty
50-
dest: /opt/zds/texmf/tex/latex/tabu/tabu.sty
51-
tags:
52-
- bootstrap
33+
dest: "{{ texlive_dir }}/texmf-dist/tex/latex/tabu/tabu.sty"

roles/latex/templates/texlive.profile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Forked from Zeste de Savoir:
2+
# https://github.com/zestedesavoir/zds-site/blob/a16c5fc932b361cbee5c6e61b24167605e24cd8b/scripts/texlive.profile
3+
selected_scheme scheme-small
4+
TEXMFCONFIG $TEXMFSYSCONFIG
5+
TEXDIR {{ texlive_dir }}
6+
TEXMFLOCAL {{ texlive_dir }}/texmf-local
7+
TEXMFSYSCONFIG {{ texlive_dir }}/texmf-config
8+
TEXMFSYSVAR {{ texlive_dir }}/texmf-var
9+
TEXMFHOME $TEXMFLOCAL
10+
TEXMFVAR $TEXMFSYSVAR
11+
binary_x86_64-linux 1
12+
collection-basic 1
13+
collection-latex 1
14+
collection-latexrecommended 1
15+
collection-xetex 1
16+
option_adjustrepo 1
17+
tlpdbopt_autobackup 1
18+
tlpdbopt_backupdir tlpkg/backups
19+
tlpdbopt_desktop_integration
20+
option_doc 1
21+
tlpdbopt_file_assocs
22+
option_fmt 1
23+
option_letter 0
24+
option_path
25+
tlpdbopt_post_code 1
26+
option_src 1
27+
option_sys_bin /usr/local/bin
28+
option_sys_info /usr/local/share/info
29+
option_sys_man /usr/local/share/man
30+
tlpdbopt_w32_multi_user 1
31+
portable 1

roles/latex/vars/main.yml

+3-36
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,6 @@
1-
latex_packages:
2-
- adjustbox
3-
- blindtext
4-
- capt-of
5-
- catoptions
6-
- chemgreek
7-
- cm-super
8-
- collectbox
9-
- ctablestack
10-
- datatool
11-
- environ
12-
- etoolbox
13-
- fontspec
14-
- framed
15-
- fvextra
16-
- geometry
17-
- ifmtarg
18-
- ifplatform
19-
- luacode
20-
- menukeys
21-
- mfirstuc
22-
- mhchem
23-
- minted
24-
- multirow
25-
- ntheorem
26-
- pagecolor
27-
- relsize
28-
- substr
29-
- tcolorbox
30-
- tracklang
31-
- trimspaces
32-
- varwidth
33-
- xfor
34-
- xifthen
35-
- xpatch
36-
- xstring
1+
texlive_dir: "{{ workdir }}/texlive"
2+
texlive_binaries: "{{ texlive_dir }}/bin/x86_64-linux"
3+
template_dir: "{{ texlive_dir }}/texmf-dist/tex/generic/latex-template"
374

385
fonttypes:
396
- ext: otf

0 commit comments

Comments
 (0)