From a7aa13f437ae25414f642ac1d2a7dd50a3d11140 Mon Sep 17 00:00:00 2001 From: yursds Date: Sat, 28 Feb 2026 23:55:15 +0100 Subject: [PATCH 1/4] fix: update LaTeX compilation commands for consistency and improve documentation --- .devcontainer/devcontainer.json | 2 +- .github/workflows/latex-check.yml | 27 +++++++++++- .vscode/settings.json | 72 ++++++++++++++++++++++++++++--- docs/usage-details.md | 2 +- 4 files changed, 93 insertions(+), 10 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3eeabc3..b8a6f81 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ "dockerComposeFile": "docker-compose.yml", "service": "teamtex", "workspaceFolder": "/workspace", - "updateContentCommand": "latexmk -pdf -outdir=build main.tex", + "updateContentCommand": "mkdir -p build && pdflatex -interaction=nonstopmode -output-directory=build main.tex && bibtex build/main || true && pdflatex -interaction=nonstopmode -output-directory=build main.tex && pdflatex -interaction=nonstopmode -output-directory=build main.tex", "customizations": { "vscode": { "extensions": [ diff --git a/.github/workflows/latex-check.yml b/.github/workflows/latex-check.yml index c02f852..e4d129d 100644 --- a/.github/workflows/latex-check.yml +++ b/.github/workflows/latex-check.yml @@ -15,11 +15,34 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Compile LaTeX document + - name: Compile LaTeX document (Pass 1) uses: xu-cheng/latex-action@v3 with: root_file: main.tex - args: -pdf -file-line-error -halt-on-error -interaction=nonstopmode -outdir=build + compiler: pdflatex + args: -interaction=nonstopmode -file-line-error -halt-on-error -output-directory=build + + - name: Compile Bibliography + uses: xu-cheng/latex-action@v3 + with: + root_file: build/main + compiler: bibtex + args: "" + continue-on-error: true + + - name: Compile LaTeX document (Pass 2) + uses: xu-cheng/latex-action@v3 + with: + root_file: main.tex + compiler: pdflatex + args: -interaction=nonstopmode -file-line-error -halt-on-error -output-directory=build + + - name: Compile LaTeX document (Pass 3) + uses: xu-cheng/latex-action@v3 + with: + root_file: main.tex + compiler: pdflatex + args: -interaction=nonstopmode -file-line-error -halt-on-error -output-directory=build - name: Verify build artifacts run: | diff --git a/.vscode/settings.json b/.vscode/settings.json index 905226b..1ecd688 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,17 +1,77 @@ { "latex-workshop.latex.outDir": "%DIR%/build", "latex-workshop.latex.autoClean.run": "onBuilt", + "latex-workshop.latex.autoBuild.run": "onSave", + "latex-workshop.latex.recipe.default": "lastUsed", "latex-workshop.view.pdf.viewer": "tab", "latex-workshop.latex.magic.args": [ "-output-directory=%DIR%/build", "%DOC%" ], - "files.exclude": { - ".devcontainer": true, - ".github": true, - "docs": true, - "LICENSE": true - }, + // "files.exclude": { + // ".devcontainer": true, + // ".github": true, + // "docs": true, + // "LICENSE": true + // }, + "latex-workshop.latex.recipes": [ + { + "name": "pdflatex", + "tools": [ + "pdflatex" + ] + }, + { + "name": "pdflatex -> bibtex -> pdflatex*2", + "tools": [ + "pdflatex", + "bibtex", + "pdflatex", + "pdflatex" + ] + }, + { + "name": "latexmk", + "tools": [ + "latexmk" + ] + } + ], + "latex-workshop.latex.tools": [ + { + "name": "latexmk", + "command": "latexmk", + "args": [ + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "-pdf", + "-outdir=%OUTDIR%", + "%DOC%" + ], + "env": {} + }, + { + "name": "pdflatex", + "command": "pdflatex", + "args": [ + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "-output-directory=%OUTDIR%", + "%DOC%" + ], + "env": {} + }, + { + "name": "bibtex", + "command": "bibtex", + "args": [ + "%OUTDIR%/%DOCFILE%" + ], + "env": {} + } + ], "editor.formatOnSave": true, "ltex.language": "en-US", "ltex.enabled": false diff --git a/docs/usage-details.md b/docs/usage-details.md index af3e8c4..668f692 100644 --- a/docs/usage-details.md +++ b/docs/usage-details.md @@ -49,7 +49,7 @@ If you rename your main file (e.g., `thesis.tex`): 1. **Automation:** Update `.devcontainer/devcontainer.json` (change `main.tex` in `updateContentCommand`). 2. **VS Code:** If needed, update `.vscode/settings.json`. -3. **Manual:** Run `latexmk -pdf -outdir=build thesis.tex`. +3. **Manual:** Run `mkdir -p build && pdflatex -interaction=nonstopmode -output-directory=build thesis.tex`. ### Missing Folders (.vscode, .devcontainer, .github, docs) From cd182ed0bda2a8d08a265e89e246cc4e83ac8b76 Mon Sep 17 00:00:00 2001 From: yursds Date: Sun, 1 Mar 2026 00:18:11 +0100 Subject: [PATCH 2/4] fix: add .latexmkrc configuration and streamline LaTeX recipes in settings --- .latexmkrc | 3 +++ .vscode/settings.json | 36 +----------------------------------- 2 files changed, 4 insertions(+), 35 deletions(-) create mode 100644 .latexmkrc diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..95c2f38 --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,3 @@ +$pdflatex = 'pdflatex -interaction=nonstopmode -file-line-error -synctex=1 %O %S'; +$force_mode = 1; +$bibtex = 'bibtex %O %B'; diff --git a/.vscode/settings.json b/.vscode/settings.json index 1ecd688..1a866fa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,21 +15,6 @@ // "LICENSE": true // }, "latex-workshop.latex.recipes": [ - { - "name": "pdflatex", - "tools": [ - "pdflatex" - ] - }, - { - "name": "pdflatex -> bibtex -> pdflatex*2", - "tools": [ - "pdflatex", - "bibtex", - "pdflatex", - "pdflatex" - ] - }, { "name": "latexmk", "tools": [ @@ -42,6 +27,7 @@ "name": "latexmk", "command": "latexmk", "args": [ + "-f", "-synctex=1", "-interaction=nonstopmode", "-file-line-error", @@ -50,26 +36,6 @@ "%DOC%" ], "env": {} - }, - { - "name": "pdflatex", - "command": "pdflatex", - "args": [ - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "-output-directory=%OUTDIR%", - "%DOC%" - ], - "env": {} - }, - { - "name": "bibtex", - "command": "bibtex", - "args": [ - "%OUTDIR%/%DOCFILE%" - ], - "env": {} } ], "editor.formatOnSave": true, From d138c76a62e6aafe80c6bfe71f893197d4ea27be Mon Sep 17 00:00:00 2001 From: yursds Date: Sun, 1 Mar 2026 00:31:33 +0100 Subject: [PATCH 3/4] fix: update LaTeX compilation commands in README and enhance SyncTeX navigation details --- .devcontainer/devcontainer.json | 4 ++-- .github/workflows/latex-check.yml | 28 +++------------------------- README.md | 11 +++++++---- docs/usage-details.md | 5 +++++ 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b8a6f81..d62f732 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ "dockerComposeFile": "docker-compose.yml", "service": "teamtex", "workspaceFolder": "/workspace", - "updateContentCommand": "mkdir -p build && pdflatex -interaction=nonstopmode -output-directory=build main.tex && bibtex build/main || true && pdflatex -interaction=nonstopmode -output-directory=build main.tex && pdflatex -interaction=nonstopmode -output-directory=build main.tex", + "updateContentCommand": "mkdir -p build && latexmk -pdf -outdir=build -interaction=nonstopmode main.tex || true", "customizations": { "vscode": { "extensions": [ @@ -21,4 +21,4 @@ } } } -} +} \ No newline at end of file diff --git a/.github/workflows/latex-check.yml b/.github/workflows/latex-check.yml index e4d129d..4df926d 100644 --- a/.github/workflows/latex-check.yml +++ b/.github/workflows/latex-check.yml @@ -15,34 +15,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Compile LaTeX document (Pass 1) + - name: Compile LaTeX document uses: xu-cheng/latex-action@v3 with: root_file: main.tex - compiler: pdflatex - args: -interaction=nonstopmode -file-line-error -halt-on-error -output-directory=build - - - name: Compile Bibliography - uses: xu-cheng/latex-action@v3 - with: - root_file: build/main - compiler: bibtex - args: "" - continue-on-error: true - - - name: Compile LaTeX document (Pass 2) - uses: xu-cheng/latex-action@v3 - with: - root_file: main.tex - compiler: pdflatex - args: -interaction=nonstopmode -file-line-error -halt-on-error -output-directory=build - - - name: Compile LaTeX document (Pass 3) - uses: xu-cheng/latex-action@v3 - with: - root_file: main.tex - compiler: pdflatex - args: -interaction=nonstopmode -file-line-error -halt-on-error -output-directory=build + compiler: latexmk + args: -pdf -file-line-error -halt-on-error -interaction=nonstopmode -outdir=build - name: Verify build artifacts run: | diff --git a/README.md b/README.md index 70878b5..f37804f 100644 --- a/README.md +++ b/README.md @@ -66,14 +66,17 @@ The project is specifically configured to keep the root directory clean by routi ### Option B: Terminal -If you prefer the command line, use `latexmk` directly: +If you prefer the command line, use `pdflatex` and `bibtex`: ```bash -# Compile -latexmk -pdf -outdir=build main.tex +# Fast Compile (no bibliography) +mkdir -p build && pdflatex -interaction=nonstopmode -output-directory=build main.tex + +# Full Compile (with bibliography) +mkdir -p build && pdflatex -interaction=nonstopmode -output-directory=build main.tex && bibtex build/main && pdflatex -interaction=nonstopmode -output-directory=build main.tex && pdflatex -interaction=nonstopmode -output-directory=build main.tex # Clean -latexmk -c -outdir=build main.tex && rm -rf build/ +rm -rf build/ ``` --- diff --git a/docs/usage-details.md b/docs/usage-details.md index 668f692..98aa02a 100644 --- a/docs/usage-details.md +++ b/docs/usage-details.md @@ -18,6 +18,11 @@ Instead of cloning or forking, you can use TeamTex as a blueprint to mint comple - **GitHub Copilot:** Supported out-of-the-box. - **Grammar Options:** Enable LTeX by editing `.devcontainer/devcontainer.json` and uncommenting `valentjn.vscode-ltex`. +- **SyncTeX (Code <-> PDF Navigation)** + The environment is already configured to synchronize the code with the generated PDF: + - **From PDF to Code (Inverse Search):** Hold `Ctrl` (or `Cmd` on Mac) and click on any text in the PDF viewer to jump straight to the source code. + - **From Code to PDF (Forward Search):** Place your cursor in the `main.tex` code and press `Ctrl+Alt+J` to jump to the corresponding paragraph in the PDF. + --- ## Important Note on Docker Image From 9fecbeda9a84ddcef0f028f26bc55e477e9d9d20 Mon Sep 17 00:00:00 2001 From: yursds Date: Sun, 1 Mar 2026 09:18:07 +0100 Subject: [PATCH 4/4] fix: update LaTeX compilation commands and improve source export exclusions --- .vscode/settings.json | 13 +++++++------ README.md | 10 ++++------ export_source.sh | 13 +++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 1a866fa..132f393 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,12 +8,13 @@ "-output-directory=%DIR%/build", "%DOC%" ], - // "files.exclude": { - // ".devcontainer": true, - // ".github": true, - // "docs": true, - // "LICENSE": true - // }, + "files.exclude": { + ".devcontainer": true, + ".github": true, + ".latexmkrc": true, + "docs": true, + "LICENSE": true + }, "latex-workshop.latex.recipes": [ { "name": "latexmk", diff --git a/README.md b/README.md index f37804f..331c8ad 100644 --- a/README.md +++ b/README.md @@ -66,16 +66,14 @@ The project is specifically configured to keep the root directory clean by routi ### Option B: Terminal -If you prefer the command line, use `pdflatex` and `bibtex`: +If you prefer the command line, use `latexmk` directly: ```bash -# Fast Compile (no bibliography) -mkdir -p build && pdflatex -interaction=nonstopmode -output-directory=build main.tex - -# Full Compile (with bibliography) -mkdir -p build && pdflatex -interaction=nonstopmode -output-directory=build main.tex && bibtex build/main && pdflatex -interaction=nonstopmode -output-directory=build main.tex && pdflatex -interaction=nonstopmode -output-directory=build main.tex +# Full Compile (handles bibliography, multiple passes automatically) +latexmk -pdf -outdir=build main.tex # Clean +latexmk -C -outdir=build rm -rf build/ ``` diff --git a/export_source.sh b/export_source.sh index 73c8432..2764b02 100644 --- a/export_source.sh +++ b/export_source.sh @@ -20,15 +20,16 @@ rm -f "$OUTPUT_NAME" # Create the zip with exclusions zip -r "$OUTPUT_NAME" . \ - -x "build/*" \ - -x ".git/*" \ - -x ".vscode/*" \ -x ".devcontainer/*" \ - -x ".github/*" \ + -x ".git/*" \ -x ".gitignore" \ + -x ".github/*" \ + -x ".latexmkrc" \ + -x ".vscode/*" \ + -x "build/*" \ -x "docs/*" \ - -x "README.md" \ + -x "export_source.sh" \ -x "LICENSE" \ - -x "export_source.sh" + -x "README.md" echo "Done! You can now download '$OUTPUT_NAME'."