@@ -0,0 +1,63 @@
|
||||
name: Build LaTeX PDF
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**/*.tex'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: nuc_runner
|
||||
container:
|
||||
image: texlive/texlive:latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2 # need previous commit to diff against
|
||||
|
||||
- name: Find changed .tex root files
|
||||
id: changed
|
||||
run: |
|
||||
apt-get update -qq && apt-get install -y -qq git > /dev/null
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
# root files = .tex files that contain \documentclass
|
||||
CHANGED=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" -- '*.tex' || true)
|
||||
ROOTS=""
|
||||
for f in $CHANGED; do
|
||||
if [ -f "$f" ] && grep -q '\\documentclass' "$f"; then
|
||||
ROOTS="$ROOTS $f"
|
||||
fi
|
||||
done
|
||||
echo "roots=$ROOTS" >> "$GITHUB_OUTPUT"
|
||||
echo "Root files to build: $ROOTS"
|
||||
|
||||
- name: Compile changed root files
|
||||
if: steps.changed.outputs.roots != ''
|
||||
run: |
|
||||
mkdir -p pdf aux
|
||||
for f in ${{ steps.changed.outputs.roots }}; do
|
||||
echo "== Building $f =="
|
||||
latexmk -pdf -interaction=nonstopmode -halt-on-error \
|
||||
-outdir=pdf -auxdir=aux "$f"
|
||||
done
|
||||
# keep pdf/ containing only pdfs
|
||||
find pdf -type f ! -name '*.pdf' -delete
|
||||
|
||||
- name: Upload built PDFs
|
||||
if: steps.changed.outputs.roots != ''
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pdf-output
|
||||
path: pdf/*.pdf
|
||||
|
||||
- name: Commit PDFs back to repo
|
||||
if: steps.changed.outputs.roots != ''
|
||||
run: |
|
||||
git config user.name "gitea-actions"
|
||||
git config user.email "actions@gitea.local"
|
||||
git remote set-url origin "https://Domipoke:${{ secrets.GITEA_PUSH_TOKEN }}@gitea.egregge.eg/Domipoke/SharedLaTeX.git"
|
||||
git add pdf/*.pdf
|
||||
git diff --cached --quiet || git commit -m "CI: rebuild PDF(s) [skip ci]"
|
||||
git push origin HEAD:${{ github.ref_name }}
|
||||
@@ -0,0 +1,43 @@
|
||||
\PassOptionsToPackage{pdftex}{graphics}
|
||||
\PassOptionsToPackage{pdftex}{color}
|
||||
\PassOptionsToPackage{pdftex}{xcolor}
|
||||
\documentclass{beamer}\usetheme{Metropolis}
|
||||
\renewcommand{\footnotesize}{\scriptsize}
|
||||
\title{Setup LaTeX}
|
||||
\author{Domipoke}
|
||||
\date{\today}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\frame{\titlepage}
|
||||
|
||||
\begin{frame}
|
||||
\frametitle{Outline}
|
||||
\tableofcontents
|
||||
\end{frame}
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
\begin{frame}{LaTeX 1/2}
|
||||
LaTeX è un linguaggio di \textbf{marcatura} (non di programmazione), ovvero un linguaggio che delinea delle regole per la formattazione di testo.\\
|
||||
Generalmente trova la sua applicazione nella scrittura di libri e paper di ricerca. \\
|
||||
LaTeX divenne negli anni successivi un po' "complesso" dato l'evolversi delle interfacce grafiche e soluzioni come word furono all'inizio solo wrap\footnote{Per wrap si fa riferimento a un programma che nasconde la complessità di un qualcosa sotto istruzioni più semplici. Nell'esempio di word è nascosto da un'interfaccia grafica. Il cliccare un pulsante all'atto pratico scrive il testo nel formato "codice LaTeX" corrispondente a quell'azione. Ad oggi word è un linguaggio assestante chiamato docx} di LaTeX o simili.
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}{LaTeX 2/2}
|
||||
LaTeX è abbastanza intuitivo una volta capite le basi del linguaggio ed è anche ricchissimo di funzionalità. \\
|
||||
LaTeX puro permette un insieme molto limitato di azioni e queste forse non giustificano nemmeno la sua "complessità" nell'uso; pertanto useremo anche molte librerie distribuite da CTAN.
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}{Requisiti 1/2}
|
||||
Prima di iniziare ci serve fare delle scelte:\\
|
||||
\begin{table}[htbp]
|
||||
\centering
|
||||
\begin{tabular}{|X|X|X|X}
|
||||
& Overleaf & Overleaf-toolkit & Visual Studio Code \\
|
||||
{LaTeX$\rightarrow$Pdf} & Media & Media & Dipende da pc generalmente veloce
|
||||
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
\end{frame}
|
||||
\end{document}
|
||||
Reference in New Issue
Block a user