Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: block body bg and stampblock afterskip #120

Merged
merged 12 commits into from
Sep 5, 2022
2 changes: 1 addition & 1 deletion .vscode/sjtubeamer.code-snippets

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

6 changes: 3 additions & 3 deletions beamercolorthemesjtubeamer.sty

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

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.

6 changes: 4 additions & 2 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.

2 changes: 1 addition & 1 deletion 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.

21 changes: 13 additions & 8 deletions src/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,13 @@ if options["target"] == "add-demo" then
end
return false
end)

-- read sjtubeamer.tex
local usrdoc = docfiledir .. "/sjtubeamer.tex"
local usrdocfile = io.open(usrdoc, 'r')
local usrdoccontent = usrdocfile:read("a")
usrdocfile:close()

for _, num in ipairs(actionlist) do
local oldid = num[2]
local num = num[1]
Expand All @@ -407,19 +414,17 @@ if options["target"] == "add-demo" then
local newid = string.gsub(oldid, num, num + 1)
ren(tutorialsuppdir, "step" .. oldid .. ".tex", "step" .. newid .. ".tex")

-- modify the number in sjtubeamer.tex
local usrdoc = docfiledir .. "/sjtubeamer.tex"
local usrdocfile = io.open(usrdoc, 'r')
local usrdoccontent = usrdocfile:read("a")
usrdocfile:close()
-- modify the number in usr doc content.
local cnt
usrdoccontent, cnt = string.gsub(usrdoccontent, "step" .. string.gsub(string.gsub(oldid,"%+","%%+"),"%-","%%-") .. "%.", "step" .. newid .. ".") -- avoid the magical character insertion
local usrdocfile = io.open(usrdoc, "w+")
usrdocfile:write(usrdoccontent)
usrdocfile:close()

print("step" .. oldid .. " -> " .. "step" .. newid .. " Doc replaced: " .. cnt)
end

-- write sjtubeamer.tex
local usrdocfile = io.open(usrdoc, "w+")
usrdocfile:write(usrdoccontent)
usrdocfile:close()
end

-- The new demo file will be created.
Expand Down
8 changes: 4 additions & 4 deletions src/doc/dev.bib
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ @Misc{lact
}

@Manual{viman,
title = {SJTU VI Manual},
title = {{SJTU VI} Manual},
author = {{Shanghai Jiao Tong University}},
month = apr,
year = {2016},
Expand All @@ -65,7 +65,7 @@ @Manual{viman
}

@Misc{texsc,
title = {{TeX{} Stack Exchange}},
title = {{\TeX{} Stack Exchange}},
url = {https://tex.stackexchange.com/},
}

Expand Down Expand Up @@ -124,7 +124,7 @@ @Manual{texnote

@Misc{tex2017,
month = apr,
title = {{Tunight: TeX{} Workshop 2017}},
title = {{Tunight: \TeX{} Workshop 2017}},
year = {2017},
organization = {TUNA},
url = {https://www.youtube.com/watch?v=fysg1IaCq2s&t=5328s},
Expand All @@ -150,7 +150,7 @@ @Manual{graphics
@Misc{mylatexot1,
author = {David Carlisle},
month = mar,
title = {Answer to "Precompiled header with XeLaTeX not working"},
title = {Answer to ``Precompiled header with \hologo{XeLaTeX} not working''},
year = {2017},
url = {https://tex.stackexchange.com/a/359900/253485},
}
Expand Down
29 changes: 17 additions & 12 deletions src/doc/sjtubeamer.tex
Original file line number Diff line number Diff line change
Expand Up @@ -222,27 +222,27 @@ \chapter{样式}

\themename{} 可以与 \cls{beamer} 提供的九种外样式随意搭配。

\def\myincludepdf#1{
\def\myincludepdf#1#2{
\tcbincludepdf[title={#1},
colframe=red!50!black,colback=red!10!white,
colbacktitle=red!50!white,left=0pt,right=0pt,top=0pt,
bottom=0pt,boxsep=0pt,boxrule=0.6pt,
toptitle=1mm,bottomtitle=1mm,drop lifted shadow,
center title,fonttitle=\ttfamily]
{tutorial/#1}
{tutorial/#2}
}
\begin{tcbitemize}[raster columns=3, raster equal height,
left=0pt,right=0pt,top=0pt,
bottom=0pt,boxsep=0pt,boxrule=0pt]
\tcbitem \myincludepdf{step2miniframes.pdf}
\tcbitem \myincludepdf{step2default.pdf}
\tcbitem \myincludepdf{step2infolines.pdf}
\tcbitem \myincludepdf{step2smoothbars.pdf}
\tcbitem \myincludepdf{step2sidebar.pdf}
\tcbitem \myincludepdf{step2split.pdf}
\tcbitem \myincludepdf{step2shadow.pdf}
\tcbitem \myincludepdf{step2tree.pdf}
\tcbitem \myincludepdf{step2smoothtree.pdf}
\tcbitem \myincludepdf{miniframes}{step2miniframes.pdf}
\tcbitem \myincludepdf{default}{step2default.pdf}
\tcbitem \myincludepdf{infolines}{step2infolines.pdf}
\tcbitem \myincludepdf{smoothbars}{step2smoothbars.pdf}
\tcbitem \myincludepdf{sidebar}{step2sidebar.pdf}
\tcbitem \myincludepdf{split}{step2split.pdf}
\tcbitem \myincludepdf{shadow}{step2shadow.pdf}
\tcbitem \myincludepdf{tree}{step2tree.pdf}
\tcbitem \myincludepdf{smoothtree}{step2smoothtree.pdf}
\end{tcbitemize}

\beamerdemo[1]{step2.tex}
Expand Down Expand Up @@ -412,7 +412,12 @@ \section{区块强调}
\beamerdemo[1]{step13.tex}

\begin{commentlist}
\item \env{stampblock} 用于生成印记区块环境,可以通过可选参数指定编号内容,可选参数缺省时为递增编号。该环境可以与 \env{columns} 配合使用,顶端对齐两列对比两种内容。必要时也可以添加覆盖参数,例如 \verb"<1>"。
\item \env{stampblock} 用于生成印记区块环境,可以通过可选参数指定编号内容,可选参数缺省时为递增编号。该环境可以与 \env{columns} 配合使用,顶端对齐两列对比两种内容。
\item 必要时也可以在可选参数前添加覆盖参数,例如 \verb"<1>[1]{标题}"。此时请指定可选参数编号内容 \verb"[1]",否则覆盖帧内的区块编号也会意料外地递增。
\item 如果需要每帧开始从 1 开始计数,可以在导言区添加
\begin{verbatim}
\AtBeginEnvironment{frame}{\setcounter{stampblockcnt}{0}}
\end{verbatim}
\end{commentlist}

\chapter{代码}
Expand Down
4 changes: 2 additions & 2 deletions src/doc/sjtubeamerdevguide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ \subsection{Beamer Interface}\label{sec:beamer}

\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.
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.} \hologo{XeLaTeX}), \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{} 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}.

Expand Down
6 changes: 3 additions & 3 deletions 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/08/27 v2.9.3 sjtubeamer color theme]
\ProvidesPackage{beamercolorthemesjtubeamer}[2022/09/05 v2.9.4 sjtubeamer color theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down Expand Up @@ -119,9 +119,9 @@
\setbeamercolor{block body}{parent=normal text,use=block title,
bg=block title.bg!15}
\setbeamercolor{block body alerted}{parent=normal text,
use=block title alerted,bg=block title alerted.bg!30}
use=block title alerted,bg=block title alerted.bg!15}
\setbeamercolor{block body example}{parent=normal text,
use=block title example,bg=block title example.bg!30}
use=block title example,bg=block title example.bg!15}
% \end{macrocode}
%
% Set up the background color for stampblock. In case you want to change to something like \verb"cprimary!10".
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/08/27 v2.9.3 sjtubeamer font theme]
\ProvidesPackage{beamerfontthemesjtubeamer}[2022/09/05 v2.9.4 sjtubeamer font theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down
12 changes: 9 additions & 3 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/08/27 v2.9.3 sjtubeamer inner theme]
\ProvidesPackage{beamerinnerthemesjtubeamer}[2022/09/05 v2.9.4 sjtubeamer inner theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down Expand Up @@ -436,7 +436,7 @@
% Create a block with title decorated by the stamp shape with incremental numbering.
% A mandantory parameter is needed for the title.
% An optional parameter is for the customized numbering.
% Overlay could be specified.
% Overlay could be specified. In this scenario, the optional parameter must be specified in case of the unexpected increment of the counter.
% \begin{macrocode}
\newcounter{stampblockcnt}
% \end{macrocode}
Expand All @@ -453,7 +453,7 @@
\vskip1ex
}
\defbeamertemplate*{block stamp end}{sjtubeamer}{
\end{beamercolorbox}\vskip\smallskipamount%
\end{beamercolorbox}\vskip2.5ex%
}
% \end{macrocode}
% Set the template to the defined ones.
Expand All @@ -478,6 +478,12 @@
\usebeamertemplate{block stamp end}%
\end{actionenv}}
% \end{macrocode}
% If you want to reset the counter from the beginning of every frame, uncomment or add the following line into your preamble:
% \begin{macrocode}
%% If you want to reset the counter for each frame:
% \AtBeginEnvironment{frame}{\setcounter{stampblockcnt}{0}}
% \end{macrocode}
% We choose not to make it as a default action, since it is harder to remove this line for users if it is intended to make the counter continous among frames.
% This macro is orginally prepared for poster. It is also useful for side-by-side comparision in one slide.
% COPYRIGHT NOTICE: Reference to code from beamr class and beamerauxtheme.
% \end{macro}
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/08/27 v2.9.3 sjtubeamer outer theme]
\ProvidesPackage{beamerouterthemesjtubeamer}[2022/09/05 v2.9.4 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/08/27 v2.9.3 sjtubeamer parent theme]
\ProvidesPackage{beamerthemesjtubeamer}[2022/09/05 v2.9.4 sjtubeamer parent theme]
% \fi
%
% \subsection{Parent Theme}
Expand Down
2 changes: 1 addition & 1 deletion 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/08/27 v2.9.3 cover library for sjtubeamer]
\ProvidesPackage{sjtucover}[2022/09/05 v2.9.4 cover library for sjtubeamer]
%</package>
% \fi
% \CheckSum{0}
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/08/27 v2.9.3 Visual Identity System library for sjtubeamer]
\ProvidesPackage{sjtuvi}[2022/09/05 v2.9.4 Visual Identity System library for sjtubeamer]
%</package>
% \fi
% \CheckSum{0}
Expand Down