-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f3179f
commit 80f273a
Showing
13 changed files
with
386 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: LaTeX Build and Lint | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
# Schedule to run at 00:00 UTC on the 1st of every month | ||
- cron: '0 0 1 * *' | ||
jobs: | ||
build-and-lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install LaTeX | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y texlive-latex-base texlive-fonts-recommended texlive-latex-extra texlive-fonts-extra texlive-latex-recommended texlive-science | ||
- name: Install cpanminus and Perl dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cpanminus | ||
sudo cpanm Log::Log4perl Log::Dispatch::File YAML::Tiny File::HomeDir Unicode::GCString | ||
- name: Install latexindent | ||
run: | | ||
curl -L https://github.com/cmhughes/latexindent.pl/archive/master.zip -o latexindent.zip | ||
unzip latexindent.zip -d latexindent | ||
sudo cp -r latexindent/latexindent.pl-main/* /usr/local/bin/ | ||
sudo chmod +x /usr/local/bin/latexindent.pl | ||
sudo mv /usr/local/bin/latexindent.pl /usr/local/bin/latexindent | ||
- name: Verify latexindent installation | ||
run: | | ||
latexindent --version | ||
- name: Check LaTeX formatting | ||
working-directory: latex | ||
run: make check | ||
|
||
- name: Compile LaTeX documents | ||
working-directory: latex | ||
run: make all | ||
|
||
- name: Upload PDFs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Compiled-PDFs | ||
path: latex/*.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
# Schedule to run at 00:00 UTC on the 1st of every month | ||
- cron: '0 0 1 * *' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Makefile for LaTeX project | ||
|
||
# List of source LaTeX files | ||
SOURCES := $(wildcard *.tex) | ||
PDFS := $(SOURCES:.tex=.pdf) | ||
|
||
# Default target | ||
all: $(PDFS) | ||
|
||
# Rule to compile LaTeX files | ||
%.pdf: %.tex | ||
pdflatex -shell-escape $< | ||
-bibtex $(<:.tex=) 2>/dev/null | ||
pdflatex -shell-escape $< | ||
pdflatex -shell-escape $< | ||
|
||
# Clean up temporary files | ||
clean: | ||
rm -f *.aux *.log *.out *.toc *.bak* *pdf *.bbl *.blg *.synctex.gz | ||
rm -rf *_minted-* | ||
|
||
# Lint .tex files | ||
lint: | ||
for file in $(SOURCES); do latexindent -w -s $$file; done | ||
|
||
# Check if .tex files are properly formatted | ||
check: | ||
@errors=0; \ | ||
for file in $(SOURCES); do \ | ||
latexindent $$file > $$file.formatted; \ | ||
if ! diff -q $$file $$file.formatted > /dev/null; then \ | ||
echo "Formatting issue detected in $$file"; \ | ||
errors=$$((errors + 1)); \ | ||
fi; \ | ||
rm -f $$file.formatted; \ | ||
done; \ | ||
if [ $$errors -ne 0 ]; then \ | ||
echo "Formatting issues found in $$errors files."; \ | ||
exit 1; \ | ||
else \ | ||
echo "All files are properly formatted."; \ | ||
fi | ||
|
||
# Help | ||
help: | ||
@echo "Available commands:" | ||
@echo " make Compile all LaTeX files to PDF" | ||
@echo " make clean Remove temporary files" | ||
@echo " make lint Format .tex files using latexindent" | ||
@echo " make check Check if .tex files are properly formatted" |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.