diff options
author | Norbert Preining <norbert@preining.info> | 2020-08-28 03:02:51 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-08-28 03:02:51 +0000 |
commit | 4d43c69d8ce1c8e128aa59c4eb19189219ac8b3d (patch) | |
tree | 7347ec6f37448ccfd050138bc0449b762ce8e7df /macros | |
parent | a6fc9ddd9fe6e7d022d0ffb4b2ef9a72f85cb1c0 (diff) |
CTAN sync 202008280302
Diffstat (limited to 'macros')
20 files changed, 1048 insertions, 36 deletions
diff --git a/macros/latex/contrib/changelog/changelog.pdf b/macros/latex/contrib/changelog/changelog.pdf Binary files differindex e6d66a6a02..d74e29c378 100644 --- a/macros/latex/contrib/changelog/changelog.pdf +++ b/macros/latex/contrib/changelog/changelog.pdf diff --git a/macros/latex/contrib/changelog/changelog.sty b/macros/latex/contrib/changelog/changelog.sty index dad913838b..b217acb048 100644 --- a/macros/latex/contrib/changelog/changelog.sty +++ b/macros/latex/contrib/changelog/changelog.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{changelog}[2020/04/23 2.2.1 Typesetting changelogs] +\ProvidesPackage{changelog}[2020/08/26 2.3.0 Typesetting changelogs] % Description: Provides the changelog environment for typesetting changelogs % License: LPPL 1.3c % Homepage: https://github.com/9999years/latex-changelog @@ -38,7 +38,7 @@ \DeclareTranslationFallback{changelog-Miscellaneous}{Miscellaneous} \DeclareTranslationFallback{changelog-Unreleased}{Unreleased} \DeclareTranslationFallback{changelog-Yanked}{YANKED} -% English translations +% English translations by Rebecca Turner <rbt@sent.as> \DeclareTranslation{English}{changelog}{Changelog} \DeclareTranslation{English}{changelog-Added}{Added} \DeclareTranslation{English}{changelog-Changed}{Changed} @@ -49,7 +49,7 @@ \DeclareTranslation{English}{changelog-Miscellaneous}{Miscellaneous} \DeclareTranslation{English}{changelog-Unreleased}{Unreleased} \DeclareTranslation{English}{changelog-Yanked}{YANKED} -% German translations +% German translations by Holger Schieferdecker % Alternative german translations as comment at the end of the line \DeclareTranslation{German}{changelog}{\"Anderungsnachweis} \DeclareTranslation{German}{changelog-Added}{Hinzugef\"{u}gt}% Neu @@ -61,7 +61,7 @@ \DeclareTranslation{German}{changelog-Miscellaneous}{Verschiedenes} \DeclareTranslation{German}{changelog-Unreleased}{Unver\"{o}ffentlicht} \DeclareTranslation{German}{changelog-Yanked}{Zur{\"u}ckgezogen} -% Spanish translations +% Spanish translations by David Arnold <dar@xoe.solutions> \DeclareTranslation{Spanish}{changelog}{Registro de cambios} \DeclareTranslation{Spanish}{changelog-Added}{Agregado} \DeclareTranslation{Spanish}{changelog-Changed}{Cambiado} @@ -72,6 +72,17 @@ \DeclareTranslation{Spanish}{changelog-Miscellaneous}{Miscel{\'a}neo} \DeclareTranslation{Spanish}{changelog-Unreleased}{No Publicado} \DeclareTranslation{Spanish}{changelog-Yanked}{REVOCADO} +% French translations by Damien Calesse <github.com/kranack> +\DeclareTranslation{French}{changelog}{Journal des modifications} +\DeclareTranslation{French}{changelog-Added}{Ajouté} +\DeclareTranslation{French}{changelog-Changed}{Modifié} +\DeclareTranslation{French}{changelog-Deprecated}{Déprécié} +\DeclareTranslation{French}{changelog-Removed}{Supprimé} +\DeclareTranslation{French}{changelog-Fixed}{Corrigé} +\DeclareTranslation{French}{changelog-Security}{Sécurité} +\DeclareTranslation{French}{changelog-Miscellaneous}{Divers} +\DeclareTranslation{French}{changelog-Unreleased}{Non publié} +\DeclareTranslation{French}{changelog-Yanked}{Annulé} \newif\ifchangelog@versionfirst \newcommand{\changelog@item}[1]{% diff --git a/macros/latex/contrib/changelog/changelog.tex b/macros/latex/contrib/changelog/changelog.tex index c48f26e52a..32a699eee6 100644 --- a/macros/latex/contrib/changelog/changelog.tex +++ b/macros/latex/contrib/changelog/changelog.tex @@ -1,10 +1,7 @@ \documentclass{ltxguidex} % for demonstrating translations \usepackage[german, american]{babel} -%\babelprovide{chinese} %\usepackage{translations} -%\DeclareLanguage{Chinese} -%\DeclareTranslation{Chinese}{changelog-added}{新增} \usepackage{fontspec} \errorcontextlines=10 @@ -20,12 +17,13 @@ } \makeatother -\setmainfont{TiemposText}[ - Extension = .otf , - UprightFont = *-Regular , - ItalicFont = *-RegularItalic , - BoldFont = *-Bold , - BoldItalicFont = *-BoldItalic , +\setmainfont{Charter}[ + Path = /nix/store/8ylkcs5xw8b3glvgp5l66md6hvxdk098-charter-200512/share/fonts/opentype/, + Extension = .otf, + UprightFont = * Regular, + ItalicFont = * Italic, + BoldFont = * Bold, + BoldItalicFont = * Bold Italic, ] \usepackage{FiraSans} \usepackage{FiraMono} @@ -39,7 +37,7 @@ \author{Rebecca Turner\thanks{Brandeis University; \email{rbt@sent.as}}} \title{The \cl\ Package} -\date{2020/04/23 2.2.1} +\date{2020/08/26 2.3.0} \begin{document} \maketitle @@ -261,11 +259,11 @@ Prints the ``revoked release'' notice: \section{Translations} -Want to use \cl\ in a non-English document? Great! Thanks to a contribution -by Holger Schieferdecker (see section~\ref{s:contrib} below), \cl\ comes -with translations for English, German, and support for adding new -translations. To use built-in translations, simply load \ctan{babel} with -the desired language: +Want to use \cl\ in a non-English document? Great! \cl\ comes with +translations for English, German, Spanish, and French, as well as support +for adding new translations (see section~\ref{s:contrib} below for +translation credits). To use built-in translations, simply load \ctan{babel} +with the desired language: \begin{otherlanguage}{german} \begin{LTXexample} % In the preamble: @@ -320,6 +318,7 @@ an email} and I'll incorporate the translation into \cl's next release! \item[David Arnold <\email{dar@xoe.solutions}>] Support for translating the changelog's section title and Spanish translations. + \item[Damien Calesse <\https{github.com/kranack}>] French translations. \end{description} \section{Changelog} @@ -327,6 +326,12 @@ an email} and I'll incorporate the translation into \cl's next release! This is this package's actual changelog --- not an example! \begin{changelog}[author=Rebecca Turner <\email{rbt@sent.as}>, section=false] +\begin{version}[v=2.3.0, date=2020-08-26, + author={Damien Calesse <\https{github.com/kranack}>}] +\added + \item French translations. +\end{version} + \begin{version}[v=2.2.0, date=2020-04-23, author={David Arnold <\email{dar@xoe.solutions}>}] \added diff --git a/macros/latex/contrib/changelog/example.pdf b/macros/latex/contrib/changelog/example.pdf Binary files differindex e1a2316a79..138b097680 100644 --- a/macros/latex/contrib/changelog/example.pdf +++ b/macros/latex/contrib/changelog/example.pdf diff --git a/macros/latex/contrib/metastr/README.txt b/macros/latex/contrib/metastr/README.txt index 0a41eae10c..f91ab5a62d 100644 --- a/macros/latex/contrib/metastr/README.txt +++ b/macros/latex/contrib/metastr/README.txt @@ -1,4 +1,4 @@ -metastr v1.1 +metastr v1.1.1 Copyright 2020 Niklas Beisert metastr is a LaTeX2e package diff --git a/macros/latex/contrib/metastr/metastr.dtx b/macros/latex/contrib/metastr/metastr.dtx index 8111b295c1..6f70de93a5 100644 --- a/macros/latex/contrib/metastr/metastr.dtx +++ b/macros/latex/contrib/metastr/metastr.dtx @@ -18,10 +18,10 @@ % and the derived files metastr.sty and metasamp.tex. % %<package|sample>\NeedsTeXFormat{LaTeX2e}[1996/12/01] -%<package>\ProvidesPackage{metastr}[2020/06/28 v1.1 Metadata Strings Storage] -%<sample>\ProvidesFile{metasamp.tex}[2020/06/28 v1.1 sample for metastr] +%<package>\ProvidesPackage{metastr}[2020/08/27 v1.1.1 Metadata Strings Storage] +%<sample>\ProvidesFile{metasamp.tex}[2020/08/27 v1.1.1 sample for metastr] %<*driver> -\def\thedate#1{2020/06/28}\def\theversion#1{v1.1} +\def\thedate#1{2020/08/27}\def\theversion#1{v1.1.1} \ProvidesFile{metastr.dtx}[\thedate{} \theversion{} metastr reference manual file] \PassOptionsToClass{10pt,a4paper}{article} \documentclass{ltxdoc} @@ -95,6 +95,7 @@ facilitate basic internationalisation and localisation. \tableofcontents \endgroup + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Introduction} @@ -240,7 +241,6 @@ it should therefore be set by the command: The starred version declares the language for PDF metadata rather than the document contents. - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Working with Strings} \label{sec:work} @@ -562,12 +562,10 @@ and serves a similar purpose as the \LaTeX{} command |\maketitle|: |\metaset{titlematter}{%|\\ | \metapick[#1]{titletext}%|\\ | \metapick[#1]{authortext}%|\\ -| \metapick[#1]{datatext}}| +| \metapick[#1]{datatext}%|\\ +| \metaget[skip]{titlematter}}| \end{tabular} \end{center} -% - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Write Document Metadata} @@ -1371,7 +1369,6 @@ or&|\metaunset[auto]{writepdf}| \end{tabular} \end{center} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Feature Suggestions} \label{sec:suggestions} @@ -1394,12 +1391,24 @@ Make use of the \textsf{babel} package for translations of basic terms. % load babel when not only en? %\item %title translations via titletext? +%\item +%perhaps use \textsf{xparse} to generate robust commands for optional variants \end{itemize} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Revision History} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\paragraph{v1.1.1:} 2020/08/27 + +\begin{itemize} +\item +introduce |skip| variant for |titlematter| register +\item +adjust hook to new \LaTeXe\ (2020-10) hook processing +\end{itemize} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph{v1.1:} 2020/06/28 \begin{itemize} @@ -1417,8 +1426,6 @@ fix saving of PDF info (|keeppdfinfo|) with updated \textsf{hyperxmp} package fix package options |hyperref|, |hyperxmp|, |checkdef|, |xmppdfinfo| \item fix compatibility with updated \textsf{doclicense} package (v2) -\item -\ldots \end{itemize} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1429,6 +1436,7 @@ fix compatibility with updated \textsf{doclicense} package (v2) first version, published on CTAN \end{itemize} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2101,12 +2109,19 @@ some representations of the selected license: % \end{macrocode} % Hook |\mstr@begindoc| to begining of |document| block -% before all other hooks are called: +% before hooks by \textsf{hyperref} are called; +% legacy code for latex releases earlier than 2020-10 +% to add hook before all other hooks are called: % \begin{macrocode} +\ifdefined\AddToHook +\DeclareHookRule{begindocument}{metastr}{before}{hyperref} +\AddToHook{begindocument}{\mstr@begindoc} +\else \begingroup \toks@\expandafter{\expandafter\mstr@begindoc\@begindocumenthook}% \xdef\@begindocumenthook{\the\toks@}% \endgroup +\fi % \end{macrocode} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2228,7 +2243,8 @@ some representations of the selected license: \metaset{titlematter}{% \metapick[#1]{titletext}% \metapick[#1]{authortext}% - \metapick[#1]{datatext}} + \metapick[#1]{datatext}% + \metaget[skip]{titlematter}} \metaset[print]{titletext}{% \metatitleline[print]{title}% \metatitlelinetwo[print]{subtitle}[print]{draft}} @@ -2241,7 +2257,8 @@ some representations of the selected license: % \begin{macrocode} \ifmstr@opt@titlematter\else \metaset{titlematter}{% - \metapick[#1]{titletext}} + \metapick[#1]{titletext}% + \metaget[skip]{titlematter}} \metaset[print]{titletext}{% \metatitleline[print]{title}% \metatitlelinetwo[print]{subtitle}[print]{draft}% @@ -3058,7 +3075,8 @@ some representations of the selected license: \metaset[course]{titlematter}{% \metapick[course]{titletext}% \metapick[course]{datatext}% - \metapick[course]{authortext}} + \metapick[course]{authortext}% + \metaget[skip]{titlematter}} \metaset[course]{titletext}{% \metatitleline[print]{course}% \metatitlelinetwo[print]{material}[print]{draft}} @@ -3071,7 +3089,8 @@ some representations of the selected license: % \begin{macrocode} \ifmstr@opt@titlematter\else \metaset[course]{titlematter}{% - \metapick[course]{titletext}} + \metapick[course]{titletext}% + \metaget[skip]{titlematter}} \metaset[course]{titletext}{% \metatitleline[print]{course}% \metatitlelinetwo[print]{material}[print]{draft}% diff --git a/macros/latex/contrib/metastr/metastr.pdf b/macros/latex/contrib/metastr/metastr.pdf Binary files differindex 0511b7fd97..fa578dc143 100644 --- a/macros/latex/contrib/metastr/metastr.pdf +++ b/macros/latex/contrib/metastr/metastr.pdf diff --git a/macros/latex/contrib/qyxf-book/LICENSE b/macros/latex/contrib/qyxf-book/LICENSE new file mode 100644 index 0000000000..510db3d20d --- /dev/null +++ b/macros/latex/contrib/qyxf-book/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 钱院学辅 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/macros/latex/contrib/qyxf-book/README.md b/macros/latex/contrib/qyxf-book/README.md new file mode 100644 index 0000000000..5b5d3e1abe --- /dev/null +++ b/macros/latex/contrib/qyxf-book/README.md @@ -0,0 +1,28 @@ +# qyxf-book: Book Template for Qian Yuan Xue Fu + +> 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: + +- Solutions to University Physics: <https://qyxf.site/latest/大物题解(上).pdf> +- Notes on Computing Methods: <https://qyxf.site/latest/计算方法撷英-v1.1.pdf> +- Guide to Computer Programming: <https://qyxf.site/latest/计算机设计程序指南.pdf> + +The document class used to be a part of the macro set `qyxf-sets`, which is deprecated due to the difficulties of using doc/docstrip utility. Currently, `qyxf-book` is developed and maintained independently and is licensed with MIT. Forks and improvements are welcomed through our source code repository: + +- Gitee: <https://gitee.com/qyxf/qyxf-book/> +- GitHub: <https://github.com/qyxf/qyxf-book/> + +![thumbnail](figure/thumbnail.png) + +## Features + +- Minimal document style, preferred for "cource helpers". +- Several color schemes are offered, and easy to customize your own scheme. +- Simple interfaces for users to customize the style of preface, main part and so on. + +![color scheme](figure/color-scheme.jpg) + +## How to use + +A demo code (`demo.tex`) is in the folder, whose content makes up the user manual. Please complie the demo by XeLaTeX engine and refer to it while using the template. diff --git a/macros/latex/contrib/qyxf-book/README.zh.md b/macros/latex/contrib/qyxf-book/README.zh.md new file mode 100644 index 0000000000..488491fcb5 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/README.zh.md @@ -0,0 +1,19 @@ +# 钱院学辅 LaTeX 书籍模板 + +`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) + +## 特点 + +- 样式简洁、干净,适于排版学习资料; +- 提供了多种配色方案,用户可在此基础上自行定制; +- 提供了其他易用接口,以定制封面、正文样式。 + +![color scheme](figure/color-scheme.jpg) + +## 使用说明 + +目录下附带一份样例代码 `demo.tex`,编译即可得模板说明书及内容示例,请根据代码和编译得到的说明书学习使用本模板。
\ 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 new file mode 100644 index 0000000000..2c0c8063e1 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/colors/black.tex @@ -0,0 +1,23 @@ +% 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 new file mode 100644 index 0000000000..c13a8c40ad --- /dev/null +++ b/macros/latex/contrib/qyxf-book/colors/bootstrap-v4.tex @@ -0,0 +1,29 @@ +% 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 new file mode 100644 index 0000000000..98257f8de9 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/colors/rbb.tex @@ -0,0 +1,24 @@ +% 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 Binary files differnew file mode 100644 index 0000000000..af296de229 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/demo.pdf diff --git a/macros/latex/contrib/qyxf-book/demo.tex b/macros/latex/contrib/qyxf-book/demo.tex new file mode 100644 index 0000000000..e9828c9617 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/demo.tex @@ -0,0 +1,500 @@ +% !TEX program = xelatex +\documentclass[ + 10pt, + twoside, + openany, + b5paper, % 以上均为 ctexbook 提供的文类选项 + colorscheme = basic % 请根据需要选择或定制配色方案 +]{qyxf-book} + +\title{钱院学辅 \LaTeX 书籍模板} +\subtitle{\LaTeX{} book class of Qian Yuan Xue Fu} % 可选 +\author{钱小辅} +\date{2019 年 2 月 29 日} +%\typo{AlphaGo} % 排版人员信息,选填 + +% 定制元信息 +\org{\Large\textit{西安交通大学}\\\textsc{Xi'an Jiaotong University}} +\footorg{\textsc{Qian Yuan Xue Fu}} +\cover{\includegraphics[width=.6\textwidth]{qyxf-logo.pdf}} +\license{} % 清空许可证信息 + +% 调整封面标题大小 +\renewcommand{\titlefont}{\Huge\bfseries} +\renewcommand{\subtitlefont}{\LARGE\itshape} + +\begin{document} + +\maketitle + +\tableofcontents + +\chapter{模板功能介绍} + +\section{模板概况} + +本模板名为 \verb|qyxf-book|,意即「\emph{钱院学辅之书}」,是西安交通大学钱学森书院学业辅导中心(简称「\emph{钱院学辅}」)自编资料时所采用的 \LaTeX 书籍模板。 + +利用 \verb|qyxf-book| 模板,我们已经生成了如下一些作品,它们都发布于钱院学辅信息站 +\footnote{网址:\url{https://qyxf.site},其中最新资料发布于 \url{https://qyxf.site/latest/} 页面上。} +上,点击以下各条链接即可在浏览器中预览、下载。因各份作品采用了不同版本的 \verb|qyxf-book| 复本,且有一些个性化的定制,故观感将略有差异。 + +\begin{tcolorbox} + \begin{description} + \item [GRE备考指南] \url{https://qyxf.site/latest/GRE备考指南-v2.0.pdf} + \item [军事理论教程] \url{https://qyxf.site/latest/军事理论教程.pdf} + \item [分析力学笔记] \url{https://qyxf.site/latest/分析力学笔记-v1.0.pdf} + \item [大学物理题解] \url{https://qyxf.site/latest/大物题解(上).pdf} + \item [实变函数习题解答] \url{https://qyxf.site/latest/实变函数习题解答.pdf} + \item [计算方法撷英] \url{https://qyxf.site/latest/计算方法撷英-v1.1.pdf} + \item [计算机程序设计指南] \url{https://qyxf.site/latest/计算机设计程序指南.pdf} + \end{description} +\end{tcolorbox} + +根据钱院学辅所编资料的题材与传播形式,本套模板的设计宗旨确定为: +\begin{enumerate} + \item 实现钱院学辅自编资料所需功能,同时留出供其他用户定制的接口; + \item 保持页面样式的干净、整洁,不引入与作品内容的呈现无关的元素; + \item 保证文档的打印效果,以及在手机、平板等小屏设备上的阅读效果。 +\end{enumerate} + +\section{版本演进} + +至目前为止,\verb|qyxf-book| 已经发展了三代版本。当前模板的版本为 \textbf{v\styversion}。 + +\subsection{V1 版本} +最早的版本。在该版本中确定了模板当前的格局(封面、信息页等)。结构、样式上效仿于 \href{https://elegantlatex.org/}{Elegant\LaTeX} 系列模板,借用了其章节标题样式、配色选项,并定义了一套字体(中文采用 Adobe 系列字体,西文采用 Cambria + Calibri,数学字体采用 Cambria Math)。 + +因技术水平,存在诸多兼容性问题,使用多有不便。仅有 \textbf{v1.0} 一个正式版本。 + +\subsection{V2 版本} + +完全摆脱 Elegant\LaTeX{} 的框架,从头独立编写。与笔记模板 \verb|qyxf-note|、告示模板 \verb|qyxf-notice|(均已不再开发)共三个模板合并为 \verb|qyxf-sets| 宏集 +\footnote{代码仓库地址:\url{https://github.com/qyxf/qyxf-sets/}(已经存档,无法编辑)。} +,采用 doc/docstrip 套件一同开发;后因这种方式的维护难度较大,\verb|qyxf-sets| 宏集停止开发,\verb|qyxf-book| 又分离出来独立开发。 + +在 V1 的基础上趋于成熟,优化了字体、封面与章节标题样式,并初步定义了一些用户常用的环境(如数学定理)。利用 \verb|pgfornament| 重新设计了章节标题、页脚的样式,取消了配色(仅用灰度色系)。 + +目前钱院学辅出品的大多数资料采用这一代模板编写。 + +\begin{itemize} + \item \textbf{v2.0}:独立开发的首个版本,确定了整个模板的框架。 + \item \textbf{v2.0a}:修正了说明文档的问题。 + \item \textbf{v2.1}:定义了可选项 \verb|sourcefont| 以启用思源字体为中文字体,将默认字体交还 C\TeX 宏集处理。 + \item \textbf{v2.2}(\verb|qyxf-sets|):实现了取消装饰的选项 \verb|nodecoration|;修正了字体设置卡顿的问题。 + \item \textbf{v2.2}(\verb|qyxf-book|):分离出来之后采用同一版本号再发布一次,增加了 demo 文件。 + \item \textbf{v2.3}:由 \href{https://github.com/SciZeal}{SciZeal} 补充了 demo 中的段落示例、\hologo{BibTeX} 示例等内容。 +\end{itemize} + +\subsection{V3 版本} + +当前版本。在 V2 版本之上进一步改进了之前的问题,并向通用、可定制的方向前进一大步。 + +在字体方面,移除了中文字体备选项,完全采用 C\TeX 宏集的默认设置;西文及数学内容采用 \TeX 发行版附带的 XITS 字体,由此使模板本身完全摆脱对外部字体的依赖\footnote{字体的定制交由用户完成,本模板不参与其中。}。 + +在样式方面,综合若干书籍及网页模板重设了各类元素的尺寸、间距,并完全移除了原由 \verb|pgfornament| 与 \verb|pgfornament-han| 宏包所实现的装饰\footnote{一方面,是因为 \TeX Live 2020 中这两个宏包未被容纳进来;另一方面,目前也发现装饰的存在不利于样式的修改、定制,且对阅读效果并无明显改善。}。 + +此外,还新增了用户定制配色方案、元信息的功能,这将为钱院学辅之外的其他用户使用本模板提供方便。 + +\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} 及图片、配色方案等附件。}。 + + +\begin{alert} + 请采用 \hologo{XeLaTeX} 编译使用本模板,其他场合下不保证本模板的功能正常;模板未来的开发之中也不会考虑对其他 \LaTeX 引擎的支持 + \footnote{未来新开发出来的 \LaTeX 引擎可能会被考虑。}。 +\end{alert} + +\section{常用功能指南} + +\subsection{命令与环境} + +本模板提供了以下几个引导命令,主要用于题解、教辅的编写。这些命令都自带 \verb|\noindent| 控制序列,请放在段首使用。 + +\begin{itemize} + \item \verb|\exercise{<id>}|:生成一个「练习」标记,接受一个参数 \verb|<id>| 作为编号 + \footnote{模板中没有为这个命令设置自动编号,主要是因为编写题解的过程中常出现选题、 + 跳题的情况,且自动编号下不易从源代码中找到对应题目。} + (可留空),如 \verb|\exercise{1}| 将生成:\exercise{1}。 + \item \verb|\solve|:生成一个「解」的标记:\solve。 + \item \verb|\analysis|:生成一个「分析」的标记:\analysis。 +\end{itemize} + +除此之外,还提供了常见的用户环境,包括: +\begin{itemize} + \item 定理类环境:定理 \verb|theorem|、引理 \verb|lemma| + \item 定义类环境:定义 \verb|definition| + \item 其他环境:注记 \verb|note|、警告 \verb|alert| +\end{itemize} +其中,定理、定义类环境属于数学环境,采用 \LaTeX 原生机制定义,仅在外围包裹一层装饰用的盒子;因此,可按照通常的写法编写数学环境,如: +\begin{tcolorbox} + \begin{verbatim} +\begin{theorem}[L'H\^opital 法则] +\begin{equation} +\lim_{x\to x_0} \frac{f(x)}{F(x)} = +\lim_{x\to x_0} \frac{f'(x)}{F'(x)}. +\end{equation} +\end{theorem} +\end{verbatim} +\end{tcolorbox} +将生成: +\begin{theorem}[L'H\^opital 法则] +\begin{equation} +\lim_{x\to x_0} \frac{f(x)}{F(x)} = +\lim_{x\to x_0} \frac{f'(x)}{F'(x)}. +\end{equation} +\end{theorem} + +\subsection{配色方案定制} + +本模板支持用户自定义的配色方案,写法请参考发布版本中 \verb|colors| 目录下的文件。目前随模板一同发布的配色方案包括: +\begin{itemize} + \item \verb|basic|:基本的灰度配色方案,仿效于 \verb|qyxf-book| V2 版本的设计,默认值。 + \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| 子目录下。 + +若您需要编写自己的配色方案,请参考表 \ref{tab:color-scheme} 所示的各项接口;建议您采用 \verb|xcolor| 宏包所提供的混色语法(如 \verb|red!50!blue|)设置对应的值,其他写法目前尚不支持。 + +\begin{table}[htbp] +\centering\small +\caption{配色方案接口表}\label{tab:color-scheme} +\begin{tabular}{llcc} +\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}{页码、引用标记、引导标记等} \\ +\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| & \\ +\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| & \\ +\bottomrule +\end{tabular} +\end{table} + +\subsection{元信息定制} + +本模板中要求填写几项元信息,如表 \ref{tab:metadata} 所示。请在使用时填写完整,以避免出现预料之外的情况。 + +\begin{table}[htbp] + \centering\small + \caption{\texttt{qyxf-book} 中需求的元信息} + \label{tab:metadata} + \begin{tabular}{llcl} + \toprule + 元信息 & 设置命令 & 可否置空 & 默认值 \\ + \midrule + 标题 & \verb|\title| & \ding{55} & 无 \\ + 副标题 & \verb|\subtitle| & \ding{51} & 无 \\ + 作者 & \verb|\author| & \ding{55} & 无 \\ + 创作日期 & \verb|\date| & \ding{55} & \verb|\today| \\ + 排版者 & \verb|\typo| & \ding{51} & 无 \\ + \midrule + 首页组织信息 & \verb|\org| & \ding{51} & \footnotesize\begin{tabular}[c]{@{}l@{}} + \verb|\textit{钱学森书院学业辅导中心}\\[1ex]| \\\verb|\textsc{Xi'an Jiaotong University}|\end{tabular} \\ + \midrule + 页脚组织信息 & \verb|\footorg| & \ding{51} & \verb|\textsc{Qian Yuan Xue Fu}| \\ + \midrule + 许可证说明 & \verb|\license| & \ding{51} & \footnotesize\begin{tabular}[c]{@{}l@{}} + \verb|本作品采用\href{https://| \\ + \verb|creativecommons.org/licenses/| \\ + \verb|by-nc-nd/4.0/}{\bfseriesCC BY-| \\ + \verb|NC-ND 4.0 协议}进行许可。使用| \\ + \verb|者可以在给出作者署名及资料来源| \\ + \verb|的前提下对本作品进行转载,但不| \\ + \verb|得对本作品进行修改,亦不得基于| \\ + \verb|本作品进行二次创作,不得将本作| \\ + \verb|品运用于商业用途。| + \end{tabular} \\ + \bottomrule + \end{tabular} +\end{table} + +\subsection{封面定制} + +本模板提供了简易的封面定制接口,通过 \verb|\cover| 命令来填写封面上需要的内容。例如,需要将本模板中自带的 \verb|cover.pdf| 文件插入到封面中心,通过以下命令即可: + +\begin{tcolorbox} +\begin{verbatim} +\cover{\includegraphics[width=0.5\textwidth]{figure/cover.pdf}} +\end{verbatim} +\end{tcolorbox} +若您希望使插入元素靠向上侧,则可这样实现: +\begin{tcolorbox} +\begin{verbatim} +\cover{\includegraphics[width=0.5\textwidth]{figure/cover.pdf}% +\vfill} +\end{verbatim} +\end{tcolorbox} +后侧的 \verb|\vfill| 会将插入元素向上挤压。在另一方向上同理。除了插入图片之外,您也可以使用 \verb|\cover| 命令在首页上插入全局性命令,或使用 Ti$k$Z 环境按页面定位插入图片。 + +此外,封面标题的字体大小、样式也可重新定义,字体接口及默认值如表 \ref{tab:preface-font} 所示。如有需要(如标题名称较长导致换行),请使用 \verb|\renewcommand| 命令修改。 + +\begin{table}[htbp] + \centering + \caption{\texttt{qyxf-book} 提供的封面字体修改接口} + \label{tab:preface-font} + \begin{tabular}{ccc} + \toprule + 接口 & 对应元信息 & 默认值 \\ + \midrule + \verb|\titlefont| & \verb|\title| & \verb|\Huge\bfseries| \\ + \verb|\subtitlefont| & \verb|\subtitle| & \verb|\huge\itshape| \\ + \verb|\authorfont| & \verb|\author| & \verb|\LARGE\itshape| \\ + \verb|\datefont| & \verb|\date| & \verb|\Large| \\ + \bottomrule + \end{tabular} +\end{table} + +\section{正文字体设置} + +\subsection{字体设置方案的考虑} + +不像其他功能完备的模板,\verb|qyxf-book| 没有提供除默认配置之外的其他「字体包」,仅给出了关闭默认字体配置的选项,其余工作完全交由用户决定 +\footnote{对于大多数用户而言,需要做的决定就是「什么也不用做,采用默认配置即可」。} +、执行。对这一点,有两方面考虑: +\begin{enumerate} + \item 钱院学辅的成员大多使用 Windows 系统,在其上为 \TeX 环境配置字体比较困难。大多数同学无法载入外部字体,使得之前版本中提供的字体配置选项相当「鸡肋」,几乎无人使用。 + \item 对于少部分有能力自行配置字体的用户而言,预先定义的字体方案则往往不合其意,不如完全置空、由用户自行完成。 +\end{enumerate} +因此,在当前版本的 \verb|qyxf-book| 模板中,完全移除了预定义的字体选项。如您认为有必要、也有能力自行配置字体,请阅读以下内容;否则,请遵循默认的字体配置。 + +\subsection{西文字体设置} + +西文字体方面,目前采用 XITS 系列字体 +\footnote{无衬线体采用接近于 Helvetica 的 \TeX{} Gyre Heros。} +。如您想变更西文字体,请完成以下两个步骤: + +\begin{enumerate} + \item 为 \verb|qyxf-book| 文类传入 \verb|xits = false| 的选项,此时西文字体将还原至 Computer Modern 字体; + \item 采用 \verb|fontspec| 宏包提供的 \verb|\setmainfont| 等命令设置字体。 +\end{enumerate} + +例如,下面的代码会将西文字体调整为 \TeX 发行版自带的 Libertinus 系列 +\footnote{其中并未设置数学字体,这种情况下模板将采用默认的数学字体。若需要调整数学字体,可采用 \texttt{unicode-math} 宏包配置。} +: + +\begin{tcolorbox} +\begin{verbatim} +\documentclass[xits = false]{qyxf-book} +% fontspec 宏包已载入,无需再声明 +\setmainfont{Libertinus Serif} +\setsansfont{Libertinus Sans} +\setmonofont{Libertinus Mono} +\end{verbatim} +\end{tcolorbox} + +\subsection{中文字体设置} + +中文字体方面,目前交由 C\TeX 宏集按系统自动选择默认字体。若您希望变更中文字体,同样需要两个步骤: +\begin{enumerate} + \item 为 \verb|qyxf-book| 文类传入 \verb|noCJKfont| 选项,此时 C\TeX 宏集将把模板的中文字体设置清空; + \item 仅完成以上一步,文档是不能编译的,还需采用 C\TeX 宏集的接口来选择其他中文字体,或采用 \verb|xeCJK| 宏包提供的命令自行设置。 +\end{enumerate} + +C\TeX 宏集提供了几种预定义的字体设置,除系统字体之外还包括: +\begin{itemize} + \item Fandol 字体 \verb|fandol|:包括宋、楷、黑、仿宋四套字体,在 \TeX 发行版中自带,无需安装; + \item 方正字体 \verb|founder|:包括方正书宋、方正黑体、方正楷体、方正仿宋等若干套字体,需自行安装,配置稍复杂; + \item Adobe 字体:包括宋、楷、黑、仿宋四套字体,需自行安装。 +\end{itemize} +在正确配置相关字体的情况下,可直接采用 C\TeX 宏集提供的 \verb|\ctexset| 命令配置,如下面的命令将使得模板采用 Fandol 字体: +\begin{tcolorbox} +\begin{verbatim} +\documentclass[noCJKfont]{qyxf-book} +\ctexset{fontset = fandol} +\end{verbatim} +\end{tcolorbox} +从方便使用的角度来说,Fandol 字体无需额外配置,显示效果也好于 Windows 系统的默认字体配置,但有缺字现象;对于需要印刷的作品,方正系列字体效果较好,字体完备 +\footnote{前提是:应安装对应于较完备的 GBK 字符集的字体文件。} +,更适宜。 + +除了直接调用 C\TeX 的配置外,也可采用由 \verb|xeCJK| 宏包 +\footnote{该宏包已经包含在模板中,其命令可以直接使用,无需在您的文档中载入。} +提供的若干命令自行配置字体。例如,下列命令将使得模板采用思源系列中文字体 +\footnote{同样的,请确保相关字体已正确配置。}: +\begin{tcolorbox} +\begin{verbatim} +\documentclass[noCJKfont]{qyxf-book} +\setCJKmainfont[AutoFakeSlant]{Source Han Serif SC} % 伪斜体 +\setCJKsansfont[AutoFakeSlant]{Source Han Sans SC} +\setCJKmonofont[AutoFakeSlant]{Source Han Sans SC} +\end{verbatim} +\end{tcolorbox} +以上命令未配置与中文字体对应的字族(如 \verb|zhsong| 之类),在一般场合没有问题。若有需要,请参考 C\TeX 文档及 \verb|xeCJK| 宏包文档进行设置。 + +\section{问题及改进} + +\subsection{已知问题} + +本模板目前还存在许多可改进之处,主要包括: +\begin{enumerate} + \item 模板对 \verb|part| 级别的标题、目录样式未作任何定制; + \item 在参考文献方面,模板仅对 \LaTeX 自带的简易文献环境 \verb|thebibliorgraphy| 做了定制,未考虑 \hologo{BibTeX} + \footnote{在 v2.3 版本中曾在 demo 中引入了 \hologo{BibTeX} 的示例;后考虑到此方面并无需求,为了简化 demo 结构,在 V3 版本中又移除了。} + 及 \verb|biblatex| 的样式支持; + \item 模板尚未引入对代码抄录宏包(如 \verb|listings|)的支持; + \item 配色方案还不完善,对部分元素的支持不佳。 +\end{enumerate} +未做改动的原因很多,最大的原因是在钱院学辅排版的过程中对这些功能暂时没有需求 +\footnote{例如,在参考文献方面,许多资料甚至连 \texttt{thebibliorgraphy} 环境也不需要,用脚注就能解决问题。}。 + +\subsection{帮帮我们!} + +如果您: +\begin{itemize} + \item 对上述功能有需求,并有能力帮助我们完善; + \item 有其他好的建议、功能推荐; + \item 设计了新颖、实用的配色、字体方案; +\end{itemize} +请通过我们的代码仓库向我们提交建议与改动请求:\url{https://gitee.com/qyxf/qyxf-book},我们将酌情采纳、接收。 + +同时,我们也欢迎您透过 fork 的形式修改出适合您自己的模板,分发给更多人使用。本模板按 MIT 许可证发行,据此您享有充分的自由。这也是对于我们模板的一种推广 +\footnote{模板滞销,帮帮我们!} +与帮助! + +本模板目前由\textbf{黑山雁}维护,您也可以通过邮箱联系维护者:\url{yjr134@163.com}。 + +\subsection{可解决的问题} + +在 \TeX\ Live 2019 中测试本模板时,发现 \textsc{Small Caps} 字族(\verb|\scfamily|)不能正常加载,回退到了普通字族;经过检查,发现默认采用的 XITS 字体在 \TeX\ Live 2019 中提供的版本(1.200)还未引入该字族,到 \TeX\ Live 2020 时对应的版本(1.300)方才完善了此部分。若您对于该字族有需求,请更新您的 \TeX 发行版。 + +\chapter{内容示例} +\section{用户环境示例} + +\begin{define} + 极限就是超越自我。 +\end{define} + +\begin{theorem} + 任何极限都可以直接观察得出。 +\end{theorem} + +\begin{lemma} + 以上内容,纯属扯淡。 +\end{lemma} + +\begin{note} + 好好学习,天天向上。 +\end{note} + +\begin{alert} + 今天你学习了吗? +\end{alert} + +\section{列表样式} +\begin{itemize} + \item 这是第一层 + \item 这也是第一层 + \begin{itemize} + \item 这是第二层 + \begin{itemize} + \item 这是第三层 + \end{itemize} + \end{itemize} +\end{itemize} + +\begin{enumerate} + \item 这是第一层 + \item 这也是第一层 + \begin{enumerate} + \item 这是第二层 + \begin{enumerate} + \item 这是第三层 + \end{enumerate} + \end{enumerate} +\end{enumerate} + +\section{正文示例} + +\textbf{微分学}(\emph{differential calculus})是微积分的一部分,是通过\emph{导数}和\emph{微分}来研究曲线斜率、加速度、最大值和最小值的一门学科,也是探讨特定数量变化速率的学科。微分学是微积分的两个主要分支之一,另一个分支则是\textbf{积分学},探讨曲线下的面积。 + + +\begin{table}[htbp] + \centering + \caption{常用导数} + \begin{tabular}{cccc} + \toprule + \textbf{原函数} & \textbf{导函数} & \textbf{原函数} & \textbf{导函数} \\ + \midrule + $C$ & $0$ & $\ln x$ & $\frac{1}{x}$ \\ + $x^\mu$ & $\mu x^{\mu - 1}$ & $\sin x$ & $\cos x$ \\ + $e^x$ & $e^x$ & $\cos x$ & $-\sin x$ \\ + \bottomrule + \end{tabular} +\end{table} + +……几乎所有量化的学科中都有\textbf{微分}的应用。例如在物理学中,运动物体其\emph{位移}对时间的导数即为其\emph{速度},\emph{速度}对时间的导数就是\emph{加速度}、物体\emph{动量}对时间的导数即为物体所受的\emph{力},重新整理后可以得到牛顿第二运动定律 $F=ma$ 。化学反应的\emph{化学反应速率}也是导数。在运筹学中,会透过导数决定在运输或是设计上最有效率的做法。 + +\begin{figure}[htbp] + \centering + \includegraphics[width=.3\textwidth]{cover.pdf} + \caption{V2 版本的封面图片} + \label{fig:qyxf-logo} +\end{figure} + +导数常用来找函数的\emph{极值}。含有微分项的方程式称为\textbf{微分方程},是自然现象描述的基础。微分以及其广义概念出现在许多数学领域中,例如\emph{复分析}、\emph{泛函分析}、\emph{微分几何}、\emph{测度}及\emph{抽象代数}\footnote{以上内容摘自维基百科中文词条 --- 微分学:\url{https://zh.wikipedia.org/wiki/微分学}。}。 + +\section{引导命令示例} + +\exercise{1} 试用配方法求解方程: +\begin{equation}\label{eq:quadratic} + ax^2 + bx + c = 0 +\end{equation} + +\solve 首先,方程左右两侧同除以 $a$,得到 +\[ x^2 + \frac bax + \frac ca = 0 \] +根据一次项来配方,按公式 $(x+A)^2=x^2+2Ax+A^2$ 配出常数项: +\[ x^2 + \frac bax + \left(\frac b{2a}\right)^2 + \frac ca - \left(\frac b{2a}\right)^2 = 0 \] +配方并移项得到 +\[ \left(x + \frac b{2a}\right)^2 = \frac {b^2}{4a^2} - \frac ca \] +方程左右开方,得 +\[ x + \frac b{2a} = \pm \sqrt{\frac {b^2}{4a^2} - \frac ca} \] +从而得到方程 \eqref{eq:quadratic} 之解为 +\begin{equation} + x = - \frac b{2a} \pm \sqrt{\frac {b^2}{4a^2} - \frac ca} +\end{equation} +该式即为一元二次方程的\textbf{通用求根公式}。 + + +\analysis 在这一问题中,需要注意以下几点 \cite{texbook,latex}: +\begin{itemize} + \item …… + \item …… + \item …… +\end{itemize} + +\begin{thebibliography}{99} + \bibitem{texbook} KNUTH~D~E. The \TeX book [M]. Addison-Wesley: Reading, 1986. + \bibitem{latex} 刘海洋. \LaTeX 入门 [M]. 人民邮电出版社: 北京, 2013. +\end{thebibliography} + +\end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/qyxf-book/figure/color-scheme.jpg b/macros/latex/contrib/qyxf-book/figure/color-scheme.jpg Binary files differnew file mode 100644 index 0000000000..afcab2cd67 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/figure/color-scheme.jpg diff --git a/macros/latex/contrib/qyxf-book/figure/cover.pdf b/macros/latex/contrib/qyxf-book/figure/cover.pdf Binary files differnew file mode 100644 index 0000000000..4250c9dd72 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/figure/cover.pdf diff --git a/macros/latex/contrib/qyxf-book/figure/qyxf-logo.pdf b/macros/latex/contrib/qyxf-book/figure/qyxf-logo.pdf Binary files differnew file mode 100644 index 0000000000..a6a38766b3 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/figure/qyxf-logo.pdf diff --git a/macros/latex/contrib/qyxf-book/figure/thumbnail.png b/macros/latex/contrib/qyxf-book/figure/thumbnail.png Binary files differnew file mode 100644 index 0000000000..2724bfcff5 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/figure/thumbnail.png diff --git a/macros/latex/contrib/qyxf-book/qyxf-book.cls b/macros/latex/contrib/qyxf-book/qyxf-book.cls new file mode 100644 index 0000000000..f69f186620 --- /dev/null +++ b/macros/latex/contrib/qyxf-book/qyxf-book.cls @@ -0,0 +1,333 @@ +% -------------------------- +% qyxf-book 钱院学辅书籍模板 +% 如不清楚含义,请勿随意更改 +% -------------------------- + +\NeedsTeXFormat{LaTeX2e}[2005/12/01] +\newcommand{\styversion}{3.0} +\newcommand{\styname}{qyxf-book} +\ProvidesClass{qyxf-book} + [2020/08/27 v3.0 Qian Yuan Xue Fu book template] +\typeout{The book template provided by Qian Yuan Xue Fu} + +% 设定 key-val 选项 +\RequirePackage{kvoptions} +\SetupKeyvalOptions{family = QYXF, prefix = QYXF@} + +% 选项定制与处理 +\DeclareStringOption[basic]{colorscheme}[basic] +\DeclareBoolOption[true]{xits} +\DeclareVoidOption{noCJKfont}{\PassOptionsToClass{fontset=none}{ctexbook}} + +% 已废弃选项提示 +\DeclareVoidOption{color}{\ClassWarning{\styname}{The option `color' is deprecated. Use `colorscheme' instead}} +\DeclareVoidOption{parskip}{\ClassWarning{\styname}{The option `parskip' is deprecated}} +\DeclareVoidOption{decoration}{\ClassWarning{\styname}{The option `decoration' is deprecated, due to the lack of `pgfornament' package in TeX Live 2020}} +\DeclareVoidOption{sourcefont}{\ClassWarning{\styname}{The option `sourcefont' is deprecated. Please customize your fonts by commands of `fontspec' and `xeCJK' package}} +\DeclareVoidOption{plain}{\ClassWarning{\styname}{The option `sourcefont' is deprecated}} +\DeclareVoidOption{opensource}{\ClassWarning{\styname}{The option `opensource' is deprecated}} + +% 处理选项 +\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessKeyvalOptions* + +% 载入文类 +\PassOptionsToPackage{no-math}{fontspec} +\PassOptionsToPackage{CJKmath = true}{xeCJK} +\LoadClass{ctexbook} + +% 西文字体处理 +\RequirePackage{amsmath} +\ifQYXF@xits + \setmainfont{XITS} + \setsansfont{TeX Gyre Heros}[Scale=0.93] + \RequirePackage{unicode-math} + \setmathfont{XITS Math} +\fi +\RequirePackage{hologo} + +% etoolbox +\RequirePackage{etoolbox} + +% 正文样式设置 +\RequirePackage[normalem]{ulem} + +% 脚注样式调整 +\renewcommand{\thefootnote}{\textbf{(\arabic{footnote})}} + +% 浮动体(图表)处理 +\RequirePackage{graphicx} +\graphicspath{{./figure/}{./pic/}{./image}} +\setlength{\textfloatsep}{6pt plus 2pt minus 4pt} +\setlength{\intextsep}{6pt plus 2pt minus 2pt} +\RequirePackage{longtable,booktabs} +\RequirePackage{tikz} +\usetikzlibrary{calc,backgrounds,shadows} +\RequirePackage[many]{tcolorbox} + +% caption 样式设定 +\RequirePackage{caption} +\DeclareCaptionFormat{colored}{\small{\bfseries\color{\@caption@color}#1} #3} +\captionsetup{ + format = colored, + skip = 1ex +} + +% 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} +% 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} +% 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} + +% 读取 color scheme +\ifdefstring{\QYXF@colorscheme}{basic}{\relax}{% + \newcommand\schemepath{colors/\QYXF@colorscheme.tex} + \input{\schemepath}} + +% tcolorbox 样式设定 +\tcbset{ + enhanced, + noparskip, + after = \noindent, + colback = \@box@background, + title filled, + colbacktitle = \@box@title@background, + colframe = \@box@frame, + coltitle = \@box@title@color, + coltext = \@box@color, + fonttitle = \bfseries, + arc = 0.25em, + boxrule = 0.5pt, + toptitle = 0.75em, + bottomtitle = 0.75em, + boxsep = 0pt, + left = 1.25em, + right = 1.25em, + top = 1.25em, + bottom = 1.25em, + drop fuzzy shadow, + breakable +} + +% 引导命令 +\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{分析}}\ } + +% 定理环境及样式设定 +\newtheorem{theorem}{定理} +\newtheorem{lemma}[theorem]{引理} +\newtheorem{define}{定义} +\BeforeBeginEnvironment{theorem}{\begin{tcolorbox}[colback=\@theorem@background,colframe=\@theorem@frame,coltext=\@theorem@color]} +\AfterEndEnvironment{theorem}{\end{tcolorbox}} +\BeforeBeginEnvironment{lemma}{\begin{tcolorbox}[colback=\@theorem@background,colframe=\@theorem@frame,coltext=\@theorem@color]} +\AfterEndEnvironment{lemma}{\end{tcolorbox}} +\BeforeBeginEnvironment{define}{\begin{tcolorbox}[colback=\@define@background,colframe=\@define@frame,coltext=\@define@color]} +\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 +} + +% 页面设置 +\RequirePackage{geometry} +\geometry{margin = 1in} +\setlength{\footskip}{30pt} +\setlength{\headheight}{15pt} + +% 链接设置 +\RequirePackage[unicode]{hyperref} +\hypersetup{ + breaklinks, + unicode, + linktoc = all, + bookmarksnumbered = true, + bookmarksopen = true, + pdfborder = {0 0 0}, + linktocpage, + pageanchor = true +} +\hypersetup{ + colorlinks = true, + linkcolor = \@link@color, + anchorcolor = \@misc@color, + urlcolor = \@link@color, + citecolor = \@misc@color +} + +% 章节标题与目录样式 +\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} +\titlespacing{\chapter}{0pt}{*1}{*4} +\titlecontents{chapter}[24pt]{\hspace{-2pc}\filright} + {\normalsize\bfseries\contentspush{\thecontentslabel\ }} + {}{\bfseries\titlerule*[8pt]{.}\contentspage} +\titlecontents{section}[20pt]{\filright} + {\contentspush{\thecontentslabel\ }} + {}{\titlerule*[8pt]{.}\contentspage} +\titlecontents{subsection}[18pt]{\hspace{2pc}\filright} + {\contentspush{\thecontentslabel\ }\itshape} + {}{\titlerule*[8pt]{}\contentspage} +\setcounter{tocdepth}{2} + +% 页眉页脚设置 +\newcommand{\footerbox}{% + {\color{\@misc@color}\bfseries\thepage}\\[-\baselineskip] + \uline{\hphantom{\@footorginfo}}\\ + \@footorginfo} +\RequirePackage{fancyhdr} +\fancyhead[EC]{\itshape\nouppercase\leftmark} +\fancyhead[OC]{\itshape\nouppercase\rightmark} +\fancyhead[EL,OR]{} +\fancyhead[ER,OL]{} +\fancyfoot[C]{\footerbox} +\fancypagestyle{plain}{% + \fancyhf{} + \fancyfoot[C]{\footerbox} + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0pt}} + +% 列表样式设置 +\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} + +% 参考文献定制 +\RequirePackage[square,numbers]{natbib} +\renewcommand{\citenumfont}[1]{{\color{\@link@color}#1}} +\renewcommand{\bibnumfmt}[1]{{\color{\@list@color}[#1]}} +\AtBeginEnvironment{thebibliography}{\addcontentsline{toc}{chapter}{\bibname}} + +% 杂项 +\RequirePackage{lastpage} +\RequirePackage{appendix} +\ctexset{appendix={number={\Roman{chapter}}}} + +% 若干 metadata +\newcommand{\@subtitle}{} +\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}} +\newcommand{\@typo}{} +\newcommand{\typo}[1]{\gdef\@typo{#1}} +\newcommand{\@cover}{} +\newcommand{\cover}[1]{\gdef\@cover{#1}} +\newcommand{\@orginfo}{% + \textit{钱学森书院学业辅导中心}\\[1ex] + \textsc{Xi'an Jiaotong University}} +\newcommand{\org}[1]{\gdef\@orginfo{#1}} +\newcommand{\@footorginfo}{\textsc{Qian Yuan Xue Fu}} +\newcommand{\footorg}[1]{\gdef\@footorginfo{#1}} +\newcommand{\@licenseinfo}{% +本作品采用% +\href{https://creativecommons.org/licenses/by-nc-nd/4.0/}% +{\bfseries CC BY-NC-ND 4.0 协议}进行许可。 +使用者可以在给出作者署名及资料来源的前提下对本作品进行转载,% +但不得对本作品进行修改,亦不得基于本作品进行二次创作,% +不得将本作品运用于商业用途。} +\newcommand{\license}[1]{\gdef\@licenseinfo{#1}} + +% 已废弃的 metadata +\newcommand{\version}[1]{\ClassWarning{\styname}{The metadata item `version' is deprecated}} +\newcommand{\sourcepage}[1]{\ClassWarning{\styname}{The metadata item `sourcepage' is deprecated}} + +% 封面样式重定义 +\newcommand{\titlefont}{\Huge\bfseries} +\newcommand{\subtitlefont}{\huge\itshape} +\newcommand{\authorfont}{\LARGE\itshape} +\newcommand{\datefont}{\Large} +\renewcommand*{\maketitle}{% + \begin{titlepage} + \null + \begin{center}\large + \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\@box@frame},% + left=20pt,top=1ex,bottom=1ex,after skip=0pt,no shadow] + {\color{\@title@color}\titlefont\@title} + \ifdefempty\@subtitle{}{\\[1ex]{\color{\@title@color}\subtitlefont\@subtitle}} + \end{tcolorbox} + \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\@title@color},% + left=20pt,top=2ex,bottom=1ex,before skip=0pt,after skip=0pt,no shadow] + {\authorfont\@author}\\\datefont\@date + \end{tcolorbox} + \vfil\@cover\vfil + \vbox{\@orginfo} + \end{center} + \vfilneg + \end{titlepage} + \thispagestyle{empty} + \newpage + \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} + \end{tcolorbox} + \ifdefempty\@licenseinfo{}{% + \begin{tcolorbox}[title={\bfseries 许可证说明}] + \@licenseinfo + \end{tcolorbox}} + \newpage + \pagestyle{fancy}} +\AtBeginDocument{% + \hypersetup{ + pageanchor=false, + pdfauthor=\@author, + pdftitle=\@title, + pdfsubject={\@author: \@title\ifdefempty{\@subtitle}{}{ - \textit{\@subtitle}}}, + pdfkeywords={qyxf, book}, + pdfcreator={XeLaTeX with \styname\ v\styversion\ \ifdefempty{\@typo}{}{(by \@typo)}} + }} + +% 目录样式重定义 +\renewcommand\tableofcontents{% +\pagestyle{empty} +\begin{center}% +\normalfont\LARGE\bfseries\contentsname% +\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname} +\end{center} +\vskip 3ex% +{\setlength\parskip{0pt}\@starttoc{toc}} +\cleardoublepage +\pagestyle{fancy} +\setcounter{page}{1} +} + +\endinput |