|
1 | | -- name: Extract Metadata and Build LaTeX Title |
| 1 | +name: Build Professional Preprint |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + |
| 7 | +env: |
| 8 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-paper: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + name: Build Preprint PDF |
| 14 | + steps: |
| 15 | + - name: Checkout repository |
| 16 | + uses: actions/checkout@v6 |
| 17 | + |
| 18 | + - name: Install apt packages |
| 19 | + run: | |
| 20 | + sudo apt-get update |
| 21 | + sudo apt-get install -y pandoc texlive texlive-latex-extra texlive-fonts-recommended texlive-xetex texlive-fonts-extra zip python3-yaml |
| 22 | +
|
| 23 | + - name: Extract Metadata and Build LaTeX Title |
2 | 24 | run: | |
3 | 25 | python3 - << 'PYEOF' |
4 | 26 | import yaml |
|
13 | 35 | affiliations = fm.get('affiliations', []) |
14 | 36 | aff_map = {str(a['index']): a for a in affiliations} |
15 | 37 |
|
16 | | - # ── Pandoc Metadata ───────────────────────────────────────────────── |
| 38 | + # 1. Generate Pandoc Metadata |
17 | 39 | meta = { |
18 | 40 | 'title': fm.get('title', ''), |
19 | 41 | 'date': str(fm.get('date', '')), |
|
26 | 48 | with open('/tmp/pandoc_meta.yaml', 'w') as f: |
27 | 49 | yaml.dump(meta, f) |
28 | 50 |
|
29 | | - # ── Title Block Construction ──────────────────────────────────────── |
| 51 | + # 2. Build LaTeX Title Block |
30 | 52 | lines = [r'\begin{center}'] |
31 | 53 | lines.append(r'{\LARGE\bfseries ' + fm.get('title','') + r'}\\[1.2em]') |
32 | 54 |
|
|
42 | 64 |
|
43 | 65 | for idx, aff in aff_map.items(): |
44 | 66 | ror_id = aff.get('ror', '') |
| 67 | + # Link ROR IDs for professional institutional verification |
45 | 68 | ror_link = rf" \small (ROR: \href{{https://ror.org/{ror_id}}}{{{ror_id}}})" if ror_id else "" |
46 | 69 | lines.append(rf'$^{{{idx}}}$\small {aff["name"]}{ror_link}\\[0.2em]') |
47 | 70 |
|
48 | 71 | corres = [a['email'] for a in authors if a.get('corresponding') and a.get('email')] |
49 | 72 | if corres: |
50 | 73 | lines.append(rf'\small $^*$Corresponding author: \href{{mailto:{corres[0]}}}{{{corres[0]}}}\\[0.2em]') |
51 | 74 | |
| 75 | + # Explicit Zenodo DOI for the PICA suite |
52 | 76 | lines.append(r'\small DOI: \href{https://doi.org/10.5281/zenodo.18377216}{10.5281/zenodo.18377216}\\[0.2em]') |
53 | 77 | lines.append(r'\small ' + str(fm.get('date',''))) |
54 | 78 | lines.append(r'\end{center}') |
|
58 | 82 | f.write('\n'.join(lines)) |
59 | 83 | PYEOF |
60 | 84 |
|
61 | | - - name: Create Header |
| 85 | + - name: Create Professional Header |
62 | 86 | run: | |
63 | 87 | cat > /tmp/header.tex << 'EOF' |
64 | 88 | \usepackage{xurl} |
|
71 | 95 | \pagestyle{fancy} |
72 | 96 | \fancyhf{} |
73 | 97 | |
74 | | - % ── Clear Preprint Identification ─────────────────────────────────── |
| 98 | + % Clear identification as a preprint while maintaining professional style |
75 | 99 | \fancyhead[L]{\small \textbf{\textcolor{gray}{PREPRINT -- NOT PEER REVIEWED}}} |
76 | 100 | \fancyhead[R]{\small \textit{PICA: Advanced Transport Automation}} |
77 | 101 | \fancyfoot[C]{\thepage} |
78 | 102 | \renewcommand{\headrulewidth}{0.4pt} |
79 | 103 | |
80 | | - % ── Internal Reference Logic ──────────────────────────────────────── |
81 | 104 | \renewcommand{\maketitle}{} |
82 | 105 | \hypersetup{ |
83 | 106 | breaklinks=true, |
84 | 107 | pdfauthor={Deshmukh and Mukherjee}, |
85 | 108 | pdftitle={PICA: High-Precision Automation} |
86 | 109 | } |
87 | 110 | EOF |
| 111 | +
|
| 112 | + - name: Generate Publication-Ready PDF |
| 113 | + run: | |
| 114 | + cd paper |
| 115 | + pandoc paper.md -o paper.pdf \ |
| 116 | + --standalone \ |
| 117 | + --citeproc \ |
| 118 | + --pdf-engine=xelatex \ |
| 119 | + --metadata-file=/tmp/pandoc_meta.yaml \ |
| 120 | + --include-in-header=/tmp/header.tex \ |
| 121 | + --include-before-body=/tmp/title_block.tex \ |
| 122 | + --variable=link-citations=true |
| 123 | +
|
| 124 | + - name: Upload Artifact |
| 125 | + uses: actions/upload-artifact@v4 |
| 126 | + with: |
| 127 | + name: professional-preprint |
| 128 | + path: paper/paper.pdf |
0 commit comments