Skip to content

Commit

Permalink
refactor: stampbox measurement (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
LogCreative authored Sep 20, 2022
1 parent e356e0a commit d339f9e
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 84 deletions.
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.

32 changes: 22 additions & 10 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.

14 changes: 1 addition & 13 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.

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}[2022/09/11 v2.9.5 sjtubeamer color theme]
\ProvidesPackage{beamercolorthemesjtubeamer}[2022/09/20 v2.9.6 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}[2022/09/11 v2.9.5 sjtubeamer font theme]
\ProvidesPackage{beamerfontthemesjtubeamer}[2022/09/20 v2.9.6 sjtubeamer font theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down
67 changes: 48 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}[2022/09/11 v2.9.5 sjtubeamer inner theme]
\ProvidesPackage{beamerinnerthemesjtubeamer}[2022/09/20 v2.9.6 sjtubeamer inner theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down Expand Up @@ -186,10 +186,10 @@
% \subsubsection{Covers}
% This part set up title page, section page, part page, section page and subsection page for this cover based on the library \verb"sjtucover" loaded in section \ref{sec:innerload}.
%
% Initialize sidebar width to 0pt as no sidebar required, which will be overwritten in outer theme.
% Initialize sidebar width to 0em as no sidebar required, which will be overwritten in outer theme.
% \begin{macrocode}
\newdimen\beamer@sidebarwidth
\beamer@sidebarwidth=0pt
\beamer@sidebarwidth=0em
% \end{macrocode}
%
% \begin{macro}{\coverpage}
Expand All @@ -202,13 +202,13 @@
% \begin{macrocode}
\tikzset{external/export=false}
% \end{macrocode}
% Set the \verb"parindent" to 0pt to avoid unwanted shift if indent is set.
% Set the \verb"parindent" to 0em to avoid unwanted shift if indent is set.
% \begin{macrocode}
\setlength{\parindent}{0em}
% \end{macrocode}
% Check if it is in sidebar mode to make necessary shift for cover pages.
% \begin{macrocode}
\ifdim\beamer@sidebarwidth=0pt %
\ifdim\beamer@sidebarwidth=0em %
\usebeamertemplate*{#1}
\else
\hspace*{-0.5\beamer@sidebarwidth}\parbox[t]{\textwidth}{
Expand Down Expand Up @@ -281,14 +281,51 @@
}
% \end{macrocode}
%
%
% \subsubsection{Itemize Environments}
%
% Set the item and enumerate style to circled one.
% \begin{macrocode}
\setbeamertemplate{items}[circle]
% \end{macrocode}
%
% Set the marker for section and subsection in TOC (Table of Contents) to \verb"stamp" style provided in \verb"sjtucover".
% Patch beamer on \verb"itemize",\verb"enumerate",\verb"description" on the left margin.
% \begin{macrocode}
\setlength\leftmargini{1.4em}
\setlength\leftmarginii{1.4em}
\setlength\leftmarginiii{1.4em}
\setbeamersize{description width=0.72em}
% \end{macrocode}
%
% Define the \verb"stamp" TOC style for section in toc. Just use the structure color of marker to match the color like the style in \verb"circle" section in toc.
% This may mismatch with the definition of \verb"section page" of \verb"max" theme. But it surely the same color with \verb"part page". Reducing the number of the color used is a correct choice.
% Futhermore, the subsection doesn't even have a stamp marker so that the three-stage structure could not be formed to make use of all three-stage colors. Just all use one color to create a better look.
% At the end of this section block, a thin vspace is added to avoid the collision between the subsection and the stamptext.
% Some space before this section block is added, since there may be some users use \verb"multicols" environment in package \verb"multicol" to make a split list of TOC (which is not recommended by the way). this space will help to avoid the collision between the section and the previous subsection.
% \begin{macrocode}
\defbeamertemplate{section in toc}{stamp}{
\vspace{2.5pt}\leavevmode\leftskip=8mm\stamptext[structure]{\inserttocsectionnumber}
\hspace{0.3em}\inserttocsection\par\vspace{0.5pt}
}
% \end{macrocode}
% Define the \verb"stamp" TOC style for subsection in toc, notice that there is no \verb"\stamptext" in subsection, in order to fit the style of \verb"circle" subsection in toc style, only with the additional left margin to align with (slightly right of) section in toc. Add thin space at the start of every subsection in toc to add some line height.
% \begin{macrocode}
\defbeamertemplate{subsection in toc}{stamp}{
\vspace{1.5pt}\leavevmode\hspace{36mm}\inserttocsubsection\par
}
% \end{macrocode}
% Define the \verb"stamp" TOC style for subsubsection in toc. Like it is in section in toc, only additional left margin is added with adaptation of the font style of subsubsection in toc. And subsubsection should never be used in beamer class, since there is no configuration for subsubsection in beamer to show. To control the visibility of subsubsection in toc,
% \begin{verbatim}\tableofcontents[subsubsectionstyle=hide]\end{verbatim}
% will hide all subsubsection in toc, since there is NO \verb"hideallsubsubsections" in beamer.
% COPYRIGHT NOTICE: reference to beamer class code with LPPL 1.3c License.
% \begin{macrocode}
\defbeamertemplate{subsubsection in toc}{stamp}{
\leavevmode\hspace{40mm}\normalsize\usebeamerfont{subsection in toc}%
\usebeamerfont{subsubsection in toc}%
\inserttocsubsubsection\par
}
% \end{macrocode}
% Set the marker for section and subsection in TOC (Table of Contents) to \verb"stamp" style.
% NOTICE: the recommended setup to use the following in full TOC
% \begin{verbatim}\tableofcontents[hideallsubsections]\end{verbatim}
% use the following in \verb"\AtBeginSection"
Expand All @@ -303,14 +340,6 @@
% or load \verb"circles" inner theme.
% \begin{verbatim}\useinnertheme{circles}\end{verbatim}
%
% Patch beamer on \verb"itemize",\verb"enumerate",\verb"description" on the left margin.
% \begin{macrocode}
\setlength\leftmargini{1.4em}
\setlength\leftmarginii{1.4em}
\setlength\leftmarginiii{1.4em}
\setbeamersize{description width=0.24cm}
% \end{macrocode}
%
% \begin{macro}{bibliolist}
% Create a bibliography list manually with \verb"\item" patched for \verb"\newblock".
% You can just use \verb"\item" without \verb"\newblock" command, or you could use \verb"\newblock" with \verb"\articleitem", \verb"\bookitem", \verb"\onlineitem".
Expand Down Expand Up @@ -417,13 +446,13 @@
frame empty,
interior empty,
sharp corners,
top=2pt,bottom=2pt,left=2pt,right=2pt,
borderline={4pt}{0pt}{
top=0.2em,bottom=0.2em,left=0.2em,right=0.2em,
borderline={0.4em}{0em}{
#1,
line width=0.5pt,
line width=0.05em,
decoration={
stampline,
segment length=8pt,
segment length=0.8em,
path has corners=true,
},
decorate
Expand All @@ -449,7 +478,7 @@
{\leavevmode\centering\hskip-2em\bfseries%
\stamptext[structure]{\insertstampnum}%
\alert{\insertblocktitle}\par\vskip1ex}
{\usebeamercolor[fg]{structure}\hrule\@height.4pt}
{\usebeamercolor[fg]{structure}\hrule\@height.04em}
\vskip1ex
}
\defbeamertemplate*{block stamp end}{sjtubeamer}{
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}[2022/09/11 v2.9.5 sjtubeamer outer theme]
\ProvidesPackage{beamerouterthemesjtubeamer}[2022/09/20 v2.9.6 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}[2022/09/11 v2.9.5 sjtubeamer parent theme]
\ProvidesPackage{beamerthemesjtubeamer}[2022/09/20 v2.9.6 sjtubeamer parent theme]
% \fi
%
% \subsection{Parent Theme}
Expand Down
33 changes: 1 addition & 32 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}[2022/09/11 v2.9.5 cover library for sjtubeamer]
\ProvidesPackage{sjtucover}[2022/09/20 v2.9.6 cover library for sjtubeamer]
%</package>
% \fi
% \CheckSum{0}
Expand Down Expand Up @@ -825,37 +825,6 @@
%</my>
% \end{macrocode}
%
% \subsubsection{Table of Contents Style}
%
% Define the \verb"stamp" TOC style for section in toc. Just use the structure color of marker to match the color like the style in \verb"circle" section in toc.
% This may mismatch with the definition of \verb"section page" of \verb"max" theme. But it surely the same color with \verb"part page". Reducing the number of the color used is a correct choice.
% Futhermore, the subsection doesn't even have a stamp marker so that the three-stage structure could not be formed to make use of all three-stage colors. Just all use one color to create a better look.
% At the end of this section block, a thin vspace is added to avoid the collision between the subsection and the stamptext.
% Some space before this section block is added, since there may be some users use \verb"multicols" environment in package \verb"multicol" to make a split list of TOC (which is not recommended by the way). this space will help to avoid the collision between the section and the previous subsection.
% \begin{macrocode}
\defbeamertemplate{section in toc}{stamp}{
\vspace{2.5pt}\leavevmode\leftskip=8mm\stamptext[structure]{\inserttocsectionnumber}
\hspace{0.3em}\inserttocsection\par\vspace{0.5pt}
}
% \end{macrocode}
% Define the \verb"stamp" TOC style for subsection in toc, notice that there is no \verb"\stamptext" in subsection, in order to fit the style of \verb"circle" subsection in toc style, only with the additional left margin to align with (slightly right of) section in toc. Add thin space at the start of every subsection in toc to add some line height.
% \begin{macrocode}
\defbeamertemplate{subsection in toc}{stamp}{
\vspace{1.5pt}\leavevmode\hspace{36mm}\inserttocsubsection\par
}
% \end{macrocode}
% Define the \verb"stamp" TOC style for subsubsection in toc. Like it is in section in toc, only additional left margin is added with adaptation of the font style of subsubsection in toc. And subsubsection should never be used in beamer class, since there is no configuration for subsubsection in beamer to show. To control the visibility of subsubsection in toc,
% \begin{verbatim}\tableofcontents[subsubsectionstyle=hide]\end{verbatim}
% will hide all subsubsection in toc, since there is NO \verb"hideallsubsubsections" in beamer.
% COPYRIGHT NOTICE: reference to beamer class code with LPPL 1.3c License.
% \begin{macrocode}
\defbeamertemplate{subsubsection in toc}{stamp}{
\leavevmode\hspace{40mm}\normalsize\usebeamerfont{subsection in
toc}\usebeamerfont{subsubsection in toc}%
\inserttocsubsubsection\par
}
% \end{macrocode}
%
% \iffalse
%</package>
% \fi
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}[2022/09/11 v2.9.5 Visual Identity System library for sjtubeamer]
\ProvidesPackage{sjtuvi}[2022/09/20 v2.9.6 Visual Identity System library for sjtubeamer]
%</package>
% \fi
% \CheckSum{0}
Expand Down

0 comments on commit d339f9e

Please sign in to comment.