Skip to content

Commit

Permalink
fix: revert \inserttitlegraphic to the original definition (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
LogCreative authored Dec 21, 2024
1 parent 2e4f39d commit 579b4c1
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- run: cat build/build-*.log
name: display build log
if: ${{ failure() || success() }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: |
build/build-*.pdf
Expand All @@ -60,7 +60,7 @@ jobs:
- run: cat build/*.log
name: display build log
if: ${{ failure() || success() }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: |
build/build-*.pdf
Expand All @@ -85,7 +85,7 @@ jobs:
- name: check if generated files are of latest version
run: |
git diff --exit-code
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: |
src/build/distrib/tds/doc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
sed -i "s|<policy domain=\"coder\" rights=\"none\" pattern=\"PDF\" />|<policy domain=\"coder\" rights=\"read\|write\" pattern=\"PDF\" />|g" /etc/ImageMagick-*/policy.xml
.github/ci/build_contrib.sh -halt-on-error -time -xelatex
name: build contrib doc with XeLaTeX
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: |
build/contrib.*.pdf
Expand Down
6 changes: 6 additions & 0 deletions .vscode/sjtubeamer.code-snippets

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

2 changes: 1 addition & 1 deletion beamercolorthemesjtubeamer.sty

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

2 changes: 1 addition & 1 deletion beamerfontthemesjtubeamer.sty

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

11 changes: 6 additions & 5 deletions beamerinnerthemesjtubeamer.sty

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

2 changes: 1 addition & 1 deletion beamerouterthemesjtubeamer.sty

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

2 changes: 1 addition & 1 deletion beamerthemesjtubeamer.sty

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

15 changes: 8 additions & 7 deletions sjtucover.sty

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

2 changes: 1 addition & 1 deletion sjtuvi.sty

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

26 changes: 15 additions & 11 deletions src/MANIFEST.md

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

2 changes: 1 addition & 1 deletion src/doc/sjtubeamer.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%% limitations under the License.
%% ------------------------------------------------------------------------

\ProvidesFile{sjtubeamer.tex}[2024/10/21 3.1.0 User Manual for sjtubeamer (Chinese)]
\ProvidesFile{sjtubeamer.tex}[2024/12/21 v3.1.1 User Manual for sjtubeamer (Chinese)]
\documentclass[
UTF8,
heading=true,
Expand Down
2 changes: 1 addition & 1 deletion src/doc/sjtubeamerdevguide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%% limitations under the License.
%% ------------------------------------------------------------------------

\ProvidesFile{sjtubeamerdevguide.tex}[2024/10/21 3.1.0 Development Guide for sjtubeamer (English)]
\ProvidesFile{sjtubeamerdevguide.tex}[2024/12/21 v3.1.1 Development Guide for sjtubeamer (English)]
\documentclass{ltxdoc}
\usepackage[scheme=plain]{ctex}
\usepackage[style=ieee]{biblatex}
Expand Down
2 changes: 1 addition & 1 deletion src/doc/sjtubeamerquickstart.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%% -----------------------------------------------------------------------

% 本行为文件元数据,可省略。
\ProvidesFile{sjtubeamerquickstart.tex}[2024/10/21 3.1.0 Quick Start for sjtubeamer (Chinese)]
\ProvidesFile{sjtubeamerquickstart.tex}[2024/12/21 v3.1.1 Quick Start for sjtubeamer (Chinese)]

% 加载 ctexbeamer 文档类【第一部分】
% 如遇无法显示的数学符号,尝试对 ctexbeamer 文档类添加 no-math 选项;
Expand Down
2 changes: 1 addition & 1 deletion src/source/beamercolorthemesjtubeamer.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamercolorthemesjtubeamer}[2024/10/21 3.1.0 sjtubeamer color theme]
\ProvidesPackage{beamercolorthemesjtubeamer}[2024/12/21 v3.1.1 sjtubeamer color theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down
2 changes: 1 addition & 1 deletion src/source/beamerfontthemesjtubeamer.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerfontthemesjtubeamer}[2024/10/21 3.1.0 sjtubeamer font theme]
\ProvidesPackage{beamerfontthemesjtubeamer}[2024/12/21 v3.1.1 sjtubeamer font theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down
41 changes: 22 additions & 19 deletions src/source/beamerinnerthemesjtubeamer.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerinnerthemesjtubeamer}[2024/10/21 3.1.0 sjtubeamer inner theme]
\ProvidesPackage{beamerinnerthemesjtubeamer}[2024/12/21 v3.1.1 sjtubeamer inner theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down Expand Up @@ -167,29 +167,32 @@
\fi
% \end{macrocode}
%
% Redefine the \verb"\titlegraphic" command in \verb"beamer" to implement it
% into the beamer template management system, as is been done in \verb"\logo".
% The original definition of \verb"\titlegraphic" is to set the command
% \verb"\inserttitlegraphic" as its parameter directly.
% \begin{macro}{\setsjtutitlegraphic}
% Set up titlegraphic for the native
% SJTUBeamer theme cover.
% \begin{macrocode}
\def\titlegraphic{\setbeamertemplate{titlegraphic}}
% \end{macrocode}
% Redefine the \verb"\inserttitlegraphic" command to use the template
% \verb"titlegraphic" directly, using the current color setup without
% forming a group (not \verb"\usebeamertemplate*").
% \begin{macrocode}
\def\inserttitlegraphic{\usebeamertemplate{titlegraphic}}
\def\setsjtutitlegraphic#1{
\setbeamertemplate{sjtutitlegraphic}[#1]
\titlegraphic{\usebeamertemplate{sjtutitlegraphic}}
}
% \end{macrocode}
% This redefinition makes \verb"\inserttitlegraphic" never be \verb"\@empty".
% If we need to check if the title graphic is empty now, use
% \verb"\ifbeamertemplateempty{titlegraphic}{}{}" instead.
% From version v2.5.2 to v3.1.0, the command \verb"\inserttitlegraphic" is
% overrided to the custom mechanism of using the beamer template
% \verb"titlegraphic" directly, but it was soon discovered that this could lead
% to circular references (\TeX{} capacity exceeded) when the user tries to set
% the title page to the default template where it will
% \verb"\usebeamertemplate{titlegraphic}" to use \verb"\inserttitlegraphic"
% where it will call \verb"\usebeamertemplate{titlegraphic}" again.
% This has already been solved by reverting to the original definition where
% \verb"\titlegraphic" will set the \verb"\inserttitlegraphic" directly.
%
% \changes{v3.1.1}{2024/12/21}{add the command to set the native titlegraphic,
% and remove the original way of overriding \cs{inserttitlegraphic}.}
% \end{macro}
%
% Set up titlegraphic for this cover.
% First set to empty in case that all definitions of this template in
% \verb"sjtucover" is not extracted.
% \begin{macrocode}
\setbeamertemplate{titlegraphic}{}
\setbeamertemplate{titlegraphic}[\sjtubeamer@inner@cover]
\setsjtutitlegraphic{\sjtubeamer@inner@cover}
% \end{macrocode}
%
% \subsubsection{Covers}
Expand Down
2 changes: 1 addition & 1 deletion src/source/beamerouterthemesjtubeamer.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemesjtubeamer}[2024/10/21 3.1.0 sjtubeamer outer theme]
\ProvidesPackage{beamerouterthemesjtubeamer}[2024/12/21 v3.1.1 sjtubeamer outer theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down
2 changes: 1 addition & 1 deletion src/source/beamerthemesjtubeamer.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
% ------------------------------------------------------------------- \fi
% \iffalse
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerthemesjtubeamer}[2024/10/21 3.1.0 sjtubeamer parent theme]
\ProvidesPackage{beamerthemesjtubeamer}[2024/12/21 v3.1.1 sjtubeamer parent theme]
% \fi
%
% \subsection{Parent Theme}
Expand Down
17 changes: 10 additions & 7 deletions src/source/sjtucover.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sjtucover}[2024/10/21 3.1.0 cover library for sjtubeamer]
\ProvidesPackage{sjtucover}[2024/12/21 v3.1.1 cover library for sjtubeamer]
%</package>
% \fi
% \CheckSum{0}
Expand Down Expand Up @@ -64,28 +64,28 @@
% \paragraph{maxplus.}
% \begin{macrocode}
%<*maxplus>
\defbeamertemplate*{titlegraphic}{maxplus}{\includegraphics{vi/sjtu-vi-sjtuphoto.jpg}}
\defbeamertemplate*{sjtutitlegraphic}{maxplus}{\includegraphics{vi/sjtu-vi-sjtuphoto.jpg}}
%</maxplus>
% \end{macrocode}
%
% \paragraph{max.}
% \begin{macrocode}
%<*max>
\defbeamertemplate*{titlegraphic}{max}{\sjtubg[opacity=0.2]}
\defbeamertemplate*{sjtutitlegraphic}{max}{\sjtubg[opacity=0.2]}
%</max>
% \end{macrocode}
%
% \paragraph{min.}
% \begin{macrocode}
%<*min>
\defbeamertemplate*{titlegraphic}{min}{\includegraphics{vi/sjtu-vi-sjtuphoto.jpg}}
\defbeamertemplate*{sjtutitlegraphic}{min}{\includegraphics{vi/sjtu-vi-sjtuphoto.jpg}}
%</min>
% \end{macrocode}
%
% \paragraph{my.}
% \begin{macrocode}
%<*my>
\defbeamertemplate*{titlegraphic}{my}{
\defbeamertemplate*{sjtutitlegraphic}{my}{
%
% Developer could define your title graphic here for "my"...
%
Expand Down Expand Up @@ -316,9 +316,12 @@
%
% \changes{v3.1.0}{2024/10/21}{Fix the condition of empty titlegraphic in
% \texttt{min} theme.}
% \changes{v3.1.1}{2024/12/21}{Revert to the original condition of empty titlegraphic in
% \texttt{min} theme.}
% \begin{macrocode}
\usebeamercolor{palette primary}%
\ifbeamertemplateempty{titlegraphic}{}{%
\ifx\inserttitlegraphic\@empty%
\else
\begin{tikzpicture}[overlay, yshift=1.2em]
\node (pic) [fg, above left, inner sep=0.32em] at (0.86\paperwidth,0)
{\resizebox{0.3\paperwidth}{!}{\inserttitlegraphic}};
Expand All @@ -332,7 +335,7 @@
(pic.south east) --
(pic.south west) -- cycle;
\end{tikzpicture}
}
\fi
\endgroup
\vskip0.5em
\vfill
Expand Down
2 changes: 1 addition & 1 deletion src/source/sjtuvi.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sjtuvi}[2024/10/21 3.1.0 Visual Identity System library for sjtubeamer]
\ProvidesPackage{sjtuvi}[2024/12/21 v3.1.1 Visual Identity System library for sjtubeamer]
%</package>
% \fi
% \CheckSum{0}
Expand Down

0 comments on commit 579b4c1

Please sign in to comment.