Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 14 additions & 21 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ on:

jobs:
build:
name: Build (${{ matrix.variant }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant: [postdoc, quant]
steps:
- name: Set up Git repository
uses: actions/checkout@v4
Expand All @@ -31,31 +36,19 @@ jobs:
- name: Compile LaTeX Document
uses: xu-cheng/latex-action@v2
with:
root_file: main.tex
root_file: main-${{ matrix.variant }}.tex
- name: move pdf
run: mv ./main.pdf ./github_artifacts/
run: mv ./main-${{ matrix.variant }}.pdf ./github_artifacts/
# The quant CV is the one published at the top-level main.pdf URL,
# so existing links keep working.
- name: alias quant build as main.pdf
if: ${{ matrix.variant == 'quant' }}
run: cp ./github_artifacts/main-quant.pdf ./github_artifacts/main.pdf
- name: Upload pdf as artifact
uses: actions/upload-artifact@v4
with:
name: main.pdf
name: main-${{ matrix.variant }}.pdf
path: ./github_artifacts
# - name: Install ghostscript
# run: sudo apt install ghostscript -y
# - name: Workaround ghostscript vunerability protection
# # A vunerabillty that existed in ghostscript no longer exists. This is to work around the temporary protection
# # that was put in place
# # https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion
# run: sudo sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
# - name: Generate Thumbnail for Page 1
# #uses: jruipinto/ImageMagick-action@v1
# run: convert -density 700 -resize 10% -append -quality 98 -alpha remove rb-cv.pdf[0] ac-cv-thumbnail-p1.jpg
# - name: move Thumbnail for Page 1
# run: mv ac-cv-thumbnail-p1.jpg github_artifacts
# - name: Generate Thumbnail for Page 2
# #uses: jruipinto/ImageMagick-action@v1
# run: convert -density 700 -resize 10% -append -quality 98 -alpha remove rb-cv.pdf[1] ac-cv-thumbnail-p2.jpg
# - name: move Thumbnail for Page 2
# run: mv ac-cv-thumbnail-p2.jpg github_artifacts

deploy:
needs: [build]
Expand Down Expand Up @@ -88,4 +81,4 @@ jobs:
uses: planetoftheweb/copy-to-branches@v1.3
env:
key: main
files: index.html CNAME
files: index.html CNAME
68 changes: 25 additions & 43 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,13 @@ on: [pull_request, workflow_dispatch, push]

jobs:

spelling:
name: Check spelling
build_and_check:
name: Build and check (${{ matrix.variant }})
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Install hunspell
run: sudo apt-get -y install hunspell hunspell-en-gb
- name: Spell Check
shell: bash --noprofile --norc -eo pipefail -o nounset {0}
run: bash cicd/spelling.sh

build_pdf:
name: Create PDF
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, '@@upload@@') }}
strategy:
fail-fast: false
matrix:
variant: [postdoc, quant]
steps:
- name: Set up Git repository
uses: actions/checkout@v4
Expand All @@ -41,53 +32,44 @@ jobs:
- name: Compile LaTeX Document
uses: xu-cheng/latex-action@v3
with:
root_file: main.tex
root_file: main-${{ matrix.variant }}.tex
- name: Install hunspell and poppler
run: sudo apt-get -y install hunspell hunspell-en-gb poppler-utils
# Both checks read the built PDF, so they run here rather than in separate
# jobs that would have to round-trip it through an artifact.
- name: Spell Check
run: cicd/spelling.sh main-${{ matrix.variant }}.pdf
shell: bash --noprofile --norc -eo pipefail -o nounset {0}
- name: Length of Document Check
run: cicd/Length.sh main-${{ matrix.variant }}.pdf
shell: bash --noprofile --norc -eo pipefail -o nounset {0}
- name: Upload Artefact
uses: actions/upload-artifact@v4
with:
name: main.pdf
path: ./main.pdf

two_pages:
name: Is less than three pages
needs: build_pdf
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: main.pdf
path: ./
- name: Install pdfinfo
run: sudo apt-get install poppler-utils
- name: Length of Document Check
run: cicd/Length.sh
shell: bash --noprofile --norc -eo pipefail -o nounset {0}
name: main-${{ matrix.variant }}.pdf
path: ./main-${{ matrix.variant }}.pdf

can_create_thumbnail:
name: Can create thumbnail
if: ${{ contains(github.event.head_commit.message, '@@thumbnail@@') }}
needs: build_pdf
needs: build_and_check
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: main.pdf
name: main-postdoc.pdf
path: ./
- name: install ghostscript
run: sudo apt install ghostscript -y
- name: Workaround ghostscript vunerability protection
# A vunerabillty that existed in ghostscript no longer exists. This is to work around the temporary protection
# that was put in place.
# A vunerabillty that existed in ghostscript no longer exists. This is to work around the temporary protection
# that was put in place.
# https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion
run: sudo sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
- name: Run convert command
- name: Run convert command
run: |
sudo apt-get install convert
convert -density 700 -resize 10% -append -quality 98 -alpha remove main.pdf thesis-thumbnail-p1.jpg

convert -density 700 -resize 10% -append -quality 98 -alpha remove main-postdoc.pdf thesis-thumbnail-p1.jpg
112 changes: 111 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,114 @@
[![PDF deployed](https://github.com/achiefa/CV/actions/workflows/deploy.yaml/badge.svg?branch=main)](https://github.com/achiefa/CV/actions/workflows/deploy.yaml)

# CV
Curriculum vitae at this [link](https://achiefa.github.io/CV/main.pdf).

Several CV variants built from one shared content database.

| Variant | Driver | Published at |
|---|---|---|
| Academic / postdoc | `main-postdoc.tex` | [main.pdf](https://achiefa.github.io/CV/main.pdf) |
| Quant / data science | `main-quant.tex` | [main-quant.pdf](https://achiefa.github.io/CV/main-quant.pdf) |

## Design

```
main-postdoc.tex driver: prose, WHICH entries appear, in WHAT order
main-quant.tex driver
style/
cvkit.sty machinery only: the record store and \use... commands.
Knows nothing about content or about which variants exist.
variant-postdoc.sty the academic LOOK + academic renderers
variant-quant.sty the industry LOOK + compact renderers
content/ the facts. Definitions only; these files print nothing.
```

The content files behave like a small `.bib`: they *define* entries and output
nothing. A driver *cites* the ones it wants.

```latex
% content/publications.tex
\definepub{ntk}
{Quantitative Understanding of PDF Fits and their Uncertainties}
{\me, L. Del Debbio, R. Kenway}
{Published in: \textit{Eur.Phys.J.C 86 (2026) 6, 722}}{2512.24116}
```

```latex
% main-quant.tex -- selection and order live here, not in the content
\cvsection{Selected Publications}
\begin{cvlist}
\item[] \footnotesize Six peer-reviewed publications since 2024. [...] \normalsize
\usepub{ntk}
\usepub{runii}
\end{cvlist}
```

Three consequences worth keeping:

- **Content never mentions a variant.** There are no `\if`-style switches in
`content/`. Adding a fourth CV touches zero content files.
- **Selection is a driver decision.** Showing a different subset of papers is
editing a list of `\usepub` lines, not adding tags or filter rules.
- **Look is a variant decision.** Each `style/variant-*.sty` owns its own
geometry, fonts, headings and renderers, so two CVs can be genuinely
different-looking documents rather than one template with tweaks.

### Registers

The one case where a fact needs different *wording* per audience is handled by
registers, which are tones of voice rather than variant names:

```latex
\definexp{nnpdf}{NNPDF Collaboration}{Developer}{since 11/2023}
\xpdesc{nnpdf}{academic}{Contribute to the maintenance and development of...}
\xpdesc{nnpdf}{industry}{Maintain and extend a production Python/C++ codebase...}
```

The driver asks for the tone it wants: `\usexp{nnpdf}{industry}`. Organisation,
role and dates still exist in exactly one place.

### Available commands

| Define (in `content/`) | Cite (in a driver) |
|---|---|
| `\definepub{key}{title}{authors}{venue}{arxiv}` | `\usepub{key}` |
| `\definexp{key}{org}{role}{dates}` + `\xpdesc{key}{register}{prose}` | `\usexp{key}{register}` |
| `\defineedu{key}{degree}{grade}{dates}{institution}{supervisor}{detail}` | `\useedu{key}` |
| `\definetalk{key}{title}{url}{date}{event}` | `\usetalk{key}` |
| `\defineaward{key}{name}{dates}{desc}` | `\useaward{key}` |
| `\defineskill{key}{label}{body}` | `\useskill{key}` |

Citing a key that does not exist is a hard build error, not a silent omission.

## Adding a variant

1. Copy a driver, e.g. `main-industry.tex`.
2. Copy a `style/variant-*.sty` and give it whatever look you want.
3. Add `industry` to `matrix.variant` in both workflow files.

No content files change.

## Building locally

```bash
latexmk -pdf main-postdoc.tex
latexmk -pdf main-quant.tex
```

## Checking a CV

```bash
cicd/spelling.sh main-quant.pdf # spelling + leftover [TODO: ...] placeholders
cicd/Length.sh main-quant.pdf # fails above two pages
```

Both run in CI on every push and pull request, for both variants.

The spell checker reads the *rendered text* of the PDF rather than the LaTeX
source. That is deliberate: entry keys, command names, lengths and arXiv IDs are
not words, and checking the source meant every one of them had to be whitelisted
in `dict/words` before CI would go green. Checking the PDF means `dict/words`
holds domain vocabulary only, and adding a `\definepub{key}` never touches it.

Placeholders render in red as `[TODO: ...]` and are a hard failure, so a CV with
an unresolved placeholder cannot pass.
20 changes: 15 additions & 5 deletions cicd/Length.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
#!/bin/bash
#
# Check that a CV PDF is at most two pages.
# Usage: cicd/Length.sh [file.pdf] (defaults to main.pdf for backwards compatibility)

set -e

pdfinfo main.pdf
PDF="${1:-main.pdf}"

NumPages=$(pdfinfo main.pdf | grep "^Pages:" | awk '{print $2}')
if [ ! -f "${PDF}" ]; then
echo "No such file: ${PDF}"
exit 1
fi

pdfinfo "${PDF}"

NumPages=$(pdfinfo "${PDF}" | grep "^Pages:" | awk '{print $2}')

echo "Number of pages: ${NumPages}"
echo "Number of pages in ${PDF}: ${NumPages}"

if [ ${NumPages} -gt 2 ]; then
if [ "${NumPages}" -gt 2 ]; then
echo "The document is too long!"
exit 1
else
echo "The document is the correct length."
fi
fi
Loading
Loading