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

feat: stamphrule #126

Merged
merged 11 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

20 changes: 19 additions & 1 deletion 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.

60 changes: 36 additions & 24 deletions src/doc/sjtubeamer.tex
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ \section{浏览器阅读器}

\begin{enumerate}
\item[\faChrome] Chrome 浏览器以及 *nix 内置的阅读器支持“演示”功能。
\begin{figure}[h]
\centering
\begin{tcolorbox}[enhanced, title={$\vdots$}, attach boxed title to top right, boxed title style={circular arc,top=0mm,bottom=2mm,left=3.25mm,right=3.25mm}, sharp corners, tile, width=6cm]
演示
\end{tcolorbox}
\end{figure}
\begin{figure}[h]
\centering
\begin{tcolorbox}[enhanced, title={$\vdots$}, attach boxed title to top right, boxed title style={circular arc,top=0mm,bottom=2mm,left=3.25mm,right=3.25mm}, sharp corners, tile, width=6cm]
演示
\end{tcolorbox}
\end{figure}
\item[\faInternetExplorer] Edge 浏览器需要调整为“适应宽度”\fbox{\faArrowsAltH},并使用 \fbox{\sffamily PageDown} 翻页。尽量不要使用该播放方法。
\end{enumerate}

Expand Down Expand Up @@ -424,13 +424,25 @@ \section{区块强调}
\end{verbatim}
\end{commentlist}

\clearpage

\themename{} 也提供了水平分割线命令,可以重写上面的例子。

\beamerdemo[1]{step14.tex}

\begin{commentlist}
\item \cmd{stamphrule} 用来生成一个水平印记分割线,类似于 \cmd{hrule}。
\item 两个 \env{column} 之间可以使用 \cmd{vrule} 产生竖直分割线隔开,紧随其后的 \cmd{hfill} 是必要的,这样这个竖直分割线才能水平居中。
\item 这里使用了 \cmd{textcolor} 来设置竖直分割线的颜色。
\end{commentlist}

\chapter{代码}

\section{代码抄录}

\themename{} 提供了代码抄录的区块环境。

\beamerdemo[1]{step14.tex}
\beamerdemo[1]{step15.tex}

\begin{commentlist}
\item \env{codeblock} 提供了带行号的代码抄录环境$^*$,第一个可选参数可以用于设置语言与其他抄录选项,第二个必选参数可以设置代码块的标题。
Expand Down Expand Up @@ -466,7 +478,7 @@ \section{Biber}

\faApple{} \faLinux{} 如果使用的是 \hologo{XeLaTeX} 编译,可以使用 \pkg{biblatex} 宏包,对于中文引用可以使用 \opt{gb7714-2015} 样式,并采用 \textsc{Biber} 进行引用处理。

\beamerdemo[1]{step15+-.tex}
\beamerdemo[1]{step16+-.tex}

\begin{commentlist}
\item 使用 \cmd{footnote} 可以添加脚注。
Expand All @@ -478,7 +490,7 @@ \section{Bib\TeX{}}

\faWindows 如果使用的是 \hologo{pdfLaTeX} 编译,需要使用 \pkg{gbt7714} 宏包,并采用老式的 \textsc{Bib\TeX{}} 进行引用处理。

\beamerdemo[2]{step16+_.tex}
\beamerdemo[2]{step17+_.tex}

\begin{commentlist}
\item 对帧使用 \verb"allowframebreaks" 参数可以对过长的内容自动换页。
Expand All @@ -489,7 +501,7 @@ \section{手动输入}

为了避免使用额外的文献数据库文件,可以手动输入文献列表。

\beamerdemo[1]{step17+-.tex}
\beamerdemo[1]{step18+-.tex}

\begin{commentlist}
\item \LaTeX{} 本身提供了 \env{thebibliography} 环境,环境的强制参数用于指定排版最长的标签(这里是两位数占位符),配套 \cmd{bibitem[标签]\{主键\}},在 \cls{beamer} 中需要辅以 \cmd{newblock} 来分隔作者、文章标题、书目与其他内容。这里的主键可以在正文中引用。
Expand All @@ -506,7 +518,7 @@ \section{表格}

考虑到许多专业数据是直接存储在逗号分隔符(\texttt{.csv})文件中的,便于数据内容的后续更改,用户可以采用 \pkg{pgfplotstable} 宏包从文件插入表格(中文表格需要使用 \hologo{XeLaTeX} 编译)。

\beamerdemo[1]{step18.tex}
\beamerdemo[1]{step19.tex}

\begin{commentlist}
\item 需要加载 \pkg{pgfplotstable} 宏包,表头变为主题色,采用三线表的样式。$^*$
Expand All @@ -517,7 +529,7 @@ \section{统计图}

如果希望通过统计图更加直观地展示数据,可以使用 \pkg{pgfplots} 宏包插入统计图。

\beamerdemo[1]{step19.tex}
\beamerdemo[1]{step20.tex}

\begin{commentlist}
\item 需要加载 \pkg{pgfplots} 宏包,必要时额外加载 \pkg{pgfplotstable} 宏包以读取文件数据。可以使用 \href{https://logcreative.github.io/PGFPlotsEdt/}{PGFPlots 统计绘图编辑器} 生成上述代码。
Expand All @@ -527,7 +539,7 @@ \section{缓存}

如果你需要使用较多的 Ti\emph{k}Z 和 \pkg{pgfplots} 插图,可以考虑启用图像缓存,当图像没有被更改时会采用上一次的编译产物。\themename{} 已经保护了一些不必要缓存的元素。

\beamerdemo[1]{step20.tex}
\beamerdemo[1]{step21.tex}

\begin{commentlist}
\item \themename{} 已经加载了 \verb"\usetikzlibrary{external}"。
Expand Down Expand Up @@ -563,7 +575,7 @@ \section{校徽}
\tcbitem[title={\cmd{vlogo}}] \resizebox{!}{4.8cm}{\vlogo{}}
\end{tcbitemize}

\beamerdemo[1]{step21.tex}
\beamerdemo[1]{step22.tex}

\begin{commentlist}
\item 使用 \cmd{logo} 设定徽标。在主题处使用 \opt{topright} 或 \opt{bottomright} 选项强制指定徽标的位置为右上角(\opt{max} 默认)或左下角(\opt{maxplus} 和 \opt{min})。
Expand All @@ -577,7 +589,7 @@ \section{二级机构组合}
\begin{tcbitemize}[raster rows=3, raster columns=1, raster every box/.style={center title, valign=center, halign=center,fonttitle=\ttfamily,colback=white}]
\tcbitem[title={\cmd{secondaryinstlogo[$\langle\textit{en}\rangle$]\{$\langle\textit{zh}\rangle$\}\{$\langle\textit{logo}\rangle$\}}}] \resizebox{!}{1cm}{\secondaryinstlogo[School of Electronic, Information and Electrical Engineering]{电子信息与电气工程学院}{\zhlogo{}}}
\tcbitem[title={\cmd{secondaryinstlogo\{$\langle\textit{en}\rangle$\}\{$\langle\textit{logo}\rangle$\}}}] \resizebox{!}{1cm}{\secondaryinstlogo{School of Electronic, \\ Information and Electrical Engineering}{\enlogo{}}}
\tcbitem[title={\cmd{secondaryinstlogo\{\cmd{resizebox}\{!\}\{0.95cm\}\{$\langle\textit{logo2}\rangle$\}\}\{$\langle\textit{logo}\rangle$\}}}] \resizebox{!}{1cm}{\secondaryinstlogo{\resizebox{!}{0.95cm}{\includegraphics{sjtug.pdf}}}{\sjtubadge{}}}
\tcbitem[title={\cmd{secondaryinstlogo\{\cmd{resizebox}\{!\}\{0.95cm\}\{$\langle\textit{logo2}\rangle$\}\}\{$\langle\textit{logo}\rangle$\}}}] \resizebox{!}{1cm}{\secondaryinstlogo{\resizebox{!}{0.95cm}{\includegraphics{sjtug.pdf}}}{\sjtubadge{}}}
\end{tcbitemize}

\begin{commentlist}
Expand All @@ -591,7 +603,7 @@ \chapter{头图}

可以更改 \themename{} 封面中的头图。

\beamerdemo[1]{step22.tex}
\beamerdemo[1]{step23.tex}

\begin{commentlist}
\item 使用 \cmd{titlegraphic} 设定头图,需要在封面图输出前进行赋值。
Expand All @@ -603,7 +615,7 @@ \chapter{背景}

可以更改 \themename{} 的背景图。

\beamerdemo[1]{step23.tex}
\beamerdemo[1]{step24.tex}

\begin{commentlist}
\item \cmd{setbeamertemplate\{background\}\{\}} 可以设定背景图。如果设定为空,将会清除现在已经设定的背景图。请在主题加载完成后设定。
Expand All @@ -618,7 +630,7 @@ \section{样式}

上面的自定义配置可以全部写入一个样式文件中,以在加载主题后加载这个自定义样式文件。采用 \texttt{my} 选项可以从零开始打造这些配置。

\beamerdemo[1]{step24.tex}
\beamerdemo[1]{step25.tex}

其中 \verb"\usepackage{my}" 即加载了同级目录下的 \verb"my.sty" 自定样式文件。

Expand Down Expand Up @@ -654,12 +666,12 @@ \section{迁移到其他主题}

\begin{table}[h]
\centering
\begin{tabular}{>{\ttfamily}c>{\ttfamily}c>{\ttfamily}c}
\begin{tabular}{ccc}
\hline
\textbackslash{}makebottom & bibliolist & \textbackslash{}highlight \\
\textbackslash{}paragraph & codeblock & \textbackslash{}stamparray \\
\textbackslash{}*logo & \textbackslash{}sjtubadge & stampbox \\
\textbackslash{}stamptext & \textbackslash{}highlightline & \textbackslash{}usesjtutheme \\
\cmd{makebottom} & \env{bibliolist} & \cmd{highlight} \\
\cmd{paragraph} & \env{codeblock} & \cmd{stamparray} \\
\cmd{*logo} \cmd{sjtubadge} & \cmd{stamphrule} & \env{stampbox} \\
\cmd{stamptext} & \cmd{highlightline} & \cmd{usesjtutheme} \\
\hline
\end{tabular}
\end{table}
Expand All @@ -670,7 +682,7 @@ \section{迁移到其他主题}
\centering
\begin{tabular}{>{\sffamily}c>{\sffamily}c>{\sffamily}c}
\hline
tikz & tcolorbox & array\\
tikz & tcolorbox & array \\
\hline
\end{tabular}
\end{table}
Expand Down
9 changes: 5 additions & 4 deletions src/doc/sjtubeamerdevguide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ \subsection{Pull Request}
\end{verbatim}
and copy the corresponding generated files to the root directory.

\subsection{Check Integration}
\subsection{Continous Integration}

All other scripts in the folder \verb".github/ci" could also be checked in your local machine to make sure you can pass the CI on GitHub Actions.

Expand Down Expand Up @@ -683,10 +683,10 @@ \subsection{Engine Support}

\subsection{Adaptive Layout}

\themename{} aims at adapting to as many layouts as possible. Since \themename{} is a decoupled modular part, the layout could be changed due to external package options. And it should be natively decoupled or adaptive to the context through adaptive codes instead of hard-coded condition tests.
\themename{} aims at adapting to as many layouts as possible. Since \themename{} is a decoupled modular part, the layout could be changed due to external package options. And it should be natively decoupled or adaptive to the context through adaptive codes instead of code with no hooks.

\begin{enumerate}
\item \textbf{Options from \texttt{beamer} class to change the size.} \themename{} is based on \verb"beamer" class in the bottom layer. Users could pass options like \verb"12pt" to change the overall font size or \verb"aspectratio=169" to change the slide size to \verb"beamer". This could damage the layout of the components like \verb"frametitle", covers if its measurement is in unit \verb"cm" or \verb"pt" if it is not font adaptive. We recommend using \verb"em" in width and \verb"ex" in height to make it font adaptive. Since the default font size of \verb"beamer" is 10pt, the following conversion on measurement could be indicated \cite{texbook} when transplanting components from other templates:
\item \textbf{Options from \texttt{beamer} class to change the size.} \themename{} is based on \verb"beamer" class in the bottom layer. Users could pass options to \verb"beamer" class like \verb"12pt" to change the overall font size or \verb"aspectratio=169" to change the slide size. This could damage the layout of the components like \verb"frametitle", covers if its measurement is in unit \verb"cm" or \verb"pt" which is not font adaptive. We recommend using \verb"em" in width and \verb"ex" in height to make it font adaptive. Since the default font size of \verb"beamer" is 10pt, the following conversion on measurement could be inferred \cite{texbook}. Make the coversion when transplanting components from other templates:

\begin{tabular}{lll}
& 1em & 1ex \\
Expand All @@ -702,7 +702,8 @@ \subsection{Adaptive Layout}
\end{tabular}

However, it is not always meant to use font adaptive \verb"em" and \verb"ex" everywhere in your code. You should be aware of some spaces should not be adaptive such as the spacing in the drawings. And when it comes to the change of aspect ratio, the result should be calculated from the width and height geometry instead of hard-coded measurement in most cases.
\item \textbf{Options from \texttt{ctexbeamer} class to change the format.} Users could also use \verb"\ctexset{}" provided by \verb"ctexbeamer" to change the format of the section number or change the font by \verb"fontset=ubuntu". \themename{} has adapted to some of the \verb"ctexset" options but the majority of them have not been adapted since the meaning could get changed from \verb"article" class to \verb"beamer" class. Some name translations are subject to change from other packages like \verb"algorithm2e". In this scenario, use \verb"\@ifpackageloaded{}" macro to patch the code manually. And sometimes the package will get loaded later of the theme, so you are most likely to make the condition test in \verb"\AtBeginDocument{}".
\item \textbf{Themes from \texttt{beamer} class.} \themename{} has adapted to most of the outer themes provided by \texttt{beamer} class by passing the corresponding option. \themename{} aims at providing consistent layouts through different outer styles. So, there are some modifications corresponding to different outer styles after one of them is loaded.
\item \textbf{Options from \texttt{ctexbeamer} class to change the format.} Users could also use \verb"\ctexset{}" provided by \verb"ctexbeamer" to change the format of the section number or change the font by \verb"fontset=ubuntu". \themename{} has adapted to some of the \verb"ctexset" options but the majority of them have not been adapted since the meaning could get changed from \verb"article" class to \verb"beamer" class. Some name translations are required to change from other packages like \verb"algorithm2e". In this scenario, use \verb"\@ifpackageloaded{}" macro to patch the code manually. And sometimes the package will get loaded after the theme, so you are most likely to do the patch in \verb"\AtBeginDocument{}".
\item \textbf{Modifications from contribution plugins.} The plugin itself may also change the layout in some ways. For example, the \verb"poster" plugin needs to change the font measurement and emulate the high DPI behavior. The more adaptive the upstream code is, the easier modifications of the plugin are. Keep it in mind to adapt to as many cases as possible.
\end{enumerate}

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}[2022/10/13 v2.9.7 sjtubeamer color theme]
\ProvidesPackage{beamercolorthemesjtubeamer}[2022/10/17 v2.9.8 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/10/13 v2.9.7 sjtubeamer font theme]
\ProvidesPackage{beamerfontthemesjtubeamer}[2022/10/17 v2.9.8 sjtubeamer font theme]
%</package>
% \fi
% \CheckSum{0}
Expand Down
Loading