Skip to content

Small adjustments

Small adjustments #31

Workflow file for this run

name: Build LaTeX document
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN
permissions:
contents: write
pages: write
id-token: write
jobs:
build_latex:
needs: convert_via_pandoc
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
working_directory: tex
root_file: template.tex
- uses: actions/download-artifact@v3
with:
name: docx_version
- run: mv tex/template.pdf dist/template.pdf && mv template.docx dist/template.docx
- name: Upload PDF and docx files
uses: actions/upload-artifact@v3
with:
name: PDF and docx
path: dist/
retention-days: 1
- name: Commit report
run: |
git config --global user.name 'revalew'
git config --global user.email 'revalew@users.noreply.github.com'
git add dist/template.pdf dist/template.docx
git commit -am "[Automated Commit] Added the compiled PDF and docx conversion"
git push
convert_via_pandoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir output
- uses: docker://pandoc/core:2.9
with:
# https://pandoc.org/MANUAL.html
# allows you to break string into multiple lines
# https://github.com/rekka/latex-flatten -> last hope if everything else will fail me
args: >-
pandoc
--data-dir=./tex
-s ./tex/template.tex
--resource-path ./tex
-f latex+raw_tex
-t docx
-o output/template.docx
- uses: actions/upload-artifact@v3
with:
name: docx_version
path: output
retention-days: 1
# convert_via_pandoc:
# args: >-
# -s comutation-manuscript.tex # The s flag stands for standalone and it takes the name of the
# -f latex # FROM LaTeX
# -t docx # TO docx
# -o output/comutation-manuscript.docx # The output file path
# --bibliography reference_files/references.bib # The .bib citation files to use. Each use of the --bibliography flag adds another file that pandoc will use.
# --bibliography reference_files/R_citations.bib
# --bibliography reference_files/additional_citations.bib
# --csl nature-genetics.csl # The Citation Style Language (CSL) file with information on how to create the citations and bibliography. Others can be found at this GitHub repository or downloaded from Zotero.
# https://github.com/citation-style-language/styles
# https://www.zotero.org/styles?q=nature