Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM qmcgaw/latexdevcontainer:latest-full

RUN apt update -y && apt install git fontconfig -y
165 changes: 165 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{
"name": "huangfusl-latex-template",
"dockerComposeFile": ["docker-compose.yml"],
"service": "vscode",
"runServices": ["vscode"],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspace",
"postCreateCommand": "",
"customizations": {
"codespaces": {
"extensions": [
// Copilot
"GitHub.copilot",
"GitHub.copilot-chat",
// LaTeX
"james-yu.latex-workshop",
// Git
"eamodio.gitlens",
// Other helpers
"shardulm94.trailing-spaces",
"stkb.rewrap", // rewrap comments after n characters on one line
// Other
"PKief.material-icon-theme",
"Equinusocio.vsc-material-theme"
],
"settings": {
// General settings
"files.eol": "\n",
"[latex]": {
"editor.defaultFormatter": "James-Yu.latex-workshop"
},
"github.copilot.enable": {
"latex": false
},
"editor.wordWrap": "on",
"files.autoSave": "onFocusChange",
"files.autoSaveDelay": 150000,
"workbench.colorTheme": "Material Theme Ocean",
"workbench.iconTheme": "material-icon-theme",
// Latex settings
"latex-workshop.linting.chktex.enabled": true,
"latex-workshop.latex.clean.subfolder.enabled": true,
"latex-workshop.latex.autoClean.run": "onFailed",
"editor.formatOnSave": true,
"files.associations": {
"*.tex": "latex"
},
"latex-workshop.latexindent.path": "latexindent",
"latex-workshop.latexindent.args": [
"-c",
"%DIR%/",
"%TMPFILE%",
"-y=defaultIndent: '%INDENT%'"
],
"latex-workshop.latex.recipes": [
{ "name": "Build", "tools": ["XeTeX"] },
{
"name": "Build (bib)",
"tools": ["XeTeX", "BibTeX", "XeTeX", "XeTeX"]
}
],
"latex-workshop.latex.tools": [
{
"name": "XeTeX",
"command": "xelatex",
"args": [
"-synctex=1",
"-shell-escape",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "BibTeX",
"command": "bibtex",
"args": ["%DOCFILE%"]
}
],
"latex-workshop.linting.run": "onType",
"latex-workshop.view.pdf.viewer": "tab",
"latex-utilities.countWord.args": ["%DOCFILE%"],
"latex-utilities.countWord.format": "${words} Words in Total, ${wordsBody} Words in Body",
"latex-utilities.countWord.path": "texcount"
}
},
"vscode": {
"extensions": [
// Copilot
"GitHub.copilot",
"GitHub.copilot-chat",
// LaTeX
"james-yu.latex-workshop",
// Git
"eamodio.gitlens",
// Other helpers
"shardulm94.trailing-spaces",
"stkb.rewrap", // rewrap comments after n characters on one line
// Other
"PKief.material-icon-theme",
"Equinusocio.vsc-material-theme"
],
"settings": {
// General settings
"files.eol": "\n",
"[latex]": {
"editor.defaultFormatter": "James-Yu.latex-workshop"
},
"github.copilot.enable": {
"latex": false
},
"editor.wordWrap": "on",
"files.autoSave": "onFocusChange",
"files.autoSaveDelay": 150000,
"workbench.colorTheme": "Material Theme Ocean",
"workbench.iconTheme": "material-icon-theme",
// Latex settings
"latex-workshop.linting.chktex.enabled": true,
"latex-workshop.latex.clean.subfolder.enabled": true,
"latex-workshop.latex.autoClean.run": "onFailed",
"editor.formatOnSave": true,
"files.associations": {
"*.tex": "latex"
},
"latex-workshop.latexindent.path": "latexindent",
"latex-workshop.latexindent.args": [
"-c",
"%DIR%/",
"%TMPFILE%",
"-y=defaultIndent: '%INDENT%'"
],
"latex-workshop.latex.recipes": [
{ "name": "Build", "tools": ["XeTeX"] },
{
"name": "Build (bib)",
"tools": ["XeTeX", "BibTeX", "XeTeX", "XeTeX"]
}
],
"latex-workshop.latex.tools": [
{
"name": "XeTeX",
"command": "xelatex",
"args": [
"-synctex=1",
"-shell-escape",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "BibTeX",
"command": "bibtex",
"args": ["%DOCFILE%"]
}
],
"latex-workshop.linting.run": "onType",
"latex-workshop.view.pdf.viewer": "tab",
"latex-utilities.countWord.args": ["%DOCFILE%"],
"latex-utilities.countWord.format": "${words} Words in Total, ${wordsBody} Words in Body",
"latex-utilities.countWord.path": "texcount"
}
}
}
}
21 changes: 21 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "3.2"

services:
vscode:
build: .
image: latexdevcontainer
volumes:
- ../:/workspace
# Docker socket to access Docker server
- /var/run/docker.sock:/var/run/docker.sock
# SSH directory
- ~/.ssh:/root/.ssh
# For Windows without WSL, a copy will be made
# from /tmp/.ssh to ~/.ssh to fix permissions
# - ~/.ssh:/tmp/.ssh:ro
# Shell history persistence
- ~/.zsh_history:/root/.zsh_history:z
environment:
- TZ=
Copy link

Copilot AI Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable 'TZ' is set to an empty value, which might lead to unexpected timezone behavior. Provide a valid timezone or remove the variable if it's not needed.

Suggested change
- TZ=

Copilot uses AI. Check for mistakes.
entrypoint: ["zsh", "-c", "while sleep 1000; do :; done"]

13 changes: 13 additions & 0 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ jobs:
run: |
latexmk -shell-escape -pdf -file-line-error -halt-on-error -interaction=nonstopmode ${{ needs.workflow-setup.outputs.tex }}

- name: Compile Poster
if: ${{ needs.workflow-setup.outputs.runner == 'self-texlive' }}
run: |
latexmk -shell-escape -pdf -file-line-error -halt-on-error -interaction=nonstopmode poster.template.tex

- name: Rename PDF
run: mv ${{ needs.workflow-setup.outputs.prefix }}.pdf ${{ needs.workflow-setup.outputs.pdf }}

Expand All @@ -96,6 +101,7 @@ jobs:
./*.gin
./*.bbl
./${{ needs.workflow-setup.outputs.pdf }}
./poster.template.pdf
./README.adoc
./hooks*
./img*
Expand Down Expand Up @@ -142,6 +148,12 @@ jobs:
run: |
latexmk -shell-escape -pdf -file-line-error -halt-on-error -interaction=nonstopmode ${{ needs.workflow-setup.outputs.tex }}
working-directory: ${{ github.workspace }}/artifact
-
name: Check compilation of poster from artifact
if: ${{ needs.workflow-setup.outputs.runner == 'self-texlive' }}
run: |
latexmk -shell-escape -pdf -file-line-error -halt-on-error -interaction=nonstopmode poster.template.tex
working-directory: ${{ github.workspace }}/artifact

release:
needs: [workflow-setup,build_latex, check]
Expand Down Expand Up @@ -174,4 +186,5 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
artifact/${{ needs.workflow-setup.outputs.prefixwithref }}.pdf
artifact/poster.template.pdf
${{ needs.workflow-setup.outputs.prefixwithref }}.tar.gz
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Linting
uses: j2kun/chktex-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ presentation.template.chl
presentation.template.lof
presentation.template.lot
presentation.template.pdf
poster.template.synctex(busy)
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
"tools": [
"xelatexmk"
]
},
{
"name": "Build",
"tools": [
"XeTeX"
]
},
{
"name": "Build (bib)",
"tools": [
"XeTeX",
"BibTeX",
"XeTeX",
"XeTeX"
]
}
],
"latex-workshop.latex.tools": [
Expand Down Expand Up @@ -41,6 +56,24 @@
"%DOCFILE%"
],
"env": {}
},
{
"name": "XeTeX",
"command": "xelatex",
"args": [
"-synctex=1",
"-shell-escape",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "BibTeX",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15113190.svg)](https://doi.org/10.5281/zenodo.15113190)
[![GitHub Release](https://img.shields.io/github/v/release/numpex/presentation.template)](https://github.com/numpex/presentation.template/releases/latest)


[![Slack](https://img.shields.io/badge/slack-presentation-brightgreen.svg?logo=slack)](https://numpex.slack.com/archives/C08L4KHUTFX)
[![Slack](https://img.shields.io/badge/slack-notifications-blue.svg?logo=slack)](https://numpex.slack.com/archives/C08KRJF3B55)

Just clone the repository, add the path to your TEXINPUTS environment
variable and you are ready to use the theme in your presentation by adding
Expand Down
20 changes: 20 additions & 0 deletions a.cli
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ delete_release() {
echo "Release $VERSION deleted successfully."
}

# Function to compile with latexmk and xelatex
compile() {
DOC=$1
if [ -z "$DOC" ]; then
echo "Usage: $0 build <document.tex>"
exit 1
fi

OUTDIR="build"
mkdir -p "$OUTDIR"

# Compile using latexmk with xelatex and the desired options
# latexmk -synctex=1 -interaction=nonstopmode -file-line-error -xelatex -outdir="$OUTDIR" "$DOC"
latexmk -synctex=1 -interaction=nonstopmode -file-line-error -pdf -outdir="$OUTDIR" "$DOC"
}

# Main script logic
case "$1" in
setup)
Expand All @@ -102,11 +118,15 @@ case "$1" in
delete)
delete_release "$2"
;;
build)
compile "$2"
;;
*)
echo "Usage: $0 {setup|create|list|delete} [version]"
echo " setup : Setup hooks for commit, checkout, and merge"
echo " create : Create a new release with the provided version"
echo " list : List all existing releases"
echo " build : Compile the TeX document using latexmk and xelatex"
echo " delete : Delete the release with the provided version"
echo " version : Optional argument specifying the version for create and delete commands"
exit 1
Expand Down
Loading