From 79bbb45205921e6a8b29c6cc26c4d8efd1aa3cc0 Mon Sep 17 00:00:00 2001 From: Julian Gethmann Date: Tue, 31 Jan 2017 18:48:33 +0100 Subject: [PATCH] Add LaTeX role --- group_vars/latex.yml | 25 ++++++ roles/latex/handlers/main.yml | 6 ++ roles/latex/tasks/KITLaTeX.yml | 154 +++++++++++++++++++++++++++++++++ roles/latex/tasks/dpg.yml | 4 +- roles/latex/tasks/main.yml | 8 +- roles/latex/tasks/neo2.yml | 4 +- 6 files changed, 193 insertions(+), 8 deletions(-) create mode 100644 roles/latex/tasks/KITLaTeX.yml diff --git a/group_vars/latex.yml b/group_vars/latex.yml index afe1108..dff2cf0 100644 --- a/group_vars/latex.yml +++ b/group_vars/latex.yml @@ -1,3 +1,26 @@ +texpath: /usr/share/texlive/texmf-local + +kit_tikz: + - texlive-tikzpfeile + - texlive-tikz-feynman + - texlive-tikzmark + - texlive-tikzscale + - texlive-circuitikz + - texlive-tikzsymbols + - texlive-tikzinclude + - texlive-tikzposter + - texlive-tikz-palattice + - texlive-aobs-tikz + - texlive-tikz-3dplot + - texlive-tikz-timing + - texlive-hf-tikz + - texlive-tikzscale + - texlive-tikz-dependency + - texlive-pgfgantt + - texlive-venndiagram + - texlive-flowchart + - texlive-mycv + - texlive-pgf-spectra texlivepackages: - texlive.x86_64 - kile @@ -10,6 +33,8 @@ texlivepackages: - texlive-units - texlive-mnsymbol - texlive-pgfgantt + - texlive-pgf-umlcd + - texlive-pgf-umlsd - texlive-prettyref - texlive-faktor - texlive-overpic diff --git a/roles/latex/handlers/main.yml b/roles/latex/handlers/main.yml index 62b61e6..897d8f0 100644 --- a/roles/latex/handlers/main.yml +++ b/roles/latex/handlers/main.yml @@ -5,6 +5,12 @@ PATH: "{{ lookup('env', 'PATH') }}" command: mktexlsr +- name: update latex local + become: yes + environment: + PATH: "{{ lookup('env', 'PATH') }}" + command: mktexlsr "{{ texpath }}" + #- name: update latex # become: yes # command: shell mktexlsr /usr/local/texlive/texmf-local/ diff --git a/roles/latex/tasks/KITLaTeX.yml b/roles/latex/tasks/KITLaTeX.yml new file mode 100644 index 0000000..823e8b3 --- /dev/null +++ b/roles/latex/tasks/KITLaTeX.yml @@ -0,0 +1,154 @@ +--- +- name: rooting + action: shell passwd -u root + become: yes + +- name: install dependencies + dnf: name="{{item}}" state=latest + become: yes + with_items: + - texlive-a0poster + - texlive-beamer + - texlive-bophook + - texlive-boxedminipage + - texlive-dinbrief + - texlive-hyperref + - texlive-lettrine + - texlive-mathpazo + - texlive-rcs + # - texlive-refcount + - texlive-sciposter + - texlive-shadow + - texlive-pgf + - texlive-xcolor + - "{{ kit_tikz }}" + + +# ansible 2.0 +#- download current zip files +# unarchive: src="{{item}}" dest=~/ansible/roles/latex/files/ copy=no +# delegate_to: 127.0.0.1 +# with_items: +# - "https://intranet.kit.edu/downloads/KIT-Vorlagen-Folien.zip" +# - "https://intranet.kit.edu/downloads/KIT-Vorlagen-Poster.zip" + + # - name: Unzip KIT-Classes + # become: yes + # #shell: ls /tmp > /tmp/list + # unarchive: src={{ item }}.zip dest=/usr/share/texlive/texmf-local/ + # with_items: + # - KITbase + # - KITbeamer + # - KITbrief + # - KITposter + # notify: update latex + # tags: kit + +- name: clone git repo + git: repo=https://git.scc.kit.edu/gethmann/KITlatex.git dest={{ texpath }}/KIT clone=yes key_file={{ lookup('file', '/home/gethmann/.ssh/id_rsa.pub') }} + become: yes + +- name: copy files + copy: src={{ texpath }}/KIT/ dest={{ texpath }} + become: yes + notify: + - update latex + + # - name: cleanup + # file: state=absent dest=/tmp/{{item}} + # with_items: + # - Install-En.pdf + # - Install-De.pdf + # - Install-En.txt + # - Install-De.txt + # - KITbase.zip + # - KITbeamerXmpl.zip + # - KITbeamer.zip + # - KIT_Briefvorlagen_LaTeX.zip + # - KITbriefXmpl.zip + # - KITbrief.zip + # - KITmanualD.pdf + # - KITmanualE.pdf + # - KITposterXmpl.zip + # - KITposter.zip + # - KIT-Vorlagen-Folien-LaTeX_06-12.zip + # - KIT-Vorlagen-Poster-LaTeX_06-12.zip + # - KIT-Vorlagen-Folien.zip + # - KIT-Vorlagen-Poster.zip + # tags: + # - latex + # - kit + +- name: hack Helvetica into KIT styles due to broken font installation + lineinfile: line="\\RequirePackage{helvet}" regexp="\\RequirePackage{uarial}" dest={{ texpath }}/tex/latex/KIT/{{item}} backup=yes + become: yes + with_items: + - beamerthemeKIT.sty + - KITbrief.cls + - KITfax.cls + - KITposter.cls + tags: + - latex + - kit + + # TODO + # - name: download uarial + # unarchive: src="ftp://ftp.dante.de/tex-archive/fonts/urw/arial.zip" dest={{ texpath }}/KIT/arial creates={{ texpath }}/KIT/arial + # become: yes + # + # - name: create missing directories + # file: state=directory path={{ texpath }}/{{ item }} + # with_items: + # - fonts/afm/urw + # - fonts/tfm/urw + # - fonts/type1/urw + # - fonts/vf/urw + # - fonts/map/dvips/ua1 + # - fonts/map/vtex + # - dvips/config + # - doc/fonts + # become: yes + # notify: + # - update latex local + # - update fonts + # - update latex + # + # - name: move afm, tfm, type1, vf dirs + # copy: src={{ item }} dest={{ texpath }}/fonts/{{ item }}/arial + # with_items: + # - afm + # - tfm + # - type1 + # - vf + # become: yes + # notify: + # - update latex local + # - update fonts + # - update latex + # + # - name: copy latex dir + # copy: src=latex dest={{ texpath }}/tex/latex/ua1 + # become: yes + # notify: + # - update latex local + # - update fonts + # - update latex + # + # - name: copy map dir + # copy: src={{ item.from }} dest={{ texpath }}/{{ item.to }} + # with_items: + # - {from: "map/ua1.map", to: "dvips/config"} + # - {from: "map/ua1.map", to: "fonts/map/dvips/ua1"} + # - {from: "map/ua1.ali", to: "fonts/map/vtex"} + # become: yes + # notify: + # - update latex local + # - update fonts + # - update latex + # + # - name: copy docu 1/2 + # copy: src={{ item }} dest={{ texpath }}/doc/fonts/urw + # with_items: + # - doc + # - README + # become: yes diff --git a/roles/latex/tasks/dpg.yml b/roles/latex/tasks/dpg.yml index 9a78f04..0e0c867 100644 --- a/roles/latex/tasks/dpg.yml +++ b/roles/latex/tasks/dpg.yml @@ -1,12 +1,12 @@ --- - name: Install DPG-Tagungen document class become: yes - copy: src=scdpg.cls dest=/usr/local/texlive/texmf-local/tex/latex/ + copy: src=scdpg.cls dest={{ texpath }}/tex/latex/ notify: hash latex tags: latex - name: Install JACoW-Tagungen document class become: yes - copy: src=jacow.cls dest=/usr/share/texlive/texmf-local/tex/latex/ + copy: src=jacow.cls dest={{ texpath }}/tex/latex/ notify: hash latex tags: latex diff --git a/roles/latex/tasks/main.yml b/roles/latex/tasks/main.yml index 351408f..04dfc43 100644 --- a/roles/latex/tasks/main.yml +++ b/roles/latex/tasks/main.yml @@ -1,10 +1,10 @@ --- - include: LateX.yml tags: install - - include: LaTeXfonts.yml - tags: fonts - #- include: KITLaTeX.yml - # tags: kit + #- include: LaTeXfonts.yml + #tags: fonts + - include: KITLaTeX.yml + tags: kit - include: AxelsBST.yml - include: dpg.yml - include: neo2.yml diff --git a/roles/latex/tasks/neo2.yml b/roles/latex/tasks/neo2.yml index 4863e5b..9f907bb 100644 --- a/roles/latex/tasks/neo2.yml +++ b/roles/latex/tasks/neo2.yml @@ -36,7 +36,7 @@ become: yes copy: src: /tmp/uniinput.sty - dest: "/usr/share/texlive/texmf-local/tex/latex/uniinput/" + dest: "{{ texpath }}/tex/latex/uniinput/" remote_src: yes notify: update latex @@ -44,6 +44,6 @@ become: yes copy: src: /tmp/uniinput.pdf - dest: "/usr/share/texlive/texmf-local/doc/latex/uniinput/" + dest: "{{ texpath }}/doc/latex/uniinput/" remote_src: yes notify: update latex -- GitLab