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
2 changes: 1 addition & 1 deletion .github/workflows/tex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
git config --system --add safe.directory $(pwd -P)
echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
make gh-actions
make

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
21 changes: 2 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
MAIN_DIR := 讲义
ANSWERS_DIR := 习题参考答案

export GH_ACTIONS_DIR := gh-actions-build
.PHONY: all clean

.PHONY: all gh-actions main ans clean

all: main

gh-actions:
# used by GitHub Actions
# mkdir -p $(GH_ACTIONS_DIR)
# make -C $(MAIN_DIR) gh-cp
# make -C $(ANSWERS_DIR) gh-cp
make -C $(MAIN_DIR)

main:
all:
$(MAKE) -C $(MAIN_DIR)

ans:
$(MAKE) -C $(ANSWERS_DIR)

clean:
# Cleaning...
$(MAKE) -C $(MAIN_DIR) clean
$(MAKE) -C $(ANSWERS_DIR) clean
rm -rf $(GH_ACTIONS_DIR)
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@

## 手动编译

在仓库目录下运行 `make` 编译讲义与习题参考答案,运行 `make main` 或 `make ans` 分别编译,或在对应文件夹下运行 `make`. 编译完成的 PDF 位于对应文件夹下.

也可以使用 Docker 编译:
在仓库目录下运行 `make` 编译讲义与习题参考答案,编译完成的 PDF 位于讲义目录下. 也可以使用 Docker 编译:

```bash
docker run -v "$PWD":/workdir -e TERM=xterm --rm texlive/texlive:TL2023-historic make
docker run -v"$PWD":/app -w/app -eTERM=xterm --rm texlive/texlive:TL2023-historic make
```
29 changes: 0 additions & 29 deletions latexmk.mk

This file was deleted.

24 changes: 21 additions & 3 deletions 讲义/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# FIXME: xindy can't handle UTF-8 filenames
FILENAME := 线性代数荣誉课辅学讲义
CPNAME := LALU

.PHONY: all-new
LATEXMK := latexmk
LATEXMK_FLAGS := -xelatex -shell-escape -interaction=nonstopmode -file-line-error

all-new: all
.PHONY: all clean

all:
# Building $(FILENAME).pdf
ifdef CPNAME
@cp -p $(FILENAME).tex $(CPNAME).tex
$(LATEXMK) $(LATEXMK_FLAGS) $(CPNAME).tex
@rm -f $(CPNAME).tex
-@mv $(CPNAME).pdf $(FILENAME).pdf
else
$(LATEXMK) $(LATEXMK_FLAGS) $(FILENAME).tex
endif
# Building answers.pdf
$(LATEXMK) $(LATEXMK_FLAGS) LALU-answers.tex
Comment thread
45gfg9 marked this conversation as resolved.

include ../latexmk.mk
clean:
rm -f *.aux *.log *.idx *.ind *.ilg *.thm *.toc *.blg *.bbl *.bcf *.out *.fls *.fdb_latexmk *.run.xml *.synctex.gz *.xdv *~ *.lof *.lot
ifdef CPNAME
rm -f $(CPNAME).pdf $(CPNAME).tex
endif
Comment thread
45gfg9 marked this conversation as resolved.