diff --git a/.gitattributes b/.gitattributes index 94a079e9..058e3e66 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,6 +14,7 @@ .gitattributes export-ignore .gitignore export-ignore +# generated sty file beamercolorthemesjtubeamer.sty linguist-generated=true beamerinnerthemesjtubeamer.sty linguist-generated=true beamerthemesjtubeamer.sty linguist-generated=true @@ -21,3 +22,6 @@ 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 \ No newline at end of file diff --git a/.github/ci/build_package.sh b/.github/ci/build_package.sh index 3f47e1d9..7fb9f5d5 100755 --- a/.github/ci/build_package.sh +++ b/.github/ci/build_package.sh @@ -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. @@ -14,4 +13,9 @@ for resource in ${resources[@]}; do rm -f $resource ln -s src/source/$resource $resource -done \ No newline at end of file +done + +if [ ! -f src/sjtubeamer-ctan.zip ]; then + echo "BUILD FAILED." + exit 1 +fi \ No newline at end of file diff --git a/.github/ci/build_test_variants.sh b/.github/ci/build_test_variants.sh index 33413c46..95256e2b 100755 --- a/.github/ci/build_test_variants.sh +++ b/.github/ci/build_test_variants.sh @@ -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 \ No newline at end of file diff --git a/.github/ci/gen_cover.sh b/.github/ci/gen_cover.sh index 3d5968ca..9a2614ba 100755 --- a/.github/ci/gen_cover.sh +++ b/.github/ci/gen_cover.sh @@ -1,6 +1,20 @@ #!/bin/bash -sed -e "s||red,light|g" src/doc/cover.template.tex > src/doc/cover-red-light.tex -sed -e "s||red,dark|g" src/doc/cover.template.tex > src/doc/cover-red-dark.tex -sed -e "s||blue,light|g" src/doc/cover.template.tex > src/doc/cover-blue-light.tex -sed -e "s||blue,dark|g" src/doc/cover.template.tex > src/doc/cover-blue-dark.tex +# covers +sed -e "s||red,light|g" src/doc/cover.template.tex > build/cover-red-light.tex +sed -e "s||red,dark|g" src/doc/cover.template.tex > build/cover-red-dark.tex +sed -e "s||blue,light|g" src/doc/cover.template.tex > build/cover-blue-light.tex +sed -e "s||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 \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e516238..0bc2fc01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index 3176091d..885f6729 100644 --- a/.gitignore +++ b/.gitignore @@ -268,3 +268,4 @@ min.pdf cover.pdf sjtubeamer*.pdf cover-*.pdf +basis-*.tex \ No newline at end of file diff --git a/README.md b/README.md index b3032286..6f0e05bf 100644 --- a/README.md +++ b/README.md @@ -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。 diff --git a/README_en.md b/README_en.md index 79d1e4e6..41fe7056 100644 --- a/README_en.md +++ b/README_en.md @@ -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** diff --git a/beamercolorthemesjtubeamer.sty b/beamercolorthemesjtubeamer.sty index 0453e917..5df35e3c 100644 --- a/beamercolorthemesjtubeamer.sty +++ b/beamercolorthemesjtubeamer.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% beamercolorthemesjtubeamer.dtx (with options: `package') -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ %% Copyright (C) 2021 SJTUG %% %% Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +19,9 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamercolorthemesjtubeamer}[2021/08/26 sjtubeamer color theme v1.4.7] +\ProvidesPackage{beamercolorthemesjtubeamer}[2021/08/28 sjtubeamer color theme v1.5.0] \RequirePackage{sjtuvi} \DefineOption{color}{color}{red} \DefineOption{color}{color}{blue} diff --git a/beamerfontthemesjtubeamer.sty b/beamerfontthemesjtubeamer.sty index 54122d59..c13a6730 100644 --- a/beamerfontthemesjtubeamer.sty +++ b/beamerfontthemesjtubeamer.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% beamerfontthemesjtubeamer.dtx (with options: `package') -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ %% Copyright (C) 2021 SJTUG %% %% Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,22 +19,11 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerfontthemesjtubeamer}[2021/08/26 sjtubeamer font theme v1.4.7] +\ProvidesPackage{beamerfontthemesjtubeamer}[2021/08/28 sjtubeamer font theme v1.5.0] \RequirePackage{silence} \WarningFilter{latexfont}{Font shape} -\def\Hy@WarnOptionDisabled#1{ - \def\next{#1}% - \ifx\next pdfauthor % - \ifx\next driverfallback % - \else - \Hy@Warning{% - Option `#1' has already been used,\MessageBreak - setting the option has no effect% - }\fi% - \fi% -} \usefonttheme{professionalfonts} \usefonttheme{structurebold} \setbeamerfont{part name}{size=\normalsize} diff --git a/beamerinnerthemesjtubeamer.sty b/beamerinnerthemesjtubeamer.sty index 893bbbc9..f13cdc91 100644 --- a/beamerinnerthemesjtubeamer.sty +++ b/beamerinnerthemesjtubeamer.sty @@ -4,8 +4,8 @@ %% %% The original source files were: %% -%% beamerinnerthemesjtubeamer.dtx (with options: `package') -%% ------------------------------------------------------------------- +%% beamerinnerthemesjtubeamer.dtx (with options: `package,maxplus,max,min,my') +%% ------------------------------------------------------------------------ %% Copyright (C) 2021 SJTUG %% %% Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,22 +19,25 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerinnerthemesjtubeamer}[2021/08/26 sjtubeamer inner theme v1.4.7] +\ProvidesPackage{beamerinnerthemesjtubeamer}[2021/08/28 sjtubeamer inner theme v1.5.0] \RequirePackage{sjtuvi} \RequirePackage{tcolorbox} -\RequirePackage{array} -\RequirePackage{colortbl} -\RequirePackage{booktabs} \DeclareOptionBeamer{maxplus}{\def\sjtubeamer@inner@cover{maxplus}} \DeclareOptionBeamer{max}{\def\sjtubeamer@inner@cover{max}} \DeclareOptionBeamer{min}{\def\sjtubeamer@inner@cover{min}} \DeclareOptionBeamer{my}{\def\sjtubeamer@inner@cover{my}} % reserved for customization -\ExecuteOptionsBeamer{max} +\ExecuteOptionsBeamer{ + maxplus, + min, + my, + max, +} \DefineOption{inner}{lang}{cn} \DefineOption{inner}{lang}{en} -\ExecuteOptionsBeamer{cn} +\@ifclassloaded{ctexbeamer}{\ExecuteOptionsBeamer{cn}}{ + \ExecuteOptionsBeamer{en}} \DefineOption{inner}{color}{red} \DefineOption{inner}{color}{blue} \ExecuteOptionsBeamer{red} @@ -67,27 +70,47 @@ \fi \if\EqualOption{inner}{cover}{maxplus} \titlegraphic{\includegraphics{sjtuphoto.jpg}} -\else\if\EqualOption{inner}{cover}{max} - \usebeamercolor{palatte primary} - \titlegraphic{\sjtubg[opacity=0.2]} - \setbeamertemplate{background} +\else + \if\EqualOption{inner}{cover}{max} + \usebeamercolor{palatte primary} + \titlegraphic{\sjtubg[opacity=0.2]} + \setbeamertemplate{background} { \let\oldlogocolor=\sjtubeamer@logocolor% \def\sjtubeamer@logocolor{cprimary!50} - \resizebox{\paperwidth}{!}{\inserttitlegraphic} + \vbox to \paperheight{ + \vfil + \hbox to \paperwidth{ + \hfil + \resizebox{\paperwidth}{!}{\inserttitlegraphic} + \hfil + } + \vfil + } \let\sjtubeamer@logocolor=\oldlogocolor% } -\else\if\EqualOption{inner}{cover}{min} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} -\else - \titlegraphic{} - % - % Developer could define your title graphic here for "my"... - % -\fi\fi\fi + \else + \if\EqualOption{inner}{cover}{min} + \titlegraphic{\includegraphics{sjtuphoto.jpg}} + \else + % + % Developer could define your title graphic here for "my"... + % + \titlegraphic{} + \fi + \fi +\fi +\newdimen\beamer@sidebarwidth +\beamer@sidebarwidth=0pt \def\titlepage{ \let\oldlogocolor=\sjtubeamer@logocolor% - \usebeamertemplate*{title page} + \ifdim\beamer@sidebarwidth=0pt % + \usebeamertemplate*{title page} + \else + \hspace*{-0.5\beamer@sidebarwidth}\parbox[t]{\textwidth}{ + \usebeamertemplate*{title page} + } + \fi \let\sjtubeamer@logocolor=\oldlogocolor% } \renewcommand{\maketitle}[1][\sjtubeamer@inner@cover]{ @@ -100,7 +123,13 @@ } \def\bottompage{ \let\oldlogocolor=\sjtubeamer@logocolor% - \usebeamertemplate*{bottom page} + \ifdim\beamer@sidebarwidth=0pt % + \usebeamertemplate*{bottom page} + \else + \hspace*{-0.5\beamer@sidebarwidth}\parbox[t]{\textwidth}{ + \usebeamertemplate*{bottom page} + } + \fi \let\sjtubeamer@logocolor=\oldlogocolor% } \if\EqualOption{inner}{lang}{cn}% @@ -191,9 +220,11 @@ \useinnertheme{circles} \if\EqualOption{inner}{cover}{maxplus}% \setbeamertemplate{blocks}[rounded] -\else\if\EqualOption{inner}{cover}{max}% - \setbeamertemplate{blocks}[rounded] -\fi\fi +\else + \if\EqualOption{inner}{cover}{max}% + \setbeamertemplate{blocks}[rounded] + \fi +\fi \newtcbox{\highlight}[1][cprimary]{ on line, arc=0pt, diff --git a/beamerouterthemesjtubeamer.sty b/beamerouterthemesjtubeamer.sty index 3d56e87d..80a1b8c6 100644 --- a/beamerouterthemesjtubeamer.sty +++ b/beamerouterthemesjtubeamer.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% beamerouterthemesjtubeamer.dtx (with options: `package') -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ %% Copyright (C) 2021 SJTUG %% %% Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,27 +19,30 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerouterthemesjtubeamer}[2021/08/26 sjtubeamer outer theme v1.4.7] +\ProvidesPackage{beamerouterthemesjtubeamer}[2021/08/28 sjtubeamer outer theme v1.5.0] \RequirePackage{sjtuvi} \DefineOption{outer}{nav}{miniframes} \DefineOption{outer}{nav}{infolines} \DefineOption{outer}{nav}{sidebar} +\DefineOption{outer}{nav}{default} +\DefineOption{outer}{nav}{smoothbars} +\DefineOption{outer}{nav}{split} +\DefineOption{outer}{nav}{shadow} +\DefineOption{outer}{nav}{tree} +\DefineOption{outer}{nav}{smoothtree} \ExecuteOptionsBeamer{miniframes} \ProcessOptionsBeamer \beamer@compresstrue \if\EqualOption{outer}{nav}{miniframes} \useoutertheme[footline=institutetitle]{miniframes} -\else\if\EqualOption{outer}{nav}{infolines} - \useoutertheme{infolines} \else\if\EqualOption{outer}{nav}{sidebar} - \PackageWarning{outer}{ - Feature "sidebar" has not been implemented yet.\MessageBreak - Fallback to the default setting. - } - \useoutertheme[footline=institutetitle]{miniframes} -\fi\fi\fi + \useoutertheme{sidebar} +\else\useoutertheme{\sjtubeamer@outer@nav} +\fi\fi +\setbeamercolor{frametitle}{use=titlelike,bg=white,fg=titlelike.fg} +\setbeamercolor{frametitle right}{parent=subsection in head/foot} \addtobeamertemplate{navigation symbols}{}{ \hbox{ \raisebox{1.2pt}[0pt][0pt]{ diff --git a/beamerthemesjtubeamer.sty b/beamerthemesjtubeamer.sty index 50d92112..8b4d2e2f 100644 --- a/beamerthemesjtubeamer.sty +++ b/beamerthemesjtubeamer.sty @@ -4,8 +4,8 @@ %% %% The original source files were: %% -%% beamerthemesjtubeamer.dtx (with options: `package') -%% ------------------------------------------------------------------- +%% beamerthemesjtubeamer.dtx (with options: `package,maxplus,max,min,my') +%% ------------------------------------------------------------------------ %% Copyright (C) 2021 SJTUG %% %% Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,14 +19,19 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerthemesjtubeamer}[2021/08/26 sjtubeamer parent theme v1.4.7] +\ProvidesPackage{beamerthemesjtubeamer}[2021/08/28 sjtubeamer parent theme v1.5.0] \DeclareOptionBeamer{maxplus}{\def\sjtubeamer@cover{maxplus}} \DeclareOptionBeamer{max}{\def\sjtubeamer@cover{max}} \DeclareOptionBeamer{min}{\def\sjtubeamer@cover{min}} \DeclareOptionBeamer{my}{\def\sjtubeamer@cover{my}} % reserved for customization -\ExecuteOptionsBeamer{max} +\ExecuteOptionsBeamer{ + maxplus, + min, + my, + max, +} \DeclareOptionBeamer{red}{\def\sjtubeamer@color{red}} \DeclareOptionBeamer{blue}{\def\sjtubeamer@color{blue}} \ExecuteOptionsBeamer{red} @@ -35,10 +40,17 @@ \ExecuteOptionsBeamer{dark} \DeclareOptionBeamer{cn}{\def\sjtubeamer@lang{cn}} \DeclareOptionBeamer{en}{\def\sjtubeamer@lang{en}} -\ExecuteOptionsBeamer{cn} +\@ifclassloaded{ctexbeamer}{\ExecuteOptionsBeamer{cn}}{ + \ExecuteOptionsBeamer{en}} \DeclareOptionBeamer{miniframes}{\def\sjtubeamer@nav{miniframes}} \DeclareOptionBeamer{infolines}{\def\sjtubeamer@nav{infolines}} \DeclareOptionBeamer{sidebar}{\def\sjtubeamer@nav{sidebar}} +\DeclareOptionBeamer{default}{\def\sjtubeamer@nav{default}} +\DeclareOptionBeamer{smoothbars}{\def\sjtubeamer@nav{smoothbars}} +\DeclareOptionBeamer{split}{\def\sjtubeamer@nav{split}} +\DeclareOptionBeamer{shadow}{\def\sjtubeamer@nav{shadow}} +\DeclareOptionBeamer{tree}{\def\sjtubeamer@nav{tree}} +\DeclareOptionBeamer{smoothtree}{\def\sjtubeamer@nav{smoothtree}} \ExecuteOptionsBeamer{miniframes} \ProcessOptionsBeamer \PassOptionsToPackage{\sjtubeamer@cover}{beamerinnerthemesjtubeamer} diff --git a/main.tex b/main.tex index b7cb0fd4..5a2a9592 100644 --- a/main.tex +++ b/main.tex @@ -33,6 +33,11 @@ % 使用 maxplus/max/min 切换标题页样式 % 使用 red/blue 切换主色调 % 使用 light/dark 切换亮/暗色模式 +% 使用外样式关键词以获得不同的边栏样式 +% miniframes infolines sidebar* +% default smoothbars split +% shadow tree smoothtree +% *siderbar 推荐与 max 一起使用。 \title[SJTU Beamer Template] % 页脚显示标题 {\textbf{上海交通大学 Beamer 模版}} % 首页标题 diff --git a/sjtucover.sty b/sjtucover.sty index 12befe91..408f5f66 100644 --- a/sjtucover.sty +++ b/sjtucover.sty @@ -4,8 +4,8 @@ %% %% The original source files were: %% -%% sjtucover.dtx (with options: `package') -%% ------------------------------------------------------------------- +%% sjtucover.dtx (with options: `package,maxplus,max,min,my') +%% ------------------------------------------------------------------------ %% Copyright (C) Shanghai Jiao Tong University %% The definition in this file is refered to the Visual Identity System %% from Shanghai Jiao Tong University (SJTU). @@ -16,49 +16,59 @@ %% the administration of SJTU. %% More infomation about the license, %% see https://vi.sjtu.edu.cn/index.php/articles/bulletin/16. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{sjtucover}[2021/08/26 cover library for sjtubeamer v1.4.7] +\ProvidesPackage{sjtucover}[2021/08/28 cover library for sjtubeamer v1.5.0] \RequirePackage{sjtuvi} -\DefineOption{sjtucover}{cover}{maxplus} -\DefineOption{sjtucover}{cover}{max} -\DefineOption{sjtucover}{cover}{min} -\DefineOption{sjtucover}{cover}{my} % reserved for customization -\ExecuteOptionsBeamer{max} +\DeclareOptionBeamer{maxplus}{\def\sjtubeamer@sjtucover@cover{maxplus}} +\DeclareOptionBeamer{max}{\def\sjtubeamer@sjtucover@cover{max}} +\DeclareOptionBeamer{min}{\def\sjtubeamer@sjtucover@cover{min}} +\DeclareOptionBeamer{my}{\def\sjtubeamer@sjtucover@cover{my}} % reserved for customization +\ExecuteOptionsBeamer{ + maxplus, + min, + my, + max, +} \ProcessOptionsBeamer \defbeamertemplate*{title page}{maxplus}[1][] { \nointerlineskip% - \begin{beamercolorbox}[wd=\paperwidth, ht=\paperheight]{empty} + \vbox{} + \vfill + \begingroup \usebeamercolor{palette primary}% \def\sjtubeamer@logocolor{palette primary.fg} - \begin{tikzpicture} - \pgfmathsetlengthmacro{\outslant}{\the\paperwidth - 0.8cm} - \node[anchor=north west, inner sep=0, outer sep=0] - at (0,\the\paperheight){ - \resizebox{!}{\the\paperheight}{\inserttitlegraphic}}; - \fill[color=white] (0,0) rectangle(\the\paperwidth,3.9); - \fill[color=bg] (0,0) rectangle(\the\paperwidth,3.88); + \begin{tikzpicture}[overlay, + xshift=-0.12\paperwidth, + yshift=-0.53\paperheight] + \pgfmathsetlengthmacro{\outslant}{1.02\paperwidth} + \node[inner sep=0, outer sep=0] + at (0.57\paperwidth,0.5\paperheight){ + \resizebox{!}{1.06\paperheight}{\inserttitlegraphic}}; + \fill[color=white] (0,0) rectangle(1.1\paperwidth,3.9); + \fill[color=bg] (0,-0.1\paperheight) rectangle(1.1\paperwidth,3.88); \node[anchor=north west, text width=.8\paperwidth] - at (0.8,3.6){% - \usebeamercolor[fg]{title} - \ifx\insertsubtitle\@empty% - {\huge\bfseries\inserttitle}\\ - \else% - {\Large\bfseries\inserttitle}\\ - {\small\insertsubtitle}\\ - \fi% + at (0.11\paperwidth,3.6){% + \usebeamercolor[fg]{title} + \ifx\insertsubtitle\@empty% + {\huge\bfseries\inserttitle}\\ + \else% + {\Large\bfseries\inserttitle}\\ + {\small\insertsubtitle}\\ + \fi% }; - \node[anchor=south west, text width=.8\paperwidth] at (0.8,0.45){% - {\usebeamercolor[fg]{author}\small\insertauthor}\\ - {\usebeamercolor[fg]{institute}\small\insertinstitute}\\ + \node[anchor=south west, text width=.8\paperwidth] at (0.11\paperwidth,0.45){% + {\usebeamercolor[fg]{author}\small\insertauthor\par} + {\usebeamercolor[fg]{institute}\small\insertinstitute\par} {\usebeamercolor[fg]{date}\small\insertdate}% }; \node[anchor=south east, inner sep=0, outer sep=0] at (\outslant,0.5){ \resizebox{!}{1cm}{\insertlogo} }; \end{tikzpicture} - \end{beamercolorbox} + \endgroup + \vfill } \defbeamertemplate*{title page}{max}[1][] { @@ -68,7 +78,7 @@ \def\sjtubeamer@logocolor{palette primary.fg} \begin{tikzpicture}[overlay] \fill [palette primary.bg] (-0.2*\the\paperwidth,-1*\the\paperheight) - rectangle (1*\the\paperwidth, 0.2*\the\paperheight); + rectangle (1*\the\paperwidth, 0.3*\the\paperheight); \node [inner sep=0pt] at (0.45\paperwidth-6pt,-0.4*\the\paperheight) {\resizebox{1.3\paperwidth}{!}{\inserttitlegraphic}}; @@ -228,50 +238,56 @@ \defbeamertemplate*{bottom page}{maxplus}[1][] { \nointerlineskip + \vbox{} \begin{tikzpicture}[overlay] \usebeamercolor{palette primary} \fill[palette primary.bg] (-0.2\paperwidth,-\paperheight) rectangle (\paperwidth, 0.5\paperheight); \end{tikzpicture} - \begin{beamercolorbox}[wd=\paperwidth,center,sep=24pt]{title} - \LARGE \bfseries \bottomthanks - \end{beamercolorbox} - \begin{beamercolorbox}[wd=\paperwidth]{empty} + \vfill + \begin{beamercolorbox}[sep=0pt]{empty} \usebeamercolor{structure} \def\sjtubeamer@logocolor{white} - \begin{tikzpicture} + \begin{tikzpicture}[overlay,xshift=0.54\paperwidth,yshift=-0.41\paperheight] \begin{scope} - \clip (-0.64\paperwidth,0.08\paperheight) - rectangle (0.36\paperwidth,0.53\paperheight); - \node [anchor=north] at (0,0.6\paperheight+0.03\paperwidth) { - \resizebox{1.3\paperwidth}{!}{\inserttitlegraphic}}; + \clip (-0.66\paperwidth,0.06\paperheight) + rectangle (0.43\paperwidth,0.53\paperheight); + \node [anchor=north] at (0,0.645\paperheight) { + \resizebox{1.33\paperwidth}{!}{\inserttitlegraphic}}; \fill[structure.fg!50!black,path fading=fade right img] - (-0.64\paperwidth,0.08\paperheight) - rectangle (0.36\paperwidth,0.53\paperheight); - \node at (-0.45\paperwidth,0.31\paperheight) + (-0.66\paperwidth,0.06\paperheight) + rectangle (0.43\paperwidth,0.53\paperheight); + \node at (-0.45\paperwidth,0.3\paperheight) {\resizebox{!}{0.115\paperheight}{\insertlogo}}; - \draw[white] (-0.64\paperwidth,0.12\paperheight) - -- (0.36\paperwidth,0.12\paperheight); + \draw[white] (-0.66\paperwidth,0.1\paperheight) + -- (0.43\paperwidth,0.1\paperheight); \end{scope} + \node at (-0.13\paperwidth,0.7\paperheight) { + \usebeamercolor[fg]{title} + \LARGE \bfseries \bottomthanks + }; \end{tikzpicture} \end{beamercolorbox} + \vfill } \defbeamertemplate*{bottom page}{max}[1][] { \nointerlineskip + \vbox{} \usebeamercolor{palette primary} \usebeamercolor{structure} - \begin{tikzpicture}[overlay] + \begin{beamercolorbox}[sep=0pt]{empty} + \begin{tikzpicture}[overlay,yshift=0.25\paperwidth] \def\leftw{0.215\paperwidth} \def\midw{0.435\paperwidth} \def\rightw{0.655\paperwidth} - \fill[palette primary.bg] (-0.2\paperwidth,-\paperheight) - rectangle (\paperwidth, 0.5\paperheight); - \fill[palette primary.fg] (\leftw,0.5\paperheight) + \fill[palette primary.bg] (-0.2\paperwidth,-1.2\paperheight) rectangle + (\paperwidth, 0.1\paperheight); + \fill[palette primary.fg] (\leftw,0.1\paperheight) -- (\leftw,-0.5\paperheight) -- (\midw,-0.65\paperheight) -- (\rightw,-0.5\paperheight) - -- (\rightw,0.5\paperheight) -- cycle; + -- (\rightw,0.1\paperheight) -- cycle; \fill[palette primary.fg] (\leftw,-0.53\paperheight) -- (\leftw,-0.59\paperheight) -- (\midw,-0.74\paperheight) @@ -280,7 +296,7 @@ -- (\midw,-0.68\paperheight) -- cycle; \node at (\midw,-0.65\paperheight) { \def\sjtubeamer@logocolor{black} - \resizebox{1.2\paperwidth}{!}{\inserttitlegraphic}}; + \resizebox{1.25\paperwidth}{!}{\inserttitlegraphic}}; \node at (\midw,-0.2\paperheight) { \def\sjtubeamer@logocolor{palette primary.bg} \resizebox{3cm}{!}{\insertlogo}}; @@ -288,7 +304,6 @@ \usebeamercolor[bg]{palette primary} \LARGE \bfseries\bottomthanks}; \end{tikzpicture} - \begin{beamercolorbox}[wd=\paperwidth,ht=\paperheight,center]{empty} \end{beamercolorbox} } \defbeamertemplate*{bottom page}{min}[1][] diff --git a/sjtuvi.sty b/sjtuvi.sty index db96fd19..27fb93d3 100644 --- a/sjtuvi.sty +++ b/sjtuvi.sty @@ -4,8 +4,8 @@ %% %% The original source files were: %% -%% sjtuvi.dtx (with options: `package') -%% ------------------------------------------------------------------- +%% sjtuvi.dtx (with options: `package,maxplus,max,min,my') +%% ------------------------------------------------------------------------ %% Copyright (C) Shanghai Jiao Tong University %% The definition in this file is refered to the Visual Identity System %% from Shanghai Jiao Tong University (SJTU). @@ -16,9 +16,9 @@ %% the administration of SJTU. %% More infomation about the license, %% see https://vi.sjtu.edu.cn/index.php/articles/bulletin/16. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{sjtuvi}[2021/08/26 Visual Identity System library for sjtubeamer v1.4.7] +\ProvidesPackage{sjtuvi}[2021/08/28 Visual Identity System library for sjtubeamer v1.5.0] \def\DefineOption#1#2#3{ % #1: package % #2: key @@ -46,7 +46,7 @@ \definecolor{sjtuBluePrimary}{RGB}{0,64,152} %problue \definecolor{sjtuBlueSecondary}{RGB}{51,141,39} %lightgreen \definecolor{sjtuBlueTertiary}{RGB}{0,81,78} %lightgray -\newcommand{\maskcolor}[3]{ +\newcommand{\definelogo}[3]{ % #1: file % #2: horizontal clip (0~1) % #3: vertical clip (0~1) @@ -74,12 +74,12 @@ } } \def\sjtubeamer@logocolor{sjtuRedPrimary} -\maskcolor{sjtubadge}{0}{0} -\maskcolor{cnlogo}{0.13}{0.75} -\maskcolor{enlogo}{0.13}{0.75} -\maskcolor{dlogo}{0}{0} -\maskcolor{vlogo}{0.8}{0.13} -\maskcolor{sjtubg}{0.3}{0.5} +\definelogo{sjtubadge}{0}{0} +\definelogo{cnlogo}{0.13}{0.75} +\definelogo{enlogo}{0.13}{0.75} +\definelogo{dlogo}{0}{0} +\definelogo{vlogo}{0.8}{0.13} +\definelogo{sjtubg}{0.3}{0.5} \tikzdeclarepattern{ name=stamp, parameters={ @@ -126,9 +126,9 @@ } } \providecommand{\stamparray}[3]{ - %#1: pattern size - %#2: starting point - %#3: ending point + % #1: pattern size + % #2: starting point + % #3: ending point \usebeamercolor{palette primary} \fill [pattern={stamp[size=#1]}, pattern color=bg!50!fg] #2 rectangle #3; diff --git a/src/build.lua b/src/build.lua index 06fac437..52666ab3 100644 --- a/src/build.lua +++ b/src/build.lua @@ -13,12 +13,13 @@ installfiles = {"*.sty","*logo.pdf","sjtubadge.pdf","sjtubg.pdf","sjtubg.png docfiledir = "doc" typesetexe = "xelatex" --- typesetfiles = {"sjtubeamermintheme.tex","sjtubeamermindevguide.tex"} -typesetfiles = {} +typesetfiles = {"sjtubeamerdevguide.tex","sjtubeamer.tex"} -- typesetruns = 1 -- for debug. Some reference may not be linked. -typesetdemofiles = {"main.tex","min.tex","cover-*.tex","cover.tex"} --- typesetdemofiles = {"cover.tex"} -- for debug -typesetsuppfiles = {"head.png","plant.jpg","test.csv","testgraph.tex","ref.bib","contents/"} +typesetdemofiles = {"min.tex"} +typesetsuppfiles = {"head.png","plant.jpg","test.csv","testgraph.tex","ref.bib"} + +-- Regression tests mainly test the decoupling properties between kernel modules. +testfiledir = "./testfiles" packtdszip = true -- recommended for "tree" layouts diff --git a/src/doc/cover-blue-dark.tex b/src/doc/cover-blue-dark.tex deleted file mode 100644 index 3c6eddb8..00000000 --- a/src/doc/cover-blue-dark.tex +++ /dev/null @@ -1,36 +0,0 @@ -\documentclass[ - aspectratio=169 -]{ctexbeamer} -\usetheme[blue,dark]{sjtubeamer} -\begin{document} - - \title[SJTU Beamer Template] % 页脚显示标题 - {\textbf{上海交通大学 Beamer 模版}} % 首页标题 - - \author[Anxue Chen, Alexara Wu, Log Creative] - {Anxue Chen, Alexara Wu, Log Creative} - - \institute[SJTU]{Shanghai Jiao Tong University} - - \date{\today} - - \subtitle{blue,dark,maxplus} - \logo{\resizebox{!}{0.7cm}{\cnlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[maxplus] - \makebottom[maxplus] - - \subtitle{blue,dark,max} - \logo{\resizebox{!}{1cm}{\sjtubadge}} - \titlegraphic{\sjtubg[opacity=0.2]} - \maketitle[max] - \frame{} - \makebottom[max] - - \subtitle{blue,dark,min} - \logo{\resizebox{!}{0.7cm}{\enlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[min] - \makebottom[min] - -\end{document} \ No newline at end of file diff --git a/src/doc/cover-blue-light.tex b/src/doc/cover-blue-light.tex deleted file mode 100644 index aca041d8..00000000 --- a/src/doc/cover-blue-light.tex +++ /dev/null @@ -1,36 +0,0 @@ -\documentclass[ - aspectratio=169 -]{ctexbeamer} -\usetheme[blue,light]{sjtubeamer} -\begin{document} - - \title[SJTU Beamer Template] % 页脚显示标题 - {\textbf{上海交通大学 Beamer 模版}} % 首页标题 - - \author[Anxue Chen, Alexara Wu, Log Creative] - {Anxue Chen, Alexara Wu, Log Creative} - - \institute[SJTU]{Shanghai Jiao Tong University} - - \date{\today} - - \subtitle{blue,light,maxplus} - \logo{\resizebox{!}{0.7cm}{\cnlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[maxplus] - \makebottom[maxplus] - - \subtitle{blue,light,max} - \logo{\resizebox{!}{1cm}{\sjtubadge}} - \titlegraphic{\sjtubg[opacity=0.2]} - \maketitle[max] - \frame{} - \makebottom[max] - - \subtitle{blue,light,min} - \logo{\resizebox{!}{0.7cm}{\enlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[min] - \makebottom[min] - -\end{document} \ No newline at end of file diff --git a/src/doc/cover-red-dark.tex b/src/doc/cover-red-dark.tex deleted file mode 100644 index f72aaf0c..00000000 --- a/src/doc/cover-red-dark.tex +++ /dev/null @@ -1,36 +0,0 @@ -\documentclass[ - aspectratio=169 -]{ctexbeamer} -\usetheme[red,dark]{sjtubeamer} -\begin{document} - - \title[SJTU Beamer Template] % 页脚显示标题 - {\textbf{上海交通大学 Beamer 模版}} % 首页标题 - - \author[Anxue Chen, Alexara Wu, Log Creative] - {Anxue Chen, Alexara Wu, Log Creative} - - \institute[SJTU]{Shanghai Jiao Tong University} - - \date{\today} - - \subtitle{red,dark,maxplus} - \logo{\resizebox{!}{0.7cm}{\cnlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[maxplus] - \makebottom[maxplus] - - \subtitle{red,dark,max} - \logo{\resizebox{!}{1cm}{\sjtubadge}} - \titlegraphic{\sjtubg[opacity=0.2]} - \maketitle[max] - \frame{} - \makebottom[max] - - \subtitle{red,dark,min} - \logo{\resizebox{!}{0.7cm}{\enlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[min] - \makebottom[min] - -\end{document} \ No newline at end of file diff --git a/src/doc/cover-red-light.tex b/src/doc/cover-red-light.tex deleted file mode 100644 index 8add184c..00000000 --- a/src/doc/cover-red-light.tex +++ /dev/null @@ -1,36 +0,0 @@ -\documentclass[ - aspectratio=169 -]{ctexbeamer} -\usetheme[red,light]{sjtubeamer} -\begin{document} - - \title[SJTU Beamer Template] % 页脚显示标题 - {\textbf{上海交通大学 Beamer 模版}} % 首页标题 - - \author[Anxue Chen, Alexara Wu, Log Creative] - {Anxue Chen, Alexara Wu, Log Creative} - - \institute[SJTU]{Shanghai Jiao Tong University} - - \date{\today} - - \subtitle{red,light,maxplus} - \logo{\resizebox{!}{0.7cm}{\cnlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[maxplus] - \makebottom[maxplus] - - \subtitle{red,light,max} - \logo{\resizebox{!}{1cm}{\sjtubadge}} - \titlegraphic{\sjtubg[opacity=0.2]} - \maketitle[max] - \frame{} - \makebottom[max] - - \subtitle{red,light,min} - \logo{\resizebox{!}{0.7cm}{\enlogo}} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} - \maketitle[min] - \makebottom[min] - -\end{document} \ No newline at end of file diff --git a/src/doc/main.tex b/src/doc/main.tex deleted file mode 100644 index 4c165c61..00000000 --- a/src/doc/main.tex +++ /dev/null @@ -1,74 +0,0 @@ -% !TeX encoding = UTF-8 - -\documentclass[xcolor=table,dvipsnames,svgnames,aspectratio=169]{ctexbeamer} -% 可以通过 fontset=macnew / fontset=ubuntu / fontset=windows 选项切换字体集 - -\usepackage{tikz} -\usetikzlibrary{arrows} -\usepackage{amsmath} -\usepackage{mflogo} -\usepackage{graphicx} -\usepackage{xspace} -\usepackage{amsmath} -\usepackage{unicode-math} -\usepackage{fontspec} -\usepackage{ccicons} -\usepackage{hologo} -\usepackage{colortbl} -\usepackage{shapepar} -\usepackage{hyperxmp} -\usepackage{booktabs} -\usepackage{qrcode} -\usepackage{listings} -\usepackage{tipa} -\usepackage{multicol} -\usepackage{datetime2} -\usepackage{hyperref} - -\usepackage{biblatex} -\addbibresource{thesis.bib} -\setbeamertemplate{bibliography item}[text] - -\usetheme[max]{sjtubeamer} -% 使用 maxplus/max/min 切换标题页样式 -% 使用 red/blue 切换主色调 -% 使用 light/dark 切换亮/暗色模式 - -\title[SJTU Beamer Template] % 页脚显示标题 -{\textbf{上海交通大学 Beamer 模版}} % 首页标题 - -\subtitle{使用教程} - -\author[Anxue Chen, Alexara Wu, Log Creative] -{Anxue Chen, Alexara Wu, Log Creative} - -\institute[SJTU]{Shanghai Jiao Tong University} - -\date{April 2021} - -\begin{document} - -% 在每一个section或subsection前都添加目录页,并高亮当前的标题 -\AtBeginSection[] % \AtBeginSubsection -{ - \begin{frame} - \frametitle{目录} - \tableofcontents[currentsection] % [currentsection,currentsubsection] - \end{frame} -} - -% 关闭 plain 选项即可在标题页显示页眉页脚。 -\begin{frame}[plain] - \titlepage -\end{frame} - -\begin{frame}{目录} - \tableofcontents -\end{frame} - -\include{contents/basis} -% \include{contents/end} - -\makebottom - -\end{document} diff --git a/src/doc/min.tex b/src/doc/min.tex index ebc5441a..1bb31888 100644 --- a/src/doc/min.tex +++ b/src/doc/min.tex @@ -5,7 +5,7 @@ \mode \usepackage{pgfplots} \usepackage{pgfplotstable} -\usetheme[min,sidebar]{sjtubeamer} +\usetheme[min]{sjtubeamer} % \usecolortheme[]{beaver} % 使用其他颜色主题 \usepackage{biblatex} \addbibresource{ref.bib} % gbt!=bibtex diff --git a/src/doc/sjtubeamer.tex b/src/doc/sjtubeamer.tex new file mode 100644 index 00000000..2e8cac82 --- /dev/null +++ b/src/doc/sjtubeamer.tex @@ -0,0 +1,8 @@ +\documentclass{article} +\usepackage[UTF8]{ctex} +\def\themename{\textsf{SJTUBeamer}} +\begin{document} + \title{\themename} + \date{\today} + \maketitle +\end{document} \ No newline at end of file diff --git a/src/doc/sjtubeamerdevguide.tex b/src/doc/sjtubeamerdevguide.tex new file mode 100644 index 00000000..d775aa17 --- /dev/null +++ b/src/doc/sjtubeamerdevguide.tex @@ -0,0 +1,90 @@ +\documentclass{ltxdoc} +\usepackage[scheme=plain]{ctex} +% \usepackage{sjtuvi} +\usepackage[colorlinks]{hyperref} +\def\themename{\textsf{SJTUBeamer}} +\title{Development Guide of\\\themename} +\def\fcmd#1{\paragraph{\fbox{\ttfamily #1}}} +\begin{document} + \maketitle + \tableofcontents + + \section{Build} + + \subsection{l3build} + + \themename{} adopts \verb"l3build" system to build the package. After entering the source code directory: + \begin{verbatim} + cd src + \end{verbatim} + You could operate the package by the following command. The build script is set in \verb"build.lua". + + \fcmd{l3build doc} This command will generate the documentation of this package. We set an overall testing file \verb"doc/min.tex" to test all features of \themename. This is the most common command for testing a certain feature. + \begin{center} + unpack $\rightarrow$ \verb"min.tex" $\rightarrow$ documentations + \end{center} + + \fcmd{l3build check} Process a regression test, with an optional parameter to perform one of the following tests: + \begin{center} + \ttfamily color font inner outer sjtuvi + \end{center} + which will show if the module is standing-free. If the compilation error occurs, please check if your code use one definition from another module without requiring it first, or the syntax error occurs. + + \fcmd{l3build save color} If you make some modification on the framework (except \verb"sjtucover") and change the result. To save the current result as a referenc, run this command and \verb"color" could be exchanged by any of the test units above. + + \fcmd{l3build clean} Clean the current \verb"src/build" directory, which will be useful if you modified one of the temporary files in that directory. (In this case, you may perform a wrong test with a modified version since \verb"l3build doc" may not refresh it.) + + \fcmd{l3build tag v1.5.0} Tag the version of source code, which will also update the date in the source code. + + \fcmd{l3build ctan} This is the last step before release. Both \verb"l3build check" and \verb"l3build doc" will be performed. The generated file is \verb"src/sjtubeamer-ctan.zip". + + More information about \verb"l3build", please refer to + \begin{verbatim} + texdoc l3build + \end{verbatim} + + \subsection{Customize Generation} + + In \verb"source/beamerthemesjtubeamer.ins", you could customize what templates you want to output on the line: + \begin{verbatim} + \def\preserveoption{,maxplus,max,min,my} + \end{verbatim} + Reduce the parameter number will reduce the number of templates it generates. It is useful if you want to debug or make a slight performance jump. Or make your own version of this template. + + \subsection{Pull Request} + + Before making a pull request, please refresh the root \verb".sty" files first. Switch to the main directory: + \begin{verbatim} + cd .. + \end{verbatim} + Then, run the bash code on *nix. + \begin{verbatim} + .github/ci/build_package.sh + \end{verbatim} + And all other scripts in the folder could also be checked in your local machine to make sure you can pass the CI on GitHub Actions. + + If you are a Windows user, please use the old extracting method in \verb"src/source": + \begin{verbatim} + latex beamerthemesjtubeamer.ins + \end{verbatim} + and copy the corresponding generated files to the root directory. + + \subsection{CI} + + TBD. + + \section{Details} + + TBD. Please refer to the old pull requests for details. + + \section{Implementation} +% The DocTeX follows the alphabatic order to input. + \DocInput{beamercolorthemesjtubeamer.dtx} + \DocInput{beamerfontthemesjtubeamer.dtx} + \DocInput{beamerinnerthemesjtubeamer.dtx} + \DocInput{beamerouterthemesjtubeamer.dtx} + \DocInput{beamerthemesjtubeamer.dtx} +% SJTUG doesn't hold the copyright of the following code. + \DocInput{sjtucover.dtx} + \DocInput{sjtuvi.dtx} +\end{document} \ No newline at end of file diff --git a/src/doc/sjtubeamermindevguide.tex b/src/doc/sjtubeamermindevguide.tex deleted file mode 100644 index 21ef9978..00000000 --- a/src/doc/sjtubeamermindevguide.tex +++ /dev/null @@ -1,418 +0,0 @@ -\documentclass{ltxdoc} -\usepackage{array} -\usepackage[colorlinks,breaklinks=true]{hyperref} -\usepackage[numbers, sort&compress]{natbib} -% \usepackage{ctex} -\bibliographystyle{IEEEtran} -\def\themename{\textsf{SJTUBeamer} \fbox{\textsc{min}}} - -\title{Developer's Guide on\\ \themename} -\author{Log Creative} -\date{v1.4 \today} -\begin{document} - \maketitle - \tableofcontents - \clearpage - \section{Preface} - - \themename{} is a presentation template based on \textsf{beamer} package in \LaTeX{}, to fulfill the enthusiasm of those SJTU users to present their content nicely, benefiting from the technology of \TeX{} typesetting engine. - - This is a Developer's Guide on \themename{} . The document is written in English because the operation in this guidance could be dangerous. Be careful when playing with those macros. - - \begin{quotation} - \begin{center} - \themename{} --- the minimal work set of SJTU VI - \end{center} - \vspace*{1em} - - \fbox{\textsc{min}} - \emph{minimal}: \hfill minimal work set of SJTU VI. - - \fbox{\textsc{min}} - \emph{minimalism}:\hfill designed in the style of minimalism. - - \fbox{\textsc{min}} - \emph{minimum}:\hfill minimum shapes to show your content. - \end{quotation} - - \section{Build} - - To make a CTAN package, a modern \verb"l3build" method is adopted for building the package. And all souce code has been refactored. - - To build the package: - \begin{verbatim} - l3build ctan - \end{verbatim} - - To install the package: - \begin{verbatim} - l3build install - \end{verbatim} - Sometimes, you have to indicate the install directory as follows: - \begin{verbatim} - l3build install --texmfhome path/to/install - \end{verbatim} - - To bump version - \begin{verbatim} - l3build tag 1.0 - \end{verbatim} - - Since \verb"l3build" is still under development, the instability may be introduced to some operating systems like Windows. In this case, use - \begin{verbatim} - cd source - latex beamerthemesjtubeamermin.ins - \end{verbatim} - and move the output file to your installation directory or the directory contains your working file. - - It is soon to have a CTAN distribution. At that time, if you are using TeX{} Live: - \begin{verbatim} - tlmgr install sjtubeamermin - \end{verbatim} - Or use MiK\TeX{}: - \begin{verbatim} - \usepackage{sjtubeamermin} % trigger the installation - \end{verbatim} - and you are ready to go! - - \section{Compliation} - - Most problems come from \LaTeX{} compilation. The required packages are in the following list. - - \begin{table}[h] - \centering - \begin{tabular}{>{\sffamily}c>{\sffamily}c>{\sffamily}c} - \hline - pgfplots & tikz & xcolor \\ - pgfplotstable & sansmath & tcolorbox \\ - ctex & biblatex & beamer \\ - \hline - \end{tabular} - \end{table} - - The detailed description is documented below. - - \subsection{MiK\TeX{}} - - All required packages will be automatically installed if you are using MiK\TeX{}\cite{miktex}. And if you want to use the \verb"latexmk" command, please install Perl\cite{perl} first. And the compilation command for \themename{} is as follows: - \begin{verbatim} - latexmk -pdf main -interaction=nonstopmode - \end{verbatim} - - \subsection{\TeX{} Live} - Since some packages are not default installed in the full release of \TeX{} Live, you have to install the packages manually. - - On Ubuntu, you could install \verb"pgf" and \verb"xcolor" and other drawing packages through the following command\cite{beamerman}: - - \begin{verbatim} - sudo apt install texlive-pictures - \end{verbatim} - - To typeset Chinese characters, you would better use \verb"CJKutf8" package (in \themename{}, set \verb"[cjk=true]"), since it is compatible with all platforms and multiple language support. Surround \verb"CJK" environment to make it work and remember to move all the Unicode characters in the permeable to the \verb"CJK" environment\cite{lsp3}: - - \begin{verbatim} - \begin{document} - \begin{CJK}{UTF8}{gbsn} - \institute[]{} - \title{} - \subtitle{} - \author{} - \date{} - % your content here ... - \end{CJK} - \end{document} - \end{verbatim} - - However, if you stick into \verb"ctex", you can install through \verb"tlmgr". If that works, then we call it a day. - - \begin{verbatim} - sudo tlmgr install ctex - \end{verbatim} - - Sometimes, you installed an old \TeX{} Live, and you have to upgrade the \verb"tlmgr" for the new version. And the process could be very buggy, since the following warning may be shown: - - \begin{verbatim} - unexpected return value from verify_checksum: -5 - \end{verbatim} - - and to upgrade the \verb"tlmgr" is painful on Ubuntu. You should add the following content to \verb"/etc/profile/", which will add the newest path when the system is booting up\cite{upgrade}: - \begin{verbatim} - export PATH=/usr/local/texlive/2021/bin/x86_64-linux: - /usr/local/texlive/:$PATH - \end{verbatim} - - Reboot your computer if necessary. Then the compile system will be moved to the newer version of \TeX{} Live. Try to install the corresponding packages through the GUI interface of \verb"tlmgr": - - \begin{verbatim} - sudo tlmgr update --self - sudo tlmgr gui - \end{verbatim} - - And if you encountered that - \begin{verbatim} - Critical Package ctex Error: CTeX fontset `fandol' is - unavailable in current(ctex) mode. - \end{verbatim} - - You have to modify your compiling program from pdf\LaTeX{} to Xe\LaTeX{} by adding the following magic command on the first line: - - \begin{verbatim} - % !TeX TS-program = xelatex - \end{verbatim} - - \subsection{Boost Up} - - However, it has been tested that the compilation on \themename{} is slow. Since the complex patterns have to be rendered in vector shapes and the bibliography requires multiple times of compilation, the time could be wasted on some repetitive works. - - This scenario could be improved by enable \verb"[pattern=none]" option on \themename{} and enable \verb"[draft]" option on beamer. The former one will disable all the pattern rendering, and the latter one will ignore all the TOC (table of contents) generating. - - The project has been implanted to Overleaf. - Here is the link \cite{overleaf}. And to make that works, the compilation on \TeX{} Live 2021 has to be implemented. And it is discovered that setting the document information outside the \verb|document| environment will cause a significantly longer compiling time, which may be caused by some improper settings in C\TeX{} package. The workaround of that is to follow the setup mentioned in \verb|CJK| settings: put that info into the body of document\cite{lsp3}. - - Currently, CI is available on Github Actions by compiling on Lua\LaTeX{}. \themename{} uses \verb|xu-cheng/latex-action@v2| for the compilation docker \cite{lact} and relocates the compiling folder to \verb"src/". After compiling, output the PDF artifact. See \verb".github/workflows/main.yml" for details. - - At the same time, AutoBeamer\cite{ab} is making its own effort on generating beamer code automatically by some replacing strategies. You could preview your beamer code through conversion on Markdown or the article \LaTeX{} code. - - Furthermore, there is space for boosting up the beamer compilation time by making use of multi-core processors. Since it is a frame-based document, and the connection between each frame is loose (only some page numbers and citations need to be calculated), the multi-threaded compilation is possible for the \textsf{beamer} class. You can glimpse the multi-threaded processing for \LaTeX{} from the package \textsf{animate}. In fact, the author created some batch compiling work\cite{pgfedt} together with the \verb"-Parallel" parameter in PowerShell 7 to make full use of the concurrent computer architecture. - - \section{Modular Architecture}\label{sec:moarch} - - By the recommendation from \textsf{beamer} package\cite{beamerman}, \themename{} uses the same modular architecture to build the template. Like it is in Java, to let the \textsf{beamer} template locate your theme, the style file has to be in the standard name. - - \begin{table}[h] - \begin{tabular}{>{\ttfamily}ll} - \bfseries .sty File & \bfseries Description \\ - beamercolorthemesjtubeamermin.sty & Define global color schemes. \\ - beamerfontthemesjtubeamermin.sty & Set the font format. \\ - beamerinnerthemesjtubeamermin.sty & Specifies all parts inside a frame. \\ - beamerouterthemesjtubeamermin.sty & The frame header and bottom bar. \\ - beamerthemesjtubeamermin.sty & Entry point of the theme. \\ - sjtucolordef.sty & Color definition from SJTU VI. \\ - sjtuvishape.sty & VI Shape definition from SJTU VI. - \end{tabular} - \end{table} - - Notice that there are some dependencies (logo files) in the \verb|vi/|. Copying the \verb|vi| folder is necessary. Or you could define the location of the logo file by giving \verb"\logo{\includegraphics{logo.pdf}}". - - \begin{figure}[h] - \framebox[\textwidth]{\ttfamily main.tex} - - \framebox[\textwidth]{\ttfamily beamerthemesjtubeamermin.sty} - - \framebox[0.25\textwidth]{\ttfamily fonttheme.sty}\framebox[0.25\textwidth]{\ttfamily colortheme.sty}\framebox[0.25\textwidth]{\ttfamily innertheme.sty}\framebox[0.25\textwidth]{\ttfamily outertheme.sty} - - \hfill\framebox[0.5\textwidth]{\ttfamily sjtucolordef.sty}\hspace*{0.25\textwidth} - - \hfill\framebox[0.5\textwidth]{\ttfamily sjtuvishape.sty} - - \hfill\framebox[0.5\textwidth]{\ttfamily logo.pdf} - \end{figure} - - \subsection{Theme} - - The main theme file \texttt{beamerthemeSJTUBeamermin.sty} is the entry point of the theme template. For users, after acquiring the \textsf{beamer} package, \verb"\usetheme" command will serve as the caller of the theme. - \begin{verbatim} - \documentclass{beamer} - \mode - \usetheme{SJTUBeamermin} - \end{verbatim} - - And this file will preprocess the option passed to the theme. Some options will be affected immediately, while others will get processed in the sub-style files. - - \begin{figure}[h] - \fbox{\parbox{0.4\textwidth}{\vskip2pt\texttt{theme.sty}\par - \parbox{0.49\textwidth}{lang}\par - \parbox{0.49\textwidth}{cjk}\par - \parbox{0.49\textwidth}{gbt}\par - \parbox{0.49\textwidth}{\emph{other settings}} - \vskip2pt}} - \parbox{0.6\textwidth}{ - \fbox{\parbox{0.55\textwidth}{\texttt{colortheme.sty}\hfill color}}\par - \fbox{\parbox{0.55\textwidth}{\texttt{fonttheme.sty}}}\par - \fbox{\parbox{0.55\textwidth}{\texttt{outertheme.sty}\hfill pattern,navigation,lang}}\par - \fbox{\parbox{0.55\textwidth}{\texttt{innertheme.sty}\hfill pattern,color,lang}} - } - \end{figure} - - And this version meets the standingfree criteria. All source files could be used seperatly from version 1.0. - - \subsection{Color} - - The color style file \verb"beamercolorthemeSJTUBeamermin.sty" is the color setup of the template. Most color schemes are derived from the basic color of SJTU VI\cite{viman}. And to adapt the color definitions of \textsf{beamer}, the corresponding interface is mapped, see 17.2 in \cite{beamerman}. - - \begin{table}[h] - \centering - \begin{tabular}{>{\ttfamily}l>{\ttfamily}l>{\ttfamily}c>{\ttfamily}c} - interface & color= & red & blue \\ - palette primary & cprimary &\#004098 & \#9E1F36 \\ - palette secondary & csecondary &\#298626 & \#F28101 \\ - palette tertiary & ctertiary &\#004D4B & \#FED201 \\ - palette quanternary & cquanternary & \#FFFFFF & \#000000 \\ - \end{tabular} - \end{table} - - As it is mapped to those beamer interfaces, to use the color, you have to declare the color struct first by - \begin{verbatim} - \usebeamercolor{palette primary} - \color{palette primary.bg} - \end{verbatim} - or simply - \begin{verbatim} - \usebeamercolor[bg]{palette primary} - \end{verbatim} - - However, there are scenarios where you cannot put temporary variables in some package options since it expands to \verb"\color{\color{mycolor}}". In this complex case, the redefinition of those standard colors is required. And that's the reason why \verb"innertheme.sty" gets \verb"color". - - \subsection{Font} - - The font style file \verb"beamerfontthemeSJTUBeamermin.sty" provides the font style of the beamer. In \themename{}, serif math font is used by - \begin{verbatim} - \usefonttheme{professionalfonts} - \end{verbatim} - which will tell \textsf{beamer} not to meddle with the specific font (in this case, math font) to the sans serif one. - - It is especially useful if you don't want to create more compilation errors since some engine doesn't support sans serif math font. The workaround for that is to introduce the package below: - \begin{verbatim} - \RequirePackage[eulergreek]{sansmath} - \end{verbatim} - - And \themename{} does both. - - \subsection{Outer} - - The outer style file \verb"beamerouterthemeSJTUBeamermin.sty" contains the layout of frames. The recommended setup is as follows: - \begin{table}[h] - \centering - \begin{tabular}{lc} - \bfseries Components & \themename \\ - head- and footline & $\bullet $ \\ - sidebars & \\ - logo & $\bullet$ \\ - frame title & $\bullet$\\ - \end{tabular} - \end{table} - - \subsection{Inner} - - The inner style file \verb"beamerinnerthemeSJTUBeamermin.sty" will customize the main components. - \begin{table}[h] - \centering - \begin{tabular}{lc} - \bfseries Components & \themename \\ - Title and part pages & $\bullet $ \\ - Itemize & $\bullet $ \\ - Enumerate & \\ - Description & \\ - Block & $\bullet $ \\ - Theorem and proof & \\ - Figures and tables & $\bullet$ \\ - Footnotes & $\bullet$ \\ - Bibliography entries & \\ - \end{tabular} - \end{table} - - Outer theme and inner theme are the core files for \themename{}, which will be discussed in the following content. - - \section{Compatibility} - - Since the vision of \LaTeX{} is to build an open-source typesetting system for multi-platforms and \textsf{beamer} is on top of that to create an easy-to-configure interface on building presentations, \themename{} follows the footstep to make its best on compatibility. - - \subsection{Beamer Interface}\label{sec:beamer} - - \textsf{Beamer} has designed a system of modern interfaces for those theme creators. \themename{} has already followed the modular architecture, as is shown in Section \ref{sec:moarch}. - - And there are more APIs in \textsf{beamer} for each corresponding theme style. There are mainly three ways to modify a theme: - \begin{enumerate} - \item \textbf{Want to use presets.} Read Part \uppercase\expandafter{\romannumeral3} in the documentation of \textsf{beamer} package \cite{beamerman}. You can acquire the doc by the terminal command: - \begin{verbatim} - texdoc beamer - \end{verbatim} - Then, you could choose to use some preset theme, or call the macro to control the appearance of each component. - \item \textbf{Want a complete modification.} Read the source code of \textsf{beamer} package \cite{beamerman}. If no additional theme is used, \textsf{beamer} will assume you are creating a theme from \verb"default". And refer to the corresponding theme file suffixed by \verb"default" will give you the bottom mechanism to implement components. - \item \textbf{Want to solve difficult problems.} Go to \TeX{} Stack Exchange \cite{texsc} for help. Always search before you ask. Then you could probably find some patches and magical formulas to tackle the issue since \TeX{} is a Turing-complete language. - \end{enumerate} - - \subsection{Mainstream Packages}\label{sec:mainstream} - - Mainstream \LaTeX{} packages are used to make sure the choice on marcos is maintained currently. Since some engine doesn't support \textsf{GhostScript} well (\emph{e.g.} Xe\LaTeX{}), \themename{} (as well as \textsf{beamer}) uses \textsc{pgf} as the backend for graphics in \textsf{PostScript}. And half of the jobs are done on graphics to implement the requirements of VI. - - \themename{} doesn't use too many rasterized pictures, since they are not flexible. You could get the Adobe Illustrator files on VI website\cite{viman}. SJTU VI goes minimalism so that it could be implemented by package Ti\emph{k}Z (which is on top of \textsc{pgf}). You could almost draw any vectorized shapes by referring to Ti\emph{k}Z documentation \cite{tikzman}. In short, Ti\emph{k}Z uses node-edge system to create graphs and many Computer Science pictures can be drawn in such a system\cite{tikztuna}. And if you don't want to mess around with the thousand pages of documentation, Ti\emph{k}ZEdt could help you create that in a WYSIWYG(what you see is what you get) way\cite{tikzedt}, which is a tool to make drafts on patterns. - - \themename{} also uses additional packages like \textsc{pgfplots} and \textsc{PgfplotsTable} to draw highly personalized statistic graphs and layout table from CSV (Comma-Seperated Values) respectively. As is mentioned, the author created a tool \textsc{PgfplotsEdt} to help such graphs in an interactive way\cite{pgfedt}. - - Code blocks are drawn by package \textsf{tcolorbox}, which is also a powerful toolkit to make customized boxes\cite{tcolorbox}. This is almost the most elegant way to make colorful boxes in the current \LaTeX{} system. - - Some of the packages have been studied by author in \LaTeX{} Sparkle Project\cite{lsp3}. You can check that out to learn more. - - \subsection{Engine Support} - To be clear, \themename{} is not adapt to all kinds of compilers in the current \LaTeX{} world. - \begin{table}[h] - \begin{center} - \begin{tabular}{ccc} - & Windows & Unix \\ - pdf\LaTeX{}(C\TeX{}) & $\surd$ & \\ - pdf\LaTeX{}(CJK) & $\surd$ & $\surd$ \\ - Xe\LaTeX{} & $\diamondsuit$ & $\surd$ \\ - Lua\LaTeX{} & $\diamondsuit$ & $\diamondsuit$\\ - \end{tabular} - \vskip 3pt\moveright 1in\vbox{\hrule width3cm \vskip 3pt - \moveleft 0em \hbox{$^*\surd$ is fully available, while $\diamondsuit$ will have font issues.} - } - \end{center} - \end{table} - - \themename{} make its effort on engine support in the following ways: - \begin{enumerate} - \item \textbf{Use \textsf{beamer} interface.} As is mentioned in Section \ref{sec:beamer}, \themename{} will not create its macro unless there is no substitute in the current version of \textsf{beamer} or it is a common method to implement some features. A good example for this is to make a bottom page, \themename{} mimicked \verb"\maketitle" command to implement \verb"\makebottom" command. A good outcome is that the style file could be separately used with low coupling. - \item \textbf{Use mainstream packages.} Mentioned in Section \ref{sec:mainstream}, mainstream packages are widely accepted in many engines. Some top-level marcos are used to increase the readability of the source code, i.e., \textsc{pgf} is lengthy and hard to be maintained. - \item \textbf{Use old-fashioned \TeX{} code.} If there is a nice way to implement in \TeX{}, then go \TeX{}. \TeX{} is a box-based typesetting system, which may be mentioned in many Computer Science books. And \LaTeX{} is on top of that to provide clear-to-read macros. In some scenarios, the native \verb"\vbox" and \verb"\hbox" command could help calculate the position of characters in a more controllable way. But it is certainly painful to learn. The \TeX{} Book\cite{texbook} is the classic to learn that, but Notes On Programming in \TeX{}\cite{texnote} is more recommended in modern \LaTeX{}. - \end{enumerate} - - \section{Implementation} - - Now, you may still be confused about how to create a beamer template. Here is a good material about it for a lead-in\cite{tex2017}, which provides a brief overview. And this part is only focusing on the implementation of \themename{}. - - \DocInput{beamercolorthemesjtubeamermin.dtx} - \DocInput{beamerfontthemesjtubeamermin.dtx} - \DocInput{beamerinnerthemesjtubeamermin.dtx} - \DocInput{beamerouterthemesjtubeamermin.dtx} - \DocInput{beamerthemesjtubeamer.dtx} - - The following code is merely an implementation of SJTU VI, which doesn't change the ownership of the design pattern. Any commercial usage should be acknowledged by the related administration of SJTU. - \DocInput{sjtuvi.dtx} - - \vfill - - \begin{center} - \Large Good Luck with \themename{} ! - \vskip 1em - - \normalsize\hskip5cm Developer - \vskip 1pt\moveright 1in\vbox{\hrule width7cm \vskip 3pt - \moveleft 0em \hbox{Log Creative}} - \end{center} - - \vfill - - \bibliography{dev} - - \vfill - - \scriptsize - - Copyright 2021 Log Creative \& \LaTeX{} Sparkle Project - - Licensed under the Apache License, Version 2.0 (the ``License''); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - \href{http://www.apache.org/licenses/LICENSE-2.0}{http://www.apache.org/licenses/LICENSE-2.0} - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an ``AS IS'' BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - The Current Maintainer of this work is Log Creative. - - \vfill - -\end{document} diff --git a/src/doc/sjtubeamermintheme.tex b/src/doc/sjtubeamermintheme.tex deleted file mode 100644 index 717ddad0..00000000 --- a/src/doc/sjtubeamermintheme.tex +++ /dev/null @@ -1,360 +0,0 @@ -\documentclass[a4paper,12pt]{article} -\usepackage{ctex} -\usepackage{amsthm} -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{geometry} -\usepackage{graphicx} -\usepackage{array} -\usepackage{subfigure} -% \usepackage{gbt7714} -\usepackage{appendix} -\usepackage{listings} -\usepackage{xcolor} -\usepackage{tikz} -\usepackage{float} -\usepackage{tcolorbox} -\usepackage[ruled,vlined,commentsnumbered]{algorithm2e} -\usepackage{multicol} -\usepackage{pgfplots} -\pgfplotsset{compat=1.17} -\usepackage{indentfirst} -\usepackage{enumitem} -\usepackage[colorlinks,linkcolor=blue,anchorcolor=blue,citecolor=blue]{hyperref} -\hypersetup{unicode} % to display the unicode char in the bookmark correctly -\usepackage{bookmark} % should be introduced after package hyperref -\usepackage{listings} -% \setlength{\parskip}{1ex} -\setenumerate[1]{itemsep=0pt,partopsep=0pt,parsep=\parskip,topsep=5pt} -\setitemize[1]{itemsep=0pt,partopsep=0pt,parsep=\parskip,topsep=5pt} -\setdescription{itemsep=0pt,partopsep=0pt,parsep=\parskip,topsep=5pt} -\geometry{left=2.0cm,right=2.0cm,top=2.0cm,bottom=2.0cm} -\renewcommand{\figurename}{图} -\renewcommand{\tablename}{表} -\renewcommand{\contentsname}{目录} -\tcbuselibrary{raster} -\tcbuselibrary{skins} -\tcbuselibrary{documentation} - -\begin{document} -\title{\textsf{SJTUBeamer} \fbox{\textsc{min}} 样式手册} -\author{Log Creative} -\date{v1.4 \today} -\maketitle - -\tableofcontents % generate contents - -\clearpage - -\section{简介} - -\textsf{SJTUBeamer} \fbox{\textsc{min}} 样式为上海交通大学幻灯片模板的 \LaTeX{} 非官方实现版本,是符合\href{http://vi.sjtu.edu.cn/}{上海交通大学视觉形象识别系统}相关规范的最小工作集,图标版权归上海交通大学所有,本项目仅供校内人员学习参考使用。 - -目前该样式处于正式发布版本, 欢迎通过拉取请求对本模板提出修改建议。 - -\section{编译} - -该模板的使用范例代码请见 \href{https://github.com/LogCreative/SJTUBeamer/blob/main/doc/red.tex}{测试文件}。您可以使用 \href{https://www.overleaf.com/latex/templates/sjtubeamermin/shxnnnjjgqvp}{在线版本} 。 - -使用 \href{https://github.com/LogCreative/SJTUBeamer/generate}{\texttt{Use This Template}} 按钮可以将本存储库附带的 Github Actions 自动编译设置同时拷贝,在提交修改 \verb"main.tex" 文件后会自动编译出 PDF 文件,置于 Github Actions 详情页面的 Artifacts 一栏。 - -如果需要本地运行,可以采用 \verb"l3build" 安装: -\begin{verbatim} - l3build ctan - l3build install -\end{verbatim} - -有些系统不支持上述方法,可以采用老版解包方法: -\begin{verbatim} - cd source - latex beamerthemesjtubeamermin.ins -\end{verbatim} -按照提示将输出文件放置在需要调用的文件同一目录下。 - -可以直接使用 \verb"latexmk" 编译。为了编译出目录,需要编译两次;如果需要编译出参考文献,则需要按照下面的顺序编译: -\begin{quotation} - \LaTeX{} $\rightarrow$ \textsc{Biber} $\rightarrow$ \LaTeX{} $\rightarrow$ \LaTeX{} -\end{quotation} -如果使用 VS Code,可以右键总文件夹,选择 \textbf{通过 Code 打开} 加载配置。如果没有对参考文献做出更多的修改时,可以直接使用一次编译刷新即可。当然也可以使用草稿模式 \verb"draft" 快速预览内容。 - -\section{选项} - -\begin{docKey*}[SJTUBeamermin]{navigation}{=tools|subsections|pages}{默认 \texttt{tools}} - 导航栏选项。默认为 \verb"tools",即工具栏与页码组合。设置为 \verb"subsections",将会产生子章节的跳转进度条。设置为 \verb"pages",将仅显示页码信息。 -\end{docKey*} - -\begin{docKey*}[SJTUBeamermin]{lang}{=cn|en}{默认 \texttt{cn}} - 语言选项,并决定校徽是中文校徽,还是英文校徽。校标使用\href{http://vi.sjtu.edu.cn/index.php/articles/base/4}{\textbf{校标组合的最小使用规范 A4-11}}的 18mm修正稿。安全空间满足\href{http://vi.sjtu.edu.cn/index.php/articles/base/4}{\textbf{校标组合的安全空间 A4-12}}的 $\frac{1}{5}$ 校标高度规定。注意,启用 \texttt{en} 将会导致中文包不会被加载,因为使用英文徽标时,幻灯片内容推荐为英文。 -\end{docKey*} - -\begin{docKey*}[SJTUBeamermin]{cjk}{=false|true}{默认 \texttt{false}} - 是否使用 \textsf{CJK} 宏包。如果开启此选项,请使用 \verb"\begin{CJK}{UTF8}{hei}" 和 \verb"\end{CJK}" 包裹 \verb"document" 环境中的内容。 -\end{docKey*} - -\begin{docKey*}[SJTUBeamermin]{color}{=blue|red}{默认 \texttt{blue}} - 使用蓝色或红色的颜色主题。根据官方学术版模板 \href{http://vi.sjtu.edu.cn/index.php/articles/app/8}{\textbf{B2-02-02}} 的相关说明,极简版式适合场合较为严肃、不适合题图复杂图片出现的情况,如需使用,建议所有内页均使用极简版式,以达到简洁、清爽的效果。故默认情况下本模板使用蓝色主题。 -\end{docKey*} - -\begin{docKey*}[SJTUBeamermin]{pattern}{=none|title|all}{默认 \texttt{title}} - 使用印记矩阵底纹。默认为 \verb"title",将会在标题页添加由 \href{http://vi.sjtu.edu.cn/index.php/articles/base/5}{\textbf{A5-03-01 辅助图形使用规范}} 规定的印记矩阵底纹,并采用了渐变底色的方式实现。如果选项为 \verb"none",就不会产生底纹;如果选项为 \verb"all",还会在每页的标题栏添加底纹,这可能会增加编译时间。 - - 现在,每一节开始的页上都会自动添加底纹。 -\end{docKey*} - -\begin{docKey*}[SJTUBeamermin]{gbt}{=false|bibtex|true}{默认 \texttt{false}} - 是否采用 GBT7714-2015 标准引用文献。推荐使用 \href{https://www.jabref.org/}{\textbf{JabRef}} 管理参考文献。 - - \paragraph{\texttt{false}} 默认不采用,并使用 \verb"biblatex" 语法添加引用文件 - \begin{verbatim} - % premable - \addbibresource{ref.bib} % gbt!=bibtex - \end{verbatim} - 并采用使用脚注的引用。此时不需要再另起参考文献的章节,当然,如果需要附上参考文献,使用下面的语句在正文插入: - \begin{verbatim} - % in document - \printbibliography[title=参考文献] % gbt!=bibtex - \end{verbatim} - \paragraph{\texttt{bibtex}} 开启为 \verb"bibtex" 需要使用老式的 \textsc{Bib\TeX{}} 编译参考文献,并注释掉上述语句,使用下面的编译顺序: - \begin{quotation} - \LaTeX{} $\rightarrow$ \textsc{Bib\TeX{}} $\rightarrow$ \LaTeX{} $\rightarrow$ \LaTeX{} - \end{quotation} - 在正文中添加引用文件: - \begin{verbatim} - % in document - \bibliography{ref.bib} % gbt=bibtex - \end{verbatim} - 启用本选项也会导致 \verb"\cite" 命令不再被重定向到 \verb"\footfullcite"(使用脚注的引用)。 - \paragraph{\texttt{true}} 使用 \verb"biblatex-gbt7714-2015" 样式,但是需要采用 \textsc{Xe}\LaTeX{} 或 Lua\LaTeX{} 编译,采用与 \verb"false" 一样的语句(本引用样式暂时不支持 pdf\LaTeX{})。本模板目前暂时没有为这两种引擎的编译做优化,字体会有差别(*nix 系统上推荐使用\textsc{Xe}\LaTeX{})。特别是 Lua\LaTeX{} 编译速度较慢,暂时不推荐使用。 - % 本模板已经使用 \verb"biblatex" 宏包作为参考文献的用户接口,所以不必使用老式 \textsc{Bib\TeX{}} 语法打印参考文献。修改 \verb"\addbibresource{ref.bib}" 更改参考文献目录,修改 \verb"\printbibliography[title=参考文献]" 中的 \verb"title" 属性可以更改参考文献的标题。 -\end{docKey*} - -% \begin{docKey*}[SJTUBeamermin]{logo}{=\marg{logo path}}{默认留空} -% 自定义 logo 的路径。使用统一的接口以控制其在不同页面的大小(如果您执意要使用 \verb"\logo" 命令,推荐将高度设置为 0.7cm)。对于有自定义的二级机构 logo 时该命令比较有用,以及在试验其他的配色方案时可以采用高对比颜色的 logo,比如下面的选项设置即可载入红色 logo: -% \begin{verbatim} -% [logo=vi/cnlogored.pdf] -% \end{verbatim} -% \end{docKey*} - -\section{环境} - -\begin{docEnvironment*}[doc parameter=\oarg{listing options}\marg{title}, doclang/environment content=code]{codeblock}{} - 代码块。第一个参数是向 \verb"listing" 宏包传递的参数,可以通过使用 \verb"[language=c++]"指定语言,第二个参数为代码块的标题。参数可以用 \verb"{}" 留空,但不要省略大括号。需要清理代码的缩进。注意代码块所在的幻灯片需要添加 \verb"fragile" 参数,也就是 \verb"\begin{frame}[fragile]"。 -\end{docEnvironment*} - -\begin{docEnvironment*}[doclang/environment content=code]{stampbox}{\oarg{bordercolor}} - 图片印记边框盒。根据 \href{http://vi.sjtu.edu.cn/index.php/articles/base/5}{\textbf{A5-03-02 辅助图形使用规范}},可以使用辅助图形添加辅助边。这里采用了单一的印记边框线条,而没有使用填充式。该样式符合官方学术版模板 \href{http://vi.sjtu.edu.cn/index.php/articles/app/8}{\textbf{B2-02-02}} 的示例。\meta{code} 为需要包裹的内容。该边框盒不是强制使用的,主要为了丰富视觉效果与统一视觉形象。本模板通过程序自动生成边栏样条,不需要通过缩放方式对提供的样条进行适配。 - - \oarg{bordercolor} 用于指定边框颜色。默认使用主题色,也可以指定一种颜色。 -\end{docEnvironment*} - -\begin{docEnvironment*}[doclang/environment content=code]{axis}{} - 插入原生统计图。该模板对于使用 \textsf{PGFPlots} 生成的统计图进行了样式统一,主要改变了配色方案为当前主题,适当改变了线宽设定。高度默认为 0.5 倍页高。 - % 由于统计图一般需要通过一些说明文字进行解释,所以在使用双栏版式时统计图的宽度将会被自动设定为栏宽。 - 作者也制作了一个 \href{https://logcreative.github.io/PGFPlotsEdt/index.html?lang=cn}{\textbf{PGFPlots 统计绘图编辑器}},便于自动生成产生该类型统计图的 \LaTeX{} 代码,关于 \textsf{PGFPlots} 宏包的使用提示也可以在 \href{https://logcreative.github.io/LaTeXSparkle/}{像模像样\LaTeX} 的 \href{https://logcreative.github.io/LaTeXSparkle/src/art/chapter06.html}{第六节} 找到。 -\end{docEnvironment*} - -\section{命令} - -\begin{docCommand*}[]{institute}{\oarg{shortname}\marg{name}} - 二级机构名称。添加本条命令将会按照 \href{https://vi.sjtu.edu.cn/index.php/articles/base/4}{\textbf{A4-08 二级机构中英文名称横式混合}} 对标题页的徽标与二级机构组合。其中\marg{name}为机构的中文全称,而\oarg{shortname}为机构的英文全称。当语言被设定为英文时,将会只显示英文全称并可以使用换行符号 \verb"\\" 对长名称换行。 -\end{docCommand*} - -\begin{docCommand*}[]{logo}{\marg{pictureenv}} - logo 路径。添加本项可以自定义 logo 图片,在标题页中将会放置高度 1cm 的 logo,在页内将会放置高度 0.7cm 的 logo。对于有自己徽标的二级机构,可以参照 \href{https://vi.sjtu.edu.cn/index.php/articles/base/4}{\textbf{A4-10-01 衍生应用中英文标准字组合}} 设置成自定义徽标文件的路径,必要时关闭 \verb"\institute" 命令。 -\end{docCommand*} - -\begin{docCommand*}[]{titlegraphic}{\marg{pictureenv}} - 标题页的附加图片。添加本项让幻灯片标题页更加个性化,在标题页右下角会出现插入的图片,并可以采用 \verb"stampbox" 印记边框包裹起来。 -\end{docCommand*} - -\begin{docCommand*}[]{part}{\marg{part name}} - 部分页。当一个幻灯片过长时,可以使用部分将幻灯片切割为多个部分,每一部分的小节信息是相互独立的。本模板提供了对应的部分页模板,并在插入部分信息后自动生成一个部分页。部分页将不会包含底端导航信息,而是在紧跟章节名后添加本部分内的小节导航条。 -\end{docCommand*} - -\begin{docCommand*}[]{sectionpage}{} - 节页。可以通过手动添加 \verb"\frame{\sectionpage}" 的方式添加当前节的提示页。 -\end{docCommand*} - -\begin{docCommand*}[]{subsectionpage}{} - 小节页。可以通过手动添加 \verb"\frame{\subsectionpage}" 的方式添加当前小节的提示页。本模板在小节页上既显示节的信息,也会显示小节的信息,因为小节作为节的组成部分,应当附属节的名称。如果希望在每一个小节前都添加一个小节页的话,可以在开始的部分添加如下的代码: - \begin{verbatim} -\AtBeginSubsection[]{ - \begin{frame} - \subsectionpage - \end{frame} -}\end{verbatim} - 可以作为新的目录形式。更为传统的方法是显示该节在整个部分的位置: - \begin{verbatim} -\AtBeginSubsection[]{ - \begin{frame} - \tableofcontents[currentsection,currentsubsection] - \end{frame} -}\end{verbatim} - 两者都是可行的。 -\end{docCommand*} - -\begin{docCommand*}[]{pgfplotstabletypeset}{\marg{file}} - 通过文件插入表格。这里默认表格文件为逗号分隔符格式(\verb".csv"),这种格式的表格可以通过 Excel 等外部软件导出而不必在 \LaTeX{} 内手动排版。本模板对于该类型插入的表格进行了样式统一,使用通用的三线表格并对表头使用主题颜色,一定程度上参考了 \href{https://vi.sjtu.edu.cn/index.php/articles/app/7}{\textbf{B1-16-01 档案袋}} 的表格设定。 -\end{docCommand*} - -\begin{docCommand*}[]{alert}{\marg{text}} - 强调文字,采用主色作为强调色。 -\end{docCommand*} - -以下命令不是 \textsf{Beamer} 的通用命令,迁移套用其他模板时请注释掉。 - -\begin{docCommand*}[]{emph}{\marg{text}} - 强调文字,采用主色与二级色的中间色作为强调色。作为从文档类迁移的兼容接口。 -\end{docCommand*} - -\begin{docCommand*}[]{highlight}{\marg{text}} - 高亮文字,采用主色底矩形、白色文字以产生高亮的效果。 -\end{docCommand*} - -\begin{docCommand*}[]{paragraph}{\marg{text}} - 段落开始,但这里被重定向到了 \verb"\highlight" 命令,用于生成主色底矩形的强调条目。作为从文档类迁移的兼容接口。 -\end{docCommand*} - -\begin{docCommand*}[]{makebottom}{} - 制作封底。本模板提供了 \href{https://vi.sjtu.edu.cn/index.php/articles/app/7}{\textbf{B1-20-01 文件封套(封面封底)}} 样式的封底。右上角为学校徽标。左下角中文时,提示语为“谢谢”,英文时,提示语为``Thank You''。并且紧跟该幻灯片的作者与标题。 -\end{docCommand*} - -\begin{docCommand*}[]{stamparray}{\marg{size}\marg{starting point}\marg{ending point}} - 印记矩阵。用于在 \docAuxEnvironment*[]{tikzpicture} 环境内手动生成 \href{http://vi.sjtu.edu.cn/index.php/articles/base/5}{\textbf{A5-05 辅助底纹制作}} 规定的印记矩阵。其中,\meta{size} 用于定义印记大小,\meta{starting point},\meta{ending point} 用于定义矩形对角顶点,均为二维坐标 \verb"(x,y)"。 -\end{docCommand*} - -\newpage -\section{样式} - -\subsection{活力红} - -活力红版本,配色方案满足\href{http://vi.sjtu.edu.cn/index.php/articles/base/3}{\textbf{辅助色彩规范 A3-02-01}}。\hfill\texttt{color=red} - -\begin{tcbraster}[raster columns=3,colframe=red,colback=white, - colbacktitle=red!50!white,fonttitle=\small\bfseries\ttfamily, - left=0pt,right=0pt,top=0pt,bottom=0pt,boxsep=0pt,boxrule=0.6pt, - toptitle=1mm,bottomtitle=1mm,drop lifted shadow,center title, - graphics pages={1,...,12}] - \tcbincludepdf{red.pdf} -\end{tcbraster} - -\clearpage -\subsection{简约蓝} - -简约蓝版本,配色方案满足\href{http://vi.sjtu.edu.cn/index.php/articles/base/3}{\textbf{辅助色彩规范 A3-02-02}}。\hfill \texttt{color=blue} - -% \begin{tcbraster}[raster columns=3,colframe=blue,colback=white, -% colbacktitle=blue!50!white,fonttitle=\small\bfseries\ttfamily, -% left=0pt,right=0pt,top=0pt,bottom=0pt,boxsep=0pt,boxrule=0.6pt, -% toptitle=1mm,bottomtitle=1mm,drop lifted shadow,center title, -% graphics pages={1,...,12}] -% \tcbincludepdf{blue.pdf} -% \end{tcbraster} - -\clearpage -\subsection{其他样式} - -本模板具有一定的颜色样式去耦合,并根据 \href{http://vi.sjtu.edu.cn/index.php/articles/base/3}{\textbf{品牌专用色彩搭配表 A3-05}},通过在导言区再添加 \verb"\usecolortheme{beaver}" -对 \textsf{beamer} 内置颜色样式进行了测试,结果如下。 - -\begin{center} - \begin{tabular}{|>{\ttfamily}m{5em}|c|c|c|c|} - \hline - 模板参数 & 蓝主红标(BR) & 蓝主白标(BW) & 红主红标(RR) & 红主白标(RW) \\ - \hline - color= & \scriptsize\ttfamily blue & \scriptsize\ttfamily blue & \scriptsize\ttfamily red & \scriptsize\ttfamily red \\ - logo= & \scriptsize\ttfamily vi/cnlogored.pdf & &\scriptsize\ttfamily vi/cnlogored.pdf& \\ - \hline - \end{tabular} - - \begin{tabular}{|>{\ttfamily}m{5em}|c|c|c|c|} - \hline - 颜色主题 & 蓝主红标(BR) & 蓝主白标(BW) & 红主红标(RR) & 红主白标(RW) \\ - \hline - albatross & & $\cdot$ & & \\ - beaver & $\odot $ & & $\boxdot $ & \\ - beetle & & $\cdot$ & & $\cdot$ \\ - crane & $\odot $ & $\odot $ & $\odot $ & $\odot $ \\ - default & & $\oslash$ & & $\oslash$ \\ - dolphin & $\circ $ & $\odot $ & $\odot $ & $\cdot$ \\ - dove & $\circ$ & & $\circ$ & \\ - fly & $\cdot$ & $\cdot$ & $\cdot$ & $\cdot$ \\ - lily & $\circ$ & $\circ$ & $\circ$ & \\ - monarca & $\circ$ & $\circ$ & $\circ$ & $\circ$ \\ - orchid & & $\odot $ & & $\odot $\\ - rose & &$\circ$ & & $\circ$ \\ - seagull & $\boxdot$ & $\odot $ & $\boxdot$ & $\odot $ \\ - seahorse & $\boxdot$ & & $\boxdot$ & \\ - sidebartab & & $\oslash $ & & $\oslash $ \\ - spruce & $\boxdot$ & & $\boxdot$ & \\ - structure & & $\oslash $ & & $\oslash $\\ - whale & & $\odot $ & & $\boxdot $ \\ - \hline - \end{tabular} - - \begin{tabular}{|c|c|c|c|c|c|} - \hline - & $\cdot$ & $\circ$ & $\odot $ & $\oslash $ & $\boxdot$ \\ - \hline - 不通过 & 仅标题页通过 & 仅内容页通过 & 通过 & 通过但无影响 & 推荐 \\ - \hline - \end{tabular} -\end{center} - -更详细的信息参见 \verb"color" 文件夹。不通过的部分是违反规定的。即使是通过的部分也需要慎重使用,因为不再符合原本的规范。更为高级的方式是在行文过程中不断更换颜色主题,或者是手动添加对应的颜色配置。 - -\section{拓展阅读} -可以前往 \href{https://logcreative.github.io/LaTeXSparkle/}{像模像样\LaTeX} 的 \href{https://logcreative.github.io/LaTeXSparkle/src/art/chapter07.html}{第七节} 阅读有关 \verb"Beamer" 宏包使用的相关信息。 - -本模板与 \href{https://github.com/LogCreative/AutoBeamer/tree/pkg}{\textbf{内嵌版本的 \textsf{AutoBeamer}}} 幻灯片自动分割模块兼容。也可以使用 \href{https://logcreative.github.io/AutoBeamer/}{\textbf{\textsf{AutoBeamer} 在线版本}},并通过 \verb"\usetheme{SJTUBeamermin}" 使用本主题。 - -如果您有兴趣帮助开发本模板,可以参见 \href{https://github.com/LogCreative/SJTUBeamermin/blob/main/CONTRIBUTING.md}{本文件} 试着贡献代码。欢迎提供任何建议! - -% \clearpage - -% \section*{更名公告} - -% 已经注意到本模板的呼号与 \href{https://github.com/sjtug/SJTUBeamer}{SJTUG 维护版本} 一致的问题,为了避免未来发布时的命名冲突,本模板将会自发布版本($\beta$-0.8)更名为 \textsf{SJTUBeamer} \fbox{\textsc{min}},届时需要使用新版本模板的用户烦劳将模板调用行做出如下更正: -% \begin{verbatim} -% \usebeamertheme{SJTUBeamer} -> \usebeamertheme{SJTUBeamermin} -% \end{verbatim} - -% 给各位用户带来的不便深表歉意,也请期待 \href{https://logcreative.github.io/LaTeXSparkle/}{像模像样\LaTeX} 项目的更多内容,未来将视支持情况推出 max 版本。 - -% \begin{quotation}\itshape -% min - minimal: minimal work set of SJTU VI. - -% min - minimalism: designed in the style of minimalism. - -% min - minimum: minimum shapes to show your content. -% \end{quotation} - -% \noindent Log Creative\\敬上 - -\vfill - -\scriptsize - -Copyright 2021 Log Creative \& \LaTeX{} Sparkle Project - -Licensed under the Apache License, Version 2.0 (the ``License''); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - \href{http://www.apache.org/licenses/LICENSE-2.0}{http://www.apache.org/licenses/LICENSE-2.0} - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an ``AS IS'' BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -The Current Maintainer of this work is Log Creative. - -\vfill - -% If this document has no reference, -% please use pdfLaTeX compilation once. -%\bibliography{ref} - -\end{document} diff --git a/src/doc/thesis.bib b/src/doc/thesis.bib deleted file mode 100644 index 8af5f4f0..00000000 --- a/src/doc/thesis.bib +++ /dev/null @@ -1,14 +0,0 @@ -@article{thelegendofjiang, - title={《他改变了中国: 江泽民传》}, - author={罗伯特 and 劳伦斯 and 库恩}, - journal={中国企业家}, - number={5}, - pages={120--120}, - year={2005} -} - -@phdthesis{devoftech, - title={新时期我国信息技术产业的发展}, - author={江泽民}, - year={2008} -} diff --git a/src/source/beamercolorthemesjtubeamer.dtx b/src/source/beamercolorthemesjtubeamer.dtx index 2b760d38..b4087314 100644 --- a/src/source/beamercolorthemesjtubeamer.dtx +++ b/src/source/beamercolorthemesjtubeamer.dtx @@ -1,4 +1,4 @@ -% \iffalse meta-comment --------------------------------------------- +% \iffalse meta-comment -------------------------------------------------- % Copyright (C) 2021 SJTUG % % Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,18 +12,18 @@ % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % See the License for the specific language governing permissions and % limitations under the License. -% ------------------------------------------------------------------- \fi +% ------------------------------------------------------------------------ \fi % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamercolorthemesjtubeamer}[2021/08/26 sjtubeamer color theme v1.4.7] +\ProvidesPackage{beamercolorthemesjtubeamer}[2021/08/28 sjtubeamer color theme v1.5.0] % % \fi % \CheckSum{0} % \StopEventually{} % \iffalse %<*package> -% ------------------------------------------------------------------- \fi +% ----------------------------------------------------------------------- \fi % % \subsection{Color Theme} % @@ -53,7 +53,8 @@ % \end{macrocode} % % Intermediate color palette depending on the choice of color theme. -% Notice: inner theme has a replica of the following code. +% +% NOTICE: inner theme has a replica of the following code. % To fullfill with the standfree requirements. % \begin{macrocode} \if\EqualOption{color}{color}{red} @@ -132,7 +133,6 @@ % \end{macrocode} % % Set the footline color. -% % \begin{macrocode} \setbeamercolor{section in head/foot}{fg=white,bg=cprimary} \setbeamercolor{subsection in head/foot}{fg=cprimary,bg=cprimary!20} diff --git a/src/source/beamerfontthemesjtubeamer.dtx b/src/source/beamerfontthemesjtubeamer.dtx index ac12018e..5272398c 100644 --- a/src/source/beamerfontthemesjtubeamer.dtx +++ b/src/source/beamerfontthemesjtubeamer.dtx @@ -1,4 +1,4 @@ -% \iffalse meta-comment --------------------------------------------- +% \iffalse meta-comment -------------------------------------------------- % Copyright (C) 2021 SJTUG % % Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,18 +12,18 @@ % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % See the License for the specific language governing permissions and % limitations under the License. -% ------------------------------------------------------------------- \fi +% ------------------------------------------------------------------------ \fi % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerfontthemesjtubeamer}[2021/08/26 sjtubeamer font theme v1.4.7] +\ProvidesPackage{beamerfontthemesjtubeamer}[2021/08/28 sjtubeamer font theme v1.5.0] % % \fi % \CheckSum{0} % \StopEventually{} % \iffalse %<*package> -% ------------------------------------------------------------------- \fi +% ------------------------------------------------------------------------ \fi % % \subsection{Font Theme} % @@ -33,20 +33,6 @@ \RequirePackage{silence} \WarningFilter{latexfont}{Font shape} % \end{macrocode} -% Disable the warning from \verb"hyperref" which conflicts the setting in C\TeX{} or CJK. It has to be manually disabled. -% \begin{macrocode} -\def\Hy@WarnOptionDisabled#1{ - \def\next{#1}% - \ifx\next pdfauthor % - \ifx\next driverfallback % - \else - \Hy@Warning{% - Option `#1' has already been used,\MessageBreak - setting the option has no effect% - }\fi% - \fi% -} -% \end{macrocode} % % Use \verb"professionalfonts" font theme to compress all formula environments, which is in serif font style. % \begin{macrocode} diff --git a/src/source/beamerinnerthemesjtubeamer.dtx b/src/source/beamerinnerthemesjtubeamer.dtx index a9da9677..c0688ba0 100644 --- a/src/source/beamerinnerthemesjtubeamer.dtx +++ b/src/source/beamerinnerthemesjtubeamer.dtx @@ -1,4 +1,4 @@ -% \iffalse meta-comment --------------------------------------------- +% \iffalse meta-comment -------------------------------------------------- % Copyright (C) 2021 SJTUG % % Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,11 +12,11 @@ % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % See the License for the specific language governing permissions and % limitations under the License. -% ------------------------------------------------------------------- \fi +% ------------------------------------------------------------------------ \fi % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerinnerthemesjtubeamer}[2021/08/26 sjtubeamer inner theme v1.4.7] +\ProvidesPackage{beamerinnerthemesjtubeamer}[2021/08/28 sjtubeamer inner theme v1.5.0] % % \fi % \CheckSum{0} @@ -49,21 +49,36 @@ % \begin{macrocode} \RequirePackage{tcolorbox} % \end{macrocode} -% Table Supports. -% \begin{macrocode} -\RequirePackage{array} -\RequirePackage{colortbl} -\RequirePackage{booktabs} -% \end{macrocode} % % \subsubsection{Option Declaration} % \begin{macro}{\sjtubeamer@inner@cover} % \begin{macrocode} +%<*maxplus> \DeclareOptionBeamer{maxplus}{\def\sjtubeamer@inner@cover{maxplus}} +% +%<*max> \DeclareOptionBeamer{max}{\def\sjtubeamer@inner@cover{max}} +% +%<*min> \DeclareOptionBeamer{min}{\def\sjtubeamer@inner@cover{min}} +% +%<*my> \DeclareOptionBeamer{my}{\def\sjtubeamer@inner@cover{my}} % reserved for customization -\ExecuteOptionsBeamer{max} +% +\ExecuteOptionsBeamer{ +%<*maxplus> + maxplus, +% +%<*min> + min, +% +%<*my> + my, +% +%<*max> + max, +% +} % \end{macrocode} % \end{macro} % @@ -71,7 +86,8 @@ % \begin{macrocode} \DefineOption{inner}{lang}{cn} \DefineOption{inner}{lang}{en} -\ExecuteOptionsBeamer{cn} +\@ifclassloaded{ctexbeamer}{\ExecuteOptionsBeamer{cn}}{ + \ExecuteOptionsBeamer{en}} % \end{macrocode} % \end{macro} % @@ -103,10 +119,12 @@ \fi % \end{macrocode} % -% Change the color variable that controls the logo color to current main color of this theme. Since this template doesn't design a dark background for the contents (it is really not easy to handle with the dark background for some serious scenario). +% \begin{macro}{\sjtubeamer@logocolor} +% Change the color variable that controls the logo color to current main color of this theme. Since this template doesn't design a dark background for the contents (it is really not easy to handle with the contents for a dark background). % \begin{macrocode} \def\sjtubeamer@logocolor{cprimary} % \end{macrocode} +% \end{macro} % % \subsubsection{Load Packages} % @@ -120,44 +138,86 @@ % % \subsubsection{Title Page \& Bottom Page} % -% Define logo. +% \begin{macro}{\logo} +% Define logo. % \begin{macrocode} \usebeamercolor{palette primary} +%<*max> \if\EqualOption{inner}{cover}{max} \logo{\resizebox{!}{1cm}{\sjtubadge}} \else +% \if\EqualOption{inner}{lang}{cn} \logo{\resizebox{!}{0.7cm}{\cnlogo}} \else \logo{\resizebox{!}{0.7cm}{\enlogo}} \fi +%<*max> \fi +% % \end{macrocode} +% \end{macro} % +% \begin{macro}{\titlegraphic} % Define the title grahic image. % % NOTICE: if you are using your own title graphic, please use png image with predefined color and transparency. Since it is beyond the control of logo color system. Or you could use the provided command in the sjtuvi library to create your own masked picture in order to follow the logo color system (The provided picture should be white and transparent in the background). +% +% The background of max will be the same as the title graphic. % \begin{macrocode} +%<*maxplus> \if\EqualOption{inner}{cover}{maxplus} \titlegraphic{\includegraphics{sjtuphoto.jpg}} -\else\if\EqualOption{inner}{cover}{max} - \usebeamercolor{palatte primary} - \titlegraphic{\sjtubg[opacity=0.2]} - \setbeamertemplate{background} +\else +% +%<*max> + \if\EqualOption{inner}{cover}{max} + \usebeamercolor{palatte primary} + \titlegraphic{\sjtubg[opacity=0.2]} + \setbeamertemplate{background} { \let\oldlogocolor=\sjtubeamer@logocolor% \def\sjtubeamer@logocolor{cprimary!50} - \resizebox{\paperwidth}{!}{\inserttitlegraphic} + \vbox to \paperheight{ + \vfil + \hbox to \paperwidth{ + \hfil + \resizebox{\paperwidth}{!}{\inserttitlegraphic} + \hfil + } + \vfil + } \let\sjtubeamer@logocolor=\oldlogocolor% } -\else\if\EqualOption{inner}{cover}{min} - \titlegraphic{\includegraphics{sjtuphoto.jpg}} -\else - \titlegraphic{} - % - % Developer could define your title graphic here for "my"... - % -\fi\fi\fi + \else +% +%<*min> + \if\EqualOption{inner}{cover}{min} + \titlegraphic{\includegraphics{sjtuphoto.jpg}} + \else +% +%<*my> + % + % Developer could define your title graphic here for "my"... + % + \titlegraphic{} +% +%<*min> + \fi +% +%<*max> + \fi +% +%<*maxplus> +\fi +% +% \end{macrocode} +% \end{macro} +% +% Initialize sidebar width to 0pt as no sidebar required, which will be overwritten in outer theme. +% \begin{macrocode} +\newdimen\beamer@sidebarwidth +\beamer@sidebarwidth=0pt % \end{macrocode} % % \begin{macro}{\titlepage} @@ -165,7 +225,13 @@ % \begin{macrocode} \def\titlepage{ \let\oldlogocolor=\sjtubeamer@logocolor% - \usebeamertemplate*{title page} + \ifdim\beamer@sidebarwidth=0pt % + \usebeamertemplate*{title page} + \else + \hspace*{-0.5\beamer@sidebarwidth}\parbox[t]{\textwidth}{ + \usebeamertemplate*{title page} + } + \fi \let\sjtubeamer@logocolor=\oldlogocolor% } % \end{macrocode} @@ -190,7 +256,13 @@ % \begin{macrocode} \def\bottompage{ \let\oldlogocolor=\sjtubeamer@logocolor% - \usebeamertemplate*{bottom page} + \ifdim\beamer@sidebarwidth=0pt % + \usebeamertemplate*{bottom page} + \else + \hspace*{-0.5\beamer@sidebarwidth}\parbox[t]{\textwidth}{ + \usebeamertemplate*{bottom page} + } + \fi \let\sjtubeamer@logocolor=\oldlogocolor% } % \end{macrocode} @@ -227,6 +299,7 @@ % \end{macrocode} % % \subsubsection{Part Page} +% \begin{macro}{\partpage} % Define the \verb"part page" beamer template. % \begin{macrocode} \defbeamertemplate*{part page}{sjtubeamermin}[1][] @@ -264,7 +337,9 @@ \vfill } % \end{macrocode} +% \end{macro} % +% \begin{macro}{\part} % Redirect the part command to make a part page. % \begin{macrocode} \AtBeginPart{ @@ -273,6 +348,7 @@ \end{frame} } % \end{macrocode} +% \end{macro} % % \subsubsection{Section Page \& Subsection Page} % Define the common \verb"\sectionblock" command to make the section block. @@ -291,6 +367,7 @@ } % \end{macrocode} % +% \begin{macro}{\sectionpage} % Define the \verb"section page" beamer template. % \begin{macrocode} \defbeamertemplate*{section page}{sjtubeamermin}[1][] @@ -302,7 +379,9 @@ \vfill } % \end{macrocode} +% \end{macro} % +% \begin{macro}{\subsectionpage} % Define the \verb"subection page" beamer template. % \begin{macrocode} \defbeamertemplate*{subsection page}{sjtubeamermin}[1][] @@ -324,6 +403,7 @@ \vfill } % \end{macrocode} +% \end{macro} % % \subsubsection{Itemize Environments} % @@ -335,11 +415,19 @@ % \subsubsection{Block Environments} % % \begin{macrocode} +%<*maxplus> \if\EqualOption{inner}{cover}{maxplus}% \setbeamertemplate{blocks}[rounded] -\else\if\EqualOption{inner}{cover}{max}% - \setbeamertemplate{blocks}[rounded] -\fi\fi +\else +% +%<*max> + \if\EqualOption{inner}{cover}{max}% + \setbeamertemplate{blocks}[rounded] + \fi +% +%<*maxplus> +\fi +% % \end{macrocode} % % \begin{macro}{\highlight} @@ -515,6 +603,7 @@ % \end{macrocode} % % \subsubsection{Footnotes} +% \begin{macro}{\footnote} % Define the \verb"footline" beamer template. The format is slightly changed from the original beamer definition. % \begin{macrocode} \defbeamertemplate*{footnote}{sjtubeamermin} @@ -526,6 +615,7 @@ \hbox to 1.5em{\hfil\insertfootnotemark}\insertfootnotetext\par% } % \end{macrocode} +% \end{macro} % % \iffalse % diff --git a/src/source/beamerouterthemesjtubeamer.dtx b/src/source/beamerouterthemesjtubeamer.dtx index 46341ecf..85f0ce07 100644 --- a/src/source/beamerouterthemesjtubeamer.dtx +++ b/src/source/beamerouterthemesjtubeamer.dtx @@ -1,4 +1,4 @@ -% \iffalse meta-comment --------------------------------------------- +% \iffalse meta-comment -------------------------------------------------- % Copyright (C) 2021 SJTUG % % Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,11 +12,11 @@ % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % See the License for the specific language governing permissions and % limitations under the License. -% ------------------------------------------------------------------- \fi +% ------------------------------------------------------------------------ \fi % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerouterthemesjtubeamer}[2021/08/26 sjtubeamer outer theme v1.4.7] +\ProvidesPackage{beamerouterthemesjtubeamer}[2021/08/28 sjtubeamer outer theme v1.5.0] % % \fi % \CheckSum{0} @@ -41,6 +41,12 @@ \DefineOption{outer}{nav}{miniframes} \DefineOption{outer}{nav}{infolines} \DefineOption{outer}{nav}{sidebar} +\DefineOption{outer}{nav}{default} +\DefineOption{outer}{nav}{smoothbars} +\DefineOption{outer}{nav}{split} +\DefineOption{outer}{nav}{shadow} +\DefineOption{outer}{nav}{tree} +\DefineOption{outer}{nav}{smoothtree} \ExecuteOptionsBeamer{miniframes} % \end{macrocode} % \end{macro} @@ -54,21 +60,23 @@ \beamer@compresstrue % \end{macrocode} % -% Use the built-in outer templates. +% Use the built-in outer templates. If you want to take special care about one outer theme, please add a condition test on that theme. Otherwise, it will use the default configuration of the corresponding built-in outer theme. % \begin{macrocode} \if\EqualOption{outer}{nav}{miniframes} \useoutertheme[footline=institutetitle]{miniframes} -\else\if\EqualOption{outer}{nav}{infolines} - \useoutertheme{infolines} \else\if\EqualOption{outer}{nav}{sidebar} - \PackageWarning{outer}{ - Feature "sidebar" has not been implemented yet.\MessageBreak - Fallback to the default setting. - } - \useoutertheme[footline=institutetitle]{miniframes} -\fi\fi\fi + \useoutertheme{sidebar} +\else\useoutertheme{\sjtubeamer@outer@nav} +\fi\fi % \end{macrocode} % +% Color patch for shadow, smoothtrees. +% \begin{macrocode} +\setbeamercolor{frametitle}{use=titlelike,bg=white,fg=titlelike.fg} +\setbeamercolor{frametitle right}{parent=subsection in head/foot} +% \end{macrocode} +% +% % Add page number to the toolbox. % \begin{macrocode} \addtobeamertemplate{navigation symbols}{}{ diff --git a/src/source/beamerthemesjtubeamer.dtx b/src/source/beamerthemesjtubeamer.dtx index 799c5ef2..76648adc 100644 --- a/src/source/beamerthemesjtubeamer.dtx +++ b/src/source/beamerthemesjtubeamer.dtx @@ -1,4 +1,4 @@ -% \iffalse meta-comment --------------------------------------------- +% \iffalse meta-comment -------------------------------------------------- % Copyright (C) 2021 SJTUG % % Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +13,7 @@ % See the License for the specific language governing permissions and % limitations under the License. % -% ------------------------------------------------------------------- \fi +% ------------------------------------------------------------------------ \fi % \CheckSum{0} % \StopEventually{} % \iffalse @@ -37,7 +37,7 @@ % ------------------------------------------------------------------- \fi % \iffalse \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerthemesjtubeamer}[2021/08/26 sjtubeamer parent theme v1.4.7] +\ProvidesPackage{beamerthemesjtubeamer}[2021/08/28 sjtubeamer parent theme v1.5.0] % \fi % % \subsection{Parent Theme} @@ -66,15 +66,37 @@ % \item The final level should be the variable name itself. % \end{itemize} % \begin{macrocode} +%<*maxplus> \DeclareOptionBeamer{maxplus}{\def\sjtubeamer@cover{maxplus}} +% +%<*max> \DeclareOptionBeamer{max}{\def\sjtubeamer@cover{max}} +% +%<*min> \DeclareOptionBeamer{min}{\def\sjtubeamer@cover{min}} +% +%<*my> \DeclareOptionBeamer{my}{\def\sjtubeamer@cover{my}} % reserved for customization +% % \end{macrocode} % $\rightarrow$ Next, declare the initial configuration. % \begin{macrocode} -\ExecuteOptionsBeamer{max} +\ExecuteOptionsBeamer{ +%<*maxplus> + maxplus, +% +%<*min> + min, +% +%<*my> + my, +% +%<*max> + max, +% +} % \end{macrocode} +% \end{macro} % % \begin{macro}{\sjtubeamer@color} % Choose the main color palette. @@ -100,30 +122,34 @@ % \end{macro} % % \begin{macro}{\sjtubeamer@lang} -% Set the main language of this beamer. +% Set the main language of this beamer. If the user is using \verb"ctexbeamer" class, the default option will be Chinese. If the user use \verb"ctex" package after using this theme, such an advanced user should specify the language to Chinese manually. +% +% TODO: may be a built in support for Chinese will be used in the future. Just taken \verb"\RequirePackage[scheme=plain]{ctex}" for basic Chinese character support. % \begin{macrocode} \DeclareOptionBeamer{cn}{\def\sjtubeamer@lang{cn}} \DeclareOptionBeamer{en}{\def\sjtubeamer@lang{en}} -\ExecuteOptionsBeamer{cn} +\@ifclassloaded{ctexbeamer}{\ExecuteOptionsBeamer{cn}}{ + \ExecuteOptionsBeamer{en}} % \end{macrocode} % \end{macro} % % \begin{macro}{\sjtubeamer@nav} -% Decide the type of the navigation bar. -% \begin{description} -% \item[miniframes] shows the progress on subsection. -% \item[infolines] shows the page number and the document info. -% \item[sidebar] make a sidebar to display the TOC. -% \end{description} +% Choose the outer theme for this template. % \begin{macrocode} \DeclareOptionBeamer{miniframes}{\def\sjtubeamer@nav{miniframes}} \DeclareOptionBeamer{infolines}{\def\sjtubeamer@nav{infolines}} \DeclareOptionBeamer{sidebar}{\def\sjtubeamer@nav{sidebar}} +\DeclareOptionBeamer{default}{\def\sjtubeamer@nav{default}} +\DeclareOptionBeamer{smoothbars}{\def\sjtubeamer@nav{smoothbars}} +\DeclareOptionBeamer{split}{\def\sjtubeamer@nav{split}} +\DeclareOptionBeamer{shadow}{\def\sjtubeamer@nav{shadow}} +\DeclareOptionBeamer{tree}{\def\sjtubeamer@nav{tree}} +\DeclareOptionBeamer{smoothtree}{\def\sjtubeamer@nav{smoothtree}} \ExecuteOptionsBeamer{miniframes} % \end{macrocode} % \end{macro} % -% $\rightarrow$ Then, the user's option will be processed after this (at the end of this subsubsection). +% $\rightarrow$ Then, the user's option will be processed after this (at the end of this subsection). % \begin{macrocode} \ProcessOptionsBeamer % \end{macrocode} @@ -151,6 +177,6 @@ % % \iffalse % -% ------------------------------------------------------------------- \fi +% ------------------------------------------------------------------------ \fi % \Finale \endinput diff --git a/src/source/beamerthemesjtubeamer.ins b/src/source/beamerthemesjtubeamer.ins index c1b57265..b46a77c4 100644 --- a/src/source/beamerthemesjtubeamer.ins +++ b/src/source/beamerthemesjtubeamer.ins @@ -1,4 +1,4 @@ -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ %% Copyright (C) 2021 SJTUG %% %% Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,15 +12,16 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% ------------------------------------------------------------------- +%% ------------------------------------------------------------------------ \input docstrip.tex % \keepsilent \askforoverwritefalse -\usedir{tex/latex/mtheme} +\usedir{tex/latex/sjtubeamer} +\def\preserveoption{,maxplus,max,min,my} % reduce the option will reduce the related module extracting. Full option should be ",maxplus,max,min,my" \preamble -------------------------------------------------------------------- +------------------------------------------------------------------------ Copyright (C) 2021 SJTUG Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,14 +35,14 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------- +------------------------------------------------------------------------ \endpreamble \generate{\file{beamerthemesjtubeamer.sty}{% - \from{beamerthemesjtubeamer.dtx}{package}} + \from{beamerthemesjtubeamer.dtx}{package\preserveoption}} } \generate{\file{beamerinnerthemesjtubeamer.sty}{% - \from{beamerinnerthemesjtubeamer.dtx}{package}} + \from{beamerinnerthemesjtubeamer.dtx}{package\preserveoption}} } \generate{\file{beamerouterthemesjtubeamer.sty}{% \from{beamerouterthemesjtubeamer.dtx}{package}} @@ -54,7 +55,7 @@ limitations under the License. } \preamble -------------------------------------------------------------------- +------------------------------------------------------------------------ Copyright (C) Shanghai Jiao Tong University The definition in this file is refered to the Visual Identity System from Shanghai Jiao Tong University (SJTU). @@ -65,14 +66,14 @@ Any commercial usage in this file should be acknowledged by the administration of SJTU. More infomation about the license, see https://vi.sjtu.edu.cn/index.php/articles/bulletin/16. -------------------------------------------------------------------- +------------------------------------------------------------------------ \endpreamble \generate{\file{sjtucover.sty}{% - \from{sjtucover.dtx}{package}} + \from{sjtucover.dtx}{package\preserveoption}} } \generate{\file{sjtuvi.sty}{% - \from{sjtuvi.dtx}{package}} + \from{sjtuvi.dtx}{package\preserveoption}} } \obeyspaces @@ -95,9 +96,9 @@ see https://vi.sjtu.edu.cn/index.php/articles/bulletin/16. \Msg{* sjtubg.png *} \Msg{* *} \Msg{* To produce the documentation run the file *} -\Msg{* SJTUBeamermintheme.tex *} +\Msg{* sjtubeamertheme.tex *} \Msg{* For Development documentation, run the file *} -\Msg{* SJTUBeamermindevguide.tex *} +\Msg{* sjtubeamerdevguide.tex *} \Msg{* through XeLaTeX. *} \Msg{* *} \Msg{* Happy TeXing! *} diff --git a/src/source/sjtucover.dtx b/src/source/sjtucover.dtx index fcc2c1ee..b2969231 100644 --- a/src/source/sjtucover.dtx +++ b/src/source/sjtucover.dtx @@ -13,7 +13,7 @@ % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{sjtucover}[2021/08/26 cover library for sjtubeamer v1.4.7] +\ProvidesPackage{sjtucover}[2021/08/28 cover library for sjtubeamer v1.5.0] % % \fi % \CheckSum{0} @@ -34,57 +34,89 @@ % % \subsubsection{Option Declaration} % +% % \begin{macrocode} -\DefineOption{sjtucover}{cover}{maxplus} -\DefineOption{sjtucover}{cover}{max} -\DefineOption{sjtucover}{cover}{min} -\DefineOption{sjtucover}{cover}{my} % reserved for customization -\ExecuteOptionsBeamer{max} +%<*maxplus> +\DeclareOptionBeamer{maxplus}{\def\sjtubeamer@sjtucover@cover{maxplus}} +% +%<*max> +\DeclareOptionBeamer{max}{\def\sjtubeamer@sjtucover@cover{max}} +% +%<*min> +\DeclareOptionBeamer{min}{\def\sjtubeamer@sjtucover@cover{min}} +% +%<*my> +\DeclareOptionBeamer{my}{\def\sjtubeamer@sjtucover@cover{my}} % reserved for customization +% +\ExecuteOptionsBeamer{ +%<*maxplus> + maxplus, +% +%<*min> + min, +% +%<*my> + my, +% +%<*max> + max, +% +} \ProcessOptionsBeamer % \end{macrocode} +% % % \subsubsection{Title Page} % +% % \paragraph{maxplus.} % \begin{macrocode} +%<*maxplus> \defbeamertemplate*{title page}{maxplus}[1][] { \nointerlineskip% - \begin{beamercolorbox}[wd=\paperwidth, ht=\paperheight]{empty} + \vbox{} + \vfill + \begingroup \usebeamercolor{palette primary}% \def\sjtubeamer@logocolor{palette primary.fg} - \begin{tikzpicture} - \pgfmathsetlengthmacro{\outslant}{\the\paperwidth - 0.8cm} - \node[anchor=north west, inner sep=0, outer sep=0] - at (0,\the\paperheight){ - \resizebox{!}{\the\paperheight}{\inserttitlegraphic}}; - \fill[color=white] (0,0) rectangle(\the\paperwidth,3.9); - \fill[color=bg] (0,0) rectangle(\the\paperwidth,3.88); + \begin{tikzpicture}[overlay, + xshift=-0.12\paperwidth, + yshift=-0.53\paperheight] + \pgfmathsetlengthmacro{\outslant}{1.02\paperwidth} + \node[inner sep=0, outer sep=0] + at (0.57\paperwidth,0.5\paperheight){ + \resizebox{!}{1.06\paperheight}{\inserttitlegraphic}}; + \fill[color=white] (0,0) rectangle(1.1\paperwidth,3.9); + \fill[color=bg] (0,-0.1\paperheight) rectangle(1.1\paperwidth,3.88); \node[anchor=north west, text width=.8\paperwidth] - at (0.8,3.6){% - \usebeamercolor[fg]{title} - \ifx\insertsubtitle\@empty% - {\huge\bfseries\inserttitle}\\ - \else% - {\Large\bfseries\inserttitle}\\ - {\small\insertsubtitle}\\ - \fi% + at (0.11\paperwidth,3.6){% + \usebeamercolor[fg]{title} + \ifx\insertsubtitle\@empty% + {\huge\bfseries\inserttitle}\\ + \else% + {\Large\bfseries\inserttitle}\\ + {\small\insertsubtitle}\\ + \fi% }; - \node[anchor=south west, text width=.8\paperwidth] at (0.8,0.45){% - {\usebeamercolor[fg]{author}\small\insertauthor}\\ - {\usebeamercolor[fg]{institute}\small\insertinstitute}\\ + \node[anchor=south west, text width=.8\paperwidth] at (0.11\paperwidth,0.45){% + {\usebeamercolor[fg]{author}\small\insertauthor\par} + {\usebeamercolor[fg]{institute}\small\insertinstitute\par} {\usebeamercolor[fg]{date}\small\insertdate}% }; \node[anchor=south east, inner sep=0, outer sep=0] at (\outslant,0.5){ \resizebox{!}{1cm}{\insertlogo} }; \end{tikzpicture} - \end{beamercolorbox} + \endgroup + \vfill } +% % \end{macrocode} -% +% % \paragraph{max.} % \begin{macrocode} +%<*max> \defbeamertemplate*{title page}{max}[1][] { \nointerlineskip @@ -93,7 +125,7 @@ \def\sjtubeamer@logocolor{palette primary.fg} \begin{tikzpicture}[overlay] \fill [palette primary.bg] (-0.2*\the\paperwidth,-1*\the\paperheight) - rectangle (1*\the\paperwidth, 0.2*\the\paperheight); + rectangle (1*\the\paperwidth, 0.3*\the\paperheight); \node [inner sep=0pt] at (0.45\paperwidth-6pt,-0.4*\the\paperheight) {\resizebox{1.3\paperwidth}{!}{\inserttitlegraphic}}; @@ -124,11 +156,13 @@ \endgroup \vfill } +% % \end{macrocode} % % \paragraph{min.} % Declare two fadings: center fade and fade right. The center fade provides a radial fading on the right side of the title page. The fade right provides a linear fading to avoid the collision on the text in the left. % \begin{macrocode} +%<*min> \tikzfading[ name=center fade, inner color=transparent!0, @@ -268,10 +302,12 @@ \vskip0.5em \vfill } +% % \end{macrocode} -% +% % \paragraph{my.} % \begin{macrocode} +%<*my> \defbeamertemplate*{title page}{my}[1][]{ % % Developer could implement your own title page template here... @@ -286,6 +322,7 @@ \usebeamercolor{palette primary} \def\sjtubeamer@logocolor{palette primary.fg} } +% % \end{macrocode} % % \subsubsection{Bottom Page} @@ -293,60 +330,69 @@ % % \paragraph{maxplus.} % \begin{macrocode} +%<*maxplus> \tikzfading[name=fade right img, left color=transparent!20, right color=transparent!100] \defbeamertemplate*{bottom page}{maxplus}[1][] { \nointerlineskip + \vbox{} \begin{tikzpicture}[overlay] \usebeamercolor{palette primary} \fill[palette primary.bg] (-0.2\paperwidth,-\paperheight) rectangle (\paperwidth, 0.5\paperheight); \end{tikzpicture} - \begin{beamercolorbox}[wd=\paperwidth,center,sep=24pt]{title} - \LARGE \bfseries \bottomthanks - \end{beamercolorbox} - \begin{beamercolorbox}[wd=\paperwidth]{empty} + \vfill + \begin{beamercolorbox}[sep=0pt]{empty} \usebeamercolor{structure} \def\sjtubeamer@logocolor{white} - \begin{tikzpicture} + \begin{tikzpicture}[overlay,xshift=0.54\paperwidth,yshift=-0.41\paperheight] \begin{scope} - \clip (-0.64\paperwidth,0.08\paperheight) - rectangle (0.36\paperwidth,0.53\paperheight); - \node [anchor=north] at (0,0.6\paperheight+0.03\paperwidth) { - \resizebox{1.3\paperwidth}{!}{\inserttitlegraphic}}; + \clip (-0.66\paperwidth,0.06\paperheight) + rectangle (0.43\paperwidth,0.53\paperheight); + \node [anchor=north] at (0,0.645\paperheight) { + \resizebox{1.33\paperwidth}{!}{\inserttitlegraphic}}; \fill[structure.fg!50!black,path fading=fade right img] - (-0.64\paperwidth,0.08\paperheight) - rectangle (0.36\paperwidth,0.53\paperheight); - \node at (-0.45\paperwidth,0.31\paperheight) + (-0.66\paperwidth,0.06\paperheight) + rectangle (0.43\paperwidth,0.53\paperheight); + \node at (-0.45\paperwidth,0.3\paperheight) {\resizebox{!}{0.115\paperheight}{\insertlogo}}; - \draw[white] (-0.64\paperwidth,0.12\paperheight) - -- (0.36\paperwidth,0.12\paperheight); + \draw[white] (-0.66\paperwidth,0.1\paperheight) + -- (0.43\paperwidth,0.1\paperheight); \end{scope} + \node at (-0.13\paperwidth,0.7\paperheight) { + \usebeamercolor[fg]{title} + \LARGE \bfseries \bottomthanks + }; \end{tikzpicture} \end{beamercolorbox} + \vfill } +% % \end{macrocode} % % \paragraph{max.} % \begin{macrocode} +%<*max> \defbeamertemplate*{bottom page}{max}[1][] { \nointerlineskip + \vbox{} \usebeamercolor{palette primary} \usebeamercolor{structure} - \begin{tikzpicture}[overlay] + \begin{beamercolorbox}[sep=0pt]{empty} + \begin{tikzpicture}[overlay,yshift=0.25\paperwidth] \def\leftw{0.215\paperwidth} \def\midw{0.435\paperwidth} \def\rightw{0.655\paperwidth} - \fill[palette primary.bg] (-0.2\paperwidth,-\paperheight) - rectangle (\paperwidth, 0.5\paperheight); - \fill[palette primary.fg] (\leftw,0.5\paperheight) + \fill[palette primary.bg] (-0.2\paperwidth,-1.2\paperheight) rectangle + (\paperwidth, 0.1\paperheight); + \fill[palette primary.fg] (\leftw,0.1\paperheight) -- (\leftw,-0.5\paperheight) -- (\midw,-0.65\paperheight) -- (\rightw,-0.5\paperheight) - -- (\rightw,0.5\paperheight) -- cycle; + -- (\rightw,0.1\paperheight) -- cycle; \fill[palette primary.fg] (\leftw,-0.53\paperheight) -- (\leftw,-0.59\paperheight) -- (\midw,-0.74\paperheight) @@ -355,7 +401,7 @@ -- (\midw,-0.68\paperheight) -- cycle; \node at (\midw,-0.65\paperheight) { \def\sjtubeamer@logocolor{black} - \resizebox{1.2\paperwidth}{!}{\inserttitlegraphic}}; + \resizebox{1.25\paperwidth}{!}{\inserttitlegraphic}}; \node at (\midw,-0.2\paperheight) { \def\sjtubeamer@logocolor{palette primary.bg} \resizebox{3cm}{!}{\insertlogo}}; @@ -363,13 +409,14 @@ \usebeamercolor[bg]{palette primary} \LARGE \bfseries\bottomthanks}; \end{tikzpicture} - \begin{beamercolorbox}[wd=\paperwidth,ht=\paperheight,center]{empty} \end{beamercolorbox} } +% % \end{macrocode} % % \paragraph{min.} % \begin{macrocode} +%<*min> \defbeamertemplate*{bottom page}{min}[1][] { % \end{macrocode} @@ -421,10 +468,12 @@ \vskip3.5em \endgroup } +% % \end{macrocode} % % \paragraph{my.} % \begin{macrocode} +%<*my> \defbeamertemplate*{bottom page}{my}[1][] { % @@ -440,6 +489,7 @@ \usebeamercolor{palette primary} \def\sjtubeamer@logocolor{palette primary.fg} } +% % \end{macrocode} % % Initialize the title page and bottom page when the package is loaded. diff --git a/src/source/sjtuvi.dtx b/src/source/sjtuvi.dtx index 014f4b98..aa16ac23 100644 --- a/src/source/sjtuvi.dtx +++ b/src/source/sjtuvi.dtx @@ -13,7 +13,7 @@ % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{sjtuvi}[2021/08/26 Visual Identity System library for sjtubeamer v1.4.7] +\ProvidesPackage{sjtuvi}[2021/08/28 Visual Identity System library for sjtubeamer v1.5.0] % % \fi % \CheckSum{0} @@ -43,7 +43,7 @@ % Here, a dummy trick is used to pass the if condition. % Since LaTeX handles \verb"\if" differently. % \verb"\iftrue" will eliminate the nearest \verb"\else" and \verb"\fi" but remains other extra \verb"\fi" and throws errors. -% To avoid this, if the macro is expanded after \verb"\if", T=T, the condition holds and finish the current pair. And continues to process the real defined macro. This solution is somehow to combat against the LaTeX compiler. In modern LaTeX 3, it is not so nasty to deal with neseted conditions. +% To avoid this, if the macro is expanded after \verb"\if", \verb"T=T", the condition holds and finish the current pair. And continues to process the real defined macro. This solution is somehow to combat against the \LaTeX compiler. In modern \LaTeX 3, it is not so nasty to deal with neseted conditions. % \verb"\iffalse" doesn't need to be considered. % \begin{macrocode} \def\EqualOption{TT\fi\ifEqualOption} % dummy trick to pass the condition test @@ -86,13 +86,13 @@ % \end{macrocode} % % \subsubsection{Declare Logo} -% \begin{macro}{\maskcolor} +% \begin{macro}{\definelogo} % Define a mask picture to make its different color variants. % The first argument assigns the file name and the second sets the horizontal cropping and the third sets the vertical cropping. Notice that the cropping is symmetrical (double the length). When the horizontal cropping is greater than the vertical cropping, the mask will be placed by its height, otherwise by its width. The domain for both cropping parameters is 0 to 1. % You should define a logo \verb"\definelogo{mylogo}{}{}" then use it in the contents like: -% \verb"\mylogo[0.5]{white}", where the first optional parameter is the opacity and the second parameter is the color you want. +% \verb"\mylogo[white]", where the optional parameter could be the override color beyond the control of main logo color system or \verb"opacity=..." to identify the opacity you want or any other parameter for a TikZ node. % \begin{macrocode} -\newcommand{\maskcolor}[3]{ +\newcommand{\definelogo}[3]{ % #1: file % #2: horizontal clip (0~1) % #3: vertical clip (0~1) @@ -121,18 +121,19 @@ } % \end{macrocode} % \end{macro} -% WARNING: This library will define the initial color to be sjtuRedPrimary, remember to change the color variable after calling this package! +% +% WARNING: This library will define the initial color to sjtuRedPrimary, remember to change the variable after using this package! % \begin{macrocode} \def\sjtubeamer@logocolor{sjtuRedPrimary} % \end{macrocode} % Define the required logo. % \begin{macrocode} -\maskcolor{sjtubadge}{0}{0} -\maskcolor{cnlogo}{0.13}{0.75} -\maskcolor{enlogo}{0.13}{0.75} -\maskcolor{dlogo}{0}{0} -\maskcolor{vlogo}{0.8}{0.13} -\maskcolor{sjtubg}{0.3}{0.5} +\definelogo{sjtubadge}{0}{0} +\definelogo{cnlogo}{0.13}{0.75} +\definelogo{enlogo}{0.13}{0.75} +\definelogo{dlogo}{0}{0} +\definelogo{vlogo}{0.8}{0.13} +\definelogo{sjtubg}{0.3}{0.5} % \end{macrocode} % % @@ -196,9 +197,9 @@ % Notice \TeX{} is not good at handling parameters. Always remember to store it into a temporary variable. Register \verb"\pgfmathresult" will store the result of \verb"\pgfmathparse". % \begin{macrocode} \providecommand{\stamparray}[3]{ - %#1: pattern size - %#2: starting point - %#3: ending point + % #1: pattern size + % #2: starting point + % #3: ending point \usebeamercolor{palette primary} \fill [pattern={stamp[size=#1]}, pattern color=bg!50!fg] #2 rectangle #3; diff --git a/src/support/contents/basis.tex b/src/support/contents/basis.tex deleted file mode 100644 index 5ffd765a..00000000 --- a/src/support/contents/basis.tex +++ /dev/null @@ -1,637 +0,0 @@ -% !TeX encoding = UTF-8 -% !TeX root = ../main.tex - -\renewcommand{\TeX}{\hologo{TeX}} -\renewcommand{\LaTeX}{\hologo{LaTeX}} -\newcommand{\BibTeX}{\hologo{BibTeX}} -\newcommand{\XeTeX}{\hologo{XeTeX}} -\newcommand{\pdfTeX}{\hologo{pdfTeX}} -\newcommand{\LuaTeX}{\hologo{LuaTeX}} -\renewcommand{\CTeX}{C\TeX} -\newcommand{\MiKTeX}{\hologo{MiKTeX}} -\newcommand{\MacTeX}{Mac\hologo{TeX}} -\newcommand{\beamer}{\textsc{beamer}} -\newcommand{\XeLaTeX}{\hologo{Xe}\kern-.13em\LaTeX{}} -\newcommand{\pdfLaTeX}{pdf\LaTeX{}} -\newcommand{\LuaLaTeX}{Lua\LaTeX{}} -\newcommand\pkg[1]{\texttt{#1}} -\def\cmd#1{\texttt{\color{DarkBlue}\footnotesize $\backslash$#1}} -\def\env#1{\texttt{\color{DarkBlue}\footnotesize #1}} -\def\cmdxmp#1#2#3{\small{\texttt{\color{DarkBlue}$\backslash$#1}\{#2\}\hspace{1em}\\ $\Rightarrow$\hspace{1em} {#3}\par\vskip1em}} -\newcommand\link[1]{\href{#1}{[Link]}} -\newcommand{\SJTUThesis}{\textsc{SJTUThesis}\xspace} -\newcommand{\SJTUThesisVersion}{1.0.0rc7} -\newcommand{\SJTUThesisDate}{2020/7/31} - -\section{学术论文排版} -\subsection{\LaTeX{} 排版入门} - -\begin{frame}[fragile] - \frametitle{引擎与格式} - \begin{itemize} - \item \textbf{引擎}:\TeX{} 的实现 - - \begin{itemize} - \item \pdfTeX{}:直接生成 PDF,支持 micro-typography - \item \XeTeX{}:支持 Unicode、OpenType 与复杂文字编排(CTL) - \item \LuaTeX{}:支持 Unicode,内联 Lua,支持 OpenType - \item (u)p\TeX{}:日本方面推动,生成 |.dvi|,(支持 Unicode) - \item Ap\TeX{}:底层 CJK 支持,内联 Ruby,Color Emoji - \end{itemize} - - \item \textbf{格式}:\TeX{} 的语言扩展(命令封装) - - \begin{itemize} - \item plain \TeX{}:Knuth 同志专用 - \item \LaTeX{}:排版科技类文章的事实标准 - \item Con\TeX t:基于 \LuaTeX{} 实现,优雅、易用(吗?) - \end{itemize} - - \item \textbf{程序}:引擎 + dump 后的格式代码 - - \begin{itemize} - \item \alert{英文文章:\pdfLaTeX{}、\XeLaTeX{} 或 \LuaLaTeX{}} - \item \alert{中文文章:\XeLaTeX{} 或 \LuaLaTeX{}} - \end{itemize} - \end{itemize} -\end{frame} - -\begin{frame}[fragile] - \frametitle{编译} - \begin{itemize} - \item 现代 \TeX{} 引擎均可直接生成 PDF - \item 命令行 - - \begin{itemize} - \item |pdflatex|/|xelatex|/|lualatex| + |<文件名>[.tex]| - \item 多次编译:每次均需要读取并处理中间文件 - \item 推荐 \pkg{latexmk}\footnote{\MiKTeX 用户需要自行安装 perl 解释器}:运行 |latexmk [<选项>] <文件名>| 即可自动完成所有工作 - \end{itemize} - - \item 编辑器 - - \begin{itemize} - \item 按钮的背后仍然是命令 - \item |PATH| 环境变量:确定可执行文件的位置 - \item VS Code + \LaTeX{} Workshop:配置 |tools| 和 |recipes| - \end{itemize} - \end{itemize} -\end{frame} - - -\begin{frame}[fragile]{文件结构} - \lstset{language=[LaTeX]TeX} - \begin{lstlisting}[basicstyle=\ttfamily] -\documentclass[a4paper]{ctexart} -% 文档类型,如 ctexart,[]内是选项,如 a4paper -% 这里开始是导言区 -\usepackage{graphicx} % 引用宏包 -\graphicspath{{fig/}} % 设置图片目录 -% 导言区到此为止 -\begin{document} -这里开始是正文 -\end{document} - \end{lstlisting} -\end{frame} - -\begin{frame}[fragile]{\LaTeX{}“命令”} - \framesubtitle{\emph{宏} (Macro)、或者\emph{控制序列} (control sequence)} -\begin{itemize} -\item 简单命令 - \begin{itemize} - \item \verb|\命令|\hspace{2em} - \verb|{\songti 中国人民解放军}| ~$\Rightarrow$ {\songti 中国人民解放军} - \item \verb|\命令[可选参数]{必选参数}|\\ -\verb|\section[精简标题]{这个题目实在太长了放到目录里面不太好看}|\\ -$\Rightarrow$ {\heiti 1.1 \hspace{1em} \songti 这个题目实在太长了放到目录里面不太好看} - \end{itemize} -\item 环境 - \begin{columns}[c] - \begin{column}{0.45\textwidth} - \begin{lstlisting}[basicstyle=\ttfamily] -\begin{equation*} - a^2-b^2=(a+b)(a-b) -\end{equation*} -\end{lstlisting} -\end{column}\hspace{1em} - \begin{column}{0.45\textwidth} -$ a^2-b^2=(a+b)(a-b)$ -\end{column} - \end{columns} -\end{itemize} -\end{frame} - -\begin{frame}[fragile]{\LaTeX{} 常用命令} - \begin{exampleblock}{简单命令} -\centering -\footnotesize - \begin{tabular}{llll} - \cmd{chapter} & \cmd{section} & \cmd{subsection} & \cmd{paragraph} \\ - 章 & 节 & 小节 & 带题头段落 \\\hline - \cmd{centering} & \cmd{emph} & \cmd{verb} & \cmd{url} \\ - 居中对齐 & 强调 & 原样输出 & 超链接 \\\hline - \cmd{footnote} & \cmd{item} & \cmd{caption} & \cmd{includegraphics} \\ - 脚注 & 列表条目 & 标题 & 插入图片 \\\hline - \cmd{label} & \cmd{cite} & \cmd{ref} \\ - 标号 & 引用参考文献 & 引用图表公式等\\\hline - \end{tabular} -\end{exampleblock} -\end{frame} -\begin{frame}[fragile]{\LaTeX{} 常用环境} -\begin{exampleblock}{环境} -\centering -\footnotesize -\begin{tabular}{lll} - \env{table} & \env{figure} & \env{equation}\\ - 表格 & 图片 & 公式 \\\hline - \env{itemize} & \env{enumerate} & \env{description}\\ - 无编号列表 & 编号列表 & 描述 \\\hline -\end{tabular} -\end{exampleblock} -\end{frame} -% -\begin{frame}{\LaTeX{}命令举例} -\cmdxmp{chapter}{前言}{\heiti 第 1 章\hspace{1em} 前言} -\cmdxmp{section[精简标题]}{这个题目实在太长了放到目录里面不太好看}{\heiti 1.1 - \hspace{1em} 这个题目实在太长了放到目录里面不太好看} -\cmdxmp{footnote}{我是可爱的脚注}{前方高能\footnote{我是可爱的脚注}} -\end{frame} - -\begin{frame}[fragile]{\LaTeX{} 环境举例} - \begin{minipage}{0.4\linewidth} - \begin{lstlisting}[basicstyle=\ttfamily\small] -\begin{itemize} - \item 一条 - \item 次条 - \item 这一条可以分为 ... - \begin{itemize} - \item 子一条 - \end{itemize} -\end{itemize} -\end{lstlisting} - \end{minipage}\hspace{1.5cm} - \begin{minipage}{0.4\linewidth} -\begin{itemize} - \item 一条 - \item 次条 - \item 这一条可以分为 ... - \begin{itemize} - \item 子一条 - \end{itemize} -\end{itemize} - \end{minipage} -\medskip - - \begin{minipage}{0.4\linewidth} -\begin{lstlisting} -\begin{enumerate} - \item 一条 - \item 次条 - \item 再条 -\end{enumerate} -\end{lstlisting} - \end{minipage}\hspace{1.5cm} - \begin{minipage}{0.4\linewidth} -\begin{enumerate} - \item 一条 - \item 次条 - \item 再条 -\end{enumerate} - \end{minipage} -\end{frame} -% - -\begin{frame}[fragile]{\LaTeX{} 数学公式} - -\begin{columns} -\begin{column}{.5\textwidth} -\begin{lstlisting}[basicstyle=\ttfamily\small] -$V = \frac{4}{3}\pi r^3$ - -\[ - V = \frac{4}{3}\pi r^3 -\] - -\begin{equation} -\label{eq:vsphere} -V = \frac{4}{3}\pi r^3 -\end{equation} -\end{lstlisting} -\end{column} - -\begin{column}{.5\textwidth} -$V = \frac{4}{3}\pi r^3$ - -\[ - V = \frac{4}{3}\pi r^3 -\] - -\begin{equation} -\label{eq:vsphere} -V = \frac{4}{3}\pi r^3 -\end{equation} -\end{column} -\end{columns} - -\end{frame} - -\begin{frame}[fragile]{\LaTeX{} 数学公式} -\begin{itemize} -\item 数学公式排版是 \LaTeX{} 的绝对强项 -\item 数学排版需要进入数学模式,引用 \texttt{amsmath} 宏包 - \begin{itemize} - \item 用单个美元符号(\verb|$|) 包围起来的内容是 {\bf 行内公式} - \item 用两个美元符号(\verb|$$|) (不推荐)或 \verb|\[ \]| 包围起来的是 {\bf 单行公式} 或 {\bf 行间公式} - \item 使用数学环境,例如 \texttt{equation} 环境内的公式会自动加上编号, - \texttt{align} 环境用于多行公式(例如方程组、多个并列条件等) - \end{itemize} -\item 寻找符号 - \begin{itemize} - \item 运行 \texttt{texdoc symbols} 查看符号表 - \item S. Pakin. \emph{The Comprehensive \LaTeX{} Symbol List} - \link{https://ctan.org/pkg/comprehensive} - \item 手写识别(有趣但不全):Detexify \link{http://detexify.kirelabs.org} - \end{itemize} -\item MathType 也可以使用和导出 \LaTeX{} 公式(不推荐) -\end{itemize} -\end{frame} - -\begin{frame}[fragile,label={frame:unicode-math}]{unicode-math:现代的数学输入方式} -\LaTeX{} 的公式确实很强大,但是……符号有点难记? - -\pkg{unicode-math} 宏包提供了几乎所见即所得的公式输入(\SJTUThesis 默认使用): - -\begin{itemize} - \item 可直接输入各类符号对应的 Unicode 字符(需要使用 UTF-8 编码): - - \begin{columns}[c] - \begin{column}{0.45\textwidth} - \begin{lstlisting}[basicstyle=\ttfamily] -\begin{equation*} -∫ Γ(x) dx = ±∞ -\end{equation*} - \end{lstlisting} - \end{column}\hspace{1em} - \begin{column}{0.45\textwidth} - \begin{equation*} - ∫ Γ(x) dx = ±∞ - \end{equation*} - \end{column} - \end{columns} - \item 使用 |symbf| 等命令自动处理字母的粗体、斜体等变体,不必引入额外宏包。 -\end{itemize} - -\begin{columns}[c] - \begin{column}{0.45\textwidth} - \begin{lstlisting}[basicstyle=\ttfamily] -\begin{align*} -\symbf{\beta} &= \beta \symbf{I} \\ -\symbf{a} &= a \symbf{I} -\end{align*} -\end{lstlisting} -\end{column}\hspace{1em} - \begin{column}{0.45\textwidth} - \begin{align*} - \symbf{\beta} &= \beta \symbf{I} \\ - \symbf{a} &= a \symbf{I} - \end{align*} - \end{column} -\end{columns} - -\end{frame} - -\begin{frame}[fragile]{层次与目录生成} -\begin{columns} -\begin{column}{.6\textwidth} - -\begin{lstlisting}[basicstyle=\ttfamily\small] -\tableofcontents % 这里是目录 -\part{有监督学习} -\chapter{支持向量机} -\section{支持向量机简介} -\subsection{支持向量机的历史} -\subsubsection{支持向量机的诞生} -\paragraph{一些趣闻} -\subparagraph{第一个趣闻} -\end{lstlisting} -\end{column} -\begin{column}{.4\textwidth} -第一部分\quad 有监督学习\\ -第一章\quad 支持向量机 \\ -1. 支持向量机简介 \\ -1.1 支持向量机的历史 \\ -1.1.1 支持向量机的诞生 \\ -一些趣闻 \\ -第一个趣闻 -\end{column} -\end{columns} -\end{frame} - - -\begin{frame}[fragile]{列表与枚举} -\begin{columns} -\begin{column}{.6\textwidth} -\begin{lstlisting}[basicstyle=\ttfamily\small] -\begin{enumerate} -\item \LaTeX{} 好处都有啥 - \begin{description} - \item[好用] 体验好才是真的好 - \item[好看] 强迫症的福音 - \item[开源] 众人拾柴火焰高 - \end{description} -\item 还有呢? - \begin{itemize} - \item 好处 1 - \item 好处 2 - \end{itemize} -\end{enumerate} -\end{lstlisting} -\end{column} -\begin{column}{.4\textwidth} -{\small -\begin{enumerate} -\item \LaTeX{} 好处都有啥 - \begin{description} - \item[好用] 体验好才是真的好 - \item[好看] 治疗强迫症 - \item[开源] 众人拾柴火焰高 - \end{description} -\item 还有呢? - \begin{itemize} - \item 好处 1 - \item 好处 2 - \end{itemize} -\end{enumerate} -} -\end{column} -\end{columns} - -\end{frame} - - -\begin{frame}[fragile]{交叉引用与插入插图} - \begin{itemize} - \item 给对象命名:图片、表格、公式等\\ - |\label{name}| -\item 引用对象\\ - |\ref{name}| - \end{itemize} -\bigskip - - \begin{minipage}{0.7\linewidth} - \begin{lstlisting} -交大校徽请参见图~\ref{fig:badge}。 -\begin{figure}[htbp] - \centering - \includegraphics[height=.2\textheight]% - {libicon.pdf} - \caption{交大校徽。} - \label{fig:badge} -\end{figure} -\end{lstlisting} - \end{minipage}\hfill - \begin{minipage}{0.3\linewidth}\centering - {\songti 交大校徽请参见图~1。}\\[1em] - \resizebox{!}{0.2\textheight}{\sjtubadge[cprimary]}\\ - {\footnotesize\heiti 图~1. 交大校徽。} - \end{minipage} -\end{frame} - -\begin{frame}[fragile]{交叉引用与插入表格} - \begin{columns} - \column{.6\textwidth} - \begin{lstlisting} -\begin{table}[htbp] - \caption{编号与含义} - \label{tab:number} - \centering - \begin{tabular}{cl} - \toprule - 编号 & 含义 \\ - \midrule - 1 & 第一 \\ - 2 & 第二 \\ - \bottomrule - \end{tabular} -\end{table} -公式~(\ref{eq:vsphere}) 中编号与含义 -请参见表~\ref{tab:number}。 -\end{lstlisting} -\column{.4\textwidth} -\centering -{\small 表~1. 编号与含义}\\[2pt] -\begin{tabular}{cl}\toprule -编号 & 含义 \\\midrule -1 & 第一\\ -2 & 第二\\\bottomrule -\end{tabular}\\[5pt] - -\normalsize 公式~(\ref{eq:vsphere})编号与含义请参见表~1。 - \end{columns} -\end{frame} - -\begin{frame}[fragile]{浮动体} -\begin{itemize} -\item 初学者最“捉摸不透”的特性之一 \link{https://liam.page/2017/03/11/floats-in-LaTeX-basic} -\item 图片和表格有时会很大,在插入的位置不一定放得下,因此需要浮动调整 -\item 避免在文中使用「下图」「上图」的说法,而是使用图表的编号,例如 |图~\ref{fig:fig1}| 。 -\item |\begin{figure}[<位置>] 图片 \end{figure}| - \begin{itemize} - \item 位置参数指定浮动体摆放的偏好 - \item |h| 当前位置(here), |t| 顶部(top), |b| 底部(bottom), |p| 单独成页(p) - \item |!h| 表示忽略一些限制,|H| 表示强制\alert{(强烈不建议,除非你知道自己在做什么)} - \end{itemize} -\item 温馨提示:图标题一般在下方,表标题一般在上方 -\end{itemize} -\end{frame} - -\begin{frame}[fragile] - \frametitle{作图与插图} - \begin{itemize} - \item 外部插入 - - \begin{itemize} - \item Mathematica、MATLAB - \item PowerPoint、Visio、Adobe Illustrator、Inkscape - \item Python \pkg{Matplotlib} 库、\texttt{Plots.jl}、R、Plotly 等 - \item draw.io \link{https://draw.io/}、ProcessOn \link{https://www.processon.com/} 等在线绘图网站 - \end{itemize} - - \item \TeX{} 内联 - - \begin{itemize} - \item Asymptote - \item \alert{\pkg{pgf}/\pkg{TikZ}、\pkg{pgfplots}} - \end{itemize} - - \item 插图格式 - - \begin{itemize} - \item 矢量图:|.pdf| - \item 位图:|.jpg| 或 |.png| - \item \alert{不再推荐 \texttt{.eps}} - \item 不(完全)支持 |.svg|、|.bmp| - \end{itemize} - - \item 一些参考:\link{https://www.zhihu.com/question/21664179} - \link{https://tex.stackexchange.com/q/158668} - \link{https://tex.stackexchange.com/q/72930} - \end{itemize} -\end{frame} - -\begin{frame}[fragile]{表格绘制} - \begin{itemize} - \item 使用 \pkg{booktabs}、\pkg{longtables}、\pkg{multirow} 等宏包 - \item 手动绘制表格确实比较令人头疼,且较难维护 - \item 推荐使用在线工具绘制后导出代码:\LaTeX{} Table Generator \link{https://www.tablesgenerator.com/latex_tables} - \end{itemize} -\end{frame} - -\begin{frame}[fragile]{文献引用} - \begin{itemize} - \item 新时期我国信息技术产业的发展 \cite{devoftech} - \item 他改变了中国 \cite{thelegendofjiang} - \end{itemize} -\end{frame} - -\begin{frame}[fragile] - \frametitle{宏包推荐(\textbf{先读文档}后使用)} - \setlength{\leftmarginii}{1.5em} - \vspace{-1.5em} - \begin{multicols}{3} - \begin{itemize} - \item 必备 - - \begin{itemize} - \item \pkg{amsmath} - \item \pkg{graphicx} - \item \pkg{hyperref} - \end{itemize} - - \item 样式 - - \begin{itemize} - \item \pkg{caption} - \item \pkg{enumitem} - \item \pkg{fancyhdr} - \item \pkg{footmisc} - \item \pkg{geometry} - \item \pkg{titlesec} - \end{itemize} - - \item 数学 - - \begin{itemize} - \item \pkg{bm} - \item \pkg{mathtools} - \item \pkg{physics} - \item \pkg{unicode-math} - \end{itemize} - - \item 表格 - - \begin{itemize} - \item \pkg{array} - \item \pkg{booktabs} - \item \pkg{longtable} - \item \pkg{tabularx} - \end{itemize} - - \item 插图、绘图 - - \begin{itemize} - \item \pkg{float} - \item \pkg{pdfpages} - \item \pkg{standalone} - \item \pkg{subfig} - \item \pkg{pgf}/\pkg{tikz} - \item \pkg{pgfplots} - \end{itemize} - - \item 字体 - - \begin{itemize} - \item \pkg{newpx} - \item \pkg{pifont} - \item \pkg{fontspec} - \end{itemize} - - \item 各种功能 - - \begin{itemize} - \item \pkg{algorithm2e} - \item \pkg{beamer} - \item \pkg{biblatex} - \item \pkg{listings} - \item \pkg{mhchem} - \item \pkg{microtype} - \item \pkg{minted} - \item \pkg{natbib} - \item \pkg{siunitx} - \item \pkg{xcolor} - \end{itemize} - - \item 多语言 - - \begin{itemize} - \item \pkg{babel} - \item \pkg{polyglossia} - \item \pkg{ctex} - \item \pkg{xeCJK} - \end{itemize} - \end{itemize} - \end{multicols} - \vspace*{-0.5cm} -\end{frame} - -\subsection{论文模板使用} - -\begin{frame}{模板是什么?} - \begin{itemize} - \item 模板 - \begin{itemize} - \item 已经设计好的格式框架 - \item 好的模板:使用户专注于内容 - \item 不应将时间花费在调整框架上 - \end{itemize} - \item 再提 Office 和 Word - \begin{itemize} - \item 很少有人会有意识地在 Word 中使用模板 - \item 定义自己的标题?定义自己的列表?定义自己的段落样式? - \item 自动化,还是手工调? - \item 经常被折腾的精疲力竭 - \item 学习 \LaTeX{} 能帮助自己更好科学地使用 Word - \end{itemize} - \end{itemize} -\end{frame} - -\begin{frame}{论文排版} - \begin{itemize} - \item 获取模板 - \begin{itemize} - \item 随发行版自带、手动网络下载 - \item 模板文档类 \texttt{.cls} 文件 - \item 示例 \texttt{.tex} 文件 - \end{itemize} - \item 编辑 \texttt{.tex} 文件:添加用户内容 - \item 编译:生成 PDF 文档 - \end{itemize} -\end{frame} - -\begin{frame}[fragile]{论文排版举例} - \begin{exampleblock}{IEEE 期刊论文} - \begin{itemize} - \item 获取模板:已随发行版自带 - \begin{itemize} - \item 在安装目录 |/texlive/2021/texmf-dist/doc/latex/IEEEtran| - 下找到 \verb"bare_jrnl.tex" - \item 复制到某个文件夹(比如个人存论文的目录) - \end{itemize} - \item 编辑 \verb"bare_jrnl.tex" 文件 (英文模板:不支持中文) - \item 编译 - \begin{itemize} - \item 英文文献:\XeLaTeX{}、\pdfLaTeX{} 编译均可 - \end{itemize} - \end{itemize} - \end{exampleblock} -\end{frame} diff --git a/src/testfiles/color.lvt b/src/testfiles/color.lvt new file mode 100644 index 00000000..0e1ba4cc --- /dev/null +++ b/src/testfiles/color.lvt @@ -0,0 +1,27 @@ +\documentclass[draft]{beamer} +\usecolortheme[red,dark]{sjtubeamer} +\input{regression-test.tex} +\begin{document} +\START + \begin{frame} + \frametitle{Base color test} + \textcolor{cprimary}{\ttfamily cprimary} color. + + \textcolor{csecondary}{\ttfamily csecondary} color. + + \textcolor{ctertiary}{\ttfamily ctertiary} color. + \end{frame} + \begin{frame} + \frametitle{Palette color test} + \begin{beamercolorbox}{palette primary} + \ttfamily palette primary + \end{beamercolorbox} + \begin{beamercolorbox}{palette secondary} + \ttfamily palette secondary + \end{beamercolorbox} + \begin{beamercolorbox}{palette tertiary} + \ttfamily palette tertiary + \end{beamercolorbox} + \end{frame} +\END +\end{document} \ No newline at end of file diff --git a/src/testfiles/color.tlg b/src/testfiles/color.tlg new file mode 100644 index 00000000..efac1259 --- /dev/null +++ b/src/testfiles/color.tlg @@ -0,0 +1,5 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +[1 +] [2 +] diff --git a/src/testfiles/font.lvt b/src/testfiles/font.lvt new file mode 100644 index 00000000..60b0238f --- /dev/null +++ b/src/testfiles/font.lvt @@ -0,0 +1,12 @@ +\documentclass[draft]{beamer} +\usefonttheme[]{sjtubeamer} +\input{regression-test.tex} +\begin{document} + \START + \begin{frame} + \frametitle{Title test} + \framesubtitle{Subtitle test} + Content test. + \end{frame} + \END +\end{document} \ No newline at end of file diff --git a/src/testfiles/font.tlg b/src/testfiles/font.tlg new file mode 100644 index 00000000..3cfc2432 --- /dev/null +++ b/src/testfiles/font.tlg @@ -0,0 +1,4 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +[1 +] diff --git a/src/testfiles/inner.lvt b/src/testfiles/inner.lvt new file mode 100644 index 00000000..e13607dc --- /dev/null +++ b/src/testfiles/inner.lvt @@ -0,0 +1,28 @@ +\documentclass[]{beamer} +\useinnertheme[min]{sjtubeamer} +\input{regression-test.tex} +\begin{document} + \logo{} + \START + \part{Part test} + \begin{frame} + \paragraph{SJTUBeamer} is a beamer template for Shanghai Jiao Tong University. + + \begin{stampbox} + Test for a stampbox. + \end{stampbox} + \end{frame} + \OMIT + \begin{frame}[fragile] + \frametitle{Code Block} + \lstset{language=[LaTeX]TeX} + \begin{codeblock}[]{\LaTeX{} Code} +\documentclass{article} +\begin{document} + Hello, world! +\end{document} + \end{codeblock} + \end{frame} + \TIMO + \END +\end{document} \ No newline at end of file diff --git a/src/testfiles/inner.tlg b/src/testfiles/inner.tlg new file mode 100644 index 00000000..efac1259 --- /dev/null +++ b/src/testfiles/inner.tlg @@ -0,0 +1,5 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +[1 +] [2 +] diff --git a/src/testfiles/outer.lvt b/src/testfiles/outer.lvt new file mode 100644 index 00000000..1c08f2c0 --- /dev/null +++ b/src/testfiles/outer.lvt @@ -0,0 +1,11 @@ +\documentclass[]{beamer} +\useoutertheme[default]{sjtubeamer} +\input{regression-test.tex} +\begin{document} + \START + \begin{frame} + \frametitle{Outer theme} + Test for outer theme. + \end{frame} + \END +\end{document} \ No newline at end of file diff --git a/src/testfiles/outer.tlg b/src/testfiles/outer.tlg new file mode 100644 index 00000000..3cfc2432 --- /dev/null +++ b/src/testfiles/outer.tlg @@ -0,0 +1,4 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +[1 +] diff --git a/src/testfiles/sjtuvi.lvt b/src/testfiles/sjtuvi.lvt new file mode 100644 index 00000000..25a0d3a8 --- /dev/null +++ b/src/testfiles/sjtuvi.lvt @@ -0,0 +1,47 @@ +\input{regression-test.tex} +\documentclass{beamer} +\usepackage{sjtuvi} +\def\colorblock#1{ + #1\hfill\tikz{\draw[black,fill=#1] (-1,-0.25) rectangle (1,0.25);}\par +} +\begin{document} + \START + \begin{frame} + \frametitle{Predefined color} + \ttfamily + \colorblock{sjtuRedPrimary} + \colorblock{sjtuRedSecondary} + \colorblock{sjtuRedTertiary} + \colorblock{sjtuBluePrimary} + \colorblock{sjtuBlueSecondary} + \colorblock{sjtuBlueTertiary} + \end{frame} + \OMIT + \setbeamertemplate{background}{ + \sjtubg + } + \begin{frame} + \frametitle{Logo Insertion} + \cnlogo + \enlogo + \dlogo + \vlogo + \sjtubadge + \end{frame} + \setbeamertemplate{background}{} + \TIMO + \begin{frame} + \frametitle{Stamp shapes} + \begin{tikzpicture} + \stamparray{4pt}{(-3,-3)}{(3,3)} + \end{tikzpicture} + \begin{tikzpicture} + \draw[decoration={ + stampline, + segment length=8pt, + path has corners=true, + },decorate,sjtuRedPrimary] (-2,-2) rectangle (2,2); + \end{tikzpicture} + \end{frame} + \END +\end{document} \ No newline at end of file diff --git a/src/testfiles/sjtuvi.tlg b/src/testfiles/sjtuvi.tlg new file mode 100644 index 00000000..2a68fc32 --- /dev/null +++ b/src/testfiles/sjtuvi.tlg @@ -0,0 +1,6 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +[1 +] +[3 +]