summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/qyxf-book
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-12 03:03:44 +0000
committerNorbert Preining <norbert@preining.info>2020-09-12 03:03:44 +0000
commit206f46fee13b7233673f40672f21b29a61c70cd9 (patch)
tree61e874e278eec407b2a151098c3822f788dcc1ed /macros/latex/contrib/qyxf-book
parent026bcd88f082ea4bb3f2ddbac395339309f00a63 (diff)
CTAN sync 202009120303
Diffstat (limited to 'macros/latex/contrib/qyxf-book')
-rw-r--r--macros/latex/contrib/qyxf-book/LICENSE2
-rw-r--r--macros/latex/contrib/qyxf-book/README.md3
-rw-r--r--macros/latex/contrib/qyxf-book/README.zh.md19
-rw-r--r--macros/latex/contrib/qyxf-book/colors/black.tex23
-rw-r--r--macros/latex/contrib/qyxf-book/colors/bootstrap-v4.tex29
-rw-r--r--macros/latex/contrib/qyxf-book/colors/rbb.tex24
-rw-r--r--macros/latex/contrib/qyxf-book/demo.pdfbin318147 -> 0 bytes
-rw-r--r--macros/latex/contrib/qyxf-book/figure/qyxf-cover.pdf (renamed from macros/latex/contrib/qyxf-book/figure/cover.pdf)bin44533 -> 44533 bytes
-rw-r--r--macros/latex/contrib/qyxf-book/qyxf-book-doc.pdfbin0 -> 329877 bytes
-rw-r--r--macros/latex/contrib/qyxf-book/qyxf-book-doc.tex (renamed from macros/latex/contrib/qyxf-book/demo.tex)126
-rw-r--r--macros/latex/contrib/qyxf-book/qyxf-book.cls241
11 files changed, 271 insertions, 196 deletions
diff --git a/macros/latex/contrib/qyxf-book/LICENSE b/macros/latex/contrib/qyxf-book/LICENSE
index 510db3d20d..e44b3e3479 100644
--- a/macros/latex/contrib/qyxf-book/LICENSE
+++ b/macros/latex/contrib/qyxf-book/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020 钱院学辅
+Copyright (c) 2020 Qian Yuan Xue Fu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/macros/latex/contrib/qyxf-book/README.md b/macros/latex/contrib/qyxf-book/README.md
index 5b5d3e1abe..3fd3a3a8cd 100644
--- a/macros/latex/contrib/qyxf-book/README.md
+++ b/macros/latex/contrib/qyxf-book/README.md
@@ -1,5 +1,8 @@
# qyxf-book: Book Template for Qian Yuan Xue Fu
+![version](https://img.shields.io/ctan/v/qyxf-book?style=flat-square)
+![license](https://img.shields.io/ctan/l/qyxf-book?style=flat-square)
+
> Warning: The template (including demo and docs) is currently designed only for Chinese typesetting. If you would like to use the template in other languages, please contact with us and offer help on that. Thanks.
`qyxf-book` is a LaTeX document class (template) developed by *Qian Yuan Xue Fu* (QYXF), a student club of *Xi'an Jiaotong University* (XJTU). Up to now, the template is applied in several academic counseling materials ("course helpers") written by members of QYXF, including:
diff --git a/macros/latex/contrib/qyxf-book/README.zh.md b/macros/latex/contrib/qyxf-book/README.zh.md
index 488491fcb5..a1210cf225 100644
--- a/macros/latex/contrib/qyxf-book/README.zh.md
+++ b/macros/latex/contrib/qyxf-book/README.zh.md
@@ -1,11 +1,12 @@
# 钱院学辅 LaTeX 书籍模板
+![version](https://img.shields.io/ctan/v/qyxf-book?style=flat-square)
+![license](https://img.shields.io/ctan/l/qyxf-book?style=flat-square)
+
`qyxf-book` 是由钱院学辅开发的、用于排版中等以上体量资料的 LaTeX 文类。目前,该模板已被用于编写了[《大学物理题解》](https://github.com/qyxf/university-physics)、《理论力学题解》、[《计算方法撷英》](https://qyxf.site/2019/11/26/notes-on-computing-methods-published)等诸多资料。
本份模板原在 [qyxf-sets 宏集](https://github.com/qyxf/qyxf-sets)项目中开发;因维护成本过高、效果不理想,现独立维护,并不再使用之前的 doc/doctrip 方式。现采用 MIT 协议许可,请大家放心地 fork、修改。
-![thumbnail](figure/thumbnail.png)
-
## 特点
- 样式简洁、干净,适于排版学习资料;
@@ -16,4 +17,16 @@
## 使用说明
-目录下附带一份样例代码 `demo.tex`,编译即可得模板说明书及内容示例,请根据代码和编译得到的说明书学习使用本模板。 \ No newline at end of file
+目录下附带一份样例代码 `demo.tex`(在 CTAN 发行的版本中为 `qyxf-book-doc.tex`),编译即可得模板说明书及内容示例,请根据代码和编译得到的说明书学习使用本模板。
+
+![thumbnail](figure/thumbnail.png)
+
+## 发布平台
+
+模板分别在:
+
+- Gitee:<https://gitee.com/qyxf/qyxf-book>
+- GitHub:<https://github.com/qyxf/qyxf-book>
+- CTAN:<https://www.ctan.org/pkg/qyxf-book>
+
+发布,Gitee 为主要开发平台,后两者更新稍慢(CTAN 上的代码目录结构、文件名称与另两者略有区别)。 \ No newline at end of file
diff --git a/macros/latex/contrib/qyxf-book/colors/black.tex b/macros/latex/contrib/qyxf-book/colors/black.tex
deleted file mode 100644
index 2c0c8063e1..0000000000
--- a/macros/latex/contrib/qyxf-book/colors/black.tex
+++ /dev/null
@@ -1,23 +0,0 @@
-% color-scheme: black
-% author-by: xjtu-blacksmith
-% create-on: 2020/8/19
-
-% main colors
-\newcommand\@primary@color{black} % 修改此处颜色即可实现双色书效果
-% for titles amd text
-\renewcommand\@title@color{\@primary@color}
-\renewcommand\@list@color{\@primary@color}
-\renewcommand\@caption@color{\@primary@color}
-\renewcommand\@link@color{\@primary@color}
-\renewcommand\@misc@color{\@primary@color}
-% for boxes
-\renewcommand\@box@background{white}
-\renewcommand\@box@title@color{\@primary@color}
-\renewcommand\@box@title@background{white}
-\renewcommand\@box@frame{\@primary@color}
-\renewcommand\@alert@title@color{white}
-\renewcommand\@alert@title@background{\@primary@color}
-% for theorems
-\renewcommand\@define@frame{\@primary@color}
-\renewcommand\@theorem@background{white}
-\renewcommand\@theorem@frame{\@primary@color} \ No newline at end of file
diff --git a/macros/latex/contrib/qyxf-book/colors/bootstrap-v4.tex b/macros/latex/contrib/qyxf-book/colors/bootstrap-v4.tex
deleted file mode 100644
index c13a8c40ad..0000000000
--- a/macros/latex/contrib/qyxf-book/colors/bootstrap-v4.tex
+++ /dev/null
@@ -1,29 +0,0 @@
-% color-scheme: bootstrap-v4
-% author-by: xjtu-blacksmith
-% create-on: 2020/8/19
-
-% main colors
-\newcommand\@primary@color{blue!50!cyan}
-\newcommand\@info@color{cyan!80!olive}
-% for titles amd text
-\renewcommand\@title@color{black!85}
-\renewcommand\@list@color{\@primary@color}
-\renewcommand\@caption@color{\@info@color}
-\renewcommand\@link@color{blue!67!green!}
-\renewcommand\@misc@color{\@primary@color}
-% for boxes
-\renewcommand\@box@background{cyan!20!white}
-\renewcommand\@box@frame{blue!30!teal}
-\renewcommand\@box@title@background{blue!55!cyan}
-\renewcommand\@box@color{blue!45!teal!80!black}
-\renewcommand\@alert@background{red!10!white}
-\renewcommand\@alert@color{red!40!black!90!white}
-\renewcommand\@alert@frame{red!75!teal}
-\renewcommand\@alert@title@background{red!80!cyan}
-% for theorems
-\renewcommand\@define@background{green!8!white!94!black}
-\renewcommand\@define@frame{green!10!white!90!black}
-\renewcommand\@define@color{green!40!black!90!white}
-\renewcommand\@theorem@background{-blue!20!black!96!green}
-\renewcommand\@theorem@frame{-blue!30!black!90!green}
-\renewcommand\@theorem@color{red!57!green!90!black} \ No newline at end of file
diff --git a/macros/latex/contrib/qyxf-book/colors/rbb.tex b/macros/latex/contrib/qyxf-book/colors/rbb.tex
deleted file mode 100644
index 98257f8de9..0000000000
--- a/macros/latex/contrib/qyxf-book/colors/rbb.tex
+++ /dev/null
@@ -1,24 +0,0 @@
-% color-scheme: rbb
-% author-by: xjtu-blacksmith
-% create-on: 2020/8/19
-
-% main colors
-\newcommand\@primary@color{blue}
-\newcommand\@info@color{red}
-% for titles amd text
-\renewcommand\@title@color{\@primary@color}
-\renewcommand\@list@color{\@primary@color}
-\renewcommand\@caption@color{\@primary@color}
-\renewcommand\@link@color{\@info@color}
-\renewcommand\@misc@color{\@primary@color}
-% for boxes
-\renewcommand\@box@background{white}
-\renewcommand\@box@frame{\@primary@color}
-\renewcommand\@box@title@background{\@primary@color}
-\renewcommand\@alert@color{\@info@color}
-\renewcommand\@alert@frame{\@info@color}
-\renewcommand\@alert@title@background{\@info@color}
-% for theorems
-\renewcommand\@define@frame{black}
-\renewcommand\@theorem@background{white}
-\renewcommand\@theorem@frame{\@primary@color} \ No newline at end of file
diff --git a/macros/latex/contrib/qyxf-book/demo.pdf b/macros/latex/contrib/qyxf-book/demo.pdf
deleted file mode 100644
index af296de229..0000000000
--- a/macros/latex/contrib/qyxf-book/demo.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/qyxf-book/figure/cover.pdf b/macros/latex/contrib/qyxf-book/figure/qyxf-cover.pdf
index 4250c9dd72..4250c9dd72 100644
--- a/macros/latex/contrib/qyxf-book/figure/cover.pdf
+++ b/macros/latex/contrib/qyxf-book/figure/qyxf-cover.pdf
Binary files differ
diff --git a/macros/latex/contrib/qyxf-book/qyxf-book-doc.pdf b/macros/latex/contrib/qyxf-book/qyxf-book-doc.pdf
new file mode 100644
index 0000000000..82d3c3fb0d
--- /dev/null
+++ b/macros/latex/contrib/qyxf-book/qyxf-book-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/qyxf-book/demo.tex b/macros/latex/contrib/qyxf-book/qyxf-book-doc.tex
index e9828c9617..d063f7558c 100644
--- a/macros/latex/contrib/qyxf-book/demo.tex
+++ b/macros/latex/contrib/qyxf-book/qyxf-book-doc.tex
@@ -4,7 +4,7 @@
twoside,
openany,
b5paper, % 以上均为 ctexbook 提供的文类选项
- colorscheme = basic % 请根据需要选择或定制配色方案
+ colorscheme = basic, % 请根据需要选择或定制配色方案
]{qyxf-book}
\title{钱院学辅 \LaTeX 书籍模板}
@@ -90,7 +90,7 @@
当前版本。在 V2 版本之上进一步改进了之前的问题,并向通用、可定制的方向前进一大步。
-在字体方面,移除了中文字体备选项,完全采用 C\TeX 宏集的默认设置;西文及数学内容采用 \TeX 发行版附带的 XITS 字体,由此使模板本身完全摆脱对外部字体的依赖\footnote{字体的定制交由用户完成,本模板不参与其中。}。
+在字体方面,移除了中文字体备选项,完全采用 C\TeX 宏集的默认设置;西文及数学内容采用 \TeX 发行版附带的 XITS 字体,使模板进一步减少了对外部字体的依赖\footnote{字体的定制交由用户完成,本模板不参与其中。}。
在样式方面,综合若干书籍及网页模板重设了各类元素的尺寸、间距,并完全移除了原由 \verb|pgfornament| 与 \verb|pgfornament-han| 宏包所实现的装饰\footnote{一方面,是因为 \TeX Live 2020 中这两个宏包未被容纳进来;另一方面,目前也发现装饰的存在不利于样式的修改、定制,且对阅读效果并无明显改善。}。
@@ -98,8 +98,7 @@
\subsection{我该用哪一个版本?}
-若需要编译由钱院学辅 2020 年 8 月前发布的资料之 \LaTeX 源码,请直接用源码中附带的 \verb|qyxf-book.cls| 文件编译,或下载 V2 系列最新版本 v2.3\footnote{链接:\url{https://gitee.com/qyxf/qyxf-book/releases/2.3}}。否则,请采用最新版本的模板套装\footnote{包括模板文件 \texttt{qyxf-book.cls} 及图片、配色方案等附件。}。
-
+若需要编译由钱院学辅 2020 年 8 月前发布的资料之 \LaTeX 源码,请直接用源码中附带的 \verb|qyxf-book.cls| 文件编译,或下载 V2 系列最新版本 v2.3\footnote{链接:\url{https://gitee.com/qyxf/qyxf-book/releases/2.3}}。否则,请采用最新版本的模板文件。
\begin{alert}
请采用 \hologo{XeLaTeX} 编译使用本模板,其他场合下不保证本模板的功能正常;模板未来的开发之中也不会考虑对其他 \LaTeX 引擎的支持
@@ -117,8 +116,10 @@
\footnote{模板中没有为这个命令设置自动编号,主要是因为编写题解的过程中常出现选题、
跳题的情况,且自动编号下不易从源代码中找到对应题目。}
(可留空),如 \verb|\exercise{1}| 将生成:\exercise{1}。
- \item \verb|\solve|:生成一个「解」的标记:\solve。
- \item \verb|\analysis|:生成一个「分析」的标记:\analysis。
+ \item \verb|\solve|:生成一个「解」的标记:\solve。(其可以接受一个可选参数来替换「解」字
+ \footnote{你可以通过这个特性定义自己需要的标记命令,下面的分析标记同理。})
+ ,如 \verb|\solve[答]| 将生成:\solve[答]。
+ \item \verb|\analysis|:生成一个「分析」的标记:\analysis。(其可以接受一个参数来替换「分析」二字,如 \verb|\analysis[注记]| 将生成:\analysis[注记]。)
\end{itemize}
除此之外,还提供了常见的用户环境,包括:
@@ -127,7 +128,7 @@
\item 定义类环境:定义 \verb|definition|
\item 其他环境:注记 \verb|note|、警告 \verb|alert|
\end{itemize}
-其中,定理、定义类环境属于数学环境,采用 \LaTeX 原生机制定义,仅在外围包裹一层装饰用的盒子;因此,可按照通常的写法编写数学环境,如:
+其中,定理、定义类环境属于数学类环境,采用 \LaTeX 原生机制定义,仅在外围包裹一层装饰用的盒子;因此,可按照通常的写法编写数学类环境,如:
\begin{tcolorbox}
\begin{verbatim}
\begin{theorem}[L'H\^opital 法则]
@@ -148,24 +149,54 @@
\subsection{配色方案定制}
-本模板支持用户自定义的配色方案,写法请参考发布版本中 \verb|colors| 目录下的文件。目前随模板一同发布的配色方案包括:
+\subsubsection{预定义配色方案}
+
+目前,模板中已预定义的配色方案包括:
\begin{itemize}
- \item \verb|basic|:基本的灰度配色方案,仿效于 \verb|qyxf-book| V2 版本的设计,默认值。
+ \item \verb|basic|:默认的灰度配色方案,与 \verb|qyxf-book| V2 版本中的配色接近。
+ \item \verb|black|:只有黑白两色的配色方案。可以很容易的调整为\emph{自定义双色方案}。
+ \item \verb|rbb|:红色 + 蓝色 + 黑色(Red Blue Black)的配色方案。可以很容易的调整为\emph{自定义三色方案}。
\item \verb|bootstrap-v4|:借鉴 BootStrap V4 中的配色方案。
- \item \verb|black|:只有黑白两色,非常适合改造成其他的双色配色方案。
- \item \verb|rbb|:红色 + 蓝色 + 黑色(Red Blue Black),在屏幕上比较醒目。
\end{itemize}
-
-配色方案定制完成后,请在文档类中通过键值对的形式引用,如
+欲使用以上的方案,请在文档类中通过键值对的形式引用,如
\begin{tcolorbox}
\verb|colorsheme = rbb|
\end{tcolorbox}
将启用 \verb|rbb| 配色方案。
-配色方案文件请\textbf{务必}放在待编译文件所在目录的 \verb|colors| 子目录下。
+\subsubsection{双色\&三色方案快速生成}
+为方便用户快速修改预定义配色方案,模板为双色方案 \verb|black| 和三色方案 \verb|rbb| 设计了两个文类选项:
+\begin{itemize}
+ \item \verb|primary|:主色,相当于 \verb|black| 中的黑色及 \verb|rbb| 中的蓝色;
+ \item \verb|seconadry|:辅助色,只对 \verb|rbb| 方案生效,相当于 \verb|rbb| 中的红色。
+\end{itemize}
+若您想快速定义一个自己的双色或三色配色方案,可直接通过以上两个文类选项设置。例如,若您希望使用橙 + 黑的双色主题,可通过以下的文类选项实现:
+\begin{tcolorbox}
+\begin{verbatim}
+\documentclass[
+ colorscheme = black, % 载入双色主题,此时主色为黑色
+ primary = orange % 将主色改为橙色
+]{qyxf-book}
+\end{verbatim}
+\end{tcolorbox}
+而如果您希望使用橙 + 紫 + 黑的三色主题,则可通过以下的文类选项实现:
+\begin{tcolorbox}
+\begin{verbatim}
+ \documentclass[
+ colorscheme = rbb, % 载入三色主题
+ primary = orange, % 将主色改为橙色
+ secondary = violet % 将辅助色改为紫色
+ ]{qyxf-book}
+\end{verbatim}
+\end{tcolorbox}
+
+\begin{alert}
+请采用 \verb|xcolor| 宏包所提供的混色语法(如 \verb|red!50!blue|)设置对应的值,其他写法目前尚不支持。下同。
+\end{alert}
-若您需要编写自己的配色方案,请参考表 \ref{tab:color-scheme} 所示的各项接口;建议您采用 \verb|xcolor| 宏包所提供的混色语法(如 \verb|red!50!blue|)设置对应的值,其他写法目前尚不支持。
+\subsubsection{自定义配色方案}
+若您需要编写自己的配色方案,请通过 \verb|\renewcommand| 命令修改表 \ref{tab:color-scheme} 所示的各项接口,在预定义主题的基础上修改相应颜色值。
\begin{table}[htbp]
\centering\small
\caption{配色方案接口表}\label{tab:color-scheme}
@@ -173,33 +204,43 @@
\toprule
条目 & 接口宏 & \parbox{5em}{\centering \texttt{basic}\\方案默认值} & 备注 \\
\midrule
-标题文字 & \verb|\@title@color| & \verb|black| & \\
-列表标记 & \verb|\@list@color| & \verb|black| & \\
-图表标题文字 & \verb|\@caption@color| & \verb|black| & \\
-链接文字 & \verb|\@link@color| & \verb|black| & \\
-杂项文字 & \verb|\@misc@color| & \verb|black| & \parbox{7em}{页码、引用标记、引导标记等} \\
+标题文字 & \verb|\TitleColor| & \verb|black| & \\
+列表标记 & \verb|\ListColor| & \verb|black| & \\
+图表标题文字 & \verb|\CaptionColor| & \verb|black| & \\
+链接文字 & \verb|\LinkColor| & \verb|black| & \\
+杂项文字 & \verb|\MiscColor| & \verb|black| & \parbox{7em}{页码、引用标记、引导标记等} \\
\midrule
-盒子背景 & \verb|\@box@background| & \verb|white| & \parbox{7em}{\texttt{tcolorbox} 环境默认定义,下同} \\
-盒子边框 & \verb|\@box@frame| & \verb|black!75| & \\
-盒子标题文字 & \verb|\@box@title@color| & \verb|white| & \\
-盒子标题背景 & \verb|\@box@title@background| & \verb|black!50| & \\
-盒子文字 & \verb|\@box@color| & \verb|black| & \\
-警告盒子背景 & \verb|\@alert@background| & \verb|white| & \parbox{7em}{对 \texttt{alert} 环境定义,下同} \\
-警告盒子文字 & \verb|\@alert@color| & \verb|black| & \\
-警告盒子边框 & \verb|\@alert@frame| & \verb|black| & \\
-警告盒子标题背景 & \verb|\@alert@title@background| & \verb|black| & \\
-警告盒子标题文字 & \verb|\@alert@title@color| & \verb|white| & \\
+盒子背景 & \verb|\BoxBackground| & \verb|white| & \parbox{7em}{\texttt{tcolorbox} 环境默认定义,下同} \\
+盒子边框 & \verb|\BoxFrame| & \verb|black!75| & \\
+盒子标题文字 & \verb|\BoxTitleColor| & \verb|white| & \\
+盒子标题背景 & \verb|\BoxTitleBackground| & \verb|black!50| & \\
+盒子文字 & \verb|\BoxColor| & \verb|black| & \\
+警告盒子背景 & \verb|\AlertBackground| & \verb|white| & \parbox{7em}{对 \texttt{alert} 环境定义,下同} \\
+警告盒子文字 & \verb|\AlertColor| & \verb|black| & \\
+警告盒子边框 & \verb|\AlertFrame| & \verb|black| & \\
+警告盒子标题背景 & \verb|\AlertTitleBackground| & \verb|black| & \\
+警告盒子标题文字 & \verb|\AlertTitleColor| & \verb|white| & \\
\midrule
-定义环境背景 & \verb|\@define@background| & \verb|white| & \parbox{7em}{对 \texttt{define} 环境定义,下同} \\
-定义环境边框 & \verb|\@define@frame| & \verb|black!40| & \\
-定义环境文字 & \verb|\@define@color| & \verb|black| & \\
-定理环境背景 & \verb|\@theorem@background| & \verb|black!10| & \parbox{7em}{对各定理类环境定义,下同} \\
-定理环境边框 & \verb|\@theorem@frame| & \verb|black!80| & \\
-定理环境文字 & \verb|\@theorem@color| & \verb|black| & \\
+定义环境背景 & \verb|\DefineBackground| & \verb|white| & \parbox{7em}{对 \texttt{define} 环境定义,下同} \\
+定义环境边框 & \verb|\DefineFrame| & \verb|black!40| & \\
+定义环境文字 & \verb|\DefineColor| & \verb|black| & \\
+定理环境背景 & \verb|\TheoremBackground| & \verb|black!10| & \parbox{7em}{对各定理类环境定义,下同} \\
+定理环境边框 & \verb|\TheoremFrame| & \verb|black!80| & \\
+定理环境文字 & \verb|\TheoremColor| & \verb|black| & \\
\bottomrule
\end{tabular}
\end{table}
+需要注意的是,在重定义链接及盒子环境的配色时,可能因设置命令提前展开接口而无法生效;在此情况下,请使用 \verb|\selectcolor| 命令强制更新这些颜色的值。例如,要变更链接颜色 \verb|\LinkColor| 及盒子文字颜色 \verb|\BoxColor| 为 \verb|red!50|,请通过以下命令实现:
+
+\begin{tcolorbox}
+\begin{verbatim}
+\renewcommand{\LinkColor}{red!50}
+\renewcommand{\BoxColor}{red!50}
+\selectcolor % 更新颜色
+\end{verbatim}
+\end{tcolorbox}
+
\subsection{元信息定制}
本模板中要求填写几项元信息,如表 \ref{tab:metadata} 所示。请在使用时填写完整,以避免出现预料之外的情况。
@@ -240,18 +281,19 @@
\subsection{封面定制}
-本模板提供了简易的封面定制接口,通过 \verb|\cover| 命令来填写封面上需要的内容。例如,需要将本模板中自带的 \verb|cover.pdf| 文件插入到封面中心,通过以下命令即可:
+本模板提供了简易的封面定制接口,通过 \verb|\cover| 命令来填写封面上需要的内容。例如,需要将本模板中自带的 \verb|qyxf-logo.pdf| 文件插入到封面中心,通过以下命令即可:
\begin{tcolorbox}
\begin{verbatim}
-\cover{\includegraphics[width=0.5\textwidth]{figure/cover.pdf}}
+\cover{\includegraphics[width=0.5\textwidth]%
+{figure/qyxf-logo.pdf}}
\end{verbatim}
\end{tcolorbox}
若您希望使插入元素靠向上侧,则可这样实现:
\begin{tcolorbox}
\begin{verbatim}
-\cover{\includegraphics[width=0.5\textwidth]{figure/cover.pdf}%
-\vfill}
+\cover{\includegraphics[width=0.5\textwidth]%
+{figure/qyxf-logo.pdf}\vfill}
\end{verbatim}
\end{tcolorbox}
后侧的 \verb|\vfill| 会将插入元素向上挤压。在另一方向上同理。除了插入图片之外,您也可以使用 \verb|\cover| 命令在首页上插入全局性命令,或使用 Ti$k$Z 环境按页面定位插入图片。
@@ -289,7 +331,7 @@
\subsection{西文字体设置}
-西文字体方面,目前采用 XITS 系列字体
+西文字体方面,目前采用与 Times 系列字体相近的 XITS 系列字体
\footnote{无衬线体采用接近于 Helvetica 的 \TeX{} Gyre Heros。}
。如您想变更西文字体,请完成以下两个步骤:
@@ -456,7 +498,7 @@ C\TeX 宏集提供了几种预定义的字体设置,除系统字体之外还
\begin{figure}[htbp]
\centering
- \includegraphics[width=.3\textwidth]{cover.pdf}
+ \includegraphics[width=.3\textwidth]{qyxf-cover.pdf}
\caption{V2 版本的封面图片}
\label{fig:qyxf-logo}
\end{figure}
diff --git a/macros/latex/contrib/qyxf-book/qyxf-book.cls b/macros/latex/contrib/qyxf-book/qyxf-book.cls
index f69f186620..8dfc56085a 100644
--- a/macros/latex/contrib/qyxf-book/qyxf-book.cls
+++ b/macros/latex/contrib/qyxf-book/qyxf-book.cls
@@ -4,10 +4,10 @@
% --------------------------
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\newcommand{\styversion}{3.0}
+\newcommand{\styversion}{3.1.0}
\newcommand{\styname}{qyxf-book}
\ProvidesClass{qyxf-book}
- [2020/08/27 v3.0 Qian Yuan Xue Fu book template]
+ [2020/09/11 v3.1.0 Qian Yuan Xue Fu book template]
\typeout{The book template provided by Qian Yuan Xue Fu}
% 设定 key-val 选项
@@ -16,6 +16,8 @@
% 选项定制与处理
\DeclareStringOption[basic]{colorscheme}[basic]
+\DeclareStringOption{primary}
+\DeclareStringOption{secondary}
\DeclareBoolOption[true]{xits}
\DeclareVoidOption{noCJKfont}{\PassOptionsToClass{fontset=none}{ctexbook}}
@@ -46,9 +48,6 @@
\fi
\RequirePackage{hologo}
-% etoolbox
-\RequirePackage{etoolbox}
-
% 正文样式设置
\RequirePackage[normalem]{ulem}
@@ -67,54 +66,128 @@
% caption 样式设定
\RequirePackage{caption}
-\DeclareCaptionFormat{colored}{\small{\bfseries\color{\@caption@color}#1} #3}
+\DeclareCaptionFormat{colored}{\small{\bfseries\color{\CaptionColor}#1} #3}
\captionsetup{
format = colored,
skip = 1ex
}
+% 处理配色方案
+\RequirePackage{etoolbox}
+\ifdefempty{\QYXF@primary}{\relax}{\newcommand{\PrimaryColor}{\QYXF@primary}}
+\ifdefempty{\QYXF@secondary}{\relax}{\newcommand{\SecondaryColor}{\QYXF@secondary}}
+
% color scheme 默认值
+
% for titles amd text
-\newcommand{\@title@color}{black}
-\newcommand{\@list@color}{black}
-\newcommand{\@caption@color}{black}
-\newcommand{\@link@color}{black}
-\newcommand{\@misc@color}{black}
+\newcommand{\TitleColor}{black}
+\newcommand{\ListColor}{black}
+\newcommand{\CaptionColor}{black}
+\newcommand{\LinkColor}{black}
+\newcommand{\MiscColor}{black}
% for boxes
-\newcommand{\@box@background}{white}
-\newcommand{\@box@frame}{black!75}
-\newcommand{\@box@title@color}{white}
-\newcommand{\@box@title@background}{black!50}
-\newcommand{\@box@color}{black}
-\newcommand{\@alert@background}{white}
-\newcommand{\@alert@color}{black}
-\newcommand{\@alert@frame}{black}
-\newcommand{\@alert@title@background}{black}
-\newcommand{\@alert@title@color}{white}
+\newcommand{\BoxBackground}{white}
+\newcommand{\BoxFrame}{black!75}
+\newcommand{\BoxTitleColor}{white}
+\newcommand{\BoxTitleBackground}{black!50}
+\newcommand{\BoxColor}{black}
+\newcommand{\AlertBackground}{white}
+\newcommand{\AlertColor}{black}
+\newcommand{\AlertFrame}{black}
+\newcommand{\AlertTitleBackground}{black}
+\newcommand{\AlertTitleColor}{white}
% for theorems
-\newcommand{\@define@background}{white}
-\newcommand{\@define@frame}{black!40}
-\newcommand{\@define@color}{black}
-\newcommand{\@theorem@background}{black!10}
-\newcommand{\@theorem@frame}{black!80}
-\newcommand{\@theorem@color}{black}
+\newcommand{\DefineBackground}{white}
+\newcommand{\DefineFrame}{black!40}
+\newcommand{\DefineColor}{black}
+\newcommand{\TheoremBackground}{black!10}
+\newcommand{\TheoremFrame}{black!80}
+\newcommand{\TheoremColor}{black}
% 读取 color scheme
-\ifdefstring{\QYXF@colorscheme}{basic}{\relax}{%
- \newcommand\schemepath{colors/\QYXF@colorscheme.tex}
- \input{\schemepath}}
+\RequirePackage{xstring}
+\IfEqCase{\QYXF@colorscheme}{%
+ {basic}{\relax}% Basic theme
+ {black}{% BLack theme (bicolor)
+ % main colors
+ \providecommand\PrimaryColor{black}
+ % for titles amd text
+ \renewcommand\TitleColor{\PrimaryColor}
+ \renewcommand\ListColor{\PrimaryColor}
+ \renewcommand\CaptionColor{\PrimaryColor}
+ \renewcommand\LinkColor{\PrimaryColor}
+ \renewcommand\MiscColor{\PrimaryColor}
+ % for boxes
+ \renewcommand\BoxBackground{white}
+ \renewcommand\BoxTitleColor{\PrimaryColor}
+ \renewcommand\BoxTitleBackground{white}
+ \renewcommand\BoxFrame{\PrimaryColor}
+ \renewcommand\AlertTitleColor{white}
+ \renewcommand\AlertTitleBackground{\PrimaryColor}
+ % for theorems
+ \renewcommand\DefineFrame{\PrimaryColor}
+ \renewcommand\TheoremBackground{white}
+ \renewcommand\TheoremFrame{\PrimaryColor}
+ }%
+ {rbb}{% Red-Blue-Black theme (tricolor)
+ % main colors
+ \providecommand\PrimaryColor{blue}
+ \providecommand\SecondaryColor{red}
+ % for titles amd text
+ \renewcommand\TitleColor{\PrimaryColor}
+ \renewcommand\ListColor{\PrimaryColor}
+ \renewcommand\CaptionColor{\PrimaryColor}
+ \renewcommand\LinkColor{\SecondaryColor}
+ \renewcommand\MiscColor{\PrimaryColor}
+ % for boxes
+ \renewcommand\BoxBackground{white}
+ \renewcommand\BoxFrame{\PrimaryColor}
+ \renewcommand\BoxTitleBackground{\PrimaryColor}
+ \renewcommand\AlertColor{\SecondaryColor}
+ \renewcommand\AlertFrame{\SecondaryColor}
+ \renewcommand\AlertTitleBackground{\SecondaryColor}
+ % for theorems
+ \renewcommand\DefineFrame{black}
+ \renewcommand\TheoremBackground{white}
+ \renewcommand\TheoremFrame{\PrimaryColor}
+ }%
+ {bootstrap-v4}{% Bootstrap V4 theme
+ % for titles amd text
+ \renewcommand\TitleColor{black!85}
+ \renewcommand\ListColor{blue!50!cyan}
+ \renewcommand\CaptionColor{cyan!80!olive}
+ \renewcommand\LinkColor{blue!67!green!}
+ \renewcommand\MiscColor{blue!50!cyan}
+ % for boxes
+ \renewcommand\BoxBackground{cyan!20!white}
+ \renewcommand\BoxFrame{blue!30!teal}
+ \renewcommand\BoxTitleBackground{blue!55!cyan}
+ \renewcommand\BoxColor{blue!45!teal!80!black}
+ \renewcommand\AlertBackground{red!10!white}
+ \renewcommand\AlertColor{red!40!black!90!white}
+ \renewcommand\AlertFrame{red!75!teal}
+ \renewcommand\AlertTitleBackground{red!80!cyan}
+ % for theorems
+ \renewcommand\DefineBackground{green!8!white!94!black}
+ \renewcommand\DefineFrame{green!10!white!90!black}
+ \renewcommand\DefineColor{green!40!black!90!white}
+ \renewcommand\TheoremBackground{-blue!20!black!96!green}
+ \renewcommand\TheoremFrame{-blue!30!black!90!green}
+ \renewcommand\TheoremColor{red!57!green!90!black}
+ }%
+}[\ClassWarning{\styname}{Color scheme `\QYXF@colorscheme' not found, `basic' theme is used then.}]
% tcolorbox 样式设定
\tcbset{
enhanced,
noparskip,
after = \noindent,
- colback = \@box@background,
+ colback = \BoxBackground,
title filled,
- colbacktitle = \@box@title@background,
- colframe = \@box@frame,
- coltitle = \@box@title@color,
- coltext = \@box@color,
+ colbacktitle = \BoxTitleBackground,
+ colframe = \BoxFrame,
+ coltitle = \BoxTitleColor,
+ coltext = \BoxColor,
fonttitle = \bfseries,
arc = 0.25em,
boxrule = 0.5pt,
@@ -130,28 +203,28 @@
}
% 引导命令
-\newcommand{\exercise}[1]{\noindent\textbf{\color{\@misc@color}练习 #1}\ }
-\newcommand{\solve}{\noindent\textbf{\color{\@misc@color}\uline{解}}\ }
-\newcommand{\analysis}{\noindent\textbf{\color{\@misc@color}\uline{分析}}\ }
+\newcommand{\exercise}[1]{\noindent\textbf{\color{\MiscColor}练习 #1}\ }
+\newcommand{\solve}[1][解]{\noindent\textbf{\color{\MiscColor}#1}\ }
+\newcommand{\analysis}[1][分析]{\noindent\emph{\color{\MiscColor}#1}\ }
% 定理环境及样式设定
\newtheorem{theorem}{定理}
\newtheorem{lemma}[theorem]{引理}
\newtheorem{define}{定义}
-\BeforeBeginEnvironment{theorem}{\begin{tcolorbox}[colback=\@theorem@background,colframe=\@theorem@frame,coltext=\@theorem@color]}
+\BeforeBeginEnvironment{theorem}{\begin{tcolorbox}[colback=\TheoremBackground,colframe=\TheoremFrame,coltext=\TheoremColor]}
\AfterEndEnvironment{theorem}{\end{tcolorbox}}
-\BeforeBeginEnvironment{lemma}{\begin{tcolorbox}[colback=\@theorem@background,colframe=\@theorem@frame,coltext=\@theorem@color]}
+\BeforeBeginEnvironment{lemma}{\begin{tcolorbox}[colback=\TheoremBackground,colframe=\TheoremFrame,coltext=\TheoremColor]}
\AfterEndEnvironment{lemma}{\end{tcolorbox}}
-\BeforeBeginEnvironment{define}{\begin{tcolorbox}[colback=\@define@background,colframe=\@define@frame,coltext=\@define@color]}
+\BeforeBeginEnvironment{define}{\begin{tcolorbox}[colback=\DefineBackground,colframe=\DefineFrame,coltext=\DefineColor]}
\AfterEndEnvironment{define}{\end{tcolorbox}}
\newtcolorbox{note}{title={注记}}
\newtcolorbox{alert}{
title = {警告},
- colback = \@alert@background,
- colframe = \@alert@frame,
- colbacktitle = \@alert@title@background,
- coltitle = \@alert@title@color,
- coltext = \@alert@color
+ colback = \AlertBackground,
+ colframe = \AlertFrame,
+ colbacktitle = \AlertTitleBackground,
+ coltitle = \AlertTitleColor,
+ coltext = \AlertColor
}
% 页面设置
@@ -174,18 +247,21 @@
}
\hypersetup{
colorlinks = true,
- linkcolor = \@link@color,
- anchorcolor = \@misc@color,
- urlcolor = \@link@color,
- citecolor = \@misc@color
+ linkcolor = \LinkColor,
+ anchorcolor = \MiscColor,
+ urlcolor = \LinkColor,
+ citecolor = \MiscColor
}
% 章节标题与目录样式
\RequirePackage{titlesec,titletoc}
\ctexset{section={name={\S,}}}
-\titleformat{\chapter}[block]{\color{\@title@color}\centering\bfseries\fontsize{2.25em}{1.2ex}}{\CTEXthechapter}{1em}{}
-\titleformat*{\section}{\color{\@title@color}\fontsize{1.75em}{1.225ex}\bfseries\centering}
-\titleformat*{\subsection}{\color{\@title@color}\fontsize{1.5em}{1.43ex}\bfseries}
+\titleformat{\chapter}[block]{\color{\TitleColor}\centering\bfseries\fontsize{2.25em}{1.2ex}}{\CTEXthechapter}{1em}{}
+\titleformat*{\section}{\color{\TitleColor}\fontsize{1.75em}{1.225ex}\bfseries\centering}
+\titleformat*{\subsection}{\color{\TitleColor}\fontsize{1.5em}{1.43ex}\bfseries}
+\titleformat*{\subsubsection}{\color{\TitleColor}\fontsize{1.25em}{1.4ex}\bfseries}
+\titleformat*{\paragraph}{\color{\TitleColor}\bfseries}
+\titleformat*{\subparagraph}{\color{\TitleColor}}
\titlespacing{\chapter}{0pt}{*1}{*4}
\titlecontents{chapter}[24pt]{\hspace{-2pc}\filright}
{\normalsize\bfseries\contentspush{\thecontentslabel\ }}
@@ -200,7 +276,7 @@
% 页眉页脚设置
\newcommand{\footerbox}{%
- {\color{\@misc@color}\bfseries\thepage}\\[-\baselineskip]
+ {\color{\MiscColor}\bfseries\thepage}\\[-\baselineskip]
\uline{\hphantom{\@footorginfo}}\\
\@footorginfo}
\RequirePackage{fancyhdr}
@@ -218,20 +294,19 @@
% 列表样式设置
\RequirePackage[shortlabels]{enumitem}
\RequirePackage{pifont}
-\newcommand{\arrowmark}{\ding{228}}
\setlist{nosep, partopsep=0.5ex}
-\setlist[itemize,1]{label={\color{\@list@color}\arrowmark}, left=0.8em}
-\setlist[itemize,2]{label={\color{\@list@color}\ding{111}}, left=2.8em}
-\setlist[itemize,3]{label={\color{\@list@color}\ding{109}}, left=4.8em}
-\setlist[enumerate,1]{label={\color{\@list@color}\textbf{\arabic*}.}, left=0.8em}
-\setlist[enumerate,2]{label={\color{\@list@color}{\arabic*}.}, left=2.8em}
-\setlist[enumerate,3]{label={\color{\@list@color}({\arabic*})}, left=4.8em}
-\setlist[description]{style=nextline, font=\color{\@list@color}\bfseries}
+\setlist[itemize,1]{label={\color{\ListColor}\ding{228}}, left=0.8em}
+\setlist[itemize,2]{label={\color{\ListColor}\ding{111}}, left=2.8em}
+\setlist[itemize,3]{label={\color{\ListColor}\ding{109}}, left=4.8em}
+\setlist[enumerate,1]{label={\color{\ListColor}\textbf{\arabic*}.}, left=0.8em}
+\setlist[enumerate,2]{label={\color{\ListColor}{\arabic*}.}, left=2.8em}
+\setlist[enumerate,3]{label={\color{\ListColor}({\arabic*})}, left=4.8em}
+\setlist[description]{style=nextline, font=\color{\ListColor}\bfseries}
% 参考文献定制
\RequirePackage[square,numbers]{natbib}
-\renewcommand{\citenumfont}[1]{{\color{\@link@color}#1}}
-\renewcommand{\bibnumfmt}[1]{{\color{\@list@color}[#1]}}
+\renewcommand{\citenumfont}[1]{{\color{\LinkColor}#1}}
+\renewcommand{\bibnumfmt}[1]{{\color{\ListColor}[#1]}}
\AtBeginEnvironment{thebibliography}{\addcontentsline{toc}{chapter}{\bibname}}
% 杂项
@@ -274,12 +349,12 @@
\begin{titlepage}
\null
\begin{center}\large
- \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\@box@frame},%
+ \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\BoxFrame},%
left=20pt,top=1ex,bottom=1ex,after skip=0pt,no shadow]
- {\color{\@title@color}\titlefont\@title}
- \ifdefempty\@subtitle{}{\\[1ex]{\color{\@title@color}\subtitlefont\@subtitle}}
+ {\color{\TitleColor}\titlefont\@title}
+ \ifdefempty\@subtitle{}{\\[1ex]{\color{\TitleColor}\subtitlefont\@subtitle}}
\end{tcolorbox}
- \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\@title@color},%
+ \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\TitleColor},%
left=20pt,top=2ex,bottom=1ex,before skip=0pt,after skip=0pt,no shadow]
{\authorfont\@author}\\\datefont\@date
\end{tcolorbox}
@@ -293,12 +368,13 @@
\hypersetup{pageanchor=true}
\null\vfill
\begin{tcolorbox}[title={\bfseries 作品信息}]
- \arrowmark \textbf{标题:}\@title{}
- \ifdefempty\@subtitle{}{: \textit{\@subtitle}}\\
- \arrowmark \textbf{作者:}\@author\\
- \ifdefempty{\@typo}{}{\arrowmark \textbf{校对排版:}\@typo\\}
- \arrowmark \textbf{出品时间:}\@date\\
- \arrowmark \textbf{总页数:}\pageref{LastPage}
+ \begin{itemize}
+ \item \textbf{标题:}\@title{}\ifdefempty\@subtitle{}{: \textit{\@subtitle}}
+ \item \textbf{作者:}\@author%
+ \ifdefempty{\@typo}{}{\item \textbf{校对排版:}\@typo}
+ \item \textbf{出品时间:}\@date
+ \item \textbf{总页数:}\pageref{LastPage}
+ \end{itemize}
\end{tcolorbox}
\ifdefempty\@licenseinfo{}{%
\begin{tcolorbox}[title={\bfseries 许可证说明}]
@@ -330,4 +406,21 @@
\setcounter{page}{1}
}
+% 修正配色方案重定义问题
+\newcommand{\selectcolor}{
+ \hypersetup{
+ linkcolor = \LinkColor,
+ anchorcolor = \MiscColor,
+ urlcolor = \LinkColor,
+ citecolor = \MiscColor
+ }
+ \tcbset{
+ colback = \BoxBackground,
+ colbacktitle = \BoxTitleBackground,
+ colframe = \BoxFrame,
+ coltitle = \BoxTitleColor,
+ coltext = \BoxColor
+ }
+}
+
\endinput