Skip to content

Merge pull request #47 from f-aguzzi/pre/beta #40

Merge pull request #47 from f-aguzzi/pre/beta

Merge pull request #47 from f-aguzzi/pre/beta #40

Workflow file for this run

name: Compile thesis to PDF
on:
push:
paths:
- 'thesis/**'
- '.github/workflows/thesis.yml'
jobs:
convert_via_pandoc:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: create file list
id: files_list
run: |
cat thesis/*.md > thesis/all_files.md
- name: Install Pandoc, Mermaid and SVGExport
run: |
sudo apt-get install pandoc
npm install @mermaid-js/mermaid-cli -g
npm install svgexport -g
- name: Run Mermaid on all files
run: npx mmdc -i thesis/all_files.md -o thesis/all_files.md
- name: Convert all SVG files to PNG
run: find thesis -type f -name "*.svg" -exec sh -c 'npx svgexport "$1" "${1%.svg}.png" 1200:800 pad' _ {} \;
- name: Substitute all .svg extensions to .png within the file and reformat
run: |
sed -i -e s/\.svg/\.png/g thesis/all_files.md
sed -i -e '/!\[.*\]\(.*\.png\)/ s/$/{ style="width: 70%; margin: auto;" }/' thesis/all_files.md
- name: Run Pandoc
run: |
cd thesis
pandoc -H disable_float.tex -o tesi_federico_aguzzi.tex all_files.md --variable=linestretch=1.5 -V fontsize=12pt -V lang=it -s
- uses: xu-cheng/latex-action@v3
with:
working_directory: thesis
root_file: tesi_federico_aguzzi.tex
- uses: actions/upload-artifact@v3
with:
name: thesis
path: thesis/tesi_federico_aguzzi.pdf