Skip to content

Commit

Permalink
optimize compilation (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
LogCreative authored Aug 28, 2021
1 parent 19433b0 commit 3c76faf
Show file tree
Hide file tree
Showing 47 changed files with 821 additions and 1,945 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
.gitattributes export-ignore
.gitignore export-ignore

# generated sty file
beamercolorthemesjtubeamer.sty linguist-generated=true
beamerinnerthemesjtubeamer.sty linguist-generated=true
beamerthemesjtubeamer.sty linguist-generated=true
sjtuvi.sty linguist-generated=true
beamerfontthemesjtubeamer.sty linguist-generated=true
beamerouterthemesjtubeamer.sty linguist-generated=true
sjtucover.sty linguist-generated=true

# regression test target file
*.tlg linguist-generated=true
8 changes: 6 additions & 2 deletions .github/ci/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ apk add zip
cd src
l3build ctan
cp -r -f build/distrib/tds/tex/latex/sjtubeamer/* ..
cp doc/cover.pdf ../build/cover.pdf

# turn resource files into symbolic link.
# TODO: a more elegant solution in the future.
Expand All @@ -14,4 +13,9 @@ for resource in ${resources[@]};
do
rm -f $resource
ln -s src/source/$resource $resource
done
done

if [ ! -f src/sjtubeamer-ctan.zip ]; then
echo "BUILD FAILED."
exit 1
fi
4 changes: 3 additions & 1 deletion .github/ci/build_test_variants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set -e
rm -rf build
mkdir -p build

# main builds

sed -e "s|usetheme\[.*\]|usetheme\[maxplus,blue\]|g" main.tex > build/build-blue.tex
sed -e "s|usetheme\[.*\]|usetheme\[max,light,red\]|g" main.tex > build/build-red.tex
sed -e "s|usetheme\[.*\]|usetheme\[min,dark,red\]|g" main.tex > build/build-min.tex

latexmk $@ -outdir=build build/build-*.tex
latexmk $@ -outdir=build build/build-*.tex
22 changes: 18 additions & 4 deletions .github/ci/gen_cover.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#!/bin/bash

sed -e "s|<options>|red,light|g" src/doc/cover.template.tex > src/doc/cover-red-light.tex
sed -e "s|<options>|red,dark|g" src/doc/cover.template.tex > src/doc/cover-red-dark.tex
sed -e "s|<options>|blue,light|g" src/doc/cover.template.tex > src/doc/cover-blue-light.tex
sed -e "s|<options>|blue,dark|g" src/doc/cover.template.tex > src/doc/cover-blue-dark.tex
# covers
sed -e "s|<options>|red,light|g" src/doc/cover.template.tex > build/cover-red-light.tex
sed -e "s|<options>|red,dark|g" src/doc/cover.template.tex > build/cover-red-dark.tex
sed -e "s|<options>|blue,light|g" src/doc/cover.template.tex > build/cover-blue-light.tex
sed -e "s|<options>|blue,dark|g" src/doc/cover.template.tex > build/cover-blue-dark.tex

coverbuilds=(red-light red-dark blue-light blue-dark)
for coverbuild in ${coverbuilds[@]};
do
{
latexmk $@ -outdir=build build/cover-$coverbuild.tex
} &
done
wait

# merge covers
cp -f src/doc/cover.tex build/cover.tex
latexmk $@ -outdir=build build/cover.tex
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
with:
run: |
.github/ci/build_test_variants.sh -halt-on-error -time -quiet -xelatex
.github/ci/gen_cover.sh -halt-on-error -time -quiet -xelatex
name: build with XeLaTeX
- run: cat build/build-*.log
name: display build log
Expand All @@ -40,6 +41,7 @@ jobs:
with:
run: |
.github/ci/build_test_variants.sh -halt-on-error -time -quiet -lualatex
.github/ci/gen_cover.sh -halt-on-error -time -quiet -lualatex
name: build with LuaLaTeX
- run: cat build/build-*.log
name: display build log
Expand All @@ -59,6 +61,7 @@ jobs:
- uses: xu-cheng/texlive-action/full@v1
with:
run: |
export diffexe="diff -U 3"
.github/ci/build_package.sh
name: build package with l3build
- name: check if generated files are of latest version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,4 @@ min.pdf
cover.pdf
sjtubeamer*.pdf
cover-*.pdf
basis-*.tex
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ latex beamerthemesjtubeamer.ins
```
> 手动解包复制。
## 测试版本

您可以通过向该主题添加参数获取不同的样式。
```latex
\usetheme[maxplus]{sjtubeamer}
% 使用 maxplus/max/min 切换标题页样式
% 使用 red/blue 切换主色调
% 使用 light/dark 切换亮/暗色模式
% 使用外样式关键词以获得不同的边栏样式
% miniframes infolines sidebar*
% default smoothbars split
% shadow tree smoothtree
% *siderbar 推荐与 max 一起使用。
```

## 展示 🧐

您可以在 [v1.0.0](https://github.com/sjtug/SJTUBeamer/releases/tag/v1.0.0) 预览生成的四个主题的 pdf。
Expand Down
15 changes: 15 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ latex beamerthemesjtubeamer.ins
```
and copy the corresponding files to the correct directory.

## Test Version

You could get different styles from the following keywords.
```latex
\usetheme[maxplus]{sjtubeamer}
% use maxplus/max/min to change covers.
% use red/blue to change main color.
% use light/dark to change dominate color.
% use the following keywords to make different sidebars:
% miniframes infolines sidebar*
% default smoothbars split
% shadow tree smoothtree
% *siderbar is recommended to be used with max option.
```

## Appearance 🧐

**Blue theme cover page**
Expand Down
6 changes: 3 additions & 3 deletions beamercolorthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions beamerfontthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 58 additions & 27 deletions beamerinnerthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 14 additions & 11 deletions beamerouterthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3c76faf

Please sign in to comment.