diff options
author | Norbert Preining <norbert@preining.info> | 2021-05-03 03:00:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-05-03 03:00:43 +0000 |
commit | bf393e635d1fb55b009da7ade3001c104c7deb48 (patch) | |
tree | 46ff95216d294610b559d25f56ba796d875b5c2f /macros | |
parent | db2a2e7b5c4ca1335618a0b5f5c574229bf459f6 (diff) |
CTAN sync 202105030300
Diffstat (limited to 'macros')
26 files changed, 2849 insertions, 2177 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/windycity/CHANGES.md b/macros/latex/contrib/biblatex-contrib/windycity/CHANGES.md index 960197f84f..ea102f1f03 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/CHANGES.md +++ b/macros/latex/contrib/biblatex-contrib/windycity/CHANGES.md @@ -8,6 +8,66 @@ indicate updates to Windy City's [repository on GitHub](https://github.com/brianchase/windycity "GitHub: brianchase/windycity"). +## 2021-05-02 + +This release brings a long overdue redesign of the workflow for +editors and translators. My hope is that users won't need to change +their bibliography databases, but I did need to change one example in +the user guide, moving an editor name list from a child entry to its +parent, where it belonged in the first place. In all, the changes +greatly extend the control and flexibility that users have over the +placement of editors and translators while allowing for simpler +internals. + +* highlights pertaining to editors and translators: + + - added support for the following editorial roles: + + + expanded by... + + expanded and compiled by... + + expanded and edited by... + + expanded and revised by... + + expanded and translated by... + + expanded and updated by... + + compiled and expanded by... + + edited and expanded by... + + revised and expanded by... + + translated and expanded by... + + updated and expanded by... + + - added support for translators of `issuetitle` and `series`, which + means you may assign translators to every title to which you may + assign editors + - editor and translator type fields now accept comma-separated + bibliography strings, making all editorial roles available for + `issuetitle`, `maintitle`, and `series` (e.g. if `editor` is the + reviser of `maintitle`, put `maintitle,reviser` or + `reviser,maintitle` in `editortype`) + - added `swaptrans:issuetitle`, `swaptrans:maintitle`, and + `swaptrans:series` entry options to swap positions of editors and + translators of `issuetitle`, `maintitle`, and `series` + - for special circumstances (explained in the user guide), added + three more entry options for swapping editors and translators: + `swaptrans:title`, `swaptrans:booktitle`, and + `swaptrans:bookbooktitle` + - added support for printing a second tier of editors after `title`, + `issuetitle`, `maintitle`, and `series` (e.g. "Edited by Jane Doe. + Revised and Expanded by John Smith") + - if the editors and translators of a work are the same, you can + control the assignment in several ways, including with just one + name list and its corresponding type field (e.g. if Jane Doe is + the compiler and translator of `title`, you can, among other + options, put `Doe, Jane` in `editor` and `comptrans` in + `editortype` or `Doe, Jane` in `translator` and `comptrans` in + `translatortype`) + - fixed several issues, at least, affecting the placement of + editors and translators, mainly the latter + +* added preamble option `shortafter` to print the same output as the + preamble option `short` but with long first citations +* for works in certain collections, fixed punctuation after the + `edition` field + ## 2021-01-30 * added support for the `pubstate` field to indicate when a work is diff --git a/macros/latex/contrib/biblatex-contrib/windycity/american-windycity.lbx b/macros/latex/contrib/biblatex-contrib/windycity/american-windycity.lbx index c368285793..8d932f698f 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/american-windycity.lbx +++ b/macros/latex/contrib/biblatex-contrib/windycity/american-windycity.lbx @@ -1,4 +1,4 @@ -% Last modified: Sat 30 Jan 2021 06:17:59 PM CST +% Last modified: Sun 02 May 2021 01:14:34 PM CDT % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License (LPPL), @@ -11,7 +11,7 @@ % implied warranties of merchantability and fitness for a particular % purpose. -\ProvidesFile{american-windycity.lbx}[2021/01/30 Windy City +\ProvidesFile{american-windycity.lbx}[2021/05/02 Windy City localization module for biblatex] \InheritBibliographyExtras{american} \InheritBibliographyStrings{american} @@ -119,9 +119,10 @@ } \NewBibliographyString{by} -\NewBibliographyString{comped,comped+,compiler,compiler+,comprev,comprev+,comptrans,comptrans+,compup,compup+} -\NewBibliographyString{editor+,edcomp,edcomp+,edrev,edrev+,edtrans,edtrans+,edup,edup+} +\NewBibliographyString{comp,comp+,comped,comped+,compex,compex+,compiler,compiler+,comprev,comprev+,comptrans,comptrans+,compup,compup+} +\NewBibliographyString{ed,ed+,editor+,edcomp,edcomp+,edex,edex+,edrev,edrev+,edtrans,edtrans+,edup,edup+} \NewBibliographyString{expanded} +\NewBibliographyString{ex,ex+,excomp,excomp+,exed,exed+,expander,expander+,exrev,exrev+,extrans,extrans+,exup,exup+} \NewBibliographyString{noplace} \NewBibliographyString{of} \NewBibliographyString{origpub} @@ -132,15 +133,14 @@ \NewBibliographyString{pseudo} \NewBibliographyString{reprint,reprinted} \NewBibliographyString{review,reviewnoauth} -\NewBibliographyString{revcomp,revcomp+,reved,reved+,reviser,reviser+,revtrans,revtrans+,revup,revup+} +\NewBibliographyString{rev,rev+,revcomp,revcomp+,reved,reved+,revex,revex+,reviser,reviser+,revtrans,revtrans+,revup,revup+} \NewBibliographyString{revised} \NewBibliographyString{selfpub} \NewBibliographyString{special} \NewBibliographyString{subverbo,subverbos} -\NewBibliographyString{transcomp,transcomp+,transed,transed+,translator+,transrev,transrev+,transup,transup+} -\NewBibliographyString{upcomp,upcomp+,updater,updater+,uped,uped+,uprev,uprev+,uptrans,uptrans+} +\NewBibliographyString{trans,trans+,transcomp,transcomp+,transed,transed+,transex,transex+,translator+,transrev,transrev+,transup,transup+} +\NewBibliographyString{up,up+,upcomp,upcomp+,updater,updater+,uped,uped+,upex,upex+,uprev,uprev+,uptrans,uptrans+} \NewBibliographyString{updated} -\NewBibliographyString{updater} \NewBibliographyString{working} \DeclareBibliographyStrings{% @@ -151,8 +151,12 @@ by = {{by}{by}}, chapter = {{chap\adddot}{chap\adddot}}, citedas = {{hereafter cited as}{hereafter cited as}}, + comp = {{compiled by}{comp\adddot}}, + comp+ = {{compiled by}{comps\adddot}}, comped = {{compiled and edit\-ed by}{comp\adddotspace and ed\adddot}}, comped+ = {{compiled and edit\-ed by}{comps\adddotspace and eds\adddot}}, + compex = {{compiled and expanded by}{comp\adddotspace and exp\adddot}}, + compex+ = {{compiled and expanded by}{comps\adddotspace and exp\adddot}}, compiler = {{compiled by}{comp\adddot}}, compiler+ = {{compiled by}{comps\adddot}}, comprev = {{compiled and revised by}{comp\adddotspace and rev\adddot}}, @@ -161,8 +165,12 @@ comptrans+ = {{compiled and translated by}{comps\adddotspace and trans\adddot}}, compup = {{compiled and updated by}{comp\adddotspace and up\adddot}}, compup+ = {{compiled and updated by}{comps\adddotspace and up\adddot}}, + ed = {{edit\-ed by}{ed\adddot}}, + ed+ = {{edit\-ed by}{eds\adddot}}, edcomp = {{edit\-ed and compiled by}{ed\adddotspace and comp\adddot}}, edcomp+ = {{edit\-ed and compiled by}{eds\adddotspace and comps\adddot}}, + edex = {{edit\-ed and expanded by}{ed\adddotspace and exp\adddot}}, + edex+ = {{edit\-ed and expanded by}{eds\adddotspace and exp\adddot}}, edition = {{ed\adddot}{ed\adddot}}, editor = {{edit\-ed by}{ed\adddot}}, editor+ = {{edit\-ed by}{eds\adddot}}, @@ -172,7 +180,21 @@ edtrans+ = {{edit\-ed and translated by}{eds\adddotspace and trans\adddot}}, edup = {{edit\-ed and updated by}{ed\adddotspace and up\adddot}}, edup+ = {{edit\-ed and updated by}{eds\adddotspace and up\adddot}}, + ex = {{expanded by}{exp\adddot}}, + ex+ = {{expanded by}{exp\adddot}}, + excomp = {{expanded and compiled by}{exp\adddotspace and comp\adddot}}, + excomp+ = {{expanded and compiled by}{exp\adddotspace and comps\adddot}}, + exed = {{expanded and edit\-ed by}{exp\adddotspace and ed\adddot}}, + exed+ = {{expanded and edit\-ed by}{exp\adddotspace and eds\adddot}}, expanded = {{expanded edition}{exp\adddotspace ed\adddot}}, + expander = {{expanded by}{exp\adddot}}, + expander+ = {{expanded by}{exp\adddot}}, + exrev = {{expanded and revised by}{exp\adddotspace and rev\adddot}}, + exrev+ = {{expanded and revised by}{exp\adddotspace and revs\adddot}}, + extrans = {{expanded and translated by}{exp\adddotspace and trans\adddot}}, + extrans+ = {{expanded and translated by}{exp\adddotspace and trans\adddot}}, + exup = {{expanded and updated by}{exp\adddotspace and up\adddot}}, + exup+ = {{expanded and updated by}{exp\adddotspace and up\adddot}}, foreword = {{foreword to}{foreword to}}, forthcoming = {{forthcoming}{forthcoming}}, ibidem = {{ibid\adddot}{ibid\adddot}}, @@ -195,8 +217,12 @@ references = {{Bibliography}{Bibliography}}, reprint = {{reprint}{repr\adddot}}, reprinted = {{reprinted in}{reprinted in}}, + rev = {{revised by}{rev\adddot}}, + rev+ = {{revised by}{revs\adddot}}, reved = {{revised and edit\-ed by}{rev\adddotspace and ed\adddot}}, reved+ = {{revised and edit\-ed by}{revs\adddotspace and eds\adddot}}, + revex = {{revised and expanded by}{rev\adddotspace and exp\adddot}}, + revex+ = {{revised and expanded by}{revs\adddotspace and exp\adddot}}, revcomp = {{revised and compiled by}{rev\adddotspace and comp\adddot}}, revcomp+ = {{revised and compiled by}{revs\adddotspace and comps\adddot}}, review = {{review of}{review of}}, @@ -212,16 +238,22 @@ special = {{special issue}{special issue}}, subverbo = {{s\adddot v\adddot}{s\adddot v\adddot}}, subverbos = {{s\adddot vv\adddot}{s\adddot vv\adddot}}, + trans = {{translated by}{trans\adddot}}, + trans+ = {{translated by}{trans\adddot}}, transcomp = {{translated and compiled by}{trans\adddotspace and comp\adddot}}, transcomp+ = {{translated and compiled by}{trans\adddotspace and comps\adddot}}, transed = {{translated and edit\-ed by}{trans\adddotspace and ed\adddot}}, transed+ = {{translated and edit\-ed by}{trans\adddotspace and eds\adddot}}, + transex = {{translated and expanded by}{trans\adddotspace and exp\adddot}}, + transex+ = {{translated and expanded by}{trans\adddotspace and exp\adddot}}, translator = {{translated by}{trans\adddot}}, translator+ = {{translated by}{trans\adddot}}, transrev = {{translated and revised by}{trans\adddotspace and rev\adddot}}, transrev+ = {{translated and revised by}{trans\adddotspace and revs\adddot}}, transup = {{translated and updated by}{trans\adddotspace and up\adddot}}, transup+ = {{translated and updated by}{trans\adddotspace and up\adddot}}, + up = {{updated by}{up\adddot}}, + up+ = {{updated by}{up\adddot}}, upcomp = {{updated and compiled by}{up\adddotspace and comp\adddot}}, upcomp+ = {{updated and compiled by}{up\adddotspace and comps\adddot}}, updated = {{updated edition}{up\adddotspace ed\adddot}}, @@ -229,6 +261,8 @@ updater+ = {{updated by}{up\adddot}}, uped = {{updated and edit\-ed by}{up\adddotspace and ed\adddot}}, uped+ = {{updated and edit\-ed by}{up\adddotspace and eds\adddot}}, + upex = {{updated and expanded by}{up\adddotspace and exp\adddot}}, + upex+ = {{updated and expanded by}{up\adddotspace and exp\adddot}}, uprev = {{updated and revised by}{up\adddotspace and rev\adddot}}, uprev+ = {{updated and revised by}{up\adddotspace and revs\adddot}}, uptrans = {{updated and translated by}{up\adddotspace and trans\adddot}}, diff --git a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.bib b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.bib index c26415de37..8c4342505a 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.bib +++ b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.bib @@ -53,6 +53,46 @@ publisher = ucp, year = {2002} } +@InCollection{doe2017a, + options = {swaptrans:title}, + title = {An Essay}, + editor = {Smith, John}, + translator = {Smith, John}, + pages = {18–35}, + crossref = {jones2017} +} +@InCollection{doe2017b, + options = {swaptrans:booktitle}, + title = {An Essay}, + editor = {Smith, John}, + translator = {Smith, John}, + pages = {18–35}, + crossref = {jones2017} +} +@InCollection{doe2017c, + options = {swaptrans:bookbooktitle}, + title = {An Essay}, + editor = {Smith, John}, + translator = {Smith, John}, + pages = {18–35}, + crossref = {jones2017} +} +@InBook{jones2017, + title = {A Volume of Essays}, + editor = {Smith, John}, + translator = {Smith, John}, + volume = {1}, + crossref = {white2017} +} +@Collection{white2017, + title = {A Collection of Essays}, + editor = {Smith, John}, + translator = {Smith, John}, + volumes = {3}, + address = {Chicago}, + publisher = {University of Chicago Press}, + year = {2017} +} @InCollection{thoreau2007.7, title = {Walking}, pages = {185–222}, @@ -81,42 +121,40 @@ publisher = ucp, year = {1948} } -@InBook{spinoza1900.1.1, - title = {A Theological-Political Treatise}, - crossref = {spinoza1900.1} +@InCollection{myers2012, + author = {Myers, Herbert}, + title = {Pitch and Transposition}, + pages = {375--393}, + crossref = {carter2012} } -@Collection{spinoza1900.1, - author = {Spinoza, Benedict de}, - title = {The Chief Works of Benedict de Spinoza}, -% edition = {rev. ed.},% alternative to below: - edition = {revised}, - translator = {Elwes, R. H. M.}, - volume = {1}, - address = {London}, - publisher = {George Bell {and} Sons}, - year = {1900} +@Collection{carter2012, + title = {A Performer's Guide to Seventeenth-Century Music}, + edition = {2}, + editor = {Carter, Stewart}, + editora = {Kite-Powell, Jeffery}, + editoratype = {revex}, + address = {Bloomington}, + publisher = {Indiana University Press}, + year = {2012} } @InCollection{doe2018, + keywords = {notinbib,notinref}, author = {Doe, Jane}, title = {A Poem}, translator = {Smith, John}, pages = {56–57}, crossref = {jones2018} } -@InCollection{edwards2018, - author = {Adams, Mary}, - title = {Another Poem}, - pages = {128–32}, - crossref = {jones2018} -} @InBook{jones2018, + keywords = {notinbib,notinref}, editor = {Jones, David}, title = {A Volume of Poems}, volume = {2}, year = {2018}, - crossref = {blow2016} + crossref = {white2016} } -@Collection{blow2016, +@Collection{white2016, + keywords = {notinbib,notinref}, editor = {White, Amy}, title = {A Collection of Poems}, volumes = {4}, @@ -124,6 +162,47 @@ publisher = ucp, year = {2016–18} } +@InCollection{doe2018.alt, + keywords = {notinbib,notinref}, + author = {Doe, Jane}, + title = {A Poem}, + translator = {Smith, John}, + pages = {56–57}, + booktitle = {A Volume of Poems}, + editor = {Jones, David}, + editortype = {booktitle}, + bookvolume = {2}, + year = {2018}, + bookbooktitle = {A Collection of Poems}, + editora = {White, Amy}, + editoratype = {bookbooktitle}, + volumes = {4}, + address = {Chicago}, + publisher = ucp, + bookyear = {2016–18} +} +@InBook{spinoza1900.1.1, + title = {A Theological-Political Treatise}, + crossref = {spinoza1900.1} +} +@Collection{spinoza1900.1, + author = {Spinoza, Benedict de}, + title = {The Chief Works of Benedict de Spinoza}, +% edition = {rev. ed.},% alternative to below: + edition = {revised}, + translator = {Elwes, R. H. M.}, + volume = {1}, + address = {London}, + publisher = {George Bell {and} Sons}, + year = {1900} +} +@InCollection{adams2018, + keywords = {notinbib,notinref}, + author = {Adams, Mary}, + title = {Another Poem}, + pages = {128–32}, + crossref = {jones2018} +} % 13.65 Full in-text citation @@ -682,7 +761,6 @@ @Book{maclean1976, author = {Maclean, Norman}, title = {A River Runs through It, and Other Stories}, - shorttitle = {A River Runs through It}, address = {Chicago}, publisher = ucp, year = {1976} @@ -1342,7 +1420,6 @@ year = {1977} } @InBook{harley1994, - editor = {Harley, J. B. and Woodward, David}, title = {Cartography in the Traditional East and Southeast Asian Societies}, volume = {2}, part = {bk. 2}, @@ -1350,6 +1427,7 @@ crossref = {cartography1987} } @Collection{cartography1987, + editor = {Harley, J. B. and Woodward, David}, title = {The History of Cartography}, address = {Chicago}, publisher = ucp, diff --git a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.pdf b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.pdf Binary files differindex 02d6ab3aa1..4000a3da1c 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.pdf +++ b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.pdf diff --git a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.sty b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.sty index 718c4f6180..c001e45902 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.sty +++ b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.sty @@ -1,4 +1,4 @@ -% Last modified: Tue 10 Nov 2020 07:45:15 AM CST +% Last modified: Tue 13 Apr 2021 05:25:58 PM CDT \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{windycity} \RequirePackage{ifxetex} @@ -164,17 +164,17 @@ \defbibheading{biblist}{% \newpage - \begin{center}\section*{Abbreviations}\end{center} + \section*{Abbreviations} \addcontentsline{toc}{section}{Abbreviations} \markright{Abbreviations}}% \defbibheading{bibliography}{% \newpage - \begin{center}\section*{Bibliography (Standard Format)}\end{center} + \section*{Bibliography (Standard Format)} \addcontentsline{toc}{section}{Bibliography (Standard Format)} \markright{Bibliography}}% \defbibheading{references}{% \newpage - \begin{center}\section*{References (Author-Date Format)}\end{center} + \section*{References (Author-Date Format)} \addcontentsline{toc}{section}{References (Author-Date Format)} \markright{References}}% \defbibheading{none}{}% diff --git a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.tex b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.tex index f6ca4e6426..07f1fc504c 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.tex +++ b/macros/latex/contrib/biblatex-contrib/windycity/doc/windycity.tex @@ -1,4 +1,4 @@ -% Last modified: Sat 30 Jan 2021 06:32:36 PM CST +% Last modified: Sun 02 May 2021 01:06:52 PM CDT \documentclass[11pt,letterpaper,oneside]{article} \usepackage{windycity} @@ -8,7 +8,7 @@ \author{Brian Chase} \email{brianmichaelchase@gmail.com} \website{https://github.com/brianchase/windycity} -\version{2021-01-30} +\version{2021-05-02} \maketitle \begingroup \hypersetup{linkcolor=black} @@ -35,13 +35,13 @@ City especially suitable for academic work. The following sections assume familiarity with \textit{CMOS} and \biblatex. Section \ref{overview} gives a brief overview of the -style's features. Section \ref{edtrans} discusses the assignment and -placement of editors, translators, and the like. Section -\ref{collections} discusses several issues with collections, including -options for formatting citations of individual volumes. Sections -\ref{notes} and \ref{paren} reproduce examples from \textit{CMOS} -chapters 14 and 15, respectively, with occasional commentary and -references to other sections. +style's features. Section \ref{editors} discusses the assignment and +placement of editors and translators. Section \ref{collections} +discusses several issues with collections, including options for +formatting citations of individual volumes. Sections \ref{notes} and +\ref{paren} reproduce examples from \textit{CMOS} chapters 14 and 15, +respectively, with occasional commentary and references to other +sections. Windy City requires \biblatex version 3.13 or later. @@ -63,10 +63,12 @@ some distributions of \LaTeX, you might be able to skip this step. Either way, please consider downloading the most recent release of Windy City from \begingroup \hypersetup{urlcolor=blue} -\href{https://www.ctan.org/pkg/windycity}{its home on CTAN}. More -recent but potentially less reliable updates are available from Windy -City's \href{https://github.com/brianchase/windycity}{repository on -GitHub}.\endgroup +\href{https://www.ctan.org/pkg/windycity}{its home on CTAN}. Releases +without the PDF user guide are available from Windy City's +\href{https://github.com/brianchase/windycity/releases}{repository on +GitHub}. More recent but potentially less reliable updates are +available on \href{https://github.com/brianchase/windycity}{the main +project page}.\endgroup Windy City consists of four files: @@ -198,11 +200,11 @@ may have problems with sorting. (You'll notice some in \ref{ref}, at the end of this document.) For best results, use the \opt{reflist} preamble option. -As you proceed through the this guide, note that all examples of -citations and bibliographies are outputs of the style from commands -that you can inspect in the document's source, \file{windycity.tex}, -and in its style file, \file{windycity.sty}. Almost all citations are -from \cmd{cite} or \cmd{parencite}. A few are from more specialized +As you proceed through this guide, note that all examples of citations +and bibliographies are outputs of the style from commands that you can +inspect in the document's source, \file{windycity.tex}, and in its +style file, \file{windycity.sty}. Almost all citations are from +\cmd{cite} or \cmd{parencite}. A few are from more specialized commands, such as \cmd{cite*} or \cmd{cites}. All example bibliographies are outputs of the style from \cmd{printbibliography}. All bibliographic data reside in \file{windycity.bib}. @@ -211,7 +213,7 @@ All bibliographic data reside in \file{windycity.bib}. \label{short} Standard citations may take a variety of shorter forms. Windy City -offers several preamble options and other means for reproducing them. +offers several preamble options and other means for producing them. Let's start with another passage of default output: @@ -308,17 +310,19 @@ break here may affect the output.} \item \cite[33]{morrison2004a} \end{citeonly} -Other ways to make citations more concise: For a compromise between -standard and short forms, try the preamble option \opt{shortfirst}. -It swaps long first citations for short ones but otherwise follows the -standard (see section \ref{preamble}). Also with standard citations, -the preamble option \opt{idemtracker} shortens the author's name of a -work's first citation if the previous citation is of the same author -(see section \ref{preamble}). The entry option \opt{noauth} omits the -author's name altogether (see section \ref{entry}). And the -\bibfield{shorthand} field allows you to set an abbreviation to stand -in place of the author's name, the work's title, and other elements of -a citation (see sections \ref{otherfields} and \ref{14.59}). +For a compromise between standard and short forms, try the preamble +option \opt{shortfirst}. It swaps long first citations for short ones +but otherwise follows the standard form (see section \ref{preamble}). +For another variant, try \opt{shortafter}, which gives the same output +as \opt{short} but with long first citations. Also with standard +citations, the preamble option \opt{idemtracker} shortens the author's +name of a work's first citation if the previous citation is of the +same author (see section \ref{preamble}). The entry option +\opt{noauth} omits the author's name altogether (see section +\ref{entry}). And the \bibfield{shorthand} field allows you to set an +abbreviation to stand in place of the author's name, the work's title, +and other elements of a citation (see sections \ref{otherfields} and +\ref{14.59}). \subsection{Preamble Options} \label{preamble} @@ -380,7 +384,7 @@ collections. For discussion of multivolume works, see section \noindent This option controls whether consecutive citations of a work on the same page receive an \textit{ibid}. The qualification ``on the same page'' means that \textit{ibid.} always refers to a work cited on -the current page without an \textit{ibid.} The latter isn't a +the current page without an \textit{ibid}. The latter isn't a requirement of \textit{CMOS} but seems reasonable, since it prevents readers from having to look at another page to find the referent of an \textit{ibid}. For examples of its output, see section \ref{short} and @@ -439,13 +443,10 @@ information. \noindent As shown in section \ref{short}, this option prints short citations (see \textit{CMOS} \ref{14.34}). The use of \opt{short} has -one feature in common with \opt{ibid}: Just as \textit{ibid.} appears -only for consecutive citations of a work on the same page, and so -never refers to a citation on a previous page, \opt{short} affects -consecutive citations of a work on the same page, never in reference -to a citation on a previous page. As with \textit{ibid.}, this feature -isn't required by \textit{CMOS}, but it prevents readers from having -to look at another page to find the title of a citation. +one feature in common with \opt{ibid}: It affects only consecutive +citations of a work on the same page. As with \textit{ibid.}, this +feature isn't required by \textit{CMOS}, but it prevents readers from +having to look at another page to find the title of a citation. In contexts where \opt{short} would drop a title from a citation, but where no name occupies the author's position, it prints the work's @@ -457,15 +458,52 @@ As noted earlier, \opt{short} has the same effect on first citations as \opt{shortfirst}. But recall from section \ref{short} that you can combine \opt{short} and \opt{ibid} for more concise output. +\optitem[false]{shortafter}{\opt{true}, \opt{false}} + +\noindent If you want the output of \opt{short} but with long first +citations, use \opt{shortafter}. Compare the following with examples +in \textit{CMOS} \ref{14.34}: + +% The option 'short' implies the option 'shortfirst'. The option +% 'shortafter' doesn't. Hence, to display the output of 'shortafter' +% below, you need only toggle true 'short'. + +\begin{citeonly} +\AtNextCitekey{\toggletrue{short}} +\item \cite[3]{morrison2004a} +\AtNextCitekey{\toggletrue{short}} +\item \cite[18]{morrison2004a} +\AtNextCitekey{\toggletrue{short}} +\item \cite[18]{morrison2004a} +\AtNextCitekey{\toggletrue{short}} +\item \cite[24--26]{morrison2004a} +\AtNextCitekey{\toggletrue{short}} +\item \cite[401-2]{morrison2004b} +\AtNextCitekey{\toggletrue{short}} +\item \cite[433]{morrison2004b} +\AtNextCitekey{\toggletrue{short}} +\item \cite[37--38]{diaz2008} +\AtNextCitekey{\toggletrue{short}} +\item \cite[403]{morrison2004b} +\AtNextCitekey{\toggletrue{short}} +\item \cite[152]{diaz2008} +\AtNextCitekey{\toggletrue{short}} +\item \cite[201-2]{diaz2008} +\AtNextMultiCite{\toggletrue{short}} +\item \cites[240]{morrison2004b}[32]{morrison2004a} +\AtNextCitekey{\toggletrue{short}} +\item \cite[33]{morrison2004a} +\end{citeonly} + \optitem[false]{shortfirst}{\opt{true}, \opt{false}} \noindent Use this option to shorten a work's first citation. The resulting output consists mainly of the author's name and the work's title. According to \textit{CMOS}, this approach is optional for documents with complete bibliographies. (See \textit{CMOS} -\ref{14.23}, also 14.29--14.36.) You may use \opt{shortfirst} in -conjunction with \opt{ibid}. However, it adds nothing to \opt{short}, -which has the same effect on first citations. +\ref{14.23}, also 14.29--14.36.) As with \opt{short}, you may use +\opt{shortfirst} in conjunction with \opt{ibid} for more concise +citations. \optitem[false]{shortlinks}{\opt{true}, \opt{false}} @@ -476,8 +514,8 @@ bibliography. In standard citations, these links encompass the entire citation (minus some punctuation). With \opt{shortlinks}, they're embedded in just one element: the title or, if no title is present, whatever part of the citation occupies the author's position, such as -the author's name, \textit{ibid.}, or a shorthand. For comparison, -here's what default links are like in blue: +the author's name, \textit{ibid.}, or a shorthand. For comparison, the +blue text below shows default links: \hypersetup{citecolor=blue} \begin{citeonly} @@ -520,10 +558,9 @@ For more information, see section \ref{collorder}. \subsection{Entry Options} \label{entry} -An entry option is a value for the \bibfield{options} field of a -work's database entry. It affects the format of that particular work. -For options that affect the format of every work, see section -\ref{preamble}. +An entry option goes in the \bibfield{options} field of a work's +database entry. It affects the format of that work. For options that +affect the format of every work, see section \ref{preamble}. \begin{optionlist} @@ -604,21 +641,74 @@ to skip the \textit{date}. See section \ref{entrytypes} for examples. translator, use \opt{swapauth}. This option works for \bibtype{book}, \bibtype{bookinbook}, \bibtype{collection}, \bibtype{inbook}, and \bibtype{incollection} entry types. For more information, see section -\ref{edtranspos}. +\ref{editors:swap}. \optitem[false]{swaptrans}{\opt{true}, \opt{false}} \noindent According to \textit{CMOS}, if a work has an editor and a translator, their names should appear in citations in the order in which they appear on the work's title page (see \textit{CMOS} -\ref{14.104}). By default, the style lists editors first. Entries with -the option \bibfield{swaptrans} reverse this order: Their translators -print first. If a work's translators and editors are the same, -\bibfield{swaptrans} reverses the order of their roles, say, from -\textit{edited and translated by} to \textit{translated and edited -by}. The same goes for compilers, revisers, and updaters, which the -style treats as specialized editors. For more information, see section -\ref{edtranspos}. +\ref{14.104}). By default, the style lists editors first. The option +\bibfield{swaptrans} reverses this order: Their translators print +first. If a work's translators and editors are the same, +\bibfield{swaptrans} reverses their roles, say, from \textit{edited +and translated by} to \textit{translated and edited by}. The same goes +for compilers, expanders, revisers, and updaters---all of whom the +style treats as specialized editors. For editors and translators of an +\bibfield{issuetitle}, \bibfield{maintitle}, or \bibfield{series}, see +their respective options below. See also section \ref{editors:swap}. + +\optitem[false]{swaptrans:book}{\opt{true}, \opt{false}} + +A short form of \opt{swaptrans:booktitle}. See below. + +\optitem[false]{swaptrans:bookbook}{\opt{true}, \opt{false}} + +A short form of \opt{swaptrans:bookbooktitle}. See below. + +\optitem[false]{swaptrans:bookbooktitle}{\opt{true}, \opt{false}} + +Like \opt{swaptrans} but narrower in scope. It applies only to the +editors and translators of a \bibfield{bookbooktitle} (a double +cross-referenced \bibfield{title}). See section \ref{editors:swap}. + +\optitem[false]{swaptrans:booktitle}{\opt{true}, \opt{false}} + +Like \opt{swaptrans} but narrower in scope. It applies only to the +editors and translators of a \bibfield{booktitle} (a cross-referenced +\bibfield{title}). See section \ref{editors:swap}. + +\optitem[false]{swaptrans:issue}{\opt{true}, \opt{false}} + +A short form of \opt{swaptrans:issuetitle}. See below. + +\optitem[false]{swaptrans:issuetitle}{\opt{true}, \opt{false}} + +Like \opt{swaptrans} but for editors and translators of an +\bibfield{issuetitle}. + +\optitem[false]{swaptrans:main}{\opt{true}, \opt{false}} + +A short form of \opt{swaptrans:maintitle}. See below. + +\optitem[false]{swaptrans:maintitle}{\opt{true}, \opt{false}} + +Like \opt{swaptrans} but for editors and translators of a +\bibfield{maintitle}. + +\optitem[false]{swaptrans:series}{\opt{true}, \opt{false}} + +Like \opt{swaptrans} but for editors and translators of a +\bibfield{series}. + +\optitem[false]{swaptrans:title}{\opt{true}, \opt{false}} + +Like \opt{swaptrans} but narrower in scope. It applies only to the +editors and translators of a \bibfield{title}, whereas +\bibfield{swaptrans} also affects those of a \bibfield{booktitle} (a +cross-referenced \bibfield{title}) and a \bibfield{bookbooktitle} (a +double cross-referenced \bibfield{title}). See section +\ref{editors:swap}. \optitem[false]{swapvol}{\opt{true}, \opt{false}} @@ -674,7 +764,7 @@ citation commands from \biblatex that Windy City supports: \noindent New users should get comfortable with \cmd{cite} and \cmd{footcite} (for notes) and \cmd{parencite} (for parenthetical citations). Their multicite forms---\cmd{cites}, \cmd{footcites}, and -\cmd{parencites}---take comma-separated lists of entry keys, while +\cmd{paren\-cites}---take comma-separated lists of entry keys, while allowing you to specify distinct \bibfield{prenote} and \bibfield{postnote} fields for each work. @@ -997,7 +1087,8 @@ in perhaps unexpected ways. \label{stdfields} Examples in this document don't always make it clear how Windy City -uses standard data fields. The section discusses some of them. +uses standard data fields. The list below highlights a selection of +fields that merit special attention. \begin{marglist} @@ -1012,7 +1103,7 @@ From \textit{CMOS} \ref{14.79}: \item \cite{hawkes1834} \end{citebib} -With respect to pseudonymous authors, another solution is to use the +For pseudonymous authors, another solution is to use the \bibfield{nameaddon} field. Unlike with \bibfield{authtype}, \bibfield{nameaddon} allows you to include an author's given name in the brackets. For examples, see \textit{CMOS} \ref{14.81}. @@ -1022,7 +1113,7 @@ edition's number in this field---for example, \textit{2} for a second edition. To indicate a revised edition, enter either \textit{revised} or \textit{rev. ed.} Both options give the same output. For expanded and updated editions, you may use \textit{expanded} or -\textit{updated}. Add additional data as necessary. For the following +\textit{updated}. Add additional data as necessary. In the following example from \textit{CMOS} bibliography 2.4, \bibfield{edition} contains \textit{updated edition by Arlene O'Sean and Antoinette Schleyer}: @@ -1039,9 +1130,9 @@ edition, such as \textit{Sunday Book Review} (see \textit{CMOS} \biblatex provides for electronic publishing information, even though the output doesn't conform to \textit{CMOS}. To that end, you may use the \bibfield{eprint} field, along with its cousins -\bibfield{eprinttype} and \bibfield{eprintclass}, and all the -associated options (\opt{eprint}, \opt{doi}, and \opt{url}), which are -set to \textit{true} by default. +\bibfield{eprinttype} and \bibfield{eprintclass}, and associated +options (\opt{eprint}, \opt{doi}, and \opt{url}), all of which are set +to \textit{true} by default. \item[issue] Windy City uses this field with \bibtype{article}, \bibtype{online}, and \bibtype{review} entry types (and their aliases) @@ -1087,7 +1178,7 @@ have an \bibtype{article} or \bibtype{periodical} entry (see \textit{CMOS} \ref{14.172}). For forthcoming works, see \textit{CMOS} \ref{14.146}, \ref{14.172}, and \ref{15.45}. Forthcoming works also print correctly with \textit{forthcoming} in the \bibfield{year} -field, as previous versions of the style required. +field. \begin{bibonly} \nocite{faraday,huang2015,jubb2015,lucki1980} @@ -1118,12 +1209,13 @@ In rare cases, \bibfield{type} is necessary for \bibtype{article} and bibliographic information doesn't allow Windy City to distinguish a journal article from a magazine or newspaper article. This happens when a magazine or newspaper article has an issue number. Normally, -Windy City would respond by printing the issue number before the date -and enclosing the date in parentheses. But the issue number needs to -go first, and the date shouldn't be in parentheses. The workaround is -to include a \bibfield{type} field with the value \textit{newsmag}. -For an example, see \textit{CMOS} \ref{14.204} and compare it with the -citation of Beattie in \ref{14.171}. +Windy City prints an issue number before the date and encloses the +date in parentheses. But for magazine and newspaper articles, the +issue number should go first, and the date shouldn't be in +parentheses. The workaround is to include a \bibfield{type} field with +the value \textit{newsmag}. For an example, see \textit{CMOS} +\ref{14.204} and compare it with the citation of Beattie in +\ref{14.171}. \end{marglist} @@ -1132,10 +1224,10 @@ citation of Beattie in \ref{14.171}. Some of Windy City's nonstandard data fields are for its internal handling of cross-referencing. Those fields aren't listed below, as -they're not meant for use in a bibliography database. The rest store -information that's crucial for correct formatting. Without them, quite -a few citations in this document wouldn't match their counterparts in -\textit{CMOS}. +they're not usually meant for use in a bibliography database (but see +section \ref{editors.other}). The rest store information that's +crucial for correct formatting. Without them, quite a few citations in +this document wouldn't match their counterparts in \textit{CMOS}. \begin{marglist} @@ -1144,16 +1236,23 @@ blog goes in \bibfield{blogtitle} and \bibfield{blogsubtitle}. Keep in mind that blog posts take the usual \bibfield{title} and \bibfield{subtitle} fields. -\item[editoraddon] Use this field to include additional editorial -information about a book. It's available for \bibtype{book}, -\bibtype{incollection}, and \bibfield{review} entry types and their -aliases. (For information on aliases in Windy City, see section -\ref{entrytypes}.) When applicable, its content appears after a book's -editors and translators without intervening punctuation. For an -example, see section \ref{entry}, where the citation of -\textit{Chaucer Life-Records} prints: ``from materials compiled by -John M. Manly and Edith Richert, with the assistance of Lilian J. -Redstone et al.'' +\item[editoraddon] This field holds editorial information about a work +that belongs immediately after \bibfield{editor} has printed, without +intervening punctuation. For an example, see \textit{CMOS} +\ref{14.105}, where the citation of \textit{Chaucer Life-Records} +includes: ``from materials compiled by John M. Manly and Edith +Richert, with the assistance of Lilian J. Redstone et al.'' This field +doesn't print when \bibfield{editor} prints in the author's position. +As a result, options that may affect where \bibfield{editor} prints, +such as \opt{swaptrans} and \opt{swapauth}, may affect whether +\bibfield{editoraddon} prints. + +% The main function of 'editoraaddon' is to inherit 'editoraddon' +% during cross-referencing. I don't expect anyone to use it in a +% bibliography database. + +%\item[editoraaddon] Like \bibfield{editoraddon} but for +%\bibfield{editora}. \item[seriesaddon] This field is for additional information about a book's series. That includes information about the run of a series, @@ -1165,16 +1264,16 @@ information like \textit{2nd ser.} and \textit{n.s.} go in the \item[shorthand] Windy City doesn't automatically italicize a \bibfield{shorthand}. Per \textit{CMOS} 14.60, a shorthand should be -italicized if the title that it abbreviates is italicized. Set it the -bibliography database with \cmd{emph} or \cmd{mkbibemph}. For examples -of a \bibfield{shorthand}, see section \ref{14.59} and the first -citation of \textit{CMOS} in this document's introduction. +italicized if the title that it abbreviates is italicized. Set it in +the bibliography database with \cmd{emph} or \cmd{mkbibemph}. For +examples of a \bibfield{shorthand}, see section \ref{14.59} and the +first citation of \textit{CMOS} in this document's introduction. \item[shorthandintro] You may override the default announcement of a \bibfield{shorthand} by adding your preferred content to -\bibfield{shorthandintro}. For an example, see the first citation of -\textit{CMOS} in this document's introduction, where the announcement -is a separate sentence, rather than in parentheses. +\bibfield{shorthandintro}. See the first citation of \textit{CMOS} in +this document's introduction, where the announcement isn't a note in +parentheses but its own sentence. \item[shortmaintitle] This field contains the short form of a \bibfield{maintitle}. It should only be necessary for certain works in @@ -1183,23 +1282,39 @@ James} in section \ref{multivolume}. \end{marglist} -\section{Editors, Translators, and Friends} -\label{edtrans} +\section{Editors and Translators} +\label{editors} -Windy City offers significant control over the handling of editors, -translators, and the like. Taking advantage of it, however, may not -seem intuitive at first. This section covers all the relevant features -and options. +Windy City offers significant control over the handling of editors and +translators. Taking advantage of it, however, may not seem intuitive +at first. This section covers all the relevant features and options. \subsection{Types of Editors and Translators} -\label{edtransnames} -For the most part, Windy City associates the \bibfield{editor} and -\bibfield{translator} fields with the lowest level title within the -scope of an entry. In most cases, then, you can assign editors and -translators simply by adding the \bibfield{editor} and -\bibfield{translator} fields to a database entry. The entry below is -an example from \textit{CMOS} \ref{14.104}: +Windy City has four name lists for editors (\bibfield{editor}, +\bibfield{editora}, \bibfield{editorb}, and \bibfield{editorc}) and +three name lists for translators (\bibfield{translator}, +\bibfield{translatora}, and \bibfield{translatorb}). At points where +it's prepared to print them, it cycles through one or both sets of +lists, depending on the context, looking for names to print. The set +of editors starts with \bibfield{editor}, followed by +\bibfield{editora}, and so on. The set of translators starts with +\bibfield{translator}, followed by \bibfield{translatora}, and so on. +Editors precede translators, unless you reverse the order with a +\opt{swaptrans} entry option (see section \ref{editors:swap}). Within +each set, the style prints the first name list that meets its criteria +for that context. Apart from exceptions discussed below, you can +assign any editor or translator name list to any \bibfield{title}, +\bibfield{issuetitle}, \bibfield{maintitle}, or \bibfield{series}. + +\subsubsection{The Basics} +\label{editors:basics} + +In most cases, you'll assign editors and translators to a +\bibfield{title}. Since it's the default assignment, you can do this +just by adding the \bibfield{editor} and \bibfield{translator} fields +to a database entry. The entry below is an example from \textit{CMOS} +\ref{14.104}: \begin{verbatim} @Collection{adorno1999, @@ -1220,14 +1335,13 @@ an example from \textit{CMOS} \ref{14.104}: \noindent When the style processes this entry, it identifies the editor and translator of the work with the names in the \bibfield{editor} and \bibfield{translator} fields. Since the entry -doesn't use the \opt{swaptrans} entry option (see section -\ref{edtranspos}), the resulting output lists the editor and +doesn't use \opt{swaptrans}, the resulting output lists the editor and translator, in that order, after the authors and title. Cross-referencing introduces a bit more complexity, but the principle is the same: Within the scope of an entry, the style associates -\bibfield{editor} and \bibfield{translator} with the lowest level -title. In this example from \textit{CMOS} \ref{14.30}, an essay is +\bibfield{editor} and \bibfield{translator} with \bibfield{title}. In +this example from \textit{CMOS} \ref{14.30}, an essay is cross-referenced to a collection: \begin{verbatim} @@ -1288,11 +1402,51 @@ scope of the \bibtype{incollection} entry: \noindent By the same token, since \bibfield{editor} falls within the scope of \bibtype{collection}, the style associates it with -\textit{The Renaissance Philosophy of Man}. +\textit{The Renaissance Philosophy of Man}, not ``The Ascent of Mont +Ventoux.'' + +Windy City supports a second tier of editors after \bibfield{title}, +\bibfield{issuetitle}, \bibfield{maintitle}, and \bibfield{series}. +Again, in your bibliography database, make sure to list editors in the +proper order: \bibfield{editor} before \bibfield{editora}, and so on. +Second tier editors never print in the author's position, even when +the first does. They always print after the relevant title. + +In the examples below, the editors print correctly because there's no +ambiguity about which title they're responsible for. Both fall within +the same entry, \bibfield{carter2012}, where their default assignment +is \textit{A Performer's Guide}. Citing a child entry, +\bibfield{myers2012}, places the editors after the collection's title, +starting with \bibfield{editor}, whereas citing the parent places +\bibfield{editor} in the author's position and \bibfield{editora} +after the collection's title. + +\begin{verbatim} + @InCollection{myers2012, + author = {Myers, Herbert}, + title = {Pitch and Transposition}, + pages = {375--393}, + crossref = {carter2012} + } + @Collection{carter2012, + title = {A Performer's Guide to Seventeenth-Century Music}, + editor = {Carter, Stewart}, + editora = {Kite-Powell, Jeffery}, + editoratype = {revex}, + address = {Bloomington}, + publisher = {Indiana University Press}, + year = {2012} + } +\end{verbatim} -The style supports three more basic editorial roles: compiler, -reviser, and updater. To assign them, you need to use the -\bibfield{editortype} field. It may help to see the bibliography +\begin{bibonly} +\nocite{myers2012,carter2012} +\end{bibonly} + +As the examples above also indicate, the style supports a variety of +editorial roles beyond just editor and translator. They are: compiler, +expander, reviser, and updater. To assign them, you need to use the +editor and translator type fields. Below are some bibliography database entries for examples in \textit{CMOS} \ref{14.103} and \ref{14.142}: @@ -1326,16 +1480,25 @@ database entries for examples in \textit{CMOS} \ref{14.103} and \item \cite{turabian2013} \end{citebib} -In addition to the five basic roles (editor, translator, compiler, -reviser, and updater), you may assign names to any pair of them. A -work's editor, for example, can also be its translator, compiler, -reviser, or updater---but no more than one of these. And just as you -can swap the order of the editor and translator roles (again, see -section \ref{edtranspos}), you can swap all other combinations, say, -to identify a work as \textit{compiled and edited by} Jane Doe rather -than \textit{edited and compiled by} her. Simply change the value of -\bibfield{editortype}. A summary of these values appears in Table -\ref{table:ed}. +You may combine all six editorial roles in pairs. A work's editor, for +example, can also be its translator, compiler, expander, reviser, or +updater---but no more than one of these. Simply put the proper value +in the corresponding type field. We saw this with \textit{A +Performer's Guide}, where the bibliography string \textit{revex} +identified Jeffery Kite-Powell as the work's reviser and expander. +These are the key lines: + +\begin{verbatim} + editora = {Kite-Powell, Jeffery}, + editoratype = {revex}, +\end{verbatim} + +\noindent Combinations that involve a translator's role, such as +\textit{translated and compiled by}, respond to the \opt{swaptrans} +options discussed in section \ref{editors:swap}. For these dual roles, +however, it's probably less confusing in the long run to change values +in the editor and translator type fields. The choice is yours. Table +\ref{editors:table} lists all editor and translator roles. \begin{table}[H] \begin{tabular}{@{}r l r l@{}} @@ -1343,47 +1506,132 @@ than \textit{edited and compiled by} her. Simply change the value of \toprule compiler & compiler & reviser & reviser\\ comped & compiler and editor & revcomp & reviser and compiler\\ -comprev & compiler and reviser & reved & reviser and editor\\ +compex & compiler and expander & reved & reviser and editor\\ +comprev & compiler and reviser & revex & reviser and expander\\ comptrans & compiler and translator & revtrans & reviser and translator\\ compup & compiler and updater & revup & reviser and updater\\ -edcomp & editor and compiler & edrev & editor and reviser\\ -transcomp & translator and compiler & transrev & translator and reviser\\ -\midrule -updater & updater & uptrans & updater and translator\\ -upcomp & updater and compiler & edup & editor and updater\\ -uped & updater and editor & transup & translator and updater\\ -uprev & updater and reviser & &\\ +editor & editor & translator & translator\\ +edcomp & editor and compiler & transcomp & translator and compiler\\ +edex & editor and expander & transed & translator and editor\\ +edrev & editor and reviser & transex & translator and expander\\ +edtrans & editor and translator & transrev & translator and reviser\\ +edup & editor and updater & transup & translator and updater\\ +expander & expander & updater & updater\\ +excomp & expander and compiler & upcomp & updater and compiler\\ +exed & expander and editor & uped & updater and editor\\ +exrev & expander and reviser & upex & updater and expander\\ +extrans & expander and translator & uprev & updater and reviser\\ +exup & expander and updater & uptrans & updater and translator\\ \end{tabular} -\caption{}\label{table:ed} +\caption{}\label{editors:table} \end{table} -For examples in \textit{CMOS}, we need to turn to the bibliography. -The first one below shows the output of \textit{reved} in the -\bibfield{editortype} field, the second of \textit{revup}. +For examples in \textit{CMOS} that use values from Table +\ref{editors:table}, we need to turn to the book's bibliography. The +first example below shows the effect of \textit{reved}, the second of +\textit{revup}. \begin{citebib} \item \cite{fowler1965} \item \cite{gowers2015} \end{citebib} -% Try swapping the editor type in the entries above for other values -% in Table \ref{table:ed}. Note that \textit{edrev} is the reverse of -% \textit{reved}---\textit{edited and revised by} instead of -% \textit{revised and edited by}. So, too, for \textit{comprev} and -% \textit{revcomp}, \textit{comptrans} and \textit{transcomp}, and so -% on. - -Missing from Table \ref{table:ed} are \textit{editor}, -\textit{translator}, \textit{edtrans}, and \textit{transed}. Windy -City has bibliography strings for them, too, but they're meant for the -style's internal use. It determines which of them applies, if any, -based on the contents of the \bibfield{editor} and -\bibfield{translator} fields and the option \opt{swaptrans}. You never -need to use them in a bibliography database. - -Three more values of \bibfield{editortype} allow you to assign editors -to higher level titles: \textit{maintitle}, \textit{series}, and -\textit{issuetitle}. Here's an example from \textit{CMOS} +For editors and translators with more than two roles per title, you +need to print more than one name list, either an editor name list and +a translator name list or two editor names lists (see the previous +discussion of second tier editors). This allows for complex +assignments such as ``Edited and Translated by Jane Doe. Revised and +Updated by Jane Doe and John Smith.'' What's not allowed is listing +three or more roles at once, as in ``Edited, Translated, and Revised +by Jane Doe.'' + +\subsubsection{Other Options and Titles} +\label{editors:other} + +Windy City simplifies the assignments of editors and translators in +several ways. For one, the default assignment of every editor name +list is \textit{editor}, and the default assignment of every +translator name list is \textit{translator}. As a result, you never +need to use the values \textit{editor} or \textit{translator} in the +type fields. It's strictly optional. The name fields alone set the +correct assignment. + +Much the same holds when the editor and translator of a work are the +same. The usual way to set this assignment is with identical name +lists: + +\begin{verbatim} + editor = {Doe, Jane}, + translator = {Doe, Jane}, +\end{verbatim} + +\noindent This gives a default assignment of \textit{editor and +translator} (\textit{edtrans} from Table \ref{editors:table}), unless you +use the appropriate \opt{swaptrans} entry option, which gives +\textit{translator and editor} (\textit{transed} from Table +\ref{editors:table}). No editor or translator type field is necessary. + +When type fields are required, Windy City offers flexibility over how +you structure your bibliography entries: If you like, you can set the +assignment with just one editor or translator type field and its +corresponding name field, or with both name fields and one type field, +or with both name fields and both type fields. To set Jane Doe as the +compiler and translator of a \bibfield{title}, Windy City treats all +five options below as equivalent: + +\begin{enumerate}[itemsep=0.2\baselineskip] + +\item + +\begin{verbatim} + editor = {Doe, Jane}, + editortype = {comptrans}, +\end{verbatim} + +\item + +\begin{verbatim} + translator = {Doe, Jane}, + translatortype = {comptrans}, +\end{verbatim} + +\item + +\begin{verbatim} + editor = {Doe, Jane}, + translator = {Doe, Jane}, + editortype = {comptrans}, +\end{verbatim} + +\item + +\begin{verbatim} + editor = {Doe, Jane}, + translator = {Doe, Jane}, + translatortype = {comptrans}, +\end{verbatim} + +\item + +\begin{verbatim} + editor = {Doe, Jane}, + translator = {Doe, Jane}, + editortype = {comptrans}, + translatortype = {comptrans}, +\end{verbatim} + +\end{enumerate} + +The last option above raises the possibility that editor and +translator type fields may conflict. What if the editor type is +\textit{comptrans} and the translator type is something else, say, +\textit{extrans}? If the editors and translators are the same, but the +type fields differ, Windy City reads the editor type field and ignores +the translator type field. + +Three more values for type fields allow you to assign editors and +translators to \bibfield{issuetitle}, \bibfield{maintitle}, and +\bibfield{series}. Here's an example from \textit{CMOS} \ref{14.123}: \begin{verbatim} @@ -1404,55 +1652,119 @@ to higher level titles: \textit{maintitle}, \textit{series}, and \item \cite{allen2009} \end{citebib} -\noindent If there were no \bibfield{editortype} assigning the editor -to the series, the output would list a book's editor. In short, for a -title's compilers, revisers, and updaters and for any title at a -higher level than \bibfield{title}, you need to use -\bibfield{editortype}. Combined with Windy City's support for citing -articles, chapters, books, and other works within books, this scheme -allows for several sets of editors per work, although it does limit -you to just one set of compilers, revisers, and updaters. - -What about translators? Unless a work's bibliography database entry -has a \bibfield{translatortype} field with the value -\textit{maintitle}, Windy City associates the names in -\bibfield{translator} with the entry's lowest level title. (Recall -``The Ascent of Mont Ventoux'' above.) You should rarely, and perhaps -never, need more than one set of translators per work. But if you do, -Windy City lets you assign as many as three---as long as you -cross-reference a work with one set of translators to another with -two. - -The style has three other name lists for editors: \bibfield{editora}, -\bibfield{editorb}, and \bibfield{editorc}. If a work has more than -one set of editors, list editors of the lowest level title in -\bibfield{editor}. Usually, those are editors of a \bibfield{title}. -The next level up, as it were, is for \bibfield{editora}, followed by -\bibfield{editorb}, then \bibfield{editorc}. Remember to include the -appropriate \bibfield{type} field to indicate an editor's role. These -fields are \bibfield{editortype} (for \bibfield{editor}), -\bibfield{editoratype} (for \bibfield{editora}), -\bibfield{editorbtype} (for \bibfield{editorb}), and -\bibfield{editorctype} (for \bibfield{editorc}). - -As it happens, Windy City puts a lot of effort into sorting out where -to print the names of editors and translators, so it's a bit more -clever than the previous paragraph suggests. In particular, if you use -\bibfield{editortype} to assign an \bibfield{editor} to a -\bibfield{maintitle} or some other higher level title, and have an -\bibfield{editora} with no corresponding \bibfield{editoratype}, Windy -City will assume that \bibfield{editora} is the editor of the -\bibfield{title}. Regardless, the best practice is to the follow the rule -of thumb described above, reserving \bibfield{editor} for -\bibfield{title} and working up from there. +\noindent If there were no \bibfield{editortype} with the value +\textit{series}, the style would have assigned \bibfield{editor} to +\bibfield{title}. The same goes for \bibfield{issuetitle} and +\bibfield{maintitle}: Assign editors and translators to them by +putting \textit{issuetitle} and \textit{maintitle} in the relevant +type fields. + +With the help of strings from Table \ref{editors:table}, all editor and +translator types are available to \bibfield{issuetitle}, +\bibfield{maintitle}, and \bibfield{series}. Commas function as +delimiters. To take the previous example, you could list Catharine +Stimpson as the editor and compiler of the series by putting the +values \textit{series,edcomp} or \textit{edcomp,series} in +\bibfield{editortype}. + +Almost any entry that relies on cross-referencing can be written +without it. Doing so, however, requires some fields in your +bibliography database that are usually meant for the style's internal +use. These fields include \bibfield{booktitle} (a cross-referenced +\bibfield{title}) and \bibfield{bookbooktitle} (a double +cross-referenced \bibfield{title}---a \bibfield{title} +cross-referenced by a cross-referenced \bibfield{title}). To +accommodate entries that don't use cross-referencing, the style +accepts the values \textit{booktitle} and \textit{bookbooktitle} in +editor and translator type fields. An example of double +cross-referencing will set us up to use both: + +\begin{verbatim} + @InCollection{doe2018, + options = {swapvol}, + author = {Doe, Jane}, + title = {A Poem}, + translator = {Smith, John}, + pages = {56–57}, + crossref = {jones2018} + } + @InBook{jones2018, + editor = {Jones, David}, + title = {A Volume of Poems}, + volume = {2}, + year = {2018}, + crossref = {white2016} + } + @Collection{white2016, + editor = {White, Amy}, + title = {A Collection of Poems}, + volumes = {4}, + address = {Chicago}, + publisher = {University of Chicago Press}, + year = {2016–18} + } +\end{verbatim} + +\begin{citebib} +\item \cite[56]{doe2018} +\end{citebib} + +\noindent The following alternative dispenses with \bibfield{crossref} +but needs two editor type fields, plus two other fields that don't +usually appear in bibliography databases: \bibfield{bookvolume} (a +cross-referenced \bibfield{volume}) and \bibfield{bookyear} (a +cross-referenced \bibfield{year}). + +\begin{verbatim} + @InCollection{doe2018.alt, + author = {Doe, Jane}, + title = {A Poem}, + translator = {Smith, John}, + pages = {56–57}, + booktitle = {A Volume of Poems}, + editor = {Jones, David}, + editortype = {booktitle}, + bookvolume = {2}, + year = {2018}, + bookbooktitle = {A Collection of Poems}, + editora = {White, Amy}, + editoratype = {bookbooktitle}, + volumes = {4}, + address = {Chicago}, + publisher = {University of Chicago Press}, + bookyear = {2016–18} + } +\end{verbatim} + +\begin{citebib} +\item \cite[56]{doe2018.alt} +\end{citebib} + +In short, for a title's compilers, expanders, revisers, and updaters, +and for any title other than \bibfield{title}, you need to put the +correct value of the assignment in the editor or translator type field +that corresponds with the editor or translator name list +(\bibfield{editortype} for \bibfield{editor}, +\bibfield{translatortype} for \bibfield{translator}, and so on). +Combined with Windy City's support for citing articles, chapters, +books, and other works within books, this scheme allows for several +sets of editors per work. \subsection{Switching Places and Roles} -\label{edtranspos} +\label{editors:swap} + +According to \textit{CMOS}, if a work has an editor and a translator, +their names should appear in citations in the order in which they +appear on the work's title page (see \textit{CMOS} \ref{14.104}). By +default, the style lists editors first. To reverse the order, the +style provides a suite of entry options that apply to the editors and +translators of different titles. This means that if a work has +multiple sets of editors and translators, you may swap positions of +any set without affecting the others. -Normally, Windy City lists editors first. But if translators are -listed first on a work's title page, you should reverse the order (see -\textit{CMOS} \ref{14.104}). For that, use the entry option -\opt{swaptrans}. Compare: +For simplicity, let's focus on \opt{swaptrans}. This option swaps the +editors and translators of works other than an \bibfield{issuetitle}, +\bibfield{maintitle}, or \bibfield{series}. Compare: \begin{citebib} \item \cite{doe2010a} @@ -1461,9 +1773,9 @@ listed first on a work's title page, you should reverse the order (see \item \cite{doe2010b} \end{citebib} -If a work has no author, but has an editor, the style will print the -editor's name in the author's position. The same happens if a work has -no author but does have a translator. The following are examples from +If a work has no author, but has editors, the style prints their names +in the author's position. The same happens if a work has no author or +editor but has translators. The following are examples from \textit{CMOS} \ref{14.103}: \begin{citebib} @@ -1486,24 +1798,90 @@ in the author's position: \end{citebib} Similarly, if a work's editors and translators are the same, the style -will print the editors' role first, as in \textit{edited and -translated by}. Reverse them with \opt{swaptrans}. From \textit{CMOS} +prints the editors' role first, as in \textit{edited and translated +by}. Reverse them with \opt{swaptrans}. From \textit{CMOS} \ref{14.104}: \begin{citebib} \item \cite{menchu1999} \end{citebib} -To make switching roles easier in these cases, you may also use the -relevant \bibfield{editortype} field with a bibliography string from -Table \ref{table:ed}. After all, for compilers, revisers, and -updaters, you need to put a value in \bibfield{editortype} anyway. So, -if you pick one that begins with \textit{trans} (\textit{transcomp}, -\textit{transed}, \textit{transrev}, or \textit{transup}), Windy City -will assume that the translator's role goes first. +You may also swap roles by changing the value in the relevant +\bibfield{editortype} field (see Table \ref{editors:table} in section +\ref{editors:basics}). For compilers, expanders, revisers, and +updaters, you need to put a value in \bibfield{editortype} anyway. You +may as well pick a value that has the roles in the correct order. +Either way, if you pick one that begins with \textit{trans} +(\textit{transcomp}, \textit{transed}, \textit{transex}, +\textit{transrev}, or \textit{transup}), Windy City assumes that the +translator's role goes first. Using \opt{swaptrans} would then put the +editor's role first. + +As often happens, cross-referencing raises some complications. The +problem is that \opt{swaptrans} applies to the editors and translators +of a \bibfield{title}, but cross-referenced works have more than one +(a \bibfield{title}, a cross-referenced \bibfield{title}, and maybe +even a double cross-referenced \bibfield{title}). Three more entry +options allow you to pick among them so as to swap whichever set of +editors and translators you want. Here's a silly example to showcase +all three options: + +\begin{verbatim} + @InCollection{doe2017, + author = {Doe, Jane}, + title = {An Essay}, + editor = {Smith, John}, + translator = {Smith, John}, + pages = {18–35}, + crossref = {jones2017} + } + @InBook{jones2017, + title = {A Volume of Essays}, + editor = {Smith, John}, + translator = {Smith, John}, + volume = {1}, + crossref = {white2017} + } + @Collection{white2017, + title = {A Collection of Essays}, + editor = {Smith, John}, + translator = {Smith, John}, + volumes = {3}, + address = {Chicago}, + publisher = {University of Chicago Press}, + year = {2017} + } +\end{verbatim} + +To swap the first set of editors and translators, use +\opt{swaptrans:title}: + +\begin{citebib} +\item \cite{doe2017a} +\end{citebib} + +To swap the second set of editors and translators, use +\opt{swaptrans:booktitle} (or \opt{swaptrans:book}): + +\begin{citebib} +\item \cite{doe2017b} +\end{citebib} + +To swap the third set of editors and translators, use +\opt{swaptrans:bookbooktitle} (or \opt{swaptrans:bookbook}): + +\begin{citebib} +\item \cite{doe2017c} +\end{citebib} + +To swap editors and translators of an \bibfield{issuetitle}, +\bibfield{maintitle}, or \bibfield{series}, use +\opt{swaptrans:issuetitle}, \opt{swaptrans:maintitle}, or +\opt{swaptrans:series}, respectively. The first two also have short +forms: \opt{swaptrans:issue} and \opt{swaptrans:main}. -On rare occasions, you may want to swap the position of an author and -an editor or translator. \textit{CMOS} \ref{14.104} gives an example: +On rare occasions, you may want to swap positions of an author and an +editor or translator. From \textit{CMOS} \ref{14.104}: \begin{citebib} \item \cite{pound1953} @@ -1514,13 +1892,13 @@ an editor or translator. \textit{CMOS} \ref{14.104} gives an example: \bibtype{collection}, \bibtype{inbook}, \bibtype{incollection}, \bibtype{mvbook}, and \bibtype{mvcollection} entry types. But beware: Windy City doesn't look ahead to see if there's really an editor or -translator to take the author's place. If it doesn't find one, it will -still print the author's name after the title, leaving the author's +translator to take the author's place. If it doesn't find one, it +still prints the author's name after the title, leaving the author's position empty. Also, if it finds both an editor and a translator, and -they're not the same person, it will print the editor's name in the +they're not the same person, it prints the editor's name in the author's position---again, giving priority to editors. If you want the translator's name in the author's position, use \opt{swapauth} with -\opt{swaptrans}. +the appropriate \opt{swaptrans} option. For correct sorting in a bibliography, a work that uses \opt{swapauth} needs a field like \bibfield{sortname} to sort it by the name of the @@ -1571,7 +1949,7 @@ priority, the collection's or the volume's. Consider an example from title of the collection. In standard notes and bibliographies, \textit{CMOS} gives you the option of reversing this order. (See especially \textit{CMOS} \ref{14.119}, \ref{14.121}, and \ref{14.122}, -and compare \ref{14.144} and \ref{15.41}.) Windy City does as well, +and compare \ref{14.144} and \ref{15.41}.) Windy City does as well with the entry or preamble option \opt{swapvol}. \begin{citebib} @@ -1689,7 +2067,7 @@ Windy City cross-references previously cited volumes. \begin{citebib} \item \cite[56]{doe2018} -\item \cite[128]{edwards2018} +\item \cite[128]{adams2018} \nocite{jones2018} \end{citebib} @@ -1699,7 +2077,7 @@ Windy City cross-references previously cited volumes. \AtNextCitekey{\toggletrue{swapvol}} \item \cite[56]{doe2018} \AtNextCitekey{\toggletrue{swapvol}} -\item \cite[128]{edwards2018} +\item \cite[128]{adams2018} \AtNextBibliography{\toggletrue{swapvol}} \nocite{jones2018} \end{citebib} @@ -2446,7 +2824,7 @@ database. \label{14.104} On how to make an author and editor swap places, see section -\ref{edtranspos}. +\ref{editors:swap}. \begin{citebib} \item \cite{bonnefoy1995} @@ -3571,6 +3949,7 @@ sorting in this section are mentioned there. Creating a reference list in the preferred way, with the \opt{reflist} preamble option, should prevent those issues.\\}% +\titleformat{\section}{\large\bfseries\filcenter}{}{2ex}{} \printbiblist[prenote=sh]{shorthand} \refstepcounter{sh}\label{sh} \printbibliography[notkeyword=notinbib,prenote=bib] diff --git a/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx b/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx index f52a3160f4..76b543d9a6 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx +++ b/macros/latex/contrib/biblatex-contrib/windycity/windycity.bbx @@ -1,4 +1,4 @@ -% Last modified: Sat 30 Jan 2021 06:17:53 PM CST +% Last modified: Sun 02 May 2021 01:14:55 PM CDT % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License (LPPL), @@ -11,7 +11,7 @@ % implied warranties of merchantability and fitness for a particular % purpose. -\ProvidesFile{windycity.bbx}[2021/01/30 Windy City bibliography style +\ProvidesFile{windycity.bbx}[2021/05/02 Windy City bibliography style for biblatex] \@ifpackagelater{biblatex}{2019/08/17} {} @@ -68,14 +68,14 @@ \DeclareBiblatexOption{entry}[boolean]{listvols}[true]{% \settoggle{listvols}{#1}}% +\providetoggle{newauth} +\DeclareBiblatexOption{entry}[boolean]{newauth}[true]{% + \settoggle{newauth}{#1}}% + \providetoggle{noauth} \DeclareBiblatexOption{entry}[boolean]{noauth}[true]{% \settoggle{noauth}{#1}}% -\providetoggle{noreprint} -\DeclareBiblatexOption{entry}[boolean]{noreprint}[true]{% - \settoggle{noreprint}{#1}}% - \DeclareBiblatexOption{global}[boolean]{nolos}[true]{% \ifstrequal{#1}{true} {\AtBeginBibliography{\blx@key@bibcheck{nolos}}} @@ -85,6 +85,10 @@ \DeclareBiblatexOption{global}[boolean]{nopages}[true]{% \settoggle{nopages}{#1}}% +\providetoggle{noreprint} +\DeclareBiblatexOption{entry}[boolean]{noreprint}[true]{% + \settoggle{noreprint}{#1}}% + \providetoggle{reflist} \DeclareBiblatexOption{global}[boolean]{reflist}[true]{% \ifstrequal{#1}{true} @@ -106,6 +110,9 @@ \toggletrue{shortfirst}}% {\togglefalse{short}}} +\DeclareBiblatexOption{global}[boolean]{shortafter}[true]{% + \settoggle{short}{#1}}% + \providetoggle{shortfirst} \DeclareBiblatexOption{global}[boolean]{shortfirst}[true]{% \settoggle{shortfirst}{#1}}% @@ -122,13 +129,38 @@ \DeclareBiblatexOption{entry}[boolean]{swapauth}[true]{% \settoggle{swapauth}{#1}}% -\providetoggle{newauth} -\DeclareBiblatexOption{entry}[boolean]{newauth}[true]{% - \settoggle{newauth}{#1}}% - \providetoggle{swaptrans} +\providetoggle{swaptrans:booktitle} +\providetoggle{swaptrans:bookbooktitle} +\providetoggle{swaptrans:issuetitle} +\providetoggle{swaptrans:maintitle} +\providetoggle{swaptrans:series} +\providetoggle{swaptrans:title} \DeclareBiblatexOption{entry}[boolean]{swaptrans}[true]{% - \settoggle{swaptrans}{#1}}% + \settoggle{swaptrans:title}{#1}% + \settoggle{swaptrans:booktitle}{#1}% + \settoggle{swaptrans:bookbooktitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:booktitle}[true]{% + \settoggle{swaptrans:booktitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:bookbooktitle}[true]{% + \settoggle{swaptrans:bookbooktitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:issuetitle}[true]{% + \settoggle{swaptrans:issuetitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:maintitle}[true]{% + \settoggle{swaptrans:maintitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:series}[true]{% + \settoggle{swaptrans:series}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:title}[true]{% + \settoggle{swaptrans:title}{#1}}% +% Short forms of the options above: +\DeclareBiblatexOption{entry}[boolean]{swaptrans:book}[true]{% + \settoggle{swaptrans:booktitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:bookbook}[true]{% + \settoggle{swaptrans:bookbooktitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:issue}[true]{% + \settoggle{swaptrans:issuetitle}{#1}}% +\DeclareBiblatexOption{entry}[boolean]{swaptrans:main}[true]{% + \settoggle{swaptrans:maintitle}{#1}}% \providetoggle{swapvol} \DeclareBiblatexOption{entry,global}[boolean]{swapvol}[true]{% @@ -161,9 +193,6 @@ maxbibnames=10, mincitenames=1, maxcitenames=3, -% Remember, if 'mincrossrefs' is greater than 1, and you cite just one -% entrykey in a document (or refsection, etc), the field 'crossref' is -% undefined. mincrossrefs=2, minxrefs=2, pagetracker=page, @@ -180,12 +209,7 @@ useprefix=false, usetranslator=true} -% If a document's language is English, set by babel or polyglossia or -% by biblatex when neither babel nor polyglossia has been loaded, use -% 'american-windycity.lbx': \DeclareLanguageMapping{english}{american-windycity} -% If the document's language isn't English, try to override -% 'american-windycity.lbx' with '<language>-windycity.lbx': \DeclareLanguageMappingSuffix{-windycity} \DeclareLabeldate{% 'reflist' preamble option loads an alternative @@ -278,10 +302,10 @@ \field{volume} \literal{0}}} -% Mapping for when 'journal', 'journaltitle', 'organization', or -% 'blogtitle' goes in the author's position. +% When 'journal', 'journaltitle', 'organization', or 'blogtitle' goes +% in the author's position. -\DeclareSourcemap{ +\DeclareStyleSourcemap{ \maps[datatype=bibtex]{ \map[overwrite]{ \pertype{article} @@ -310,7 +334,7 @@ } } } -\DeclareSourcemap{ +\DeclareStyleSourcemap{ \maps[datatype=bibtex]{ \map[overwrite]{ \pertype{online} @@ -337,7 +361,7 @@ } } } -\DeclareSourcemap{ +\DeclareStyleSourcemap{ \maps[datatype=bibtex]{ \map[overwrite=false]{ \pertype{inreference} @@ -359,6 +383,29 @@ } } +% Save the entry key of every editor, translator, and title. + +\DeclareStyleSourcemap{ + \maps[datatype=bibtex]{ + \map[overwrite, foreach={title,booktitle,bookbooktitle}]{ + \step[fieldsource=entrykey] + \step[fieldset=$MAPLOOPkey, origfieldval] + \step[notfield=$MAPLOOP, final] + \step[fieldset=$MAPLOOPkey, null] + } + \map[overwrite, foreach={% + editor,editora,editorb,editorc,translator,translatora,translatorb}]{ + \step[fieldsource=entrykey] + \step[fieldset=$MAPLOOPtype, fieldvalue={,}, appendstrict] + \step[fieldset=$MAPLOOPtype, origfieldval, append] + \step[notfield=$MAPLOOP, final] + \step[fieldset=$MAPLOOPtype, null] + } + } +} + +% For 'collsonly' and 'nolos' options and the 'reference' entry type. + \defbibcheck{collsonly}{% \ifentrytype{inbook} {\iffieldundef{crossref} @@ -389,18 +436,22 @@ \ResetDataInheritance \DefaultInheritance[\except{*}{review}{all=false}]{all=true,override=false} \DeclareDataInheritance{*}{incollection,inbook,letter,review}{% + \inherit[override=true]{titlekey}{booktitlekey} + \inherit[override=true]{booktitlekey}{bookbooktitlekey} \inherit{author}{bookauthor} \inherit{authortype}{bookauthortype} \inherit{shortauthor}{shortbookauthor} - \inherit{editor}{editora} - \inherit{editora}{editorb} - \inherit{editorb}{editorc} - \inherit{editortype}{editoratype} - \inherit{editoratype}{editorbtype} - \inherit{editorbtype}{editorctype} + \inherit[override=true]{editor}{editora} + \inherit[override=true]{editora}{editorb} + \inherit[override=true]{editorb}{editorc} + \inherit[override=true]{editortype}{editoratype} + \inherit[override=true]{editoratype}{editorbtype} + \inherit[override=true]{editorbtype}{editorctype} + \inherit{editoraddon}{editoraaddon} \inherit{translator}{translatora} \inherit{translatora}{translatorb} - \inherit{translatortype}{translatoratype} + \inherit[override=true]{translatortype}{translatoratype} + \inherit[override=true]{translatoratype}{translatorbtype} \inherit{title}{booktitle} \inherit{subtitle}{booksubtitle} \inherit{titleaddon}{booktitleaddon} @@ -442,12 +493,16 @@ \let\crossreflist\empty \let\pluga\empty \let\plugb\empty -\let\xeditor\empty -\let\yeditor\empty \let\xtitle\empty \let\xvolume\empty +\let\xeditor\empty +\let\yeditor\empty +\let\edtypes\empty +\let\transtypes\empty + \providetoggle{authposition} +\providetoggle{atleastone} \providetoggle{bibliography} \providetoggle{ibid:loccit} \providetoggle{multicite} @@ -496,8 +551,6 @@ \global\togglefalse{reflist}}% {\item} -% Index names only. - \renewbibmacro*{bibindex}{% \ifbibindex {\indexnames{labelname}}% @@ -536,8 +589,8 @@ \DeclareIndexNameAlias{translator}{default} % Affixes like 'Jr.', should appear last, delimited with a comma, when -% inverted, as in a bibliography, but not otherwise, as in a note. See -% CMOS, 17th ed., 6.43 and 16.41, as well as the example in 14.75. +% the name is inverted. See CMOS, 17th ed., 6.43 and 16.41, and the +% example in 14.75. \renewbibmacro*{name:family-given}[4]{% \ifuseprefix @@ -705,14 +758,18 @@ \step[typesource=www, typetarget=online] \step[typesource=inreference, typetarget=reference] \step[typesource=mathesis, typetarget=thesis] - \step[typesource=phdthesis, typetarget=thesis]} + \step[typesource=phdthesis, typetarget=thesis] + } \map{ \step[fieldsource=school, fieldtarget=institution] \step[fieldsource=address, fieldtarget=location] - \step[fieldsource=journal, fieldtarget=journaltitle]}} + \step[fieldsource=journal, fieldtarget=journaltitle] + } +} \DeclareBibliographyAlias{collection}{book} \DeclareBibliographyAlias{cite:collection}{cite:book} +\DeclareBibliographyAlias{*}{book} \DeclareBibliographyAlias{inbook}{incollection} \DeclareBibliographyAlias{letter}{incollection} @@ -722,8 +779,6 @@ \DeclareBibliographyAlias{unpublished}{thesis} \DeclareBibliographyAlias{cite:unpublished}{cite:thesis} -\DeclareBibliographyAlias{*}{book} - %%%%%%%%%%%%%%%%%%%%%%%%% %% Author's Position %% %%%%%%%%%%%%%%%%%%%%%%%%% @@ -738,11 +793,11 @@ {\usebibmacro{authpos+deflabel}}% {\usebibmacro{author+bookauthor}% \ifnameundef{\cbx@namelist} - {\usebibmacro{edtrans:authpos}% + {\usebibmacro{editors:a}% \ifnameundef{\cbx@namelist} {\toggletrue{noauth}% \usebibmacro{authpos+deflabel}}% - {\usebibmacro{addplus:authpos}% + {\usebibmacro{addplus+etc}% \usebibmacro{namehash+etc}}} {\usebibmacro{namehash+etc}}}} @@ -824,244 +879,162 @@ % For editors and translators in the author's position. -\newbibmacro*{edtrans:authpos}{% - \togglefalse{noed}% - \togglefalse{notrans}% - \usebibmacro{test:ed:authpos}% - \usebibmacro{test:trans:authpos}% - \ifboolexpr{ togl {noed} - and togl {notrans}} - {} - {\iftoggle{noed} - {\usebibmacro{transcombos}}% - {\iftoggle{notrans} - {\usebibmacro{edcombos}}% - {\iftoggle{swaptrans} - {\usebibmacro{transcombos}}% - {\usebibmacro{edcombos}}}}}} - -\newbibmacro*{test:ed:authpos}{% - \ifboolexpr{ test {\ifnameundef{editor}} - and test {\ifnameundef{editora}}} - {\toggletrue{noed}}% - {\ifnameundef{editor} - {\usebibmacro{test:editora:authpos}}% - {\usebibmacro{test:editor:authpos}% - \iftoggle{noed} - {\global\togglefalse{noed}% - \usebibmacro{test:editora:authpos}}% - {}}}} - -\newbibmacro*{test:xeditor:a}[1]{% - \ifboolexpr{ test {\ifnameundef{\xeditor}} - or test {\iffieldequalstr{\xeditor type}{issuetitle}} - or test {\iffieldequalstr{\xeditor type}{series}}} - {\toggletrue{noed}}% - {\ifstrequal{#1}{ap}% not 'authposition' toggle - {\usebibmacro{test:xeditor:b:authpos}}% - {\usebibmacro{test:xeditor:b}}}} - -\newbibmacro*{test:xeditor:b:authpos}{% - \iffieldequalstr{\xeditor type}{maintitle} - {\iftoggle{collection:bk} - {\iftoggle{swapvol} - {} - {\toggletrue{noed}}} - {\toggletrue{noed}}} - {\ifboolexpr{ togl {collection:bk} - and togl {swapvol}} - {\toggletrue{noed}}% - {\ifboolexpr{ togl {collection:icbk} - or togl {collection:icib}} - {\ifnameundef{translator} - {} - {\toggletrue{noed}}} - {}}}} +\newbibmacro*{editors:a}{% + \usebibmacro{test:ed:a}% + \usebibmacro{test:trans:a}% + \iftoggle{swapvol} + {\ifboolexpr{ test {\ifinlist{maintitle}{\edtypes}} + or test {\ifinlist{maintitle}{\transtypes}}} + {\usebibmacro{test:swaptrans:a}{maintitle}}% + {\usebibmacro{test:swaptrans:a}{booktitle}}} + {\usebibmacro{test:swaptrans:a}{title}}} + +\newbibmacro*{test:ed:a}{% + \renewcommand*{\do}[1]{% + \ifnameundef{##1} + {\toggletrue{noed}}% + {\togglefalse{noed}% + \renewcommand*{\xeditor}{##1}% + \let\edtypes\empty + \forcsvfield{\listadd\edtypes}{\xeditor type}% + \usebibmacro{test:a:types}{\edtypes}{noed}}}% needs '%' + \docsvlist{editor,editora,editorb,editorc}}% + +\newbibmacro*{test:trans:a}{% + \renewcommand*{\do}[1]{% + \ifnameundef{##1} + {\toggletrue{notrans}}% + {\togglefalse{notrans}% + \renewcommand*{\yeditor}{##1}% + \let\transtypes\empty + \forcsvfield{\listadd\transtypes}{\yeditor type}% + \usebibmacro{test:a:types}{\transtypes}{notrans}}}% needs '%' + \docsvlist{translator,translatora,translatorb}}% + +\newbibmacro*{test:a:types}[2]{% + \ifboolexpr{ test {\ifinlist{issuetitle}{#1}} + or test {\ifinlist{series}{#1}}} + {\toggletrue{#2}}% + {\ifinlist{maintitle}{#1} + {\iftoggle{collection:bk} + {\iftoggle{swapvol} + {\listbreak}% + {\toggletrue{#2}}} + {\toggletrue{#2}}} + {\ifboolexpr{ togl {collection:bk} + and togl {swapvol}} + {\toggletrue{#2}}% + {\usebibmacro{test:a:keys}{#1}{#2}}}}} -\newbibmacro*{test:editor:authpos}{% - \renewcommand*{\xeditor}{editor}% - \usebibmacro{test:xeditor:a}{ap}% - \iftoggle{noed} - {} +\newbibmacro*{test:a:keys}[2]{% + \xifinlist{\thefield{\xtitle titlekey}}{#1} {\ifboolexpr{ togl {collection:ib} - and togl {swapvol} - and not test {\ifnameundef{editora}}} - {\toggletrue{noed}}% + and togl {swapvol}} + {\toggletrue{#2}}% {\ifboolexpr{ togl {swapvol} and ( togl {collection:icbk} or togl {collection:icib} )} - {\toggletrue{noed}}% - {}}}} + {\toggletrue{#2}}% + {\listbreak}}} + {\listbreak}}% + +\newbibmacro*{test:swaptrans:a}[1]{% + \iftoggle{swaptrans:#1} + {\toggletrue{swaptrans}% + \iftoggle{notrans} + {\usebibmacro{ed:a:combos}}% + {\usebibmacro{trans:a:combos}}% + \togglefalse{swaptrans}}% + {\iftoggle{noed} + {\usebibmacro{trans:a:combos}}% + {\usebibmacro{ed:a:combos}}}} -\newbibmacro*{test:editora:authpos}{% - \renewcommand*{\xeditor}{editora}% - \usebibmacro{test:xeditor:a}{ap}% +\newbibmacro*{ed:a:combos}{% \iftoggle{noed} {} - {\ifboolexpr{ togl {collection:ib} - and not togl {swapvol} - and test {\ifnameundef{editor}}} - {\toggletrue{noed}}% - {}}} - -\newbibmacro*{test:trans:authpos}{% - \usebibmacro{trans+transa+transb}% - \ifnameundef{\yeditor} - {\toggletrue{notrans}}% - {\iffieldequalstr{translatortype}{maintitle} - {\ifboolexpr{ togl {collection:bk} - and togl {swapvol}} - {} - {\toggletrue{notrans}}} - {\iffieldequalstr{translatoratype}{maintitle} - {\ifboolexpr{ togl {collection:icbk} - and togl {swapvol}} - {} - {\toggletrue{notrans}}} - {}}}} - -\newbibmacro*{trans+transa+transb}{% - \ifnameundef{translator} - {\ifnameundef{translatora} - {\renewcommand*{\yeditor}{translatorb}}% - {\renewcommand*{\yeditor}{translatora}}} - {\renewcommand*{\yeditor}{translator}}} - -\newbibmacro*{transcombos}{% - \renewcommand*{\cbx@namelist}{\yeditor}% - \ifnamesequal{\xeditor}{\yeditor} - {\clearname{\xeditor}% - \ifboolexpr{ test {\iffieldstart{editortype}{c}} - or test {\iffieldequalstr{\xeditor type}{transcomp}}} - {\renewcommand*{\cbx@bibstring}{transcomp}}% - {\ifboolexpr{ test {\iffieldstart{\xeditor type}{r}} - or test {\iffieldequalstr{\xeditor type}{transrev}}} - {\renewcommand*{\cbx@bibstring}{transrev}}% - {\ifboolexpr{ test {\iffieldstart{\xeditor type}{u}} - or test {\iffieldequalstr{\xeditor type}{transup}}} - {\renewcommand*{\cbx@bibstring}{transup}}% - {\renewcommand*{\cbx@bibstring}{transed}}}}} - {\renewcommand*{\cbx@bibstring}{translator}}} - -\newbibmacro*{edcombos}{% - \renewcommand*{\cbx@namelist}{\xeditor}% - \ifnamesequal{\xeditor}{\yeditor} - {\clearname{\yeditor}% - \usebibmacro{edcombos:trans}}% - {\usebibmacro{edcombos:notrans}}} - -\newbibmacro*{edcombos:trans}{% - \iffieldstart{\xeditor type}{c} - {\renewcommand*{\cbx@bibstring}{comptrans}}% - {\iffieldstart{\xeditor type}{r} - {\renewcommand*{\cbx@bibstring}{revtrans}}% - {\iffieldstart{\xeditor type}{u} - {\renewcommand*{\cbx@bibstring}{uptrans}}% - {\iffieldequalstr{\xeditor type}{transcomp} - {\renewcommand*{\cbx@bibstring}{transcomp}}% - {\iffieldequalstr{\xeditor type}{transed} - {\renewcommand*{\cbx@bibstring}{transed}}% - {\iffieldequalstr{\xeditor type}{transrev} - {\renewcommand*{\cbx@bibstring}{transrev}}% - {\iffieldequalstr{\xeditor type}{transup} - {\renewcommand*{\cbx@bibstring}{transup}}% - {\renewcommand*{\cbx@bibstring}{edtrans}}}}}}}}} - -\newbibmacro*{edcombos:notrans}{% - \iffieldequalstr{\xeditor type}{compiler} - {\renewcommand*{\cbx@bibstring}{compiler}}% - {\iffieldequalstr{\xeditor type}{reviser} - {\renewcommand*{\cbx@bibstring}{reviser}}% - {\iffieldequalstr{\xeditor type}{updater} - {\renewcommand*{\cbx@bibstring}{updater}}% - {\iffieldequalstr{\xeditor type}{comped} - {\renewcommand*{\cbx@bibstring}{comped}}% - {\iffieldequalstr{\xeditor type}{comprev} - {\renewcommand*{\cbx@bibstring}{comprev}}% - {\iffieldequalstr{\xeditor type}{compup} - {\renewcommand*{\cbx@bibstring}{compup}}% - {\iffieldequalstr{\xeditor type}{edcomp} - {\renewcommand*{\cbx@bibstring}{edcomp}}% - {\iffieldequalstr{\xeditor type}{edrev} - {\renewcommand*{\cbx@bibstring}{edrev}}% - {\iffieldequalstr{\xeditor type}{edup} - {\renewcommand*{\cbx@bibstring}{edup}}% - {\iffieldequalstr{\xeditor type}{revcomp} - {\renewcommand*{\cbx@bibstring}{revcomp}}% - {\iffieldequalstr{\xeditor type}{reved} - {\renewcommand*{\cbx@bibstring}{reved}}% - {\iffieldequalstr{\xeditor type}{revup} - {\renewcommand*{\cbx@bibstring}{revup}}% - {\iffieldequalstr{\xeditor type}{upcomp} - {\renewcommand*{\cbx@bibstring}{upcomp}}% - {\iffieldequalstr{\xeditor type}{uped} - {\renewcommand*{\cbx@bibstring}{uped}}% - {\iffieldequalstr{\xeditor type}{uprev} - {\renewcommand*{\cbx@bibstring}{uprev}}% - {\renewcommand*{\cbx@bibstring}{editor}}}}}}}}}}}}}}}}} - -% Thanks to David Fussner's biblatex-chicago for pointing me to this -% command by Philipp Lehman. Source: -% https://groups.google.com/forum/#!topic/comp.text.tex/kG003fkZK1I - -\newrobustcmd*{\iffieldstart}[2]{% - \iffieldundef{#1} - {\@secondoftwo}% originally '\@gobbletwo' - {\begingroup - \edef\@tempa{% - \long\def\noexpand\iffieldstart@i####1\detokenize{#2}####2}% - \@tempa\@nil{\endgroup\ifblank{##1}}% - \savefield*{#1}{\@tempa}% - \expandafter\iffieldstart@i\detokenize - \expandafter\expandafter\expandafter{% - \expandafter\@tempa\detokenize{#2}}\@nil}}% - -\newbibmacro*{addplus:authpos}{% - \iftoggle{cbx:short} - {} - {\usebibmacro{addplus}% - \renewcommand*{\plugb}{% - \addcomma\space\bibsstring{\cbx@bibstring}}}} + {\usebibmacro{edcombos:a}}} -\newbibmacro*{addplus}{% - \ifnameundef{\xeditor} - {\ifnameundef{\yeditor} - {} - {\ifnumgreater{\value{\yeditor}}{1} - {\edef\cbx@bibstring{\cbx@bibstring +}}% - {}}} - {\ifnumgreater{\value{\xeditor}}{1} - {\edef\cbx@bibstring{\cbx@bibstring +}}% - {}}} - -% For editors and translators not in the author's position. - -\newbibmacro*{edtrans}{% - \iftoggle{swaptrans} - {\usebibmacro{transcombos+etc}% - \usebibmacro{edcombos+etc}}% - {\usebibmacro{edcombos+etc}% - \usebibmacro{transcombos+etc}}% - \usebibmacro{editoraddon}}% - -\newbibmacro*{transcombos+etc}{% - \togglefalse{noed}% - \togglefalse{notrans}% - \usebibmacro{test:ed}% - \usebibmacro{test:trans}% +\newbibmacro*{trans:a:combos}{% \iftoggle{notrans} {} - {\usebibmacro{transcombos}% - \usebibmacro{pluga+etc}}} - -\newbibmacro*{edcombos+etc}{% - \togglefalse{noed}% - \togglefalse{notrans}% - \usebibmacro{test:ed}% - \usebibmacro{test:trans}% + {\usebibmacro{transcombos:a}}} + +% For editors and translators after the author's position. + +\newbibmacro*{editors:b}{% + \usebibmacro{test:ed:b}% + \usebibmacro{test:trans:b}% + \ifdefstring{\xtitle}{book} + {\usebibmacro{test:swaptrans:b}{booktitle}}% + {\ifdefstring{\xtitle}{bookbook} + {\usebibmacro{test:swaptrans:b}{bookbooktitle}}% + {\usebibmacro{test:swaptrans:b}{title}}}} + +\newbibmacro*{test:ed:b}{% + \renewcommand*{\do}[1]{% + \ifnameundef{##1} + {\toggletrue{noed}}% + {\togglefalse{noed}% + \renewcommand*{\xeditor}{##1}% + \let\edtypes\empty + \forcsvfield{\listadd\edtypes}{\xeditor type}% + \usebibmacro{test:b:types}{\edtypes}{noed}}}% needs '%' + \docsvlist{editor,editora,editorb,editorc}}% + +\newbibmacro*{test:trans:b}{% + \renewcommand*{\do}[1]{% + \ifnameundef{##1} + {\toggletrue{notrans}}% + {\togglefalse{notrans}% + \renewcommand*{\yeditor}{##1}% + \let\transtypes\empty + \forcsvfield{\listadd\transtypes}{\yeditor type}% + \usebibmacro{test:b:types}{\transtypes}{notrans}}}% needs '%' + \docsvlist{translator,translatora,translatorb}}% + +\newbibmacro*{test:b:types}[2]{% + \ifboolexpr{ test {\ifinlist{issuetitle}{#1}} + or test {\ifinlist{maintitle}{#1}} + or test {\ifinlist{series}{#1}}} + {\toggletrue{#2}}% + {\ifinlist{booktitle}{#1} + {\ifdefstring{\xtitle}{book} + {\usebibmacro{test:b:keys}{#1}{#2}}% + {\toggletrue{#2}}} + {\ifinlist{bookbooktitle}{#1} + {\ifdefstring{\xtitle}{bookbook} + {\usebibmacro{test:b:keys}{#1}{#2}}% + {\toggletrue{#2}}} + {\usebibmacro{test:b:keys}{#1}{#2}}}}} + +\newbibmacro*{test:b:keys}[2]{% + \xifinlist{\thefield{\xtitle titlekey}}{#1} + {\listbreak}% + {\toggletrue{#2}}} + +\newbibmacro*{test:swaptrans:b}[1]{% + \iftoggle{swaptrans:#1} + {\toggletrue{swaptrans}% + \usebibmacro{trans:b:combos}% + \usebibmacro{ed:b:combos}% + \togglefalse{swaptrans}}% + {\usebibmacro{ed:b:combos}% + \usebibmacro{trans:b:combos}}} + +\newbibmacro*{ed:b:combos}{% \iftoggle{noed} + {\usebibmacro{ed:b:second}}% + {\usebibmacro{edcombos:a}% + \usebibmacro{pluga+etc}% + \usebibmacro{editoraddon}{editor}% + \usebibmacro{editoraddon}{editora}% + \usebibmacro{ed:b:second}% + \usebibmacro{editoraddon}{editora}}} + +\newbibmacro*{trans:b:combos}{% + \iftoggle{notrans} {} - {\usebibmacro{edcombos}% + {\usebibmacro{transcombos:a}% \usebibmacro{pluga+etc}}} \newbibmacro*{pluga+etc}{% @@ -1086,141 +1059,64 @@ {\setunit{\addcomma\space}}% {\newunit}}% -% Tests for 'edtrans' macro. - -\newbibmacro*{test:ed}{% - \iftoggle{edshift} - {\usebibmacro{eda+edb+edc}}% - {\ifnameundef{editor} - {\usebibmacro{test:editora}}% - {\usebibmacro{test:editor}% - \iftoggle{noed} - {\togglefalse{noed}% - \usebibmacro{test:editora}}% - {}}}} - -\newbibmacro*{eda+edb+edc}{% - \ifnameundef{editor} - {\ifnameundef{editora} - {\ifnameundef{editorb} - {\renewcommand*{\xeditor}{editorc}}% - {\renewcommand*{\xeditor}{editorb}}% - \usebibmacro{test:editorb}}% - {\usebibmacro{test:editora}% - \iftoggle{noed} - {\togglefalse{noed}% - \renewcommand*{\xeditor}{editorb}% - \usebibmacro{test:editorb}}% - {}}} - {\usebibmacro{test:editor}% - \iftoggle{noed} - {\togglefalse{noed}% - \usebibmacro{test:editora}}% - {}}} - -\newbibmacro*{test:editor}{% - \renewcommand*{\xeditor}{editor}% - \usebibmacro{test:xeditor:a}{}% +\newbibmacro*{ed:b:second}{% + \usebibmacro{test:ed:b}% \iftoggle{noed} {} - {\ifdefstring{\xtitle}{book} - {\toggletrue{noed}}% - {}}} + {\usebibmacro{edcombos:a}% + \usebibmacro{pluga+etc}}} -\newbibmacro*{test:editora}{% - \renewcommand*{\xeditor}{editora}% - \usebibmacro{test:xeditor:a}{}% +% For editors and translators of an 'issuetitle', 'maintitle', or 'series'. + +\newbibmacro*{editors:c}[1]{% + \usebibmacro{test:ed:c}{#1}% + \usebibmacro{test:trans:c}{#1}% + \iftoggle{swaptrans:#1} + {\toggletrue{swaptrans}% + \usebibmacro{trans:c:combos}% + \usebibmacro{ed:c:combos}{#1}% + \togglefalse{swaptrans}}% + {\usebibmacro{ed:c:combos}{#1}% + \usebibmacro{trans:c:combos}}} + +\newbibmacro*{test:ed:c}[1]{% + \renewcommand*{\do}[1]{% + \ifnameundef{##1} + {\toggletrue{noed}}% + {\togglefalse{noed}% + \renewcommand*{\xeditor}{##1}% + \let\edtypes\empty + \forcsvfield{\listadd\edtypes}{\xeditor type}% + \ifinlist{#1}{\edtypes} + {\listbreak}% + {\toggletrue{noed}}}}% needs '%' + \docsvlist{editor,editora,editorb,editorc}}% + +\newbibmacro*{test:trans:c}[1]{% + \renewcommand*{\do}[1]{% + \ifnameundef{##1} + {\toggletrue{notrans}}% + {\togglefalse{notrans}% + \renewcommand*{\yeditor}{##1}% + \let\transtypes\empty + \forcsvfield{\listadd\transtypes}{\yeditor type}% + \ifinlist{#1}{\transtypes} + {\listbreak}% + {\toggletrue{notrans}}}}% needs '%' + \docsvlist{translator,translatora,translatorb}}% + +\newbibmacro*{ed:c:combos}[1]{% \iftoggle{noed} {} - {\ifboolexpr{ test {\ifdefempty{\xtitle}} - and ( togl {collection:ib} - or togl {collection:icbk} - or togl {collection:icib} - or not togl {collection} )} - {\toggletrue{noed}}% - {\ifboolexpr{ test {\ifdefstring{\xtitle}{bookbook}} - and togl {swapvol} - and ( togl {collection:icib} - or togl {collection:icbk} )} - {\toggletrue{noed}}% - {}}}} - -\newbibmacro*{test:editorb}{% - \usebibmacro{test:xeditor:a}{}% - \iftoggle{collection:icib} - {\ifdefstring{\xtitle}{book} - {\toggletrue{noed}}% - {}} - {}} - -\newbibmacro*{test:xeditor:b}{% - \iffieldequalstr{\xeditor type}{maintitle} - {\toggletrue{noed}}% - {\ifdefempty{\xtitle} - {\ifboolexpr{ test {\iffieldequalstr{\xeditor type}{compiler}} - or test {\iffieldequalstr{\xeditor type}{comped}} - or test {\iffieldequalstr{\xeditor type}{comprev}} - or test {\iffieldequalstr{\xeditor type}{comptrans}} - or test {\iffieldequalstr{\xeditor type}{compup}} - or test {\iffieldequalstr{\xeditor type}{editor}} - or test {\iffieldequalstr{\xeditor type}{edcomp}} - or test {\iffieldequalstr{\xeditor type}{edrev}} - or test {\iffieldequalstr{\xeditor type}{edtrans}} - or test {\iffieldequalstr{\xeditor type}{edup}} - or test {\iffieldequalstr{\xeditor type}{reviser}} - or test {\iffieldequalstr{\xeditor type}{revcomp}} - or test {\iffieldequalstr{\xeditor type}{reved}} - or test {\iffieldequalstr{\xeditor type}{revtrans}} - or test {\iffieldequalstr{\xeditor type}{revup}} - or test {\iffieldequalstr{\xeditor type}{transcomp}} - or test {\iffieldequalstr{\xeditor type}{transed}} - or test {\iffieldequalstr{\xeditor type}{transrev}} - or test {\iffieldequalstr{\xeditor type}{transup}} - or test {\iffieldequalstr{\xeditor type}{updater}} - or test {\iffieldequalstr{\xeditor type}{upcomp}} - or test {\iffieldequalstr{\xeditor type}{uped}} - or test {\iffieldequalstr{\xeditor type}{uprev}} - or test {\iffieldequalstr{\xeditor type}{uptrans}} - or test {\iffieldequalstr{\xeditor type}{title}} - or test {\iffieldundef{\xeditor type}}} - {} - {\toggletrue{noed}}} - {}}} - -\newbibmacro*{test:trans}{% - \usebibmacro{trans+transa+transb}% - \ifnameundef{\yeditor} - {\toggletrue{notrans}}% - {\iffieldequalstr{\yeditor type}{maintitle} - {\toggletrue{notrans}}% - {\ifdefstring{\yeditor}{translatorb} - {\ifboolexpr{ test {\ifdefempty{\xtitle}} - or test {\ifdefstring{\xtitle}{book}}} - {\toggletrue{notrans}}% - {}} - {\ifdefstring{\yeditor}{translatora} - {\ifboolexpr{ test {\ifdefempty{\xtitle}} - or test {\ifdefstring{\xtitle}{bookbook}}} - {\toggletrue{notrans}}% - {}} - {\ifboolexpr{ togl {collection} - and togl {swapvol} - and test {\ifdefstring{\xtitle}{book}}} - {\toggletrue{notrans}}% - {}}}}}} - -% For editors of an 'issuetitle', 'maintitle', or 'series'. - -\newbibmacro*{editortypes}[1]{% - \ifboolexpr{ test {\iffieldequalstr{editortype}{#1}} - or test {\iffieldequalstr{editoratype}{#1}} - or test {\iffieldequalstr{editorbtype}{#1}} - or test {\iffieldequalstr{editorctype}{#1}}} {\usebibmacro{edtranspunct:c}% - \renewcommand*{\cbx@bibstring}{editor}% - \usebibmacro{editorlists}{#1}% - \usebibmacro{pluga+printnames}}% - {}} + \usebibmacro{edcombos:a}% + \usebibmacro{pluga+printnames}% + \setunit{\addcomma\space}% + \usebibmacro{editoraddon}{editor}% + \usebibmacro{editoraddon}{editora}% + \usebibmacro{ed:c:second}{#1}% + \setunit{\addcomma\space}% + \usebibmacro{editoraddon}{editora}}} \newbibmacro*{edtranspunct:c}{% \ifboolexpr{ togl {collection:bk} @@ -1228,41 +1124,163 @@ {\newunit}% {\setunit{\addcomma\space}}} -\newbibmacro*{editorlists}[1]{% - \iffieldequalstr{editortype}{#1} - {\renewcommand*{\cbx@namelist}{editor}}% - {\iffieldequalstr{editoratype}{#1} - {\renewcommand*{\cbx@namelist}{editora}}% - {\iffieldequalstr{editorbtype}{#1} - {\renewcommand*{\cbx@namelist}{editorb}}% - {\renewcommand*{\cbx@namelist}{editorc}}}}} - -% For translators of a 'maintitle'. +\newbibmacro*{trans:c:combos}{% + \iftoggle{notrans} + {} + {\usebibmacro{edtranspunct:c}% + \usebibmacro{transcombos:a}% + \usebibmacro{pluga+printnames}}} -\newbibmacro*{translatortypes}{% - \ifboolexpr{ test {\iffieldequalstr{translatortype}{maintitle}} - or test {\iffieldequalstr{translatoratype}{maintitle}}} +\newbibmacro*{ed:c:second}[1]{% + \usebibmacro{test:ed:c}{#1}% + \iftoggle{noed} + {} {\usebibmacro{edtranspunct:c}% - \renewcommand*{\cbx@bibstring}{translator}% - \iffieldequalstr{translatortype}{maintitle} - {\renewcommand*{\cbx@namelist}{translator}}% - {\renewcommand*{\cbx@namelist}{translatora}}% - \usebibmacro{pluga+printnames}}% - {}} + \usebibmacro{edcombos:a}% + \usebibmacro{pluga+printnames}}} + +% Macros common to 'editors:a', 'editors:b', and 'editors:c'. -% A catchall for additional editorial information about a 'title'. +\newbibmacro*{edcombos:a}{% + \renewcommand*{\cbx@namelist}{\xeditor}% + \ifnamesequal{\xeditor}{\yeditor} + {\clearname{\yeditor}% + \toggletrue{notrans}% + \usebibmacro{edcombos:b}{\edtypes}{edtrans}% + \iftoggle{atleastone} + {} + {\usebibmacro{edcombos:b}{\transtypes}{edtrans}}} + {\usebibmacro{edcombos:c}}} -\newbibmacro*{editoraddon}{% - \iffieldundef{editoraddon} +\newbibmacro*{transcombos:a}{% + \renewcommand*{\cbx@namelist}{\yeditor}% + \ifnamesequal{\xeditor}{\yeditor} + {\clearname{\xeditor}% + \toggletrue{noed}% + \usebibmacro{transcombos:b}{\edtypes}{transed}% + \iftoggle{atleastone} + {} + {\usebibmacro{transcombos:b}{\transtypes}{transed}}} + {\usebibmacro{transcombos:c}}} + +\newbibmacro*{edcombos:b}[2]{% + \togglefalse{atleastone}% + \renewcommand*{\do}[1]{% + \ifinlist{##1}{#1} + {\toggletrue{atleastone}% + \listbreak}% + {}}% needs '%' + \docsvlist{comptrans,comp,compiler,comped,compex,comprev,compup,transcomp}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{comptrans}}% + {\docsvlist{extrans,ex,excomp,exed,expander,exrev,exup,transex}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{extrans}}% + {\docsvlist{revtrans,rev,revcomp,reved,revex,reviser,revup,transrev}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{revtrans}}% + {\docsvlist{uptrans,up,upcomp,updater,uped,upex,uprev,transup}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{uptrans}}% + {\renewcommand*{\cbx@bibstring}{#2}}}}}} + +\newbibmacro*{edcombos:c}{% + \renewcommand*{\do}[1]{% + \ifboolexpr{ test {\ifinlist{##1}{\edtypes}} + or test {\ifstrequal{##1}{editor}}} + {\usebibmacro{swapstrings}{##1}% + \listbreak}% + {}}% needs '%' + \docsvlist{comp,comped,compex,compiler,comprev,comptrans,compup,ed,edcomp,edex,edrev,edtrans,edup, + ex,excomp,exed,expander,exrev,extrans,exup,rev,revcomp,reved,revex,reviser,revtrans, + revup,transcomp,transed,transex,transrev,transup,up,upcomp,updater,uped,upex,uprev, + uptrans,editor}}% + +\newbibmacro*{transcombos:b}[2]{% + \togglefalse{atleastone}% + \renewcommand*{\do}[1]{% + \ifinlist{##1}{#1} + {\toggletrue{atleastone}% + \listbreak}% + {}}% needs '%' + \docsvlist{transcomp,comp,comped,compex,compiler,comprev,comptrans,compup}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{transcomp}}% + {\docsvlist{transex,ex,excomp,exed,expander,exrev,extrans,exup}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{transex}}% + {\docsvlist{transrev,rev,revcomp,reved,revex,reviser,revtrans,revup}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{transrev}}% + {\docsvlist{transup,up,upcomp,updater,uped,upex,uprev,uptrans}% + \iftoggle{atleastone} + {\renewcommand*{\cbx@bibstring}{transup}}% + {\renewcommand*{\cbx@bibstring}{#2}}}}}} + +\newbibmacro*{transcombos:c}{% + \renewcommand*{\do}[1]{% + \ifboolexpr{ test {\ifinlist{##1}{\transtypes}} + or test {\ifstrequal{##1}{translator}}} + {\usebibmacro{swapstrings}{##1}% + \listbreak}% + {}}% needs '%' + \docsvlist{comptrans,edtrans,extrans,revtrans,transcomp,transed,transex,transrev,transup,uptrans, + translator}}% + +\newbibmacro*{swapstrings}[1]{% + \iftoggle{swaptrans} + {\ifstrequal{#1}{comptrans} + {\renewcommand*{\cbx@bibstring}{transcomp}}% + {\ifstrequal{#1}{edtrans} + {\renewcommand*{\cbx@bibstring}{transed}}% + {\ifstrequal{#1}{extrans} + {\renewcommand*{\cbx@bibstring}{transex}}% + {\ifstrequal{#1}{revtrans} + {\renewcommand*{\cbx@bibstring}{transrev}}% + {\ifstrequal{#1}{transcomp} + {\renewcommand*{\cbx@bibstring}{comptrans}}% + {\ifstrequal{#1}{transed} + {\renewcommand*{\cbx@bibstring}{edtrans}}% + {\ifstrequal{#1}{transex} + {\renewcommand*{\cbx@bibstring}{extrans}}% + {\ifstrequal{#1}{transrev} + {\renewcommand*{\cbx@bibstring}{revtrans}}% + {\ifstrequal{#1}{transup} + {\renewcommand*{\cbx@bibstring}{uptrans}}% + {\ifstrequal{#1}{uptrans} + {\renewcommand*{\cbx@bibstring}{transup}}% + {\renewcommand*{\cbx@bibstring}{#1}}}}}}}}}}}} + {\renewcommand*{\cbx@bibstring}{#1}}} + +\newbibmacro*{addplus+etc}{% + \iftoggle{cbx:short} {} - {\nopunct\printfield{editoraddon}% - \clearfield{editoraddon}}} + {\usebibmacro{addplus}% + \renewcommand*{\plugb}{% + \addcomma\space\bibsstring{\cbx@bibstring}}}} + +\newbibmacro*{addplus}{% + \ifnameundef{\xeditor} + {\ifnameundef{\yeditor} + {} + {\ifnumgreater{\value{\yeditor}}{1} + {\edef\cbx@bibstring{\cbx@bibstring +}}% + {}}} + {\ifnumgreater{\value{\xeditor}}{1} + {\edef\cbx@bibstring{\cbx@bibstring +}}% + {}}} + +\newbibmacro*{editoraddon}[1]{% + \ifboolexpr{ test {\iffieldundef{#1addon}} + or not test {\ifdefstring{\xeditor}{#1}}} + {} + {\nopunct\printfield{#1addon}% + \clearfield{#1addon}}} %%%%%%%%%%%%%%%%%%%%%%%% %% Names and Dashes %% %%%%%%%%%%%%%%%%%%%%%%%% -% HERE \newbibmacro*{printnames+etc}{% \ifboolexpr{ togl {authposition} and togl {bibliography}} @@ -1304,7 +1322,7 @@ \printfield[parens]{handle}% \clearfield{handle}}} -% In short citations, omit addons. See CMOS, 17th ed., 14.80 and +% Omit addons in short citations. See CMOS, 17th ed., 14.80 and % 14.209. \newbibmacro*{nameaddon}{% @@ -1333,7 +1351,7 @@ \let\anona\empty \let\anonb\empty \let\pluga\empty - \let\plugb\empty}% + \let\plugb\empty} %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Titles and Subtitles %% @@ -1442,7 +1460,7 @@ {\bibstring{in}\space \renewcommand*{\xtitle}{issue}% \usebibmacro{longtitle+titleaddon}% - \usebibmacro{editortypes}{issuetitle}}% + \usebibmacro{editors:c}{issuetitle}}% \newunit\bibstring{special}% \setunit{\addcomma\space}}} @@ -1886,7 +1904,7 @@ \usebibmacro{author+bookauthor+etc}% \usebibmacro{title+labelyear}% \usebibmacro{note}% - \usebibmacro{edtrans}}% + \usebibmacro{editors:b}}% \newbibmacro*{articles}{% \newunit @@ -1947,14 +1965,14 @@ \usebibmacro{longtitle+titleaddon}% \toggletrue{edshift}% \usebibmacro{byauthor}% - \usebibmacro{edtrans}% + \usebibmacro{editors:b}% \usebibmacro{volumes+bookseries+etc}}% {\usebibmacro{title+labelyear}% \usebibmacro{byauthor}% \iffieldundef{maintitle} {\usebibmacro{note+edition+etc}% \usebibmacro{volumes+bookseries+etc}}% - {\usebibmacro{edtrans}% + {\usebibmacro{editors:b}% \usebibmacro{volumes+bookseries+etc}% \usebibmacro{maintitle+note+etc}}} \usebibmacro{date+loc+etc}% @@ -1970,15 +1988,15 @@ {\usebibmacro{author+bookauthor+etc}% \iffieldundef{title} {\usebibmacro{booktitle}% - \usebibmacro{edtrans}}% + \usebibmacro{editors:b}}% {\ifboolexpr{ togl {collection:ib} and togl {swapvol} and not togl {collection:icib}} {\usebibmacro{booktitle}% - \usebibmacro{edtrans}}% + \usebibmacro{editors:b}}% {\usebibmacro{title+labelyear}% \usebibmacro{byauthor}% - \usebibmacro{edtrans}% + \usebibmacro{editors:b}% \usebibmacro{chapter+in}}}} {\usebibmacro{supplement}% \newunit @@ -1996,7 +2014,7 @@ \ifcsdef{c@\thefield{crossref}} {\setcounter{\thefield{crossref}}{0}}% {\newcounter{\thefield{crossref}}}% needs '%' - \usebibmacro{incollections}}}} + \usebibmacro{incollections}}}} \newbibmacro*{websites}{% \ifboolexpr{ test {\iffieldundef{blogtitle}} @@ -2029,7 +2047,7 @@ \iftoggle{shortfirst} {} {\toggletrue{edshift}% - \usebibmacro{edtrans}}} + \usebibmacro{editors:b}}} \newbibmacro*{inst+loc+date}{% \usebibmacro{thesis+type}% @@ -2095,7 +2113,7 @@ \printfield{series}}% \isdot\addcomma \usebibmacro{seriesaddon}% - \usebibmacro{editortypes}{series}% + \usebibmacro{editors:c}{series}% \newunit}}% \newbibmacro*{volume}{% @@ -2197,11 +2215,7 @@ \usebibmacro{maintitle}% \usebibmacro{note}% \usebibmacro{edition}{}% - \iftoggle{swaptrans} - {\usebibmacro{translatortypes}% - \usebibmacro{editortypes}{maintitle}}% - {\usebibmacro{editortypes}{maintitle}% - \usebibmacro{translatortypes}}} + \usebibmacro{editors:c}{maintitle}}% \newbibmacro*{volume+number+etc}{% \iffieldundef{\xvolume volume} @@ -2247,14 +2261,13 @@ \newbibmacro*{note+edition+etc}{% \usebibmacro{note}% \usebibmacro{edition}{}% - \usebibmacro{edtrans}}% + \usebibmacro{editors:b}}% \newbibmacro*{edition}[1]{% \iffieldundef{edition} {} {\iftoggle{edshift} - {\setunit{\addcomma\space}% - \togglefalse{edshift}}% + {\setunit{\addcomma\space}}% {\newunit}% \iffieldbibstring{edition} {\bibstring{\thefield{edition}}} @@ -2431,8 +2444,7 @@ \newunit \printfield{series}% \usebibmacro{seriesaddon}% - \usebibmacro{editortypes}{series}% - \setunit{\addcomma\space}}} + \usebibmacro{editors:c}{series}}} \newbibmacro*{seriesaddon}{% \iffieldundef{seriesaddon} @@ -2468,10 +2480,8 @@ {}} \newbibmacro*{other:number}{% - \ifboolexpr{ test {\iffieldequalstr{editortype}{series}} - or test {\iffieldequalstr{editoratype}{series}} - or test {\iffieldequalstr{editorbtype}{series}} - or test {\iffieldequalstr{editorctype}{series}}} + \ifboolexpr{ test {\ifinlist{series}{\edtypes}} + or test {\ifinlist{series}{\transtypes}}} {\setunit{\addcomma\space}% \printfield{number}}% {\setunit{\addspace}% not '\setunit{\space}' @@ -2513,7 +2523,7 @@ \usebibmacro{longtitle+titleaddon}% \toggletrue{edshift}% \usebibmacro{byauthor}% - \usebibmacro{edtrans}}% + \usebibmacro{editors:b}}% {\usebibmacro{volume+number+etc}% \toggletrue{edshift}% \usebibmacro{booktitle}% @@ -2531,10 +2541,10 @@ \usebibmacro{volumes+bookseries+etc}% \toggletrue{edshift}% \usebibmacro{booktitle}% - \usebibmacro{edtrans}}% + \usebibmacro{editors:b}}% {\toggletrue{edshift}% \usebibmacro{booktitle}% - \usebibmacro{edtrans}% + \usebibmacro{editors:b}% \renewcommand*{\xvolume}{book}% \usebibmacro{volume+number+etc}% \iftoggle{collection:icbk} diff --git a/macros/latex/contrib/biblatex-contrib/windycity/windycity.cbx b/macros/latex/contrib/biblatex-contrib/windycity/windycity.cbx index bb0ca85e87..f73248dcf5 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/windycity.cbx +++ b/macros/latex/contrib/biblatex-contrib/windycity/windycity.cbx @@ -1,4 +1,4 @@ -% Last modified: Sat 30 Jan 2021 06:17:55 PM CST +% Last modified: Sun 02 May 2021 01:14:43 PM CDT % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License (LPPL), @@ -11,7 +11,7 @@ % implied warranties of merchantability and fitness for a particular % purpose. -\ProvidesFile{windycity.cbx}[2021/01/30 Windy City citation style for +\ProvidesFile{windycity.cbx}[2021/05/02 Windy City citation style for biblatex] \@ifpackagelater{biblatex}{2019/08/17} {} @@ -360,6 +360,22 @@ {} {\newunit}}% +% Thanks to David Fussner's biblatex-chicago for pointing me to this +% command by Philipp Lehman. Source: +% https://groups.google.com/forum/#!topic/comp.text.tex/kG003fkZK1I + +\newrobustcmd*{\iffieldstart}[2]{% + \iffieldundef{#1} + {\@secondoftwo}% originally '\@gobbletwo' + {\begingroup + \edef\@tempa{% + \long\def\noexpand\iffieldstart@i####1\detokenize{#2}####2}% + \@tempa\@nil{\endgroup\ifblank{##1}}% + \savefield*{#1}{\@tempa}% + \expandafter\iffieldstart@i\detokenize + \expandafter\expandafter\expandafter{% + \expandafter\@tempa\detokenize{#2}}\@nil}}% + \newbibmacro*{volume+page}{% \iffieldundef{volume} {} diff --git a/macros/latex/contrib/biblatex-contrib/windycity/windycity.dbx b/macros/latex/contrib/biblatex-contrib/windycity/windycity.dbx index 51a83057e7..1bdbc03b64 100644 --- a/macros/latex/contrib/biblatex-contrib/windycity/windycity.dbx +++ b/macros/latex/contrib/biblatex-contrib/windycity/windycity.dbx @@ -1,4 +1,4 @@ -\ProvidesFile{windycity.dbx}[2021/01/30 Windy City data model file for +\ProvidesFile{windycity.dbx}[2021/05/02 Windy City data model file for biblatex] \DeclareDatamodelFields[type=field,datatype=literal]{% blogsubtitle, @@ -6,10 +6,13 @@ blogtitleaddon, bookauthortype, bookbooktitle, - bookbookvolume, bookvolume, + bookbookvolume, + booktitlekey, + bookbooktitlekey, bookyear, editoraddon, + editoraaddon, endbookyear, handle, seriesaddon, @@ -17,8 +20,10 @@ shortbooktitle, shortmaintitle, shortorganization, + titlekey, + translatortype, translatoratype, - translatortype} + translatorbtype} \DeclareDatamodelFields[type=list,datatype=name]{% preface, shortbookauthor, diff --git a/macros/latex/contrib/easybook/doc/chapter1.tex b/macros/latex/contrib/easybook/doc/chapter1.tex index eee3216307..11d793de88 100644 --- a/macros/latex/contrib/easybook/doc/chapter1.tex +++ b/macros/latex/contrib/easybook/doc/chapter1.tex @@ -2,7 +2,7 @@ \chapter{多彩盒子} -\begin{outline} +\begin{outline}[leftmargin = *] \index{zhaiyao@摘要盒子} \item \zhlipsum*[68][name = zhufu] \item \zhlipsum*[68][name = zhufu] diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.pdf b/macros/latex/contrib/easybook/doc/easybook-demo.pdf Binary files differindex 67b4ed5564..0aa9c117da 100644 --- a/macros/latex/contrib/easybook/doc/easybook-demo.pdf +++ b/macros/latex/contrib/easybook/doc/easybook-demo.pdf diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.tex b/macros/latex/contrib/easybook/doc/easybook-demo.tex index c1fed9f9f5..d37e662e63 100644 --- a/macros/latex/contrib/easybook/doc/easybook-demo.tex +++ b/macros/latex/contrib/easybook/doc/easybook-demo.tex @@ -1,9 +1,9 @@ \documentclass[ - class = book, - scheme = chinese, - zihao = -4, - font = noto, - paper = a4paper, + class = book, + scheme = chinese, + zihao = -4, + font = noto, + paper = a4paper, openany ]{easybook} @@ -11,56 +11,56 @@ { style = { - color = seaside, - % color-all = 009393, - % multoc = true, - % withpart = true, - footwith = page, - notomath = true, - rulewidth = 0.75pt, - % uppercase = false, - number-sep = {.} + color = seaside, + % color-all = 009393, + % multoc = true, + % withpart = true, + footwith = page, + notomath = true, + rulewidth = 0.75pt, + % uppercase = false, + number-sep = {.} }, link = { hyperlink = various, linkcolor = navyblue, - linktoc = all + linktoc = all }, spread = { - line = 1.355, - table = 1.05, - math = 1.05, - caption = 1, - footnote = 1 + line = 1.355, + table = 1.05, + math = 1.05, + caption = 1, + footnote = 1 }, elsefont = { - table-cap = \sffamily\zihao{5}, - figure-cap = \sffamily\zihao{5}, + table-cap = \sffamily\zihao{5}, + figure-cap = \sffamily\zihao{5}, listing-cap = \sffamily\zihao{5}, - footnote = \rmfamily, - marginpar = \sffamily\zihao{-5} + footnote = \rmfamily, + marginpar = \sffamily\zihao{-5} }, thmset = { - thmbox = true, - within = chapter, - bodyfont = \normalfont, + thmbox = true, + within = chapter, + bodyfont = \normalfont, headpunct = {.} }, geoset = { - vmargin = {2.54cm,2.54cm}, - hmargin = 3.17cm, - headheight = 2.04cm, - headsep = 0.5cm, + vmargin = {2.54cm,2.54cm}, + hmargin = 3.17cm, + headheight = 2.04cm, + headsep = 0.5cm, ignorefoot }, hdrset = { - % headrule = {}, + % headrule = {}, head-foot = { \easyhead[EC]{\color{DarkOrchid}\kaishu\leftmark} @@ -70,30 +70,30 @@ }, tocset = { - hang = false, - line-align = true, - numsep-all = \ccwd, - part = + hang = false, + line-align = true, + numsep-all = \ccwd, + part = { - format += \large, - indent = 0\ccwd, - rule = \tocrule{}[\bfseries] + format += \large, + indent = 0\ccwd, + rule = \tocrule{}[\bfseries] }, chapter = { - format = \addvspace{1pc}\sffamily\large, - indent = 0\ccwd, - rule = \tocrule[0.7pc](1.2){$\cdot$}[\bfseries] + format = \addvspace{1pc}\sffamily\large, + indent = 0\ccwd, + rule = \tocrule[0.7pc](1.2){$\cdot$}[\bfseries] } }, bibset = { bib-loadpkg = true, - backend = bibtex, - bib-style = numerical + backend = bibtex, + bib-style = numerical }, % secnumdepth = 2, - % tocdepth = 2 + % tocdepth = 2 } \usepackage{lipsum,zhlipsum,bicaption,tasks,tcolorbox,imakeidx} @@ -106,7 +106,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/05/01\hskip\ccwd\relax v1.24y} +\date{2021/05/02\hskip\ccwd\relax v1.24z} \frontmatter[roman] \maketitle diff --git a/macros/latex/contrib/easybook/doc/easybook.pdf b/macros/latex/contrib/easybook/doc/easybook.pdf Binary files differindex 5bd3115667..04f3b5c583 100644 --- a/macros/latex/contrib/easybook/doc/easybook.pdf +++ b/macros/latex/contrib/easybook/doc/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 7a4ecaeec7..73f3c1ead7 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -56,7 +56,7 @@ The latest version of this license is in % % \title{\sffamily easybook 文档类手册} % \author{瞿毅} -% \date{2021/05/01\hskip\ccwd\relax v1.24y\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/05/02\hskip\ccwd\relax v1.24z\thanks{\url{https://gitee.com/texl3/easybook}}} % % \maketitle % \begin{abstract} @@ -180,7 +180,7 @@ The latest version of this license is in % \end{syntax} % \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。已经预置了中英文的目录标题,可以使用 \opt{title} 选项更改目录标题的名称。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。 % \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} -% \changes{v1.24y}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24z}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -263,7 +263,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{link/...} \\ % \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。 % \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。} -% \changes{v1.24y}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24z}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -342,7 +342,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{bibset/...} % \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。} % \changes{v1.23}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。} -% \changes{v1.24y}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} +% \changes{v1.24z}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} % \end{function} % % \begin{optdesc} @@ -414,7 +414,7 @@ The latest version of this license is in % \end{syntax} % 文档类已预置8个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令。 % \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} -% \changes{v1.24y}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} +% \changes{v1.24z}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} % \end{function} % % \begin{optdesc} @@ -498,7 +498,7 @@ The latest version of this license is in % \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。} % \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 标志选项。} % \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} -% \changes{v1.24y}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} +% \changes{v1.24z}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot} @@ -538,7 +538,7 @@ The latest version of this license is in % % \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令,带有加号的 \opt{format+} 选项用于在已有的格式命令后附加内容。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。 % \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。} -% \changes{v1.24y}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} +% \changes{v1.24z}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-04-20]{\tocrule,\EbNumberline} @@ -578,10 +578,10 @@ The latest version of this license is in % rule-all = <目录引导线样式> % \end{syntax} % \ding{229} 以上选项路径为 \opt{tocset/list/...} 或 \opt{tocset/...} -% \changes{v1.24y}{2021/04/05}{可以设置图、表和代码目录的标签。} -% \changes{v1.24y}{2021/04/06}{增加目录引导线右边对齐方式。} -% \changes{v1.24y}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} -% \changes{v1.24y}{2021/05/01}{给目录增加 \opt{format+} 和 \opt{rule-all} 选项。} +% \changes{v1.24z}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24z}{2021/04/06}{增加目录引导线右边对齐方式。} +% \changes{v1.24z}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} +% \changes{v1.24z}{2021/05/01}{给目录增加 \opt{format+} 和 \opt{rule-all} 选项。} % \end{function} % % \begin{optdesc} @@ -623,7 +623,7 @@ The latest version of this license is in % \tn{end}\marg{环境名} % \end{syntax} % \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式,也可以直接使用可选参数的键值列表,具体选项见 \pkg{enumitem} 宏包文档。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 -% \changes{v1.24y}{2021/04/08}{重新优化列表环境的配置。} +% \changes{v1.24z}{2021/04/08}{重新优化列表环境的配置。} % \end{function} % % \begin{ctexexam} @@ -701,17 +701,17 @@ The latest version of this license is in % 使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg{tcolorbox} 宏包,它们的配置键值列表选项同样由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖之前预置的设置。 % % \subsubsection{摘要盒子} -% \begin{function}[added = 2021-01-05,updated = 2021-03-19]{outline} +% \begin{function}[added = 2021-01-05,updated = 2021-05-02]{outline} % \begin{syntax} -% \tn{begin}\marg{outline}\parg{标题名称}\oarg{配置选项} +% \tn{begin}\marg{outline}\oarg{列表配置选项}\parg{标题名称}\oarg{盒子配置选项} % \ \tn{item} <摘要内容> % \tn{end}\marg{outline} % \end{syntax} -% 摘要盒子可用于章前摘要,它的标题是可选参数,默认标题是摘要。 +% 摘要盒子可用于章前摘要,它的标题是可选参数,默认标题是摘要。列表配置选项与 \pkg{enumitem} 宏包中列表的选项相同,可以设置摘要条目的各种距离。 % \end{function} % % \begin{ctexexam} -% \begin{outline}(标题名称) +% \begin{outline}[leftmargin = *](标题名称) % \item 摘要内容 % \item 摘要内容 % \end{outline} @@ -742,7 +742,7 @@ The latest version of this license is in % \tn{end}\marg{ebparbox} % \end{syntax} % 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。 -% \changes{v1.24y}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} +% \changes{v1.24z}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} % \end{function} % % \subsubsection{行内盒子} @@ -801,7 +801,7 @@ The latest version of this license is in % \tn{labelformat}\marg{计数器}\marg{标签引用格式} % \end{syntax} % 使用 \tn{ref} 命令进行引用将会自动检测环境并添加相应的前缀,\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。 -% \changes{v1.24y}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} +% \changes{v1.24z}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} % \end{function} % % \subsubsection{索引} @@ -811,7 +811,7 @@ The latest version of this license is in % \tn{printindex*+}\parg{索引名}\oarg{键值列表} % \end{syntax} % \pkg{imakeidx} 宏包可使用索引的功能,重新定义了它的 \tn{printindex} 命令用于生成索引目录,键值列表及用法与小节 \ref{subsec:document command} 相同,但 \opt{multoc} 选项和 \pkg{imakeidx} 原本的接口命令 \tn{indexsetup} 部分选项失效。仅做了简单的设置如将索引设为双栏并加入目录,其他选项可另外配置。 -% \changes{v1.24y}{2021/05/01}{重新定义 \tn{printindex} 命令与文档适配。} +% \changes{v1.24z}{2021/05/01}{重新定义 \tn{printindex} 命令与文档适配。} % \end{function} % % \subsubsection{自定义脚注} @@ -915,23 +915,29 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/05/01}{1.24x}{beta} +\ProvidesExplClass{easybook}{2021/05/02}{1.24z}{beta} -\cs_generate_variant:Nn \eb_ctex_define:nn {nx} -\cs_generate_variant:Nn \int_to_arabic:n {v} -\cs_generate_variant:Nn \dim_add:Nn {NV} -\cs_generate_variant:Nn \eb_put_hyperref:n {x} +\cs_generate_variant:Nn \eb_ctex_define:nn { nx } +\cs_generate_variant:Nn \int_to_arabic:n { v } +\cs_generate_variant:Nn \dim_add:Nn { NV } +\cs_generate_variant:Nn \eb_put_hyperref:n { x } \cs_new_protected:Npn \eb_ctex_define:nn #1 - {\keys_define:nn {ctex/#1}} + { \keys_define:nn { ctex/#1 } } \cs_new_protected:Npn \eb_put_ctexbook:n #1 - {\PassOptionsToClass{#1}{ctexbook}} + { \PassOptionsToClass{#1}{ctexbook} } \cs_new_protected:Npn \eb_patch_cmd:Nnn #1#2#3 - {\ctex_patch_cmd_once:NnnnTF #1{}{#2}{#3}{}{\ctex_patch_failure:N #1}} + { + \ctex_patch_cmd_once:NnnnTF #1 { } { #2 } { #3 } + { } { \ctex_patch_failure:N #1 } + } \cs_new_protected:Npn \eb_appto_cmd:Nn #1#2 - {\ctex_appto_cmd:NnnTF #1{}{#2}{}{\ctex_patch_failure:N #1}} + { + \ctex_appto_cmd:NnnTF #1 { } { #2 } + { } { \ctex_patch_failure:N #1 } + } \cs_new_protected:Npn \eb_at_end_preamble:n - {\ctex_gadd_ltxhook:nn {env/document/before}} -\cs_gset_eq:NN \PackageWarning\use_none:nn + { \ctex_gadd_ltxhook:nn { env/document/before } } +\cs_gset_eq:NN \PackageWarning \use_none:nn \bool_set_false:N \l__eb_compile_draft_bool \bool_set_false:N \l__eb_title_newline_bool @@ -941,76 +947,77 @@ The latest version of this license is in \tl_new:N \g__eb_config_tl \clist_new:N \g__eb_options_clist -\keys_define:nn {easybook} +\keys_define:nn { easybook } { - draft .code:n = \bool_set_true:N \l__eb_compile_draft_bool, - newline .code:n = \bool_set_true:N \l__eb_title_newline_bool, - scheme .code:n = \eb_put_ctexbook:n {scheme = #1}, - enmode .meta:n = {newline,scheme = plain}, + draft .code:n = \bool_set_true:N \l__eb_compile_draft_bool, + newline .code:n = \bool_set_true:N \l__eb_title_newline_bool, + scheme .code:n = \eb_put_ctexbook:n { scheme = #1 }, + enmode .meta:n = { newline,scheme = plain }, - font .choices:nn = - {adobe,founder,mac,windows,none} - {\eb_put_ctexbook:n {fontset = \l_keys_choice_tl}}, - font/noto .code:n = + font .choices:nn = + { adobe,founder,mac,windows,none } + { \eb_put_ctexbook:n { fontset = \l_keys_choice_tl } }, + font/noto .code:n = { \bool_set_true:N \l__eb_font_noto_bool - \eb_put_ctexbook:n {fontset = none} + \eb_put_ctexbook:n { fontset = none } }, - font/overleaf .code:n = {}, - font/linux .code:n = \eb_put_ctexbook:n {fontset = ubuntu}, - font .value_required:n = true, - font .initial:n = overleaf, + font/overleaf .code:n = { }, + font/linux .code:n = \eb_put_ctexbook:n { fontset = ubuntu }, + font .value_required:n = true, + font .initial:n = overleaf, - paper .choice:, - paper .value_required:n = true, - paper/unknown .code:n = \PassOptionsToPackage{#1}{geometry}, - paper .initial:n = a4paper, + paper .choice:, + paper .value_required:n = true, + paper/unknown .code:n = \PassOptionsToPackage{#1}{geometry}, + paper .initial:n = a4paper, - oneside .value_forbidden:n = true, - twoside .value_forbidden:n = true, - oneside .code:n = + oneside .value_forbidden:n = true, + twoside .value_forbidden:n = true, + oneside .code:n = { \bool_set_false:N \l__eb_page_twoside_bool - \eb_put_ctexbook:n {oneside} + \eb_put_ctexbook:n { oneside } }, - twoside .code:n = + twoside .code:n = { \bool_set_true:N \l__eb_page_twoside_bool - \eb_put_ctexbook:n {twoside} + \eb_put_ctexbook:n { twoside } }, - class .choice:, - class .value_required:n = true, - class/book .code:n = {}, - class/article .code:n = + class .choice:, + class .value_required:n = true, + class/book .code:n = { }, + class/article .code:n = { \bool_set_false:N \l__eb_class_book_bool - \keys_set:nn {easybook}{oneside} + \keys_set:nn { easybook } { oneside } }, - class .initial:n = book, + class .initial:n = book, - config .tl_set:N = \g__eb_config_tl, - unknown .code:n = - {\clist_gput_right:No \g__eb_options_clist{\CurrentOption}} + config .tl_set:N = \g__eb_config_tl, + unknown .code:n = + { \clist_gput_right:No \g__eb_options_clist { \CurrentOption } } } \ProcessKeysOptions{easybook} \clist_map_inline:nn { - {svgnames}{xcolor}, - {hang,stable}{footmisc}, - {normalem}{ulem}, - {protrusion = false}{microtype}, - {list = off}{bicaption}, - {shortlabels,inline}{enumitem}, - {many}{tcolorbox}, - {xindy}{imakeidx}, - {CJKmath = true}{xeCJK}, - {no-math}{fontspec}, - {noto,upint}{newtxmath} - }{\PassOptionsToPackage#1} -\eb_put_ctexbook:n {\g__eb_options_clist} + { svgnames } { xcolor }, + { hang,stable } { footmisc }, + { normalem } { ulem }, + { protrusion = false } { microtype }, + { list = off } { bicaption }, + { shortlabels,inline } { enumitem }, + { many } { tcolorbox }, + { xindy } { imakeidx }, + { CJKmath = true } { xeCJK }, + { no-math } { fontspec }, + { noto,upint } { newtxmath } + } + { \PassOptionsToPackage #1 } +\eb_put_ctexbook:n { \g__eb_options_clist } \LoadClass[UTF8]{ctexbook} \bool_new:N \l__eb_multoc_bool @@ -1027,46 +1034,46 @@ The latest version of this license is in } \seq_map_inline:Nn \c__eb_options_path_seq { - \ctex_define:n {#1 .meta:nn = {ctex/#1}{##1}} - \cs_new:cpn {#1}##1{\keys_set:nn {ctex/#1}{##1}} + \ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} } + \cs_new:cpn {#1} ##1 { \keys_set:nn {ctex/#1} {##1} } } \ctex_define:n { - lstlistlistingname .tl_set:N = \lstlistlistingname, - lstlistingname .tl_set:N = \lstlistingname - } -\eb_ctex_define:nn {style} - { - multoc .bool_set:N = \l__eb_multoc_bool, - multoc .default:n = true, - withpart .bool_set:N = \l__eb_chap_withpart_bool, - withpart .default:n = true, - withpart .initial:n = false, - notomath .bool_set:N = \l__eb_notomath_bool, - notomath .default:n = true, - notomath .initial:n = true, - rulewidth .dim_set:N = \l__eb_rule_width_dim, - rulewidth .initial:n = 0.75pt, - uppercase .bool_set:N = \l__eb_uppercase_bool, - uppercase .default:n = true, - uppercase .initial:n = true, - - footwith .choices:nn = - {part,page,chapter} - {\tl_set_eq:NN \l__eb_foot_numberwith_tl\l_keys_choice_tl}, - footwith .value_required:n = true, - footwith .initial:n = chapter, - - figure-sep .tl_set:N = \l__eb_figure_separator_tl, - table-sep .tl_set:N = \l__eb_table_separator_tl, - listing-sep .tl_set:N = \l__eb_lstlisting_separator_tl, - equation-sep .tl_set:N = \l__eb_equation_separator_tl, - number-sep .meta:n = - { - figure-sep = {#1},table-sep = {#1}, - listing-sep = {#1},equation-sep = {#1} + lstlistlistingname .tl_set:N = \lstlistlistingname, + lstlistingname .tl_set:N = \lstlistingname + } +\eb_ctex_define:nn { style } + { + multoc .bool_set:N = \l__eb_multoc_bool, + multoc .default:n = true, + withpart .bool_set:N = \l__eb_chap_withpart_bool, + withpart .default:n = true, + withpart .initial:n = false, + notomath .bool_set:N = \l__eb_notomath_bool, + notomath .default:n = true, + notomath .initial:n = true, + rulewidth .dim_set:N = \l__eb_rule_width_dim, + rulewidth .initial:n = 0.75pt, + uppercase .bool_set:N = \l__eb_uppercase_bool, + uppercase .default:n = true, + uppercase .initial:n = true, + + footwith .choices:nn = + { part,page,chapter } + { \tl_set_eq:NN \l__eb_foot_numberwith_tl \l_keys_choice_tl }, + footwith .value_required:n = true, + footwith .initial:n = chapter, + + figure-sep .tl_set:N = \l__eb_figure_separator_tl, + table-sep .tl_set:N = \l__eb_table_separator_tl, + listing-sep .tl_set:N = \l__eb_lstlisting_separator_tl, + equation-sep .tl_set:N = \l__eb_equation_separator_tl, + number-sep .meta:n = + { + figure-sep = #1,table-sep = #1, + listing-sep = #1,equation-sep = #1 }, - number-sep .initial:n = {.} + number-sep .initial:n = { . } } \RequirePackage @@ -1086,20 +1093,20 @@ The latest version of this license is in \ctex_at_end_preamble:n { \bool_if:NT \l__eb_notomath_bool - {\RequirePackage{newtxmath,bm}} + { \RequirePackage{newtxmath,bm} } } \ctex_at_end:n { \tl_if_empty:NF \g__eb_config_tl - {\file_input:n {\g__eb_config_tl}} + { \file_input:n { \g__eb_config_tl } } } \cs_new_protected:Npn \eb_package_later_bool:nn #1#2 { \@ifpackagelater{#1}{#2} - {}{\msg_warning:nnn {easybook}{package-old}{#1}} + {}{\msg_warning:nnn { easybook } { package-old } {#1}} } -\msg_new:nnn {easybook}{package-old} +\msg_new:nnn { easybook } { package-old } { Package~#1~has~been~out~of~date. \\ Some~problems~or~errors~may~occur \\ @@ -1108,131 +1115,133 @@ The latest version of this license is in } \clist_map_inline:nn { - {expl3}{2020/10/27}, - {xparse}{2020/10/27}, - {l3keys2e}{2020/10/27}, - {ctex}{2020/10/19}, - {thmtools}{2020/08/01}, - {caption-light}{2020/08/24} - }{\eb_package_later_bool:nn #1} + { expl3 } { 2020/10/27 }, + { xparse } { 2020/10/27 }, + { l3keys2e } { 2020/10/27 }, + { ctex } { 2020/10/19 }, + { thmtools } { 2020/08/01 }, + { caption-light } { 2020/08/24 } + } + { \eb_package_later_bool:nn #1 } \sys_if_engine_xetex:TF { - \cs_new_eq:NN \eb_set_family:nnn \xeCJK_set_family:nnn + \cs_new_eq:NN \eb_set_family:nnn \xeCJK_set_family:nnn \cs_new_eq:NN \eb_switch_family:n \xeCJK_switch_family:n - }{ - \cs_new_eq:NN \eb_set_family:nnn \ctex_ltj_set_family:nnn + } + { + \cs_new_eq:NN \eb_set_family:nnn \ctex_ltj_set_family:nnn \cs_new_eq:NN \eb_switch_family:n \ctex_ltj_switch_family:n } \cs_new_protected:Npn \eb_setmainfont:nn #1#2 - {\__fontspec_main_setmainfont:nn {#2}{#1}} + { \__fontspec_main_setmainfont:nn {#2} {#1} } \cs_new_protected:Npn \eb_setsansfont:nn #1#2 - {\__fontspec_main_setsansfont:nn {#2}{#1}} + { \__fontspec_main_setsansfont:nn {#2} {#1} } \cs_new_protected:Npn \eb_setmonofont:nn #1#2 - {\__fontspec_main_setmonofont:nn {#2}{#1}} + { \__fontspec_main_setmonofont:nn {#2} {#1} } \cs_new_protected:Npn \eb_setCJKmainfont:nn #1#2 - {\eb_set_family:nnn {\CJKrmdefault}{#2}{#1}} + { \eb_set_family:nnn { \CJKrmdefault } {#2} {#1} } \cs_new_protected:Npn \eb_setCJKsansfont:nn #1#2 - {\eb_set_family:nnn {\CJKsfdefault}{#2}{#1}} + { \eb_set_family:nnn { \CJKsfdefault } {#2} {#1} } \cs_new_protected:Npn \eb_setCJKmonofont:nn #1#2 - {\eb_set_family:nnn {\CJKttdefault}{#2}{#1}} + { \eb_set_family:nnn { \CJKttdefault } {#2} {#1} } \cs_new_protected:Npn \eb_set_zhfont_songti:nn #1#2 - {\eb_set_family:nnn {songti}{#2}{#1}} + { \eb_set_family:nnn { songti } {#2} {#1} } \cs_new_protected:Npn \eb_set_zhfont_heiti:nn #1#2 - {\eb_set_family:nnn {heiti}{#2}{#1}} + { \eb_set_family:nnn { heiti } {#2} {#1} } \cs_new_protected:Npn \eb_set_zhfont_kaishu:nn #1#2 - {\eb_set_family:nnn {kaishu}{#2}{#1}} + { \eb_set_family:nnn { kaishu } {#2} {#1} } \cs_new_protected:Npn \eb_set_zhfont_fangsong:nn #1#2 - {\eb_set_family:nnn {fangsong}{#2}{#1}} + { \eb_set_family:nnn { fangsong } {#2} {#1} } \tl_const:Nn \eb_option_zhfont_tl - {UprightFont = *,AutoFakeBold = 1.5,ItalicFont = *} + { UprightFont = *,AutoFakeBold = 1.5,ItalicFont = * } \cs_new_protected:Npx \eb_setCJKmainfont:n #1 - {\eb_setCJKmainfont:nn {#1}{\eb_option_zhfont_tl}} + { \eb_setCJKmainfont:nn {#1} { \eb_option_zhfont_tl } } \cs_new_protected:Npx \eb_setCJKsansfont:n #1 - {\eb_setCJKsansfont:nn {#1}{\eb_option_zhfont_tl}} + { \eb_setCJKsansfont:nn {#1} { \eb_option_zhfont_tl } } \cs_new_protected:Npx \eb_setCJKmonofont:n #1 - {\eb_setCJKmonofont:nn {#1}{\eb_option_zhfont_tl}} + { \eb_setCJKmonofont:nn {#1} { \eb_option_zhfont_tl } } \cs_new_protected:Npx \eb_set_zhfont_songti:n #1 - {\eb_set_zhfont_songti:nn {#1}{\eb_option_zhfont_tl}} + { \eb_set_zhfont_songti:nn {#1} { \eb_option_zhfont_tl } } \cs_new_protected:Npx \eb_set_zhfont_heiti:n #1 - {\eb_set_zhfont_heiti:nn {#1}{\eb_option_zhfont_tl}} + { \eb_set_zhfont_heiti:nn {#1} { \eb_option_zhfont_tl } } \cs_new_protected:Npx \eb_set_zhfont_kaishu:n #1 - {\eb_set_zhfont_kaishu:nn {#1}{\eb_option_zhfont_tl}} + { \eb_set_zhfont_kaishu:nn {#1} { \eb_option_zhfont_tl } } \cs_new_protected:Npx \eb_set_zhfont_fangsong:n #1 - {\eb_set_zhfont_fangsong:nn {#1}{\eb_option_zhfont_tl}} + { \eb_set_zhfont_fangsong:nn {#1} { \eb_option_zhfont_tl } } \bool_if:NT \l__eb_font_noto_bool { - \eb_setmainfont:nn {NotoSerif} + \eb_setmainfont:nn { NotoSerif } { - Extension = .ttf, + Extension = .ttf, UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = *-Italic + BoldFont = *-Bold, + ItalicFont = *-Italic } - \eb_setsansfont:nn {NotoSans} + \eb_setsansfont:nn { NotoSans } { - Extension = .ttf, + Extension = .ttf, UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = *-Italic + BoldFont = *-Bold, + ItalicFont = *-Italic } - \eb_setmonofont:nn {NotoSansMono} + \eb_setmonofont:nn { NotoSansMono } { - Extension = .ttf, + Extension = .ttf, UprightFont = *-Regular, - BoldFont = *-Bold + BoldFont = *-Bold } - \eb_setCJKmainfont:nn {FZShuSong-Z01S} + \eb_setCJKmainfont:nn { FZShuSong-Z01S } { UprightFont = *, - BoldFont = FZHei-B01S, - ItalicFont = FZKai-Z03S + BoldFont = FZHei-B01S, + ItalicFont = FZKai-Z03S } - \eb_setCJKsansfont:n {FZHei-B01S} - \eb_setCJKmonofont:n {FZFangSong-Z02S} - \eb_set_zhfont_songti:n {FZShuSong-Z01S} - \eb_set_zhfont_heiti:n {FZHei-B01S} - \eb_set_zhfont_kaishu:n {FZKai-Z03S} - \eb_set_zhfont_fangsong:n {FZFangSong-Z02S} - \cs_new_protected:Npn \songti{\eb_switch_family:n {songti}} - \cs_new_protected:Npn \heiti{\eb_switch_family:n {heiti}} - \cs_new_protected:Npn \kaishu{\eb_switch_family:n {kaishu}} - \cs_new_protected:Npn \fangsong{\eb_switch_family:n {fangsong}} + \eb_setCJKsansfont:n { FZHei-B01S } + \eb_setCJKmonofont:n { FZFangSong-Z02S } + \eb_set_zhfont_songti:n { FZShuSong-Z01S } + \eb_set_zhfont_heiti:n { FZHei-B01S } + \eb_set_zhfont_kaishu:n { FZKai-Z03S } + \eb_set_zhfont_fangsong:n { FZFangSong-Z02S } + \cs_new_protected:Npn \songti { \eb_switch_family:n { songti } } + \cs_new_protected:Npn \heiti { \eb_switch_family:n { heiti } } + \cs_new_protected:Npn \kaishu { \eb_switch_family:n { kaishu } } + \cs_new_protected:Npn \fangsong { \eb_switch_family:n { fangsong } } } \eb_at_end_preamble:n - {\cs_if_exist:NF \kaishu{\cs_gset_eq:NN \kaishu\itshape}} + { \cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape } } \includepdfset{fitpaper = true} \geometry { - vmargin = 2.54cm, - hmargin = 3.17cm, - columnsep = 2\ccwd, - headheight = 2.04cm, - headsep = 0.5cm, - footskip = 0.79cm, - footnotesep = 0.5cm, - marginparsep = 8pt, - marginparwidth = 2.54cm + vmargin = 2.54cm, + hmargin = 3.17cm, + columnsep = 2\ccwd, + headheight = 2.04cm, + headsep = 0.5cm, + footskip = 0.79cm, + footnotesep = 0.5cm, + marginparsep = 8pt, + marginparwidth = 2.54cm } \clist_new:N \g__eb_geometry_clist -\eb_ctex_define:nn {geoset} +\eb_ctex_define:nn { geoset } { - footnotemargin .dim_set:N = \footnotemargin, - footnotemargin .initial:n = 0.5\ccwd, - footparskip .tl_set:N = \hangfootparskip, - footparskip .initial:n = 0ex, - footparindent .tl_set:N = \hangfootparindent, - footparindent .initial:n = 2\ccwd, - unknown .code:n = + footnotemargin .dim_set:N = \footnotemargin, + footnotemargin .initial:n = 0.5\ccwd, + footparskip .tl_set:N = \hangfootparskip, + footparskip .initial:n = 0ex, + footparindent .tl_set:N = \hangfootparindent, + footparindent .initial:n = 2\ccwd, + unknown .code:n = { \clist_gput_right:Nx \g__eb_geometry_clist { \l_keys_key_str - \tl_if_empty:NF \l_keys_value_tl{ = {#1}} + \tl_if_empty:NF \l_keys_value_tl { = {#1} } } } } @@ -1242,8 +1251,8 @@ The latest version of this license is in \clearpage \bool_if:NT \l__eb_page_twoside_bool { - \int_if_odd:nF {\c@page} - {\hbox:n {}\thispagestyle{#1}\clearpage} + \int_if_odd:nF { \c@page } + { \hbox:n { }\thispagestyle{#1}\clearpage } } } \RenewDocumentCommand{\frontmatter}{sO{Roman}} @@ -1258,67 +1267,68 @@ The latest version of this license is in \booltrue{@mainmatter} \pagenumbering{arabic} } -\cs_gset_eq:NN \easyhead\fancyhead -\cs_gset_eq:NN \easyfoot\fancyfoot -\eb_ctex_define:nn {hdrset} +\cs_gset_eq:NN \easyhead \fancyhead +\cs_gset_eq:NN \easyfoot \fancyfoot +\eb_ctex_define:nn { hdrset } { - head-foot .tl_set:N = \l__eb_fancyhf_content_tl, - head-foot .initial:n = + head-foot .tl_set:N = \l__eb_fancyhf_content_tl, + head-foot .initial:n = { \bool_if:NTF \l__eb_page_twoside_bool { \easyhead[EC]{\color{ctex@frame}\kaishu\leftmark} \easyhead[OC]{\color{ctex@frame}\kaishu\rightmark} \easyhead[EL,OR]{\color{ctex@frame}\thepage} - }{ + } + { \easyhead[L]{\color{ctex@frame}\kaishu\leftmark} \easyhead[R]{\color{ctex@frame}\thepage} } }, - chap-mark .cs_set:Np = \eb_fancyhf_chapter_mark:n #1, - chap-mark .initial:n = + chap-mark .cs_set:Np = \eb_fancyhf_chapter_mark:n #1, + chap-mark .initial:n = { - \int_compare:nT {\c@secnumdepth > -1} + \int_compare:nT { \c@secnumdepth > -1 } { \ifbool{@mainmatter} { - \int_if_odd:nT {\CTEX@chapter@numbering} - {\CTEXthechapter\hspace{\ccwd}} + \int_if_odd:nT { \CTEX@chapter@numbering } + { \CTEXthechapter\hspace{\ccwd} } }{} }#1 }, - sec-mark .cs_set:Np = \eb_fancyhf_section_mark:n #1, - sec-mark .initial:n = + sec-mark .cs_set:Np = \eb_fancyhf_section_mark:n #1, + sec-mark .initial:n = { - \int_compare:nT {\c@secnumdepth > 0} + \int_compare:nT { \c@secnumdepth > 0 } { - \int_if_odd:nT {\CTEX@section@numbering} - {\CTEXthesection\hspace{0.5\ccwd}} + \int_if_odd:nT { \CTEX@section@numbering } + { \CTEXthesection\hspace{0.5\ccwd} } }#1 }, - subsec-mark .cs_set:Np = \eb_fancyhf_subsection_mark:n #1, - subsec-mark .initial:n = + subsec-mark .cs_set:Np = \eb_fancyhf_subsection_mark:n #1, + subsec-mark .initial:n = { - \int_compare:nT {\c@secnumdepth > 1} + \int_compare:nT { \c@secnumdepth > 1 } { - \int_if_odd:nT {\CTEX@subsection@numbering} - {\CTEXthesubsection\hspace{0.5\ccwd}} + \int_if_odd:nT { \CTEX@subsection@numbering } + { \CTEXthesubsection\hspace{0.5\ccwd} } }#1 }, - headrule .tl_gset:N = \headrule, - headrule .initial:n = + headrule .tl_gset:N = \headrule, + headrule .initial:n = { \group_begin: \color{ctex@frame}\vspace*{1.5pt} \hrule width \textwidth height \l__eb_rule_width_dim \group_end: }, - footrule .tl_gset:N = \footrule, - footrule .initial:n = {}, - footnoterule .tl_gset:N = \footnoterule, - footnoterule .initial:n = + footrule .tl_gset:N = \footrule, + footrule .initial:n = { }, + footnoterule .tl_gset:N = \footnoterule, + footnoterule .initial:n = { \group_begin: \color{ctex@frame} @@ -1330,185 +1340,183 @@ The latest version of this license is in \cs_new:Npn \eb_upper_number_mark_bool:nn #1#2 { \bool_if:NT \l__eb_uppercase_bool - {\text_uppercase:n}{\use:c {eb_fancyhf_#1_mark:n}{#2}} + { \text_uppercase:n } { \use:c { eb_fancyhf_#1_mark:n } {#2} } } -\cs_new:Npn \eb@number@markdouble#1#2 +\cs_new:Npn \eb@number@markdouble #1#2 { \markboth - {\eb_upper_number_mark_bool:nn {#1}{#2}} + {\eb_upper_number_mark_bool:nn {#1} {#2}} { \bool_if:NT \l__eb_page_twoside_bool - {\eb_upper_number_mark_bool:nn {#1}{#2}} + { \eb_upper_number_mark_bool:nn {#1} {#2} } } } -\cs_new:Npn \eb@number@markright#1#2 - {\markright{\eb_upper_number_mark_bool:nn {#1}{#2}}} +\cs_new:Npn \eb@number@markright #1#2 + { \markright{\eb_upper_number_mark_bool:nn {#1} {#2}} } \ctex_at_end_preamble:n { - \exp_args:NV \geometry\g__eb_geometry_clist + \exp_args:NV \geometry \g__eb_geometry_clist \fancyhf{} \tl_use:N \l__eb_fancyhf_content_tl - \cs_gset_eq:NN \ps@plain\ps@empty + \cs_gset_eq:NN \ps@plain \ps@empty \pagestyle{fancy} \bool_if:NTF \l__eb_class_book_bool { - \cs_gset:Npn \chaptermark#1 - {\eb@number@markdouble{chapter}{#1}} - \cs_gset:Npn \sectionmark#1 - {\eb@number@markright{section}{#1}} - }{ - \cs_gset:Npn \sectionmark#1 - {\eb@number@markdouble{section}{#1}} - \cs_gset:Npn \subsectionmark#1 - {\eb@number@markright{subsection}{#1}} + \cs_gset:Npn \chaptermark #1 + { \eb@number@markdouble{chapter}{#1} } + \cs_gset:Npn \sectionmark #1 + { \eb@number@markright{section}{#1} } + } + { + \cs_gset:Npn \sectionmark #1 + { \eb@number@markdouble{section}{#1} } + \cs_gset:Npn \subsectionmark #1 + { \eb@number@markright{subsection}{#1} } } \bool_if:NT \l__eb_compile_draft_bool { \bool_if:NTF \l__eb_page_twoside_bool - {\easyfoot[C]{\color{SlateGray}\sffamily\today}} - {\easyhead[C]{\color{SlateGray}\sffamily\today}} + { \easyfoot[C]{\color{SlateGray}\sffamily\today} } + { \easyhead[C]{\color{SlateGray}\sffamily\today} } \geometry{showframe} } } \seq_const_from_clist:Nn \c__eb_toc_headings_level_seq - {part,chapter,section,subsection,list} + { part,chapter,section,subsection,list } \seq_map_inline:Nn \c__eb_toc_headings_level_seq { - \ctex_define:n {tocset/#1 .meta:nn = {ctex/tocset/#1}{##1}} - \eb_ctex_define:nn {tocset} + \ctex_define:n { tocset/#1 .meta:nn = { ctex/tocset/#1 } {##1} } + \eb_ctex_define:nn { tocset } { - #1/format .tl_set:c = l__eb_toc_#1_format_tl, - #1/format+ .code:n = - {\tl_put_right:cn {l__eb_toc_#1_format_tl}{##1}}, + #1/format .tl_set:c = l__eb_toc_#1_format_tl, + #1/format+ .code:n = + { \tl_put_right:cn {l__eb_toc_#1_format_tl} {##1} }, #1/format~+ .code:n = - {\tl_put_right:cn {l__eb_toc_#1_format_tl}{##1}}, - #1/indent .tl_set:c = l__eb_toc_#1_indent_tl, - #1/rule .tl_set:c = l__eb_toc_#1_rule_tl, - #1/numsep .tl_set:c = eb@toc@#1@numsep + { \tl_put_right:cn {l__eb_toc_#1_format_tl} {##1} }, + #1/indent .tl_set:c = l__eb_toc_#1_indent_tl, + #1/rule .tl_set:c = l__eb_toc_#1_rule_tl, + #1/numsep .tl_set:c = eb@toc@#1@numsep } } -\cs_new:Npn \EbNumberline#1 +\cs_new:Npn \EbNumberline #1 { \CTEXifname { - \use:c {CTEXthe#1} - \hspace{\use:c {eb@toc@#1@numsep}} + \use:c { CTEXthe#1 } + \hspace{\use:c { eb@toc@#1@numsep }} }{} } \newbool{eb@titletoc@hang@fix} -\eb_ctex_define:nn {tocset} - { - list/lolskip .skip_set:N = \l__eb_toc_lolskip_skip, - list/lolskip .initial:n = 0.8pc, - list/belowoffset .dim_set:N = \l__eb_toc_listoffset_dim, - list/belowoffset .initial:n = - {\bool_if:NTF \l__eb_class_book_bool{0pc}{0.15pc}}, - belowoffset .dim_set:N = \l__eb_toc_offset_dim, - belowoffset .initial:n = - {\bool_if:NTF \l__eb_class_book_bool{-1pc}{-0.35pc}}, - tocline-fig .cs_set:Np = \eb@labelname@lof#1, - tocline-fig .initial:n = - { - \figurename\space#1 +\eb_ctex_define:nn { tocset } + { + list/lolskip .skip_set:N = \l__eb_toc_lolskip_skip, + list/lolskip .initial:n = 0.8pc, + list/belowoffset .dim_set:N = \l__eb_toc_listoffset_dim, + list/belowoffset .initial:n = + {\bool_if:NTF \l__eb_class_book_bool { 0pc } { 0.15pc } }, + + belowoffset .dim_set:N = \l__eb_toc_offset_dim, + belowoffset .initial:n = + { \bool_if:NTF \l__eb_class_book_bool { -1pc } { -0.35pc } }, + tocline-fig .cs_set:Np = \eb@labelname@lof #1, + tocline-fig .initial:n = + { + \figurename\space #1 \notbool{eb@titletoc@hang@fix} {\hspace{\eb@toc@list@numsep}}{} }, - tocline-tab .cs_set:Np = \eb@labelname@lot#1, - tocline-tab .initial:n = + tocline-tab .cs_set:Np = \eb@labelname@lot #1, + tocline-tab .initial:n = { - \tablename\space#1 + \tablename\space #1 \notbool{eb@titletoc@hang@fix} {\hspace{\eb@toc@list@numsep}}{} }, - tocline-lst .tl_set:N = \eb@labelname@lol, - tocline-lst .initial:n = + tocline-lst .tl_set:N = \eb@labelname@lol, + tocline-lst .initial:n = { \lstlistingname\space\thelstlisting \notbool{eb@titletoc@hang@fix} {\hspace{\eb@toc@list@numsep}}{} }, - line-align .bool_set:N = \l__eb_toc_line_align_bool, - line-align .default:n = true, - line-align .initial:n = true, + line-align .bool_set:N = \l__eb_toc_line_align_bool, + line-align .default:n = true, + line-align .initial:n = true, - hang .choice:, - hang/true .code:n = + hang .choice:, + hang/true .code:n = { \booltrue{eb@titletoc@hang@fix} \ctex_set:n { - chapter/tocline = \CTEXnumberline{##1}##2, - section/tocline = \CTEXnumberline{##1}##2, - subsection/tocline = \CTEXnumberline{##1}##2 + chapter/tocline = \CTEXnumberline{##1}##2, + section/tocline = \CTEXnumberline{##1}##2, + subsection/tocline = \CTEXnumberline{##1}##2 } }, - hang/false .code:n = + hang/false .code:n = { \ctex_set:n { - chapter/tocline = \EbNumberline{##1}##2, - section/tocline = \EbNumberline{##1}##2, - subsection/tocline = \EbNumberline{##1}##2 + chapter/tocline = \EbNumberline{##1}##2, + section/tocline = \EbNumberline{##1}##2, + subsection/tocline = \EbNumberline{##1}##2 } }, - hang .default:n = true, - hang .initial:n = false, + hang .default:n = true, + hang .initial:n = false, - numsep-all .meta:n = + numsep-all .meta:n = { - part/numsep = {#1}, - chapter/numsep = {#1}, - section/numsep = {#1}, - subsection/numsep = {#1}, - list/numsep = {#1} + part/numsep = #1, + chapter/numsep = #1, + section/numsep = #1, + subsection/numsep = #1, + list/numsep = #1 }, - indent-all .meta:n = - { - part/indent = {#1}, - chapter/indent = {#1}, - section/indent = {#1}, - subsection/indent = {#1}, - list/indent = {#1} + numsep-all .initial:n = \ccwd, + indent-all .meta:n = + { + part/indent = #1, + chapter/indent = #1, + section/indent = #1, + subsection/indent = #1, + list/indent = #1 }, - rule-all .meta:n = + rule-all .meta:n = { - part/rule = {#1}, - chapter/rule = {#1}, - section/rule = {#1}, - subsection/rule = {#1}, - list/rule = {#1} + part/rule = #1, + chapter/rule = #1, + section/rule = #1, + subsection/rule = #1, + list/rule = #1 } } -\ctex_set:nn {tocset} +\ctex_set:nn { tocset } { part/format = \addvspace{1pc}\sffamily\large, part/indent = 0\ccwd, - part/rule = \tocrule{}[\bfseries], - part/numsep = \ccwd, + part/rule = \tocrule{}[\bfseries], - chapter/format = \addvspace{1pc}\sffamily\large, - chapter/indent = 0\ccwd, - chapter/rule = \tocrule{$\cdot$}[\bfseries], - chapter/numsep = \ccwd, + chapter/format = \addvspace{1pc}\sffamily\large, + chapter/indent = 0\ccwd, + chapter/rule = \tocrule{$\cdot$}[\bfseries], - section/format = \addvspace{0.35pc}, - section/indent = - {\bool_if:NTF \l__eb_class_book_bool{1.5\ccwd}{0\ccwd}}, - section/rule = \tocrule{$\cdot$}, - section/numsep = \ccwd, + section/format = \addvspace{0.35pc}, + section/indent = + { \bool_if:NTF \l__eb_class_book_bool {1.5\ccwd } { 0\ccwd } }, + section/rule = \tocrule{$\cdot$}, subsection/format = \addvspace{0.35pc}, subsection/indent = - {\bool_if:NTF \l__eb_class_book_bool{3.8\ccwd}{1.4\ccwd}}, - subsection/rule = \tocrule{$\cdot$}, - subsection/numsep = \ccwd, + { \bool_if:NTF \l__eb_class_book_bool {3.8\ccwd } { 1.4\ccwd } }, + subsection/rule = \tocrule{$\cdot$}, list/format = \addvspace{0.2pc}, list/indent = 0\ccwd, - list/rule = \tocrule{$\cdot$}, - list/numsep = \ccwd + list/rule = \tocrule{$\cdot$} } \NewDocumentCommand{\tocrule}{sO{0.7pc}D(){1.2}mO{}} @@ -1519,52 +1527,53 @@ The latest version of this license is in {\thecontentspage} { \bool_if:NTF \l__eb_toc_line_align_bool - {\contentspage}{\thecontentspage} + { \contentspage } { \thecontentspage } } } \cs_new_protected:Npn \eb_titlecontents_set:nn #1#2 { \titlecontents{#1} - [\use:c {l__eb_toc_#2_indent_tl}] - {\use:c {l__eb_toc_#2_format_tl}} + [\use:c { l__eb_toc_#2_indent_tl }] + {\use:c { l__eb_toc_#2_format_tl }} { \ifbool{eb@titletoc@hang@fix} { \contentspush { \bool_if:NT \l__eb_toc_number_color_bool - {\color{ctex@toc@number}} + { \color{ctex@toc@number} } \thecontentslabel - \hspace{\use:c {eb@toc@#2@numsep}} + \hspace{\use:c { eb@toc@#2@numsep }} } }{} }{} - {\use:c {l__eb_toc_#2_rule_tl}} + {\use:c { l__eb_toc_#2_rule_tl }} } \contentsuse{lstlisting}{lol} \clist_map_inline:nn { - {part}{part}, - {chapter}{chapter}, - {section}{section}, - {subsection}{subsection}, - {figure}{list}, - {table}{list}, - {lstlisting}{list} - }{\eb_titlecontents_set:nn #1} + { part } { part }, + { chapter } { chapter }, + { section } { section }, + { subsection } { subsection }, + { figure } { list }, + { table } { list }, + { lstlisting } { list } + } + { \eb_titlecontents_set:nn #1 } \prop_new:N \l__eb_label_name_prop \prop_set_from_keyval:Nn \l__eb_label_name_prop { - figure = \eb@labelname@lof, - table = \eb@labelname@lot + figure = \eb@labelname@lof, + table = \eb@labelname@lot } -\cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 +\cs_gset:Npn \caption@@@addcontentsline #1#2#3#4 { \addcontentsline{#1}{#2} { \ifbool{eb@titletoc@hang@fix}{\protect\numberline}{} - {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} + {\prop_item:Nn \l__eb_label_name_prop {#2}{#3}}#4 } } \ctex_patch_cmd:Nnn \lst@MakeCaption @@ -1581,103 +1590,107 @@ The latest version of this license is in \eb_appto_cmd:Nn \@chapter { - \skip_if_eq:nnF {\l__eb_toc_lolskip_skip}{\c_zero_skip} + \skip_if_eq:nnF { \l__eb_toc_lolskip_skip } { \c_zero_skip } { \addtocontents{lol} {\protect\addvspace{\skip_use:N \l__eb_toc_lolskip_skip}} } \bool_if:NF \l__eb_class_book_bool - {\msg_error:nn {easybook}{no-chapter}} + { \msg_error:nn { easybook } { no-chapter } } } \eb_appto_cmd:Nn \@schapter { \bool_if:NF \l__eb_class_book_bool - {\msg_error:nn {easybook}{no-chapter}} + { \msg_error:nn { easybook } { no-chapter } } } -\msg_new:nnn {easybook}{no-chapter} +\msg_new:nnn { easybook } { no-chapter } { Your~document~class~is~in~article~mode. \\ The~\string\chapter\space~command~will~not~be~used. } -\tl_set:Nn \l__eb_toc_type_tl{book} -\keys_define:nn {eb/listoc} +\tl_set:Nn \l__eb_toc_type_tl { book } +\keys_define:nn { eb/listoc } { - article .code:n = \tl_set:Nn \l__eb_toc_type_tl{article}, - book .code:n = {}, - multoc .bool_set:N = \l__eb_multoc_bool, - multoc .default:n = true, - multoc .initial:n = false, - title .tl_set:N = \eb@toc@title + article .code:n = \tl_set:Nn \l__eb_toc_type_tl { article }, + book .code:n = { }, + multoc .bool_set:N = \l__eb_multoc_bool, + multoc .default:n = true, + multoc .initial:n = false, + title .tl_set:N = \eb@toc@title } \cs_new:Npn \eb_upper_nonumber_mark_bool:n #1 { \bool_if:NTF \l__eb_uppercase_bool - {\text_uppercase:n {#1}} - {\text_titlecase_first:n {#1}} + { \text_uppercase:n {#1} } + { \text_titlecase_first:n {#1} } } -\cs_new:Npn \eb@nonumber@markdouble#1 +\cs_new:Npn \eb@nonumber@markdouble #1 { \markboth {\eb_upper_nonumber_mark_bool:n {#1}} { \bool_if:NT \l__eb_page_twoside_bool - {\eb_upper_nonumber_mark_bool:n {#1}} + { \eb_upper_nonumber_mark_bool:n {#1} } } } -\cs_new:Npn \eb@nonumber@markright#1 - {\markright{\eb_upper_nonumber_mark_bool:n {#1}}} +\cs_new:Npn \eb@nonumber@markright #1 + { \markright{\eb_upper_nonumber_mark_bool:n {#1}} } \cs_new_protected:Npn \eb_title_mark_intoc:n #1 { - \tl_if_eq:NnTF \l__eb_toc_type_tl{book} + \tl_if_eq:NnTF \l__eb_toc_type_tl { book } { - \chapter*{\phantomsection#1} + \chapter*{\phantomsection #1} \CTEX@addtocline{chapter}{#1} \eb@nonumber@markdouble{#1} - }{ - \section*{\phantomsection#1} + } + { + \section*{\phantomsection #1} \CTEX@addtocline{section}{#1} \bool_if:NTF \l__eb_class_book_bool - {\eb@nonumber@markright{#1}} - {\eb@nonumber@markdouble{#1}} + { \eb@nonumber@markright{#1} } + { \eb@nonumber@markdouble{#1} } } } \cs_new_protected:Npn \eb_title_mark_notoc:n #1 { - \tl_if_eq:NnTF \l__eb_toc_type_tl{book} + \tl_if_eq:NnTF \l__eb_toc_type_tl { book } { - \chapter*{\phantomsection#1} + \chapter*{\phantomsection #1} \eb@nonumber@markdouble{#1} - }{ - \section*{\phantomsection#1} + } + { + \section*{\phantomsection #1} \bool_if:NTF \l__eb_class_book_bool - {\eb@nonumber@markright{#1}} - {\eb@nonumber@markdouble{#1}} + { \eb@nonumber@markright{#1} } + { \eb@nonumber@markdouble{#1} } } } \cs_new_protected:Npn \eb_title_number_intoc_bool:nn #1#2 { \IfBooleanTF{#1} { - \tl_if_eq:NnTF \l__eb_toc_type_tl{book} - {\chapter{\eb@toc@title}} - {\section{\eb@toc@title}} - }{ + \tl_if_eq:NnTF \l__eb_toc_type_tl { book } + { \chapter{\eb@toc@title} } + { \section{\eb@toc@title} } + } + { \IfBooleanTF{#2} - {\eb_title_mark_notoc:n {\eb@toc@title}} - {\eb_title_mark_intoc:n {\eb@toc@title}} + { \eb_title_mark_notoc:n {\eb@toc@title} } + { \eb_title_mark_intoc:n {\eb@toc@title} } } } \cs_new_protected:Npn \eb_class_title_level_bool:n #1 { \bool_if:NTF \l__eb_class_book_bool { - \chapter*{\phantomsection#1} + \chapter*{\phantomsection #1} \CTEX@addtocline{chapter}{#1} - }{ - \section*{\phantomsection#1} + } + { + \section*{\phantomsection #1} \CTEX@addtocline{section}{#1} } \eb@nonumber@markdouble{#1} @@ -1689,25 +1702,26 @@ The latest version of this license is in \ifbool{@twocolumn} { \booltrue{@restonecol} - \bool_if:NTF \l__eb_multoc_bool{\twocolumn}{\onecolumn} + \bool_if:NTF \l__eb_multoc_bool {\twocolumn } { \onecolumn } }{ \boolfalse{@restonecol} - \bool_if:NT \l__eb_multoc_bool{\twocolumn} + \bool_if:NT \l__eb_multoc_bool { \twocolumn } } - }{\tl_set:Nn \l__eb_toc_type_tl{article}} + } + { \tl_set:Nn \l__eb_toc_type_tl { article } } } \cs_new_protected:Npn \eb_multoc_post_bool: { \bool_if:NT \l__eb_class_book_bool - {\ifbool{@restonecol}{\twocolumn}{\onecolumn}} + { \ifbool{@restonecol}{\twocolumn}{\onecolumn} } } \RenewDocumentCommand{\tableofcontents}{o} { \group_begin: - \tl_set_eq:NN \eb@toc@title\contentsname - \IfValueT{#1}{\keys_set:nn {eb/listoc}{#1}} + \tl_set_eq:NN \eb@toc@title \contentsname + \IfValueT{#1}{\keys_set:nn { eb/listoc } {#1}} \eb_multoc_pre_bool: - \eb_title_mark_notoc:n {\eb@toc@title} + \eb_title_mark_notoc:n { \eb@toc@title } \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{toc} \eb_multoc_post_bool: @@ -1716,11 +1730,11 @@ The latest version of this license is in \RenewDocumentCommand{\listoffigures}{st+o} { \group_begin: - \tl_set_eq:NN \eb@toc@title\listfigurename - \IfValueT{#3}{\keys_set:nn {eb/listoc}{#3}} + \tl_set_eq:NN \eb@toc@title \listfigurename + \IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}} \eb_multoc_pre_bool: - \eb_title_number_intoc_bool:nn {#2}{#1} - \dim_add:NV \l__eb_toc_offset_dim\l__eb_toc_listoffset_dim + \eb_title_number_intoc_bool:nn {#2} {#1} + \dim_add:NV \l__eb_toc_offset_dim \l__eb_toc_listoffset_dim \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{lof} \eb_multoc_post_bool: @@ -1729,11 +1743,11 @@ The latest version of this license is in \RenewDocumentCommand{\listoftables}{st+o} { \group_begin: - \tl_set_eq:NN \eb@toc@title\listtablename - \IfValueT{#3}{\keys_set:nn {eb/listoc}{#3}} + \tl_set_eq:NN \eb@toc@title \listtablename + \IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}} \eb_multoc_pre_bool: - \eb_title_number_intoc_bool:nn {#2}{#1} - \dim_add:NV \l__eb_toc_offset_dim\l__eb_toc_listoffset_dim + \eb_title_number_intoc_bool:nn {#2} {#1} + \dim_add:NV \l__eb_toc_offset_dim \l__eb_toc_listoffset_dim \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{lot} \eb_multoc_post_bool: @@ -1742,38 +1756,38 @@ The latest version of this license is in \NewDocumentCommand{\listoflistings}{st+o} { \group_begin: - \tl_set_eq:NN \eb@toc@title\lstlistlistingname - \IfValueT{#3}{\keys_set:nn {eb/listoc}{#3}} + \tl_set_eq:NN \eb@toc@title \lstlistlistingname + \IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}} \eb_multoc_pre_bool: - \eb_title_number_intoc_bool:nn {#2}{#1} - \dim_add:NV \l__eb_toc_offset_dim\l__eb_toc_listoffset_dim + \eb_title_number_intoc_bool:nn {#2} {#1} + \dim_add:NV \l__eb_toc_offset_dim \l__eb_toc_listoffset_dim \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{lol} \eb_multoc_post_bool: \group_end: } -\ctex_at_end_package:nn {imakeidx} +\ctex_at_end_package:nn { imakeidx } { \makeindex[ - options = -M~texindy~-C~utf8, - program = truexindy, - columns = 2, + options = -M~texindy~-C~utf8, + program = truexindy, + columns = 2, columnsep = 2\ccwd ] \RenewDocumentCommand{\printindex}{st+D(){\imki@jobname}o} { \group_begin: - \tl_set_eq:NN \eb@toc@title\indexname - \cs_set_eq:NN \imki@indexlevel\use_none:n + \tl_set_eq:NN \eb@toc@title \indexname + \cs_set_eq:NN \imki@indexlevel \use_none:n \setkeys{imki}{intoc = false} - \IfValueT{#4}{\keys_set:nn {eb/listoc}{#4}} + \IfValueT{#4}{\keys_set:nn { eb/listoc } {#4}} \bool_if:NF \l__eb_class_book_bool - {\tl_set:Nn \l__eb_toc_type_tl{article}} + { \tl_set:Nn \l__eb_toc_type_tl { article } } \tl_set:Nn \imki@indexheaders { - \eb_title_number_intoc_bool:nn {#2}{#1} - \cs_set_eq:NN \thispagestyle\use_none:n + \eb_title_number_intoc_bool:nn {#2} {#1} + \cs_set_eq:NN \thispagestyle \use_none:n \cs_undefine:N \imki@firstpagestyle } \imki@putindex{#3} @@ -1786,18 +1800,18 @@ The latest version of this license is in \tl_new:N \l__eb_font_listing_tl \tl_new:N \l__eb_font_footnote_tl -\eb_ctex_define:nn {elsefont} +\eb_ctex_define:nn { elsefont } { - table-cap .tl_set:N = \l__eb_font_table_tl, - table-cap .initial:n = \sffamily\small, - figure-cap .tl_set:N = \l__eb_font_figure_tl, - figure-cap .initial:n = \sffamily\small, - listing-cap .tl_set:N = \l__eb_font_listing_tl, - listing-cap .initial:n = \sffamily\small, - footnote .tl_set:N = \l__eb_font_footnote_tl, - footnote .initial:n = \rmfamily, - marginpar .tl_set:N = \marginfont, - marginpar .initial:n = \rmfamily\footnotesize + table-cap .tl_set:N = \l__eb_font_table_tl, + table-cap .initial:n = \sffamily\small, + figure-cap .tl_set:N = \l__eb_font_figure_tl, + figure-cap .initial:n = \sffamily\small, + listing-cap .tl_set:N = \l__eb_font_listing_tl, + listing-cap .initial:n = \sffamily\small, + footnote .tl_set:N = \l__eb_font_footnote_tl, + footnote .initial:n = \rmfamily, + marginpar .tl_set:N = \marginfont, + marginpar .initial:n = \rmfamily\footnotesize } \DeclareCaptionLabelSeparator{ccwd}{\hspace{\ccwd}} @@ -1807,14 +1821,13 @@ The latest version of this license is in \DeclareCaptionFont{eb@listing@font}{\l__eb_font_listing_tl} \captionsetup { - format = hang, - % figurewithin = section, - % tablewithin = section, + format = hang, font = {stretch = {\fp_use:N \l__eb_spread_caption_fp}}, - labelfont = {color = ctex@frame}, - labelsep = ccwd, + labelfont = {color = ctex@frame}, + labelsep = ccwd, singlelinecheck = true, - belowskip = 0pt,aboveskip = 10pt + belowskip = 0pt, + aboveskip = 10pt } \captionsetup[table]{font += eb@table@font} \captionsetup[figure]{font += eb@figure@font} @@ -1822,38 +1835,39 @@ The latest version of this license is in \captionsetup[subfigure] { labelformat = parens, - font += eb@figure@font, - belowskip = 2pt,aboveskip = 6pt + font+ = eb@figure@font, + belowskip = 2pt, + aboveskip = 6pt } -\ctex_at_end_package:nn {bicaption} +\ctex_at_end_package:nn { bicaption } { \captionsetup[figure][bi-second]{name = Figure} \captionsetup[table][bi-second]{name = Table} } -\cs_new:Npn \eb_arabic:n #1{\int_to_arabic:v {c@#1}} -\cs_new_protected:Npn \eb_separator_set:n #1 + +\cs_new:Npn \eb_arabic:n #1 { \int_to_arabic:v { c@#1 } } +\cs_gset:cpn { thesection } + { + \int_compare:nT { \c@chapter > 0 } { \thechapter. } + \eb_arabic:n { section } + } +\seq_const_from_clist:Nn \c__eb_serial_number_counter_seq + { figure,table,lstlisting,equation } +\seq_map_inline:Nn \c__eb_serial_number_counter_seq { - \cs_set:cpn {the#1} + \cs_set:cpn { the#1 } { - \int_compare:nT {\c@chapter > 0} + \int_compare:nT { \c@chapter > 0 } { \thechapter - \use:c {l__eb_#1_separator_tl} + \use:c { l__eb_#1_separator_tl } } \eb_arabic:n {#1} } } -\cs_gset:cpn {thesection} - { - \int_compare:nT {\c@chapter > 0}{\thechapter.} - \eb_arabic:n {section} - } -\clist_map_inline:nn - {figure,table,lstlisting,equation} - {\eb_separator_set:n {#1}} \cs_gset_protected:Npn \appendix { - \int_compare:nNnTF {\c@chapter} > {0} + \int_compare:nNnTF { \c@chapter } > { 0 } { \setcounter{chapter}{0} \setcounter{section}{0} @@ -1862,7 +1876,8 @@ The latest version of this license is in \gdef\CTEX@thechapter{\CTEX@appendix@number} \gdef\CTEX@postchapter{\CTEX@postappendix} \gdef\CTEX@chapter@numbering{\CTEX@appendix@numbering} - }{ + } + { \setcounter{section}{0} \setcounter{subsection}{0} \gdef\thesection{\@Alph\c@section} @@ -1870,22 +1885,22 @@ The latest version of this license is in \gdef\CTEX@thesection{\CTEX@appendix@number} \gdef\CTEX@postsection{\CTEX@postappendix} \gdef\CTEX@section@numbering{\CTEX@appendix@numbering} - \ctex_set:nn {appendix}{number = {\@Alph\c@section},name = {}} + \ctex_set:nn { appendix }{ number = \@Alph\c@section,name = { } } } } \AtBeginEnvironment{tabularx} { - \exp_args:Nx \linespread{\fp_use:N \l__eb_spread_table_fp} + \exp_args:Nx \linespread { \fp_use:N \l__eb_spread_table_fp } \selectfont\ignorespaces } \AtBeginEnvironment{tabular} { - \exp_args:Nx \linespread{\fp_use:N \l__eb_spread_table_fp} + \exp_args:Nx \linespread { \fp_use:N \l__eb_spread_table_fp } \selectfont\ignorespaces } \ctex_after_end_preamble:n { - \exp_args:Nx \linespread{\fp_use:N \l__eb_spread_line_fp} + \exp_args:Nx \linespread { \fp_use:N \l__eb_spread_line_fp } \selectfont\ignorespaces } @@ -1895,38 +1910,38 @@ The latest version of this license is in \fp_new:N \l__eb_spread_caption_fp \fp_new:N \l__eb_spread_footnote_fp -\eb_ctex_define:nn {spread} - { - line .fp_set:N = \l__eb_spread_line_fp, - line .initial:n = 1.3, - table .fp_set:N = \l__eb_spread_table_fp, - table .initial:n = 1.05, - math .fp_set:N = \l__eb_spread_math_fp, - math .initial:n = 1.05, - caption .fp_set:N = \l__eb_spread_caption_fp, - caption .initial:n = 1, - footnote .fp_set:N = \l__eb_spread_footnote_fp, - footnote .initial:n = 1, - spread-all .meta:n = - { - line = {#1},table = {#1},math = {#1}, - caption = {#1},footnote = {#1} +\eb_ctex_define:nn { spread } + { + line .fp_set:N = \l__eb_spread_line_fp, + line .initial:n = 1.3, + table .fp_set:N = \l__eb_spread_table_fp, + table .initial:n = 1.05, + math .fp_set:N = \l__eb_spread_math_fp, + math .initial:n = 1.05, + caption .fp_set:N = \l__eb_spread_caption_fp, + caption .initial:n = 1, + footnote .fp_set:N = \l__eb_spread_footnote_fp, + footnote .initial:n = 1, + spread-all .meta:n = + { + line = #1,table = #1,math = #1, + caption = #1,footnote = #1 } } -\skip_set:Nn \parskip{0pt plus 2pt minus 1pt} -\skip_set:Nn \floatsep{12pt plus 2pt minus 2pt} -\skip_set:Nn \intextsep{14pt plus 2pt minus 2pt} -\skip_set:Nn \textfloatsep{16pt plus 2pt minus 4pt} -\skip_set:Nn \dbltextfloatsep{16pt plus 2pt minus 4pt} -\skip_set:Nn \@fpsep{8pt plus 2.0fil} +\skip_set:Nn \parskip { 0pt plus 2pt minus 1pt } +\skip_set:Nn \floatsep { 12pt plus 2pt minus 2pt } +\skip_set:Nn \intextsep { 14pt plus 2pt minus 2pt } +\skip_set:Nn \textfloatsep { 16pt plus 2pt minus 4pt } +\skip_set:Nn \dbltextfloatsep { 16pt plus 2pt minus 4pt } +\skip_set:Nn \@fpsep { 8pt plus 2.0fil } \setcounter{topnumber}{4} \setcounter{bottomnumber}{4} \setcounter{totalnumber}{8} -\tl_gset:Nn \textfraction{0.18} -\tl_gset:Nn \topfraction{0.85} -\tl_gset:Nn \bottomfraction{0.65} -\tl_gset:Nn \floatpagefraction{0.60} +\tl_gset:Nn \textfraction { 0.18 } +\tl_gset:Nn \topfraction { 0.85 } +\tl_gset:Nn \bottomfraction { 0.65 } +\tl_gset:Nn \floatpagefraction { 0.60 } \newcolumntype{L}{X} \newcolumntype{C}{>{\centering\arraybackslash}X} @@ -1935,18 +1950,21 @@ The latest version of this license is in \DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps,.tif} \cs_new_protected:Npn \eb_enumitem_labelval_set:nn #1#2 - {\SetEnumitemValue{label}{#1}{\color{ctex@emph}#2}} + { \SetEnumitemValue{label}{#1}{\color{ctex@emph}#2} } \clist_map_inline:nn { - {bullet}{\textbullet}, - {endash}{\normalfont\bfseries\textendash}, - {asterisk}{\textasteriskcentered}, - {arabic}{\arabic*.}, - {alph}{(\alph*)}, - {roman}{\roman*.}, - {outline}{\upshape\ding{111}} - }{\eb_enumitem_labelval_set:nn #1} + { bullet } { \textbullet }, + { endash } { \normalfont\bfseries\textendash }, + { asterisk } { \textasteriskcentered }, + { arabic } { \arabic*. }, + { alph } { (\alph*) }, + { roman } { \roman*. }, + { outline } { \upshape\ding{111} } + } + { \eb_enumitem_labelval_set:nn #1 } \SetEnumitemValue{font}{sf}{\color{ctex@emph}\normalfont\sffamily} +\SetEnumitemValue{ref}{enumii}{\arabic{enumi}.\alph*} +\SetEnumitemValue{ref}{enumiii}{\arabic{enumi}.\alph{enumii}.\roman*} \setlist { labelsep = .75\ccwd,listparindent = 2\ccwd,leftmargin = *, @@ -1959,26 +1977,25 @@ The latest version of this license is in \setlist[itemize,2]{label = endash} \setlist[itemize,3]{label = asterisk} \setlist[enumerate,1]{label = arabic,ref = \arabic*} -\setlist[enumerate,2]{label = alph,ref = \arabic{enumi}.\alph*} -\setlist[enumerate,3]{label = roman,ref = \arabic{enumi}.\alph{enumii}.\roman*} -\setlist*[enumerate,3]{labelwidth = *} +\setlist[enumerate,2]{label = alph,ref = enumii} +\setlist[enumerate,3]{label = roman,ref = enumiii,labelwidth = *} \setlist[description]{font = sf,labelwidth = *,leftmargin = 2\ccwd} \cs_new_protected:Npn \eb_thmname_set:nnn #1#2#3 { - \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} - {\tl_const:cn {c__eb_name_#1_tl}{#3}} - {\tl_const:cn {c__eb_name_#1_tl}{#2}} + \tl_if_eq:NnTF \l__ctex_scheme_tl { chinese } + { \tl_const:cn { c__eb_name_#1_tl } {#3} } + { \tl_const:cn { c__eb_name_#1_tl } {#2} } } \NewDocumentCommand{\EbNewtheorem} {mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}} { \ctex_at_end_preamble:n { - \eb_thmname_set:nnn {#1}{#2}{#3} + \eb_thmname_set:nnn {#1} {#2} {#3} \exp_args:No \declaretheorem@i { - name = \use:c {c__eb_name_#1_tl}, + name = \use:c { c__eb_name_#1_tl }, style = easy-theorem,#5 }{#1}[] \bool_if:NT \l__eb_thmbox_bool @@ -1986,7 +2003,7 @@ The latest version of this license is in \@ifpackageloaded{tcolorbox} {\tcolorboxenvironment{#1}{#4}}{} } - \labelformat{#1}{\use:c {c__eb_name_#1_tl}~##1} + \labelformat{#1}{\use:c { c__eb_name_#1_tl }~##1} } } @@ -2001,99 +2018,107 @@ The latest version of this license is in \RenewDocumentCommand{\newtheorem}{O{}m} {\AfterPreamble{\declaretheorem[#1]{#2}}} -\eb_ctex_define:nn {thmset} - { - thmbox .bool_set:N = \l__eb_thmbox_bool, - thmbox .default:n = true, - thmbox .initial:n = false, - within .tl_set:N = \l__eb_thm_numberwith_tl, - within .initial:n = \bool_if:NT \l__eb_class_book_bool{chapter}, - bodyfont .tl_set:N = \l__eb_thm_bodyfont_tl, - bodyfont .initial:n = {}, - notefont .tl_set:N = \l__eb_thm_notefont_tl, - notefont .initial:n = {}, - headfont .tl_set:N = \l__eb_thm_headfont_tl, - headfont .initial:n = \color{ctex@emph}\sffamily, - headpunct .tl_set:N = \l__eb_thm_headpunct_tl, - headpunct .initial:n = {}, - spacepost .tl_set:N = \l__eb_thm_spacepost_tl, - spacepost .initial:n = \ccwd, - headindent .tl_set:N = \l__eb_thm_headindent_tl, - headindent .initial:n = 0\ccwd, - spaceabove .tl_set:N = \l__eb_thm_spaceabove_tl, - spaceabove .initial:n = .75ex plus .1ex, - spacebelow .tl_set:N = \l__eb_thm_spacebelow_tl, - spacebelow .initial:n = .75ex plus .1ex +\eb_ctex_define:nn { thmset } + { + thmbox .bool_set:N = \l__eb_thmbox_bool, + thmbox .default:n = true, + thmbox .initial:n = false, + within .tl_set:N = \l__eb_thm_numberwith_tl, + within .initial:n = \bool_if:NT \l__eb_class_book_bool { chapter }, + bodyfont .tl_set:N = \l__eb_thm_bodyfont_tl, + bodyfont .initial:n = { }, + notefont .tl_set:N = \l__eb_thm_notefont_tl, + notefont .initial:n = { }, + headfont .tl_set:N = \l__eb_thm_headfont_tl, + headfont .initial:n = \color{ctex@emph}\sffamily, + headpunct .tl_set:N = \l__eb_thm_headpunct_tl, + headpunct .initial:n = { }, + spacepost .tl_set:N = \l__eb_thm_spacepost_tl, + spacepost .initial:n = \ccwd, + headindent .tl_set:N = \l__eb_thm_headindent_tl, + headindent .initial:n = 0\ccwd, + spaceabove .tl_set:N = \l__eb_thm_spaceabove_tl, + spaceabove .initial:n = .75ex plus .1ex, + spacebelow .tl_set:N = \l__eb_thm_spacebelow_tl, + spacebelow .initial:n = .75ex plus .1ex } \tl_const:Nn \c__eb_thmtools_keyval_tl { [ - spaceabove = \l__eb_thm_spaceabove_tl, - spacebelow = \l__eb_thm_spacebelow_tl, - headindent = \l__eb_thm_headindent_tl, - headfont = \l__eb_thm_headfont_tl, - notefont = \l__eb_thm_notefont_tl, - notebraces = {}{}, - bodyfont = \l__eb_thm_bodyfont_tl, - headpunct = \l__eb_thm_headpunct_tl, + spaceabove = \l__eb_thm_spaceabove_tl, + spacebelow = \l__eb_thm_spacebelow_tl, + headindent = \l__eb_thm_headindent_tl, + headfont = \l__eb_thm_headfont_tl, + notefont = \l__eb_thm_notefont_tl, + notebraces = {}{}, + bodyfont = \l__eb_thm_bodyfont_tl, + headpunct = \l__eb_thm_headpunct_tl, postheadspace = \l__eb_thm_spacepost_tl, - within = \l__eb_thm_numberwith_tl, - headformat = \NAME\space\NUMBER\NOTE + within = \l__eb_thm_numberwith_tl, + headformat = \NAME\space\NUMBER\NOTE ] } \eb_at_end_preamble:n { \exp_last_unbraced:No \declaretheoremstyle\c__eb_thmtools_keyval_tl{easy-theorem} - \eb_thmname_set:nnn {exercise}{Exercise}{练习} + \eb_thmname_set:nnn { exercise } { Exercise } { 练习 } \cs_undefine:N \proof \clist_map_inline:nn { - {lemma}{引理}, - {example}{例}, - {theorem}{定理}, - {corollary}{推论}, - {definition}{定义}, - {proposition}{性质}, - {remark}{注}[numbered = no], - {{proof}{证明}[numbered = no,qed = \qedsymbol]} - }{\EbNewtheorem#1} + { lemma } { 引理 }, + { example } { 例 }, + { theorem } { 定理 }, + { corollary } { 推论 }, + { definition } { 定义 }, + { proposition } { 性质 }, + { remark } { 注 } [ numbered = no ], + { { proof } { 证明 } [ numbered = no,qed = \qedsymbol ] } + } + { \EbNewtheorem #1 } } -\ctex_at_end_package:nn {tasks} +\ctex_at_end_package:nn { tasks } { \settasks { - label = (\Alph*), - after-item-skip = 0ex plus .1ex, - column-sep = \ccwd, - item-indent = 2\ccwd, - label-width = 1.5\ccwd + label = (\Alph*), + column-sep = \ccwd, + item-indent = 2\ccwd, + label-width = 1.5\ccwd, + after-item-skip = 0ex plus .1ex } } \setchemformula { - math-scripts = false, - charge-hshift = 0.25\ccwd, - subscript-vshift = -0.2ex + math-scripts = false, + charge-hshift = 0.25\ccwd, + subscript-vshift = -0.2ex } \sisetup { detect-family, detect-weight, detect-shape, - detect-inline-family = math, - detect-inline-weight = math, + detect-inline-family = math, + detect-inline-weight = math, detect-display-math, - range-phrase = \ensuremath{\sim}, - range-units = single, table-parse-only, - group-digits = false + range-phrase = \ensuremath{\sim}, + range-units = single, + group-digits = false } \allowdisplaybreaks[4] -\tl_gset:Nn \ULthickness{.75pt} -\skip_set:Nn \jot{4pt plus 1pt minus 1pt} -\cs_new_protected:Npn \l__eb_math_restore:n #1 +\tl_gset:Nn \ULthickness { 0.75pt } +\skip_set:Nn \jot { 4pt plus 1pt minus 1pt } +\seq_const_from_clist:Nn \c__eb_math_spread_env_seq + { + array,matrix,pmatrix,bmatrix,Bmatrix,vmatrix,Vmatrix, + matrix*,pmatrix*,bmatrix*,Bmatrix*,vmatrix*,Vmatrix*, + cases,cases*,dcases,dcases*,rcases,rcases*,drcases,drcases*, + aligned,alignedat,gathered,multlined,lgathered,rgathered + } +\seq_map_inline:Nn \c__eb_math_spread_env_seq { \AtBeginEnvironment{#1} { @@ -2101,40 +2126,45 @@ The latest version of this license is in \selectfont\ignorespaces } } -\clist_map_inline:nn - { - array,matrix,pmatrix,bmatrix,Bmatrix,vmatrix,Vmatrix, - matrix*,pmatrix*,bmatrix*,Bmatrix*,vmatrix*,Vmatrix*, - cases,cases*,dcases,dcases*,rcases,rcases*,drcases,drcases*, - aligned,alignedat,gathered,multlined,lgathered,rgathered - }{\l__eb_math_restore:n {#1}} \eb_patch_cmd:Nnn \start@gather - {\collect@body} - {\linespread{\fp_use:N \l__eb_spread_math_fp}\selectfont\collect@body} + { \collect@body } + { + \linespread{\fp_use:N \l__eb_spread_math_fp} + \selectfont\collect@body + } \eb_patch_cmd:Nnn \start@align - {\collect@body} - {\linespread{\fp_use:N \l__eb_spread_math_fp}\selectfont\collect@body} + { \collect@body } + { + \linespread{\fp_use:N \l__eb_spread_math_fp} + \selectfont\collect@body + } \eb_patch_cmd:Nnn \start@multline - {\collect@body} - {\linespread{\fp_use:N \l__eb_spread_math_fp}\selectfont\collect@body} + { \collect@body } + { + \linespread{\fp_use:N \l__eb_spread_math_fp} + \selectfont\collect@body + } \eb_patch_cmd:Nnn \gather@split - {\spread@equation} - {\linespread{\fp_use:N \l__eb_spread_math_fp}\selectfont\spread@equation} + { \spread@equation } + { + \linespread{\fp_use:N \l__eb_spread_math_fp} + \selectfont\spread@equation + } \ctex_after_end_preamble:n { - \skip_set:Nn \abovedisplayskip{5pt plus 1pt minus 1pt} - \skip_set:Nn \belowdisplayskip{5pt plus 1pt minus 1pt} - \skip_set:Nn \abovedisplayshortskip{0pt} - \skip_set:Nn \belowdisplayshortskip{5pt plus 1pt minus 1pt} + \skip_set:Nn \abovedisplayskip { 5pt plus 1pt minus 1pt } + \skip_set:Nn \belowdisplayskip { 5pt plus 1pt minus 1pt } + \skip_set:Nn \abovedisplayshortskip { 0pt } + \skip_set:Nn \belowdisplayshortskip { 5pt plus 1pt minus 1pt } } -\cs_gset:Npn \tagform@#1 - {\maketag@@@{\color{ctex@emph}(\ignorespaces#1\unskip\@@italiccorr)}} -\ctex_at_end_package:nn {unicode-math} - {\msg_redirect_module:nnn {unicode-math}{warning}{none}} +\cs_gset:Npn \tagform@ #1 + { \maketag@@@{\color{ctex@emph}(\ignorespaces #1\unskip\@@italiccorr)} } +\ctex_at_end_package:nn { unicode-math } + {\msg_redirect_module:nnn { unicode-math } { warning } { none } } -\ctex_at_end_package:nn {tcolorbox} +\ctex_at_end_package:nn { tcolorbox } { - \eb_package_later_bool:nn {tcolorbox}{2020/10/09} + \eb_package_later_bool:nn { tcolorbox } { 2020/10/09 } \tcbset { tc-theorem/.style = @@ -2164,16 +2194,16 @@ The latest version of this license is in before~skip = 3.75ex,after~skip = 2.5ex }, breakable, - boxsep = 0pt, - arc = 0pt, + boxsep = 0pt, + arc = 0pt, fonttitle = \sffamily, - boxrule = \l__eb_rule_width_dim + boxrule = \l__eb_rule_width_dim } - \NewDocumentEnvironment{outline}{D(){\abstractname}o+b} + \NewDocumentEnvironment{outline}{O{}D(){\abstractname}o+b} { - \begin{tcolorbox}[tc-outline,title = #1,IfValueT = {#2}{#2}] - \begin{outlinelist} - #3 + \begin{tcolorbox}[tc-outline,title = #2,IfValueT = {#3}{#3}] + \begin{outlinelist}[#1] + #4 \end{outlinelist} \end{tcolorbox} }{} @@ -2184,9 +2214,9 @@ The latest version of this license is in { \tcbox[ tc-exercise, - fuzzy~halo = 5pt~with~#3, - IfValueT = {#6}{#6}, - phantom = + fuzzy~halo = 5pt~with~#3, + IfValueT = {#6}{#6}, + phantom = \IfBooleanF{#1} { \CTEX@ifnametrue @@ -2197,8 +2227,8 @@ The latest version of this license is in ]{\IfBooleanF{#1}{\CTEXthesection\hspace{0.5\ccwd}}#5} }{ \group_begin: - \keys_set:nn {ctex/section}{format += \centering} - \IfValueT{#6}{\keys_set:nn {ctex/section}{#6}} + \keys_set:nn { ctex/section } { format += \centering } + \IfValueT{#6}{\keys_set:nn { ctex/section } {#6}} \IfBooleanTF{#1}{\section*{#5}}{\section{#5}} \group_end: }#7 @@ -2230,8 +2260,8 @@ The latest version of this license is in borderline~west = {3pt}{0pt}{#2}, IfBooleanTF = {#1} { - colback = white, - IfValueT = {#3}{title = #3}, + colback = white, + IfValueT = {#3}{title = #3}, top = 0pt,bottom = 0pt,toptitle = 0pt }{ colback = #2,colbacktitle = #2, @@ -2265,90 +2295,92 @@ The latest version of this license is in \tl_new:N \l__eb_bib_citestyle_tl \tl_new:N \l__eb_bib_file_tl -\eb_ctex_define:nn {bibset} +\eb_ctex_define:nn { bibset } { - backend .choice:, - backend/bibtex .code:n = {}, - backend/biblatex .code:n = - {\bool_set_false:N \l__eb_backend_bibtex_bool}, + backend .choice:, + backend/bibtex .code:n = { }, + backend/biblatex .code:n = + { \bool_set_false:N \l__eb_backend_bibtex_bool }, - bib-style .choice:, - bib-style .value_required:n = true, - bib-style/numerical .code:n = + bib-style .choice:, + bib-style .value_required:n = true, + bib-style/numerical .code:n = { - \tl_set:Nn \l__eb_bib_style_tl{#1} + \tl_set:Nn \l__eb_bib_style_tl {#1} \tl_clear:N \l__eb_bib_otherstyle_tl }, - bib-style/authoryear .code:n = + bib-style/authoryear .code:n = { - \tl_set:Nn \l__eb_bib_style_tl{#1} + \tl_set:Nn \l__eb_bib_style_tl {#1} \tl_clear:N \l__eb_bib_otherstyle_tl }, - bib-style/unknown .code:n = - {\tl_set_eq:NN \l__eb_bib_otherstyle_tl\l_keys_value_tl}, - bib-style .initial:n = numerical, + bib-style/unknown .code:n = + { \tl_set_eq:NN \l__eb_bib_otherstyle_tl \l_keys_value_tl }, + bib-style .initial:n = numerical, - cite-style .code:n = - {\tl_set:Nn \l__eb_bib_citestyle_tl{#1}}, - bibfile .tl_set:N = \l__eb_bib_file_tl, - bibfile .initial:n = refs.bib, + cite-style .code:n = + { \tl_set:Nn \l__eb_bib_citestyle_tl {#1} }, + bibfile .tl_set:N = \l__eb_bib_file_tl, + bibfile .initial:n = refs.bib, - bib-loadpkg .bool_set:N = \l__eb_bib_loadpkg_bool, - bib-loadpkg .default:n = true, - bib-loadpkg .initial:n = true + bib-loadpkg .bool_set:N = \l__eb_bib_loadpkg_bool, + bib-loadpkg .default:n = true, + bib-loadpkg .initial:n = true } \cs_new_protected:Npn \EbBibtexSet { \tl_if_empty:NTF \l__eb_bib_otherstyle_tl { - \tl_if_eq:NnT \l__eb_bib_style_tl{numerical} + \tl_if_eq:NnT \l__eb_bib_style_tl { numerical } { \bibliographystyle{gbt7714-numerical} \setcitestyle{comma,square,super} } - \tl_if_eq:NnT \l__eb_bib_style_tl{authoryear} - {\bibliographystyle{gbt7714-author-year}} - \cs_set_eq:NN \cite\citep - }{\exp_args:NV \bibliographystyle\l__eb_bib_otherstyle_tl} + \tl_if_eq:NnT \l__eb_bib_style_tl { authoryear } + { \bibliographystyle{gbt7714-author-year} } + \cs_set_eq:NN \cite \citep + } + { \exp_args:NV \bibliographystyle \l__eb_bib_otherstyle_tl } \tl_if_empty:NF \l__eb_bib_citestyle_tl - {\exp_args:NV \setcitestyle\l__eb_bib_citestyle_tl} - \skip_set:Nn \bibsep{0ex} + { \exp_args:NV \setcitestyle \l__eb_bib_citestyle_tl } + \skip_zero:N \bibsep \NewDocumentCommand{\printbibliography}{st+o} { \group_begin: - \tl_set_eq:NN \eb@toc@title\bibname - \IfValueT{##3}{\keys_set:nn {eb/listoc}{##3}} + \tl_set_eq:NN \eb@toc@title \bibname + \IfValueT{##3}{ \keys_set:nn { eb/listoc } {##3} } \eb_multoc_pre_bool: \tl_set:Nn \bibsection - {\eb_title_number_intoc_bool:nn {##2}{##1}} - \exp_args:NV \bibliography\l__eb_bib_file_tl + { \eb_title_number_intoc_bool:nn {##2} {##1} } + \exp_args:NV \bibliography \l__eb_bib_file_tl \eb_multoc_post_bool: \group_end: } } \cs_new_protected:Npn \eb_put_biblatex:n #1 - {\PassOptionsToPackage{#1}{biblatex}} + { \PassOptionsToPackage{#1}{biblatex} } \cs_new_protected:Npn \EbBiblatexPreset { \tl_if_empty:NTF \l__eb_bib_otherstyle_tl { - \tl_if_eq:NnT \l__eb_bib_style_tl{numerical} - {\eb_put_biblatex:n {style = gb7714-2015}} - \tl_if_eq:NnT \l__eb_bib_style_tl{authoryear} - {\eb_put_biblatex:n {style = gb7714-2015ay}} - }{\eb_put_biblatex:n {style = \l__eb_bib_otherstyle_tl}} + \tl_if_eq:NnT \l__eb_bib_style_tl { numerical } + { \eb_put_biblatex:n { style = gb7714-2015 } } + \tl_if_eq:NnT \l__eb_bib_style_tl { authoryear } + { \eb_put_biblatex:n { style = gb7714-2015ay } } + } + { \eb_put_biblatex:n { style = \l__eb_bib_otherstyle_tl } } \tl_if_empty:NF \l__eb_bib_citestyle_tl - {\eb_put_biblatex:n {citestyle = \l__eb_bib_citestyle_tl}} - \eb_put_biblatex:n {backend = biber} + { \eb_put_biblatex:n { citestyle = \l__eb_bib_citestyle_tl } } + \eb_put_biblatex:n { backend = biber } } \cs_new_protected:Npn \EbBiblatexPostset { - \exp_args:NV \addbibresource\l__eb_bib_file_tl - \tl_gset:Nn \blx@default@theheading{bibintoc} + \exp_args:NV \addbibresource \l__eb_bib_file_tl + \tl_gset:Nn \blx@default@theheading { bibintoc } \defbibheading{bibintoc}[\bibname] {\eb_class_title_level_bool:n {##1}} - \skip_set:Nn \bibitemsep{0ex} + \skip_zero:N \bibitemsep } \eb_at_end_preamble:n { @@ -2358,7 +2390,8 @@ The latest version of this license is in { \RequirePackage[sort&compress]{natbib} \EbBibtexSet - }{ + } + { \EbBiblatexPreset \RequirePackage{biblatex} \EbBiblatexPostset @@ -2373,42 +2406,42 @@ The latest version of this license is in \exp_args:Nx \linespread{\fp_use:N \l__eb_spread_footnote_fp}\selectfont \exp_args:NNNo \group_end: - \dim_set:Nn \footnotesep{\dim_use:N \box_ht:N \strutbox} + \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } \bool_if:NT \l__eb_chap_withpart_bool - {\counterwithin*{chapter}{part}} - \tl_if_eq:NnT \l__eb_foot_numberwith_tl{part} + { \counterwithin*{chapter}{part} } + \tl_if_eq:NnT \l__eb_foot_numberwith_tl { part } { \counterwithout*{footnote}{chapter} \counterwithin*{footnote}{part} } - \tl_if_eq:NnT \l__eb_foot_numberwith_tl{page} + \tl_if_eq:NnT \l__eb_foot_numberwith_tl { page } { \counterwithout*{footnote}{chapter} \counterwithin*{footnote}{page} } } \eb_patch_cmd:Nnn \@footnotetext - {\reset@font} + { \reset@font } { \linespread{\fp_use:N \l__eb_spread_footnote_fp} \selectfont\ignorespaces \l__eb_font_footnote_tl } \eb_patch_cmd:Nnn \@mpfootnotetext - {\reset@font} + { \reset@font } { \linespread{\fp_use:N \l__eb_spread_footnote_fp} \selectfont\ignorespaces \l__eb_font_footnote_tl } \eb_patch_cmd:Nnn \@makefnmark - {\normalfont}{\l__eb_font_footnote_tl} -\cs_gset:Npn \thempfootnote{\int_to_alph:n {\c@mpfootnote}} + { \normalfont } { \l__eb_font_footnote_tl } +\cs_gset:Npn \thempfootnote { \int_to_alph:n { \c@mpfootnote } } \lstdefinestyle{easy-listings} { - language = [LaTeX]TeX, - texcsstyle = + language = [LaTeX]TeX, + texcsstyle = { *\lst@ifdisplaystyle \bfseries\color{ctex@verb} @@ -2416,7 +2449,7 @@ The latest version of this license is in \color{ctex@verb} \fi }, - basicstyle = + basicstyle = { \ttfamily\lst@ifdisplaystyle \small @@ -2424,7 +2457,7 @@ The latest version of this license is in \color{ctex@verb} \fi }, - keywordstyle = + keywordstyle = { \lst@ifdisplaystyle \bfseries\color{ctex@verb} @@ -2432,58 +2465,58 @@ The latest version of this license is in \color{ctex@verb} \fi }, - framexleftmargin = 0pt, + framexleftmargin = 0pt, framexrightmargin = 0pt, - xleftmargin = 3pt, - xrightmargin = 3pt, - numbersep = 10pt, - framesep = 3pt, - frame = single, - rulecolor = \color{ctex@frame}, - commentstyle = \color{SlateGray}, - emphstyle = \color{ctex@emph}, - emph = {caption,multirow,subcaption,tabularx}, - morekeywords = + xleftmargin = 3pt, + xrightmargin = 3pt, + numbersep = 10pt, + framesep = 3pt, + frame = single, + rulecolor = \color{ctex@frame}, + commentstyle = \color{SlateGray}, + emphstyle = \color{ctex@emph}, + emph = {caption,multirow,subcaption,tabularx}, + morekeywords = { includegraphics,setmainfont,setsansfont,setmonofont,setCJKmainfont,setCJKsansfont,setCJKmonofont,setCJKfamilyfont,RequirePackage } } \lstset { - style = easy-listings, - breaklines = true, - resetmargins = true, - % numbers = left, - numberstyle = \footnotesize, - abovecaptionskip = -1ex, - belowcaptionskip = 1.5ex, - aboveskip = 1.5ex plus .2ex minus .1ex, - belowskip = 0.55ex plus .2ex minus .1ex, - keepspaces = true, - framerule = \l__eb_rule_width_dim, - columns = flexible + style = easy-listings, + breaklines = true, + resetmargins = true, + % numbers = left, + numberstyle = \footnotesize, + aboveskip = 1.5ex plus .2ex minus .1ex, + belowskip = 0.55ex plus .2ex minus .1ex, + keepspaces = true, + framerule = \l__eb_rule_width_dim, + columns = flexible, + abovecaptionskip = -1ex, + belowcaptionskip = 1.5ex } \lstloadlanguages{C,C++,Java,Python,Matlab} \clist_new:N \l__eb_hyperref_clist \cs_new_protected:Npn \eb_put_hyperref:n #1 - {\clist_put_right:Nn \l__eb_hyperref_clist{#1}} + { \clist_put_right:Nn \l__eb_hyperref_clist {#1} } \cs_new_protected:Npn \eb_define_linkcolor:nnn #1#2#3 - {\definecolorset{HTML}{ctex@}{}{link,#1;url,#2;cite,#3}} + { \definecolorset{HTML}{ctex@}{}{link,#1;url,#2;cite,#3} } \cs_new_protected:Npn \eb_define_themecolor:nnn #1#2#3 - {\definecolorset{HTML}{ctex@}{}{frame,#1;emph,#2;verb,#3}} + { \definecolorset{HTML}{ctex@}{}{frame,#1;emph,#2;verb,#3} } \cs_new_protected:Npn \eb_define_linkcolor:n #1 - {\definecolorset{HTML}{ctex@}{}{link,#1;url,#1;cite,#1}} + { \definecolorset{HTML}{ctex@}{}{link,#1;url,#1;cite,#1} } \cs_new_protected:Npn \eb_define_themecolor:n #1 - {\definecolorset{HTML}{ctex@}{}{frame,#1;emph,#1;verb,#1}} + { \definecolorset{HTML}{ctex@}{}{frame,#1;emph,#1;verb,#1} } \cs_new:Npn \eb_linkcolor_set:n #1 { - linkcolor/\clist_item:nn {#1}{1} .code:n = + linkcolor/\clist_item:nn {#1} {1} .code:n = { \eb_define_linkcolor:nnn - {\clist_item:nn {#1}{2}} - {\clist_item:nn {#1}{3}} - {\clist_item:nn {#1}{4}} + { \clist_item:nn {#1} {2} } + { \clist_item:nn {#1} {3} } + { \clist_item:nn {#1} {4} } \eb_put_hyperref:n { linkcolor = ctex@link,linkbordercolor = ctex@link, @@ -2494,88 +2527,91 @@ The latest version of this license is in } \cs_new:Npn \eb_themecolor_set:n #1 { - color/\clist_item:nn {#1}{1} .code:n = + color/\clist_item:nn {#1} {1} .code:n = { \eb_define_themecolor:nnn - {\clist_item:nn {#1}{2}} - {\clist_item:nn {#1}{3}} - {\clist_item:nn {#1}{4}} + { \clist_item:nn {#1} {2} } + { \clist_item:nn {#1} {3} } + { \clist_item:nn {#1} {4} } }, } \bool_set_false:N \l__eb_toc_number_color_bool -\eb_ctex_define:nn {link} +\eb_ctex_define:nn { link } { - hyperlink .choice:, - hyperlink/edge .code:n = {}, - hyperlink/none .code:n = \eb_put_hyperref:n {hidelinks}, + hyperlink .choice:, + hyperlink/edge .code:n = { }, + hyperlink/none .code:n = \eb_put_hyperref:n { hidelinks }, hyperlink/various .code:n = { \bool_set_true:N \l__eb_toc_number_color_bool - \eb_put_hyperref:n {colorlinks} + \eb_put_hyperref:n { colorlinks } }, - hyperlink .default:n = edge, - hyperlink .initial:n = edge, + hyperlink .default:n = edge, + hyperlink .initial:n = edge, - linktoc .choice:, - linktoc/unknown .code:n = + linktoc .choice:, + linktoc/unknown .code:n = { - \eb_put_hyperref:n {linktoc = #1} - \clist_map_inline:nn {page,none} + \eb_put_hyperref:n { linktoc = #1 } + \clist_map_inline:nn { page,none } { - \tl_if_eq:NnT \l_keys_value_tl{##1} - {\clist_map_break:n {\colorlet{ctex@toc@number}{black}}} + \tl_if_eq:NnT \l_keys_value_tl {##1} + { + \clist_map_break:n + { \colorlet{ctex@toc@number}{black} } + } } }, - linktoc .default:n = all, - linktoc .initial:n = all, - unknown .code:n = + linktoc .default:n = all, + linktoc .initial:n = all, + unknown .code:n = { \eb_put_hyperref:x { \l_keys_key_str - \tl_if_empty:NF \l_keys_value_tl{ = {#1}} + \tl_if_empty:NF \l_keys_value_tl { = {#1} } } } } -\eb_ctex_define:nx {link} +\eb_ctex_define:nx { link } { - linkcolor .choice:, + linkcolor .choice:, \clist_map_function:nN { - {fresh, 62d71f,0000B2,005752}, - {cutepink, ff69b4,9d5196,57b5e5}, - {navyblue, 000080,004986,eb6877}, - {crimson, dc143c,00c1c9,afcd20} + { fresh, 62d71f,0000B2,005752 }, + { cutepink, ff69b4,9d5196,57b5e5 }, + { navyblue, 000080,004986,eb6877 }, + { crimson, dc143c,00c1c9,afcd20 } } \eb_linkcolor_set:n - linkcolor .default:n = navyblue, - linkcolor .initial:n = navyblue, - linkcol-all .code:n = - {\eb_define_linkcolor:n {\exp_not:n {#1}}} + linkcolor .default:n = navyblue, + linkcolor .initial:n = navyblue, + linkcol-all .code:n = + { \eb_define_linkcolor:n { \exp_not:n {#1} } } } \colorlet{ctex@toc@number}{ctex@link} -\eb_ctex_define:nx {style} +\eb_ctex_define:nx { style } { - color .choice:, - color .value_required:n = true, + color .choice:, + color .value_required:n = true, \clist_map_function:nN { - {none, 000000,000000,000000}, - {seaside, 4169e1,708090,9932cc}, - {energy, f39800,00a0e9,893895}, - {cyberpunk, 601986,eb6877,a4005b} + { none, 000000,000000,000000 }, + { seaside, 4169e1,708090,9932cc }, + { energy, f39800,00a0e9,893895 }, + { cyberpunk, 601986,eb6877,a4005b } } \eb_themecolor_set:n - color .initial:n = none, + color .initial:n = none, color-all .code:n = - {\eb_define_themecolor:n {\exp_not:n {#1}}} + { \eb_define_themecolor:n { \exp_not:n {#1} } } } \cs_new:Npn \eb_allow_urlbreak: { \cs_new:Npn \eb_add_urlbreak_points: - {\tl_map_function:NN \c__eb_urlbreak_points_tl\do} + { \tl_map_function:NN \c__eb_urlbreak_points_tl\do } \eb_appto_cmd:Nn \UrlBreaks{\UrlOrds\eb_add_urlbreak_points:} } @@ -2590,23 +2626,23 @@ The latest version of this license is in \RequirePackage{hyperref} \urlstyle{same} \eb_allow_urlbreak: - \ctex_hypersetup:n {pdfstartview = FitH} - \exp_args:NV \hypersetup\l__eb_hyperref_clist + \ctex_hypersetup:n { pdfstartview = FitH } + \exp_args:NV \hypersetup \l__eb_hyperref_clist \labelformat{part}{\CTEXthepart} \labelformat{chapter}{\CTEXthechapter} \labelformat{figure}{\figurename~#1} \labelformat{table}{\tablename~#1} - \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} + \tl_if_eq:NnTF \l__ctex_scheme_tl { chinese } { - \keys_set_known:nn {ctex} + \keys_set_known:nn { ctex } { - contentsname = 目\hspace{\ccwd}录, - indexname = 索\hspace{\ccwd}引, - listfigurename = 图片索引, - listtablename = 表格索引, - abstractname = 摘\hspace{\ccwd}要, - lstlistlistingname = 代码索引, - lstlistingname = 代码 + contentsname = 目\hspace{\ccwd}录, + indexname = 索\hspace{\ccwd}引, + listfigurename = 图片索引, + listtablename = 表格索引, + abstractname = 摘\hspace{\ccwd}要, + lstlistlistingname = 代码索引, + lstlistingname = 代码 } \labelformat{equation}{式(#1)} \labelformat{align}{式(#1)} @@ -2614,12 +2650,13 @@ The latest version of this license is in \labelformat{gather}{式(#1)} \labelformat{section}{节#1} \labelformat{subsection}{小节#1} - }{ - \keys_set_known:nn {ctex} + } + { + \keys_set_known:nn { ctex } { - abstractname = Abstract, - lstlistlistingname = List~of~Codes, - lstlistingname = Code + abstractname = Abstract, + lstlistlistingname = List~of~Codes, + lstlistingname = Code } \labelformat{equation}{Equation~(#1)} \labelformat{align}{Equation~(#1)} @@ -2633,59 +2670,59 @@ The latest version of this license is in \ctex_set:n { secnumdepth = 3, - tocdepth = \bool_if:NTF \l__eb_class_book_bool{1}{2}, + tocdepth = \bool_if:NTF \l__eb_class_book_bool { 1 } { 2 }, part = { pagestyle = empty, - tocline = \EbNumberline{#1}#2, - format = \color{ctex@frame}\sffamily\Huge, + tocline = \EbNumberline{#1}#2, + format = \color{ctex@frame}\sffamily\Huge, aftername = { \bool_if:NTF \l__eb_title_newline_bool - {\par\nobreak}{\hspace{\ccwd}} + { \par\nobreak } { \hspace{\ccwd} } } }, chapter = { - % pagestyle = fancy, - format = + % pagestyle = fancy, + format = { \color{ctex@frame}\sffamily\LARGE - \bool_if:NF \l__eb_title_newline_bool{\centering} + \bool_if:NF \l__eb_title_newline_bool { \centering } }, - aftername = + aftername = { \bool_if:NTF \l__eb_title_newline_bool - {\par\nobreak\vskip 1.5pc}{\hspace{\ccwd}} + { \par\nobreak\vskip 1.5pc } { \hspace{\ccwd} } }, - beforeskip = -1.5ex, - afterskip = 3ex, - lotskip = 0.8pc, - lofskip = 0.8pc + beforeskip = -1.5ex, + afterskip = 3ex, + lotskip = 0.8pc, + lofskip = 0.8pc }, section = { - hang = true, - format = \color{ctex@frame}\sffamily\Large, - aftername = \hspace{0.5\ccwd}, - beforeskip = 1.5ex plus .2ex minus .1ex, - afterskip = 1.5ex plus .2ex minus .1ex + hang = true, + format = \color{ctex@frame}\sffamily\Large, + aftername = \hspace{0.5\ccwd}, + beforeskip = 1.5ex plus .2ex minus .1ex, + afterskip = 1.5ex plus .2ex minus .1ex }, subsection = { - hang = true, - format = \color{ctex@frame}\sffamily\large, - aftername = \hspace{0.5\ccwd}, - beforeskip = 1.3ex plus .2ex minus .1ex, - afterskip = 1.3ex plus .2ex minus .1ex + hang = true, + format = \color{ctex@frame}\sffamily\large, + aftername = \hspace{0.5\ccwd}, + beforeskip = 1.3ex plus .2ex minus .1ex, + afterskip = 1.3ex plus .2ex minus .1ex }, subsubsection = { - hang = true, - format = \color{ctex@frame}\sffamily, - aftername = \hspace{0.5\ccwd}, - beforeskip = \parskip, - afterskip = \parskip + hang = true, + format = \color{ctex@frame}\sffamily, + aftername = \hspace{0.5\ccwd}, + beforeskip = \parskip, + afterskip = \parskip } } @@ -2693,8 +2730,8 @@ The latest version of this license is in { \ctex_set:n { - part/hang = true, - chapter/hang = true + part/hang = true, + chapter/hang = true } } %</class> diff --git a/macros/latex/contrib/elegantbook/README-CN.md b/macros/latex/contrib/elegantbook/README-CN.md new file mode 100644 index 0000000000..1b31dab34a --- /dev/null +++ b/macros/latex/contrib/elegantbook/README-CN.md @@ -0,0 +1,32 @@ +<!-- Author : Dongsheng Deng & Liam Huang--> +<!-- Program Email: elegantlatex2e@gmail.com --> + +[Homepage](https://elegantlatex.org/) | [Github](https://github.com/ElegantLaTeX/ElegantBook) | [CTAN](https://ctan.org/pkg/elegantbook) | [Download](https://github.com/ElegantLaTeX/ElegantBook/releases) | [Wiki](https://github.com/ElegantLaTeX/ElegantBook/wiki) | [Weibo](https://weibo.com/elegantlatex) + +![License](https://img.shields.io/ctan/l/elegantbook.svg) ![CTAN Version](https://img.shields.io/ctan/v/elegantbook.svg) ![Github Version](https://img.shields.io/github/release/ElegantLaTeX/ElegantBook.svg) ![Repo Size](https://img.shields.io/github/repo-size/ElegantLaTeX/ElegantBook.svg) + +--- + +# ElegantBook 优美的 LaTeX 书籍模板 + +ElegantBook 是为 LaTeX 书籍写作而设计的模板,由 [Dongsheng Deng](https://ddswhu.me/) 和 [Liam Huang](https://liam.page/) 创立,模板创立的初衷是方便我们自己做笔记 :smile:。如果你有其他问题、建议或者报告 bug,可以提交 issues 或者给我们发邮件:elegantlatex2e@gmail.com。QQ 用户交流群:692108391,欢迎加入。 + +## 重要提示 + +**重要提示**:ElegantLaTeX 项目 **不接受** 任何非预授权的提交(pull requests)! + +## 致谢 + +特别感谢 ChinaTeX 以及 [LaTeX 工作室](http://www.latexstudio.net/)对于本系列模板的大力宣传与推广。 + +如果你喜欢我们的模板,你可以在 Github 上收藏我们的模板。 + +## 协议 + +本模板发布遵循 LaTeX 项目公共许可证 1.3 c 或更高版本。如果是衍生作品,请务必加入协议声明和模板信息(github、CTAN 地址)。 + +## 衍生作 + ++ [ElegantBookdown](https://github.com/XiangyunHuang/ElegantBookdown):[XiangyunHuang](https://github.com/XiangyunHuang) 开发并维护的基于 ElegantBook 的 Bookdown 模板。 ++ [bookdownplus](https://github.com/pzhaonet/bookdownplus):应网友要求,[pzhaonet](https://github.com/pzhaonet) 在 bookdownplus 收录了 ElegantPaper 模板,并为 Mac 做了字体适配。 ++ [PanBook](https://github.com/annProg/PanBook):[annProg](https://github.com/annProg) 开发并维护的基于 Markdown 写作的工作流,收录了 ElegantBook 和 ElegantPaper 模板。
\ No newline at end of file diff --git a/macros/latex/contrib/elegantbook/README.md b/macros/latex/contrib/elegantbook/README.md index e0695d071f..582d36380c 100644 --- a/macros/latex/contrib/elegantbook/README.md +++ b/macros/latex/contrib/elegantbook/README.md @@ -5,82 +5,6 @@ ![License](https://img.shields.io/ctan/l/elegantbook.svg) ![CTAN Version](https://img.shields.io/ctan/v/elegantbook.svg) ![Github Version](https://img.shields.io/github/release/ElegantLaTeX/ElegantBook.svg) ![Repo Size](https://img.shields.io/github/repo-size/ElegantLaTeX/ElegantBook.svg) ---- - -# ElegantBook 优美的 LaTeX 书籍模板 - -ElegantBook 是为 LaTeX 书籍写作而设计的模板,由 [Dongsheng Deng](https://ddswhu.me/) 和 [Liam Huang](https://liam.page/) 创立,模板创立的初衷是方便我们自己做笔记 :smile:。如果你有其他问题、建议或者报告 bug,可以提交 issues 或者给我们发邮件:elegantlatex2e@gmail.com。QQ 用户交流群:692108391,欢迎加入。 - -## 重要提示 - -**版本提醒:** 由于新版本进行了重构,并且 3.06 版本对于封面进行了改版,3.06 以后的版本并不兼容之前版本,如果你想把之前版本的文件转为 3.06 以后的版本,请查看[跨版本转换](https://github.com/ElegantLaTeX/ElegantBook/wiki/convert)。我们强烈建议你使用最新版。 - -**重要提示**:ElegantLaTeX 项目 **不接受** 任何非作者预约提交(pull requests)! - -## 致谢 - -2019 年 5 月 20 日,ElegantBook 模板在 Github 上的 Star 数达到了 100,这对于 ElegantLaTeX 系列模板是一个非常重要的里程碑!在此特别感谢 ChinaTeX 以及 [LaTeX 工作室](http://www.latexstudio.net/)对于本系列模板的大力宣传与推广。LaTeX 工作室网站上有很多精彩的帖子和精致的模板,欢迎大家去挖掘里面的宝藏。这也是我所见到的国内最全面的 LaTeX 相关的网站。 - -如果你喜欢我们的模板,你可以在 Github 上收藏我们的模板。 - -## 捐赠 - -如果您非常喜爱我们的模板或者我,你还可以选择捐赠以表达您对我们模板和我的支持。本模板自 3.08 版本发布了捐赠信息之后,收到了超过千元的捐赠(四舍五入就是一个亿),非常感谢! - -![](https://github.com/ElegantLaTeX/ElegantBook/wiki/donate.jpg) - -**赞赏费用的使用解释权归 ElegantLaTeX 所有,并且不接受监督,请自愿理性打赏**。10 元以上的赞赏,我们将列入捐赠榜,谢谢各位金主!(如果有遗漏,请务必联系我们,这对我们很重要) - - -| 捐赠者 | 金额 | 时间 | 渠道 | -| :------: | :----: | :----: | :------: | -| Lerh | 10 RMB | 2019/05/15 | 微信 | -| 越过地平线 | 10 RMB | 2019/05/15 | 微信 | -| 银桑 | 20 RMB | 2019/05/27 | 微信 | -| *空 | 10 RMB | 2019/05/30 | 微信 | -| [latexstudio.net](http://www.latexstudio.net) | 666 RMB | 2019/06/05 | 支付宝 | -| Cassis | 11 RMB | 2019/06/30 | 微信 | -| *君 | 10 RMB | 2019/07/23 | 微信 | -| P*u | 50 RMB | 2019/07/30 | 微信 | -| *萌 | 19 RMB | 2019/08/28 | 微信 | -| 曲豆豆 | 10 RMB | 2019/08/28 | 微信 | -| 李博 | 100 RMB | 2019/10/06 | 微信 | -| Njustsll | 10 RMB | 2019/10/11 | 微信 | -| 刘志阔 | 99.99 RMB | 2019/10/15 | 支付宝 | -| *涛 | 16 RMB | 2019/10/17 | 微信 | -| 赤霓 | 12 RMB | 2019/10/17 | 支付宝 | -| 追寻原风景 | 10 RMB | 2019/10/28 | 微信 | -| 郭德良 | 88 RMB | 2019/11/03 | 微信 | -| 自强不息 | 20 RMB | 2019/11/04 | 支付宝 | -| 读书之虫 | 20 RMB | 2019/11/18 | 微信 | -| *等 | 10 RMB | 2019/11/18 | 微信 | -| *哲 | 20 RMB | 2019/11/18 | 微信 | -| 佚名 | 10 RMB | 2019/11/24 | 微信 | -| Jiye Qian | 66 RMB | 2019/12/04 | 微信 | -| * 阳 | 20 RMB | 2019/12/05 | 微信 | -| Catcher | 11 RMB | 2019/12/08 | 支付宝 | -| 希尔波特门徒 | 10 RMB | 2019/12/09 | 支付宝 | -| * 伟 | 10 RMB | 2019/12/09 | 微信 | -| Simon | 20 RMB | 2019/12/11 | 支付宝 | -| 流殇丶浅忆 | 66.60 RMB | 2019/12/18 | 支付宝 | -| 羽 | 10 RMB | 2019/12/20 | 支付宝 | -| * 琛 | 15 RMB | 2019/12/20 | 微信 | -| 随风 | 20 RMB | 2019/12/27 | 支付宝 | -| Ws | 23.30 RMB | 2019/12/28 | 微信 | - - -再次感谢大家对于模板的喜爱! - -## 协议 - -本模板发布遵循 LaTeX 项目公共许可证 1.3 c 或更高版本。如果是衍生作品,请务必加入协议声明和模板信息(github、CTAN 地址)。 - -## 衍生作 - -+ [ElegantBookdown](https://github.com/XiangyunHuang/ElegantBookdown):[XiangyunHuang](https://github.com/XiangyunHuang) 开发并维护的基于 ElegantBook 的 Bookdown 模板。 -+ [bookdownplus](https://github.com/pzhaonet/bookdownplus):应网友要求,[pzhaonet](https://github.com/pzhaonet) 在 bookdownplus 收录了 ElegantPaper 模板,并为 Mac 做了字体适配。 -+ [PanBook](https://github.com/annProg/PanBook):[annProg](https://github.com/annProg) 开发并维护的基于 Markdown 写作的工作流,收录了 ElegantBook 和 ElegantPaper 模板。 - ------- # ElegantBook: An Elegant LaTeX Template for Books @@ -89,48 +13,11 @@ ElegantBook is designed for writing books, created by [Dongsheng Deng](https://d ## Important Notes -**Version Note**: Users for 2.x, please refer to [Version Convert](https://github.com/ElegantLaTeX/ElegantBook/wiki/convert). We strongly recommend that you use the latest version. - -**Important Info**: For some reasons, __unauthorial__ pull requests are **UNACCEPTABLE** since May 20, 2019. For those who want to help revise the templates, submit issues or clone to your own repository to modify under the LPPL-1.3c. +For some reasons, __unauthorized__ pull requests are **UNACCEPTABLE** since May 20, 2019. For those who want to help revise the templates, submit issues or clone to your own repository to modify under the LPPL-1.3c. ## Acknowledgement -_News_: _The number of stars on Github for ElegantBook reached 100 on May 20, 2019_. - -Thank ChinaTeX and [LaTeX Studio](http://www.latexstudio.net/) for their promotion. LaTeX studio offers tons of valuable posts and templates for discovery. It is the most comprehensive website on LaTeX in China. If you like our template, star on Github for supporting us. - -## Donation - -To express your love for our templates and/or our developers, please do not hesitate to tip us. Since last release of 3.08, we have received about a thousand RMB! (The emergence of a millionaire is on the way. Loading... ) - -![](https://github.com/ElegantLaTeX/ElegantBook/wiki/donate.jpg) - -The explanation right of the tip usage belongs to ElegantLaTeX with no supervision. Feel free to tip us. Those who donate more than 10 RMB will be recorded in the Donation List. Thank all the tippers! Thank you all. - - -| Tipper | Amount | Date | Channel | -| :--------------: | :----: | :-------: | :-----: | -| Lerh | 10 RMB | 2019/5/15 | Wechat | -| YueGuoDiPingXian | 10 RMB | 2019/5/15 | Wechat | -| YinSang | 20 RMB | 2019/5/27 | Wechat | -| * Kong | 10 RMB | 2019/05/30 | Wechat | -| [latexstudio.net](http://www.latexstudio.net) | 666 RMB | 2019/06/05 | Alipay | -| Cassis | 11 RMB | 2019/06/30 | Wechat | -| * Jun | 10 RMB | 2019/07/23 | Wechat | -| P*u | 50 RMB | 2019/07/30 | Wechat | -| * Meng | 19 RMB | 2019/08/28 | Wechat | -| QuDouDou | 10 RMB | 2019/08/28 | Wechat | -| LI Bo | 100 RMB | 2019/10/06 | Wechat | -| Njustsll | 10 RMB | 2019/10/11 | Wechat | -| LIU ZhiKuo | 99.99 RMB | 2019/10/15 | Alipay | -| * Tao | 16 RMB | 2019/10/17 | Wechat | -| ChiHong | 12 RMB | 2019/10/17 | Alipay | -| YuanFengJing | 10 RMB | 2019/10/28 | Wechat | -| GUO DeLiang | 88 RMB | 2019/11/03 | Wechat | -| ZiQiangBuXi | 20 RMB | 2019/11/03 | Alipay | -| DuShuZhiChong | 20 RMB | 2019/11/18 | Wechat | -| * Deng | 10 RMB | 2019/11/18 | Wechat | -| * Zhe | 20 RMB | 2019/11/18 | Wechat | +Thank ChinaTeX and [LaTeX Studio](http://www.latexstudio.net/) for their promotion. ## License diff --git a/macros/latex/contrib/elegantbook/elegantbook-cn.pdf b/macros/latex/contrib/elegantbook/elegantbook-cn.pdf Binary files differindex 344c848843..efecb61556 100644 --- a/macros/latex/contrib/elegantbook/elegantbook-cn.pdf +++ b/macros/latex/contrib/elegantbook/elegantbook-cn.pdf diff --git a/macros/latex/contrib/elegantbook/elegantbook-cn.tex b/macros/latex/contrib/elegantbook/elegantbook-cn.tex index 1d328f73c5..714436ee70 100644 --- a/macros/latex/contrib/elegantbook/elegantbook-cn.tex +++ b/macros/latex/contrib/elegantbook/elegantbook-cn.tex @@ -1,15 +1,17 @@ -\documentclass[cn,11pt,chinese]{elegantbook} +\documentclass[cn,10pt,math=newtx,citestyle=gb7714-2015,bibstyle=gb7714-2015]{elegantbook} \title{ElegantBook:优美的 \LaTeX{} 书籍模板} \subtitle{Elegant\LaTeX{} 经典之作} \author{Ethan Deng \& Liam Huang} \institute{Elegant\LaTeX{} Program} -\date{April 12, 2020} -\version{3.11} +\date{May 2, 2021} +\version{4.1} \bioinfo{自定义}{信息} -\extrainfo{温柔正确的人总是难以生存,因为这世界既不温柔,也不正确。—— 比企谷八幡} +\extrainfo{各人自扫门前雪,休管他人瓦上霜。—— 陈元靓} + +\setcounter{tocdepth}{3} \logo{logo-blue.png} \cover{cover.jpg} @@ -18,23 +20,27 @@ \usepackage{array} \newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}} +\definecolor{customcolor}{RGB}{32,178,170} +\colorlet{coverlinecolor}{customcolor} + \begin{document} \maketitle \frontmatter \chapter*{特别声明} + \markboth{Introduction}{前言} -在过去的 2019 年,\href{https://elegantlatex.org/}{Elegant\LaTeX{}} 系列模板均逐步上线 \href{https://github.com/ElegantLaTeX}{GitHub}、\href{https://ctan.org/pkg/elegantbook}{CTAN}、\href{https://www.overleaf.com/latex/templates/elegantbook-template/zpsrbmdsxrgy}{Overleaf} 以及 \href{https://gitee.com/ElegantLaTeX/ElegantBook}{Gitee} 上。截止到 2019 年底,ElegantNote、ElegantBook、ElegantPaper 三个模板在 GitHub 上的收藏数达到了 194、333 和 220,从 2019 年 5 月开启捐赠之后收到了用户 33 笔合计超过 1500 元的捐赠,用户群人数也超过了 400 人。这些数字的背后,反映出 Elegant\LaTeX{} 越来越受用户的喜爱,在此非常感谢大家。 +自 2019 年 Elegant\LaTeX{} 系列模板上线 GitHub、CTAN 以来,受到很多用户的喜爱。 -但是,我想声明的是: +2020 年,我打算做 Elegant\LaTeX{} 的最后一个版本,也就是原定计划 ElegantBook 4.x 版本为 Elegant\LaTeX{} 系列模板的终止符。基于我想把 4.x 做成一个最终版本,我计划了很多事情,包括将代码转为 dtx,将三个模板的文档打包进 dtx 里面,然后重新设计封面,补充各种页面,增加元素等等。我想的很多,但是做起来并不是很顺利,中间也发生了很多事情,不想解释。直至今年 4 月,我决定,不论如何,先把 4.1 发布出来。 -\begin{center} - 由于某些原因,Elegant\LaTeX{} 项目 \underline{不再接受}\textbf{任何}非我本人预约的提交。 -\end{center} +\vskip 0.5cm -我是一个理想主义者,关于这个模板,我有自己的想法。我所关心的是,我周围的人能方便使用 \LaTeX{} 以及此模板,我自己会为自己的东西感到开心。如果维护模板让我不开心,那我就不会再维护了。诚然这个模板并不是完美的,但是相比 2.x 好很多了,这些改进离不开大家的反馈、China\TeX{} 和逐鹿人的鼓励以及支援人员的帮助! +另外,在临近 Elegant\LaTeX{} 模板告别之际,我想和各位用户说:多分享,多奉献。 + +\vskip 0.5cm \underline{如果你无法认同我的想法,建议直接删除本模板。} @@ -42,13 +48,13 @@ \begin{flushright} Ethan Deng\\ -February 10, 2020 +May 2, 2021 \end{flushright} \tableofcontents -%\listofchanges \mainmatter + \chapter{Elegant\LaTeX{} 系列模板介绍} Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。强烈推荐使用最新正式版本!本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。 @@ -58,7 +64,6 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 \item 官网:\href{https://elegantlatex.org/}{https://elegantlatex.org/} \item GitHub 网址:\href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/} \item CTAN 地址:\href{https://ctan.org/pkg/elegantbook}{https://ctan.org/pkg/elegantbook} - \item 文档 Wiki:\href{https://github.com/ElegantLaTeX/ElegantBook/wiki}{https://github.com/ElegantLaTeX/ElegantBook/wiki} \item 下载地址:\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{正式发行版},\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版} \item 微博:Elegant\LaTeX{} \item 微信公众号:Elegant\LaTeX{} @@ -69,13 +74,15 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 \section{ElegantBook 更新说明} -此次为 3.x 最后一个版本,在 3.10 基础上,主要为了解决 \TeX{} Live 2020 中编译错误,具体内容有: +此次为 4.x 第一个版本,在 3.x 基础上,主要更新了定理以及参考文献的支持方式,具体内容有: \begin{enumerate} - \item \textbf{重要修正}:修复因为 \lstinline{gbt7714} 宏包更新导致的 \lstinline{natbib option clash} 错误; - \item 由于 \lstinline{pgfornament} 宏包未被 \TeX Live 2020 收录,因此删除 base 相关的内容; - \item 修复部分环境的空格问题; - \item 增加了意大利语言选项 \lstinline{lang=it}。 + \item \textbf{重要改动}:由原先的 \hologo{BibTeX} 改为 biblatex 编译方式(后端为 \lstinline{biber}),请注意两者之间的差异; + \item \textbf{重要改进}:修改对于定理写法兼容方式,提高数学公式代码的兼容性; + \item 页面设置改动,默认页面更宽;方便书写和阅读; + \item 支持目录文字以及页码跳转; + \item 不再维护 \hologo{pdfLaTeX} 中文支持方式,请务必使用 \hologo{XeLaTeX} 编译中文文稿。 + \item 增加多语言选项,法语 \lstinline{lang=fr}、德语 \lstinline{lang=de}、荷兰语 \lstinline{lang=nl}、匈牙利语 \lstinline{lang=hu}、西班牙语 \lstinline{lang=es}、蒙古语 \lstinline{lang=mn} 等。 \end{enumerate} \begin{note} @@ -96,18 +103,11 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议 \subsection{本地免安装使用} - -\textbf{免安装}使用方法如下,从 GitHub 或者 CTAN 下载最新(正式)版文件,严格意义上只需要类文件 \lstinline{elegantbook.cls}。然后将模板文件放在你的工作目录下即可使用。这样使用的好处是,无需安装,简便;缺点是,当模板更新之后,你需要手动替换 \lstinline{cls} 文件。 +\textbf{免安装}使用方法如下,从 GitHub 或者 CTAN 下载最新版,严格意义上只需要类文件 \lstinline{elegantbook.cls}。然后将模板文件放在你的工作目录下即可使用。这样使用的好处是,无需安装,简便;缺点是,当模板更新之后,你需要手动替换 \lstinline{cls} 文件。 \subsection{发行版安装使用} -如果你是 \TeX{} Live 2019 用户,我们推荐你直接进行安装和更新。你可以通过 \TeX{} Live 2019 自带的 \lstinline{tlshell}\footnote{也叫 \TeX{} Live Manager} 进行安装。安装非常简单,步骤如下,搜索并打开 \lstinline{tlshell},然后通过 \lstinline{File -> Load Default Repository} 加载远程仓库,如果你不想使用默认的仓库,你可以通过 \lstinline{Options} 下的菜单设置远程仓库。设置好仓库之后,等待仓库加载完毕,你可以在下面的搜索栏搜索 \lstinline{elegantbook},然后选择进行安装与更新。 - -\begin{figure}[htbp] - \centering - \includegraphics[width=0.7\textwidth]{tlshell.png} - \caption{使用 \TeX{} Live Shell 安装 ElegantBook 模板} -\end{figure} +本模板测试环境为 Win10 和 TeX Live 2021,如果你刚安装 \TeX{} Live 2021 用户,安装后建议升级全部宏包,升级方法:使用 cmd 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新。 \subsection{更新问题} @@ -124,119 +124,41 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议 \subsection{其他发行版本} -如果你是 \TeX{} Live 2018 的用户,由于 2018 难以更新到 2019,建议卸载 2018 重装 2019。如果嫌麻烦,你可以手动安装模板,将 \lstinline{elegantbook.cls} 复制到你的 \TeX{} Live 目录下,默认安装目录为 \lstinline|C:\texlive\2019\texmf-dist\tex\latex\elegantbook|,然后通过命令行(管理员权限),运行 \lstinline{texhash} 即可。 - -由于宏包版本问题,本模板不支持 C\TeX{} 套装。更多关于 \TeX{} Live 2019 的安装使用以及 C\TeX{} 与 \TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install_latex/releases}{一份简短的安装 \LaTeX{} 的介绍}。 +由于宏包版本问题,本模板不支持 C\TeX{} 套装,请务必安装 TeX Live。更多关于 \TeX{} Live 的安装使用以及 C\TeX{} 与 \TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install_latex/releases}{一份简短的安装 \LaTeX{} 的介绍}。 -\section{用户作品计划} - -Elegant\LaTeX{} 系列模板从创立至今已经有 9 年了,我们的模板也受到了很多用户的喜爱,在此,为了促进模板用户之间的交流,了解用户需求,完善本模板,我们将建立一个区域专门展示用户的文档,包括但不限于 GitHub 和官网等。如果你愿意将自己的作品展示出来,请邮件或者其他方式联系我们。如果自己代码已经传到 GitHub 或者 Gitee 等网站,可以提供对应网址。\href{https://github.com/ElegantLaTeX/Archive/tree/master/Collections}{用户文档中心}目前有下面一些作品: -\begin{enumerate} -\item 唐绍东:微积分笔记 -\item 曲豆豆:超甜微积分习题集 -\item 王世强:《化工数值计算与 MATLAB》复习指南 -\item 李晨迪:Fluid Mechanics Notes -\item 肖明顺:地球物理勘查常用规范汇编 -\item 白衣卿相:期末复习笔记-拓扑学摘要 -\end{enumerate} - \section{关于提交} 出于某些因素的考虑,Elegant\LaTeX{} 项目自 2019 年 5 月 20 日开始,\textbf{不再接受任何非作者预约性质的提交}(pull request)!如果你想改进模板,你可以给我们提交 issues,或者可以在遵循协议(LPPL-1.3c)的情况下,克隆到自己仓库下进行修改。 -\section{协作人员招募} - -招募 Elegant\LaTeX{} 的协作人员(志愿者),没有报酬。工作内容:翻译 Elegant\LaTeX{} 系列模板文档,维护模板的维基,如果有公众号文稿写作经历的话,也可以帮忙写微信稿。本公告长期有效。目前 Elegant\LaTeX{} 共有 4 名协作人员,在此感谢他们无私的奉献! -\begin{itemize} - \item 官方文档翻译: \href{https://github.com/peggy2006xzyz}{YPY}; - \item GitHub 维基维护: \href{https://github.com/izinngo}{Ingo Zinngo}、\href{https://github.com/xiaohao890809}{追寻原风景}; - \item QQ 群管理、FAQ 整理: \href{https://github.com/sikouhjw}{Sikouhjw}. -\end{itemize} - -另外,也感谢 \href{https://github.com/stone-zeng}{Xiangdong Zeng}、\href{https://github.com/latexers}{逐鹿人}等人帮忙群管理。 - -\section{致谢} -2019 年 5 月 20 日,ElegantBook 模板在 GitHub 上的收藏数(star)达到了 100\footnote{截止 3.10 版本正式发布,star 数为 374。}。在此特别感谢 China\TeX{} 以及 \href{http://www.latexstudio.net/}{\LaTeX{} 工作室}对于本系列模板的大力宣传与推广。\LaTeX{} 工作室网站上有很多精彩的帖子和精致的模板,欢迎大家去挖掘里面的宝藏,这也是国内最全面的 \LaTeX{} 相关的网站。 - -如果你喜欢我们的模板,你可以在 GitHub 上收藏我们的模板。 -%\begin{figure}[htbp] -% \centering -% \includegraphics[width=\textwidth]{star.png} -% \caption{一键三连求赞} -%\end{figure} - -\section{捐赠} - -如果您非常喜爱我们的模板或者我,你还可以选择捐赠\footnote{最好在捐赠时备注信息。}以表达您对我们模板和我的支持。本模板自 3.08 版本发布了捐赠信息之后,收到了超过 1500 元的捐赠(四舍五入就是一个亿),非常感谢! - -\begin{figure}[htbp] -\centering -\includegraphics[width=0.5\textwidth]{donate.jpg} -\end{figure} - -\textbf{赞赏费用的使用解释权归 Elegant\LaTeX{} 所有,并且不接受监督,请自愿理性打赏}。10 元以上的赞赏,我们将列入捐赠榜,谢谢各位金主! - -\begin{table}[!htb] - \centering - \caption{Elegant\LaTeX{} 系列模板捐赠榜} - \begin{tabular}{*{4}{>{\scriptsize}c}|*{4}{>{\scriptsize}c}} - \hline - \textbf{捐赠者} & \textbf{金额} & \textbf{时间} & \textbf{渠道} & \textbf{捐赠者} & \textbf{金额} & \textbf{时间} & \textbf{渠道} \\ - \hline - Lerh & 10 RMB & 2019/05/15 & 微信 & 越过地平线 & 10 RMB & 2019/05/15 & 微信 \\ - 银桑 & 20 RMB & 2019/05/27 & 微信 & *空 & 10 RMB & 2019/05/30 & 微信 \\ - latexstudio.net & 666 RMB & 2019/06/05 & 支付宝 & A*n & 40 RMB & 2019/06/15 & 微信 \\ - * 夏 & 22 RMB & 2019/06/15 & 微信 & * 倩 & 21 RMB & 2019/06/15 & 微信 \\ - Cassis & 11 RMB & 2019/06/30 & 微信 & *君 & 10 RMB & 2019/07/23 & 微信 \\ - P*u & 50 RMB & 2019/07/30 & 微信 & *萌 & 19 RMB & 2019/08/28 & 微信 \\ - 曲豆豆 & 10 RMB & 2019/08/28 & 微信 & 李博 & 100 RMB & 2019/10/06 & 微信 \\ - Njustsll & 10 RMB & 2019/10/11 & 微信 & 刘志阔 & 99.99 RMB & 2019/10/15 & 支付宝 \\ - * 韬 & 16 RMB & 2019/10/17 & 微信 & 赤霓 & 12 RMB & 2019/10/17 & 支付宝 \\ - 追寻原风景 & 10 RMB & 2019/10/28 & 微信 & 郭德良 & 88 RMB & 2019/11/03 & 微信 \\ - 自强不息 & 20 RMB & 2019/11/04 & 支付宝 & 读书之虫 & 20 RMB & 2019/11/18 & 微信 \\ - *等 & 10 RMB & 2019/11/18 & 微信 & *哲 & 20 RMB & 2019/11/18 & 微信 \\ - 佚名 & 10 RMB & 2019/11/24 & 微信 & Jiye Qian & 66 RMB & 2019/12/04 & 微信 \\ - * 阳 & 20 RMB & 2019/12/05 & 微信 & Catcher & 11 RMB & 2019/12/08 & 支付宝 \\ - 希尔波特门徒 & 10 RMB & 2019/12/09 & 支付宝 & * 伟 & 10 RMB & 2019/12/09 & 微信 \\ - Simon & 20 RMB & 2019/12/11 & 支付宝 & 流殇丶浅忆 & 66.60 RMB & 2019/12/18 & 支付宝 \\ - 羽 & 10 RMB & 2019/12/20 & 支付宝 & * 琛 & 15 RMB & 2019/12/20 & 微信 \\ - 随风 & 20 RMB & 2019/12/27 & 支付宝 & Ws & 23.30 RMB & 2019/12/28 & 微信 \\ - 初八 & 100 RMB & 2020/01/02 & 支付宝 & p*e & 20 RMB & 2020/01/03 & 微信 \\ - Shunmx & 100 RMB & 2020/01/03 & 微信 & hj & 10 RMB & 2020/01/03 & 微信 \\ - F*5 & 10 RMB & 2020/01/03 & 微信 & S*m & 20.20 RMB & 2020/01/03 & 微信 \\ - 二代青雉 & 13 RMB & 2020/01/14 & 支付宝 & *? & 66 RMB & 2020/01/15 & 微信 \\ - Mr. Xiong & 20 RMB & 2020/01/17 & 微信 & *博 & 15 RMB & 2020/01/18 & 微信 \\ - * 者 & 10 RMB & 2020/02/02 & 微信 & Jackie & 88.80 RMB & 2020/02/09 & 微信 \\ - Henry\_Sun、 & 50 RMB & 2020/02/14 & 支付宝 & * 桥 & 50 RMB & 2020/02/21 & 微信 \\ - 昀琏 & 10 RMB & 2020/03/02 & 支付宝 & S*y & 10 RMB & 2020/03/15 & 微信 \\ - * 哥 & 66.66 RMB & 2020/03/17 & 微信 & K*e & 30 RMB & 2020/03/30 & 微信\\ - * 阳 & 20 RMB & 2020/04/02 & 微信 & 士*n & 30 RMB & 2020/04/11 & 微信 \\ - \hline - \end{tabular}% - \label{tab:donation}% -\end{table}% - -另外,为了表示感谢,我们制作了捐赠纪念证,欢迎大家来信告知邮箱以及姓名(艺名),我们将通过邮件发送电子版纪念证。 - -\begin{figure}[!htbp] -\centering -\includegraphics[width=0.6\textwidth]{cert.pdf} -\end{figure} \chapter{ElegantBook 设置说明} -本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8,推荐使用 \TeX{} Live 编译。本文编写环境为 Win10 (64bit) + \TeX{} Live 2020,支持 \hologo{pdfLaTeX} 以及 \hologo{XeLaTeX} 编译。中文请尽量使用 \hologo{XeLaTeX} 编译。 +本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8,推荐使用 \TeX{} Live 编译。本文编写环境为 Win10 (64bit) + \TeX{} Live 2021,英文支持 \hologo{pdfLaTeX},中文仅支持 \hologo{XeLaTeX} 编译。 \section{语言模式} -本模板内含三套语言环境 \lstinline{lang=cn}、\lstinline{lang=en} 以及 \lstinline{lang=it} \footnote{由 \href{https://github.com/VincentMVV}{VincentMVV} 提供意大利语翻译,具体的内容见\href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation}。},改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下: +本模板内含两套基础语言环境 \lstinline{lang=cn}、\lstinline{lang=en}。改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下: \begin{lstlisting} \documentclass[cn]{elegantbook} \documentclass[lang=cn]{elegantbook} \end{lstlisting} +除模板自带的两套语言设定之外,由网友提供的其他语言环境设置如下: +\begin{itemize} + \item 由 \href{https://github.com/VincentMVV}{VincentMVV} 提供的意大利语翻译 \lstinline{lang=it},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation}; + \item 由 \href{https://github.com/abfek66}{abfek66} 提供的法语翻译 \lstinline{lang=fr},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation}; + % \item 由 \href{https://github.com/stultus}{stultus} 提供的马拉雅拉姆语翻译 \lstinline{lang=},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/90}{Malayalam translation}; + \item 由 \href{https://github.com/inktvis75}{inktvis75} 提供的荷兰语翻译 \lstinline{lang=nl},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/108}{Dutch Translation}; + \item 由 \href{https://github.com/palkotamas}{palkotamas} 提供的匈牙利语翻译 \lstinline{lang=hu},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/111}{Hungarian translation}; + \item 由 Lisa 提供的德语翻译 \lstinline{lang=de},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/113}{Deutsch translation}; + \item 由 Gustavo A. Corradi 提供的西班牙语的翻译 \lstinline{lang=es},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/133}{Spanish translation}; + \item 由 \href{https://github.com/Altantsooj}{Altantsooj} 提供的蒙古语的翻译 \lstinline{lang=mn},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/137}{Mongolian translation}。 +\end{itemize} + + + \begin{remark} -只有中文环境(\lstinline{lang=cn})才可以输入中文。另外如果抄录环境(\lstinline{lstlisting})中有中文字符,请务必使用 \hologo{XeLaTeX} 编译。 +以上各个语言的设定均为网友设定,我们未对上述翻译进行过校对,如果有问题,请在对应的 issue 下评论。并且,只有中文环境(\lstinline{lang=cn})才可以输入中文。 \end{remark} \section{设备选项} @@ -259,47 +181,47 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 9 年了,我们的模板 \centering \begin{tabular}{ccccccc} \toprule - & \textcolor{structure1}{green} - & \textcolor{structure2}{cyan} - & \textcolor{structure3}{blue} - & \textcolor{structure4}{gray} - & \textcolor{structure5}{black} - & 主要使用的环境\\ + & \textcolor{structure1}{green} + & \textcolor{structure2}{cyan} + & \textcolor{structure3}{blue} + & \textcolor{structure4}{gray} + & \textcolor{structure5}{black} + & 主要使用的环境\\ \midrule structure & \ccr{structure1} - & \ccr{structure2} - & \ccr{structure3} - & \ccr{structure4} - & \ccr{structure5} - & chapter \ section \ subsection \\ + & \ccr{structure2} + & \ccr{structure3} + & \ccr{structure4} + & \ccr{structure5} + & chapter \ section \ subsection \\ main & \ccr{main1} - & \ccr{main2} - & \ccr{main3} - & \ccr{main4} - & \ccr{main5} - & definition \ exercise \ problem \\ + & \ccr{main2} + & \ccr{main3} + & \ccr{main4} + & \ccr{main5} + & definition \ exercise \ problem \\ second & \ccr{second1} - & \ccr{second2} - & \ccr{second3} - & \ccr{second4} - & \ccr{second5} - & theorem \ lemma \ corollary\\ + & \ccr{second2} + & \ccr{second3} + & \ccr{second4} + & \ccr{second5} + & theorem \ lemma \ corollary\\ third & \ccr{third1} - & \ccr{third2} - & \ccr{third3} - & \ccr{third4} - & \ccr{third5} - & proposition\\ + & \ccr{third2} + & \ccr{third3} + & \ccr{third4} + & \ccr{third5} + & proposition\\ \bottomrule \end{tabular} \end{table} 如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 structurecolor、main、second、third 颜色,具体方法如下: -\begin{lstlisting} +\begin{lstlisting}[tabsize=4]] \definecolor{structurecolor}{RGB}{0,0,0} \definecolor{main}{RGB}{70,70,70} \definecolor{second}{RGB}{115,45,2} -\definecolor{third}{RGB}{0,80,80} +\definecolor{third}{RGB}{0,80,80} \end{lstlisting} \section{封面} @@ -307,23 +229,32 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 9 年了,我们的模板 \subsection{封面个性化} 从 3.10 版本开始,封面更加弹性化,用户可以自行选择输出的内容,包括 \lstinline{\title} 在内的所有封面元素都可为空。目前封面的元素有 -\begin{itemize} - \item 标题:\lstinline{\title} - \item 副标题:\lstinline{\subtitle} - \item 作者:\lstinline{\author} - \item 机构:\lstinline{\institute} - \item 日期:\lstinline{\date} - \item 版本:\lstinline{\version} - \item 箴言:\lstinline{\extrainfo} - \item 封面图:\lstinline{\cover} - \item 徽标:\lstinline{\logo} -\end{itemize} + +\begin{table}[htbp] + \centering + \caption{封面元素信息} + \begin{tabular}{p{0.07\textwidth}p{0.15\textwidth}|p{0.07\textwidth}p{0.15\textwidth}|p{0.07\textwidth}p{0.15\textwidth}} + \toprule + 信息 & 命令 & 信息 & 命令 & 信息 & 命令 \\ + \midrule + 标题 & \lstinline|\title| & 副标题 & \lstinline|\subtitle| & 作者 & \lstinline|\author| \\ + 机构 & \lstinline|\institute| & 日期 & \lstinline|\date| & 版本 & \lstinline|\version| \\ + 箴言 & \lstinline|\extrainfo| & 封面图 & \lstinline|\cover| & 徽标 & \lstinline|\logo| \\ + \bottomrule + \end{tabular} +\end{table} 另外,额外增加一个 \lstinline{\bioinfo} 命令,有两个选项,分别是信息标题以及信息内容。比如需要显示{\kaishu User Name:111520},则可以使用 \begin{lstlisting} \bioinfo{User Name}{115520} \end{lstlisting} +封面中间位置的色块的颜色可以使用下面命令进行修改: +\begin{lstlisting} + \definecolor{customcolor}{RGB}{32,178,170} + \colorlet{coverlinecolor}{customcolor} +\end{lstlisting} + \subsection{封面图} 本模板使用的封面图片来源于 \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}\footnote{感谢 China\TeX{} 提供免费图源网站,另外还推荐 \href{https://www.pexels.com/}{pexels.com}。},图片完全免费,可用于任何场景。封面图片的尺寸为 $1280 \times 1024$, 更换图片的时候请\textbf{严格}按照封面图片尺寸进行裁剪。推荐一个免费的在线图片裁剪网站 \href{https://www.fotor.com/cn}{fotor.com}。用户 QQ 群内有一些合适尺寸的封面,欢迎取用。 @@ -334,7 +265,7 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 9 年了,我们的模板 \subsection{自定义封面} -另外,如果需要使用自定义的封面,比如 Adobe illustrator 或者其他软件制作的 A4 PDF 文档,请把 \lstinline{\maketitle} 注释掉,然后借助 \lstinline{pdfpages} 宏包将自制封面插入即可。如果使用 \lstinline{titlepage} 环境,也是类似。如果需要 2.x 版本的封面,请参考 \href{https://github.com/EthanDeng/etitlepage}{etitlepage}。 +另外,如果使用自定义的封面,比如 Adobe illustrator 或者其他软件制作的 A4 PDF 文档,请把 \lstinline{\maketitle} 注释掉,然后借助 \lstinline{pdfpages} 宏包将自制封面插入即可。如果使用 \lstinline{titlepage} 环境,也是类似。如果需要 2.x 版本的封面,请参考 \href{https://github.com/EthanDeng/etitlepage}{etitlepage}。 \section{章标标题} @@ -377,12 +308,24 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 9 年了,我们的模板 由于本模板使用了 \lstinline{tcolorbox} 宏包来定制定理类环境,所以和普通的定理环境的使用有些许区别,定理的使用方法如下: \begin{lstlisting} \begin{theorem}{theorem name}{label} -The content of theorem. + The content of theorem. \end{theorem} \end{lstlisting} 第一个必选项 \lstinline{theorem name} 是定理的名字,第二个必选项 \lstinline{label} 是交叉引用时所用到的标签,交叉引用的方法为 \verb|\ref{thm:label}|。请注意,交叉引用时必须加上前缀 \lstinline{thm:}。 +在用户多次反馈下,4.x 之后,引入了原生定理的支持方式,也就是使用可选项方式: + +\begin{lstlisting} +\begin{theorem}[theorem name] \label{thm:theorem-label} + The content of theorem. +\end{theorem} +% or +\begin{theorem} \label{thm:theorem-withou-name} + The content of theorem without name. +\end{theorem} +\end{lstlisting} + 其他相同用法的定理类环境有: \begin{table}[htbp] @@ -402,6 +345,34 @@ The content of theorem. \label{tab:theorem-class}% \end{table}% +% \subsection{算法环境} + + +% \begin{algorithm}\label{alg:test} +% \Input{A bitmap $I$ of size $w \times l$} +% \Output{A partition of the bitmap} +% \BlankLine +% \emph{special treatment of the first line}\; +% \For{$i \leftarrow 2$ \KwTo $l$}{ +% \emph{special treatment of the first element of line $i$}\; +% \For{$j \leftarrow 2$ \KwTo $w$}{\label{forins} +% $\Left \leftarrow \FindCompress{$I[i,j-1]$}$\; +% $\Up \leftarrow \FindCompress{$I[i-1,]$}$\; +% $\This \leftarrow \FindCompress{$I[i,j]$}$\; +% \If(\tcp*[h]{O(\Left,\This)==1}){\Left compatible with \This}{\label{lt} +% \lIf{$\Left < \This$}{$\Union{\Left,\This}$} +% \lElse{$\Union{\This,\Left}$} +% } +% \If(\tcp*[f]{O(\Up,\This)==1}){\Up compatible with \This}{\label{ut} +% \lIf{$\Up < \This$}{$\Union{\Up,\This}$} +% \tcp{\This is put under \Up to keep tree as flat as possible}\label{cmt} +% \lElse{$\Union{\This,\Up}$}\tcp*[r]{\This{} linked to \Up}\label{lelse} +% } +% } +% \lForEach{element $e$ of the line $i$}{\FindCompress{p}} +% } +% \caption{disjoint decomposition}\label{algo_disjdecomp} +% \end{algorithm} \subsection{其他环境的使用} @@ -453,27 +424,22 @@ The content of theorem. \section{参考文献} -此模板使用了 \hologo{BibTeX} 来生成参考文献,在中文示例中,使用了 \lstinline{gbt7714} 宏包。参考文献示例:\cite{en1,en2,en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 +此模板使用了 \hologo{biber} 来生成参考文献,也即使用 \lstinline{biblatex} 宏包,在中文示例中,使用了 \lstinline{gbt7714} 宏包。参考文献示例:\cite{cn1,en2,en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 -你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 \hologo{BibTeX} 编译。如果你想添加未引用的文献,可以使用 -\begin{lstlisting}[frame=single] -\nocite{EINAV2010,Havrylchyk2018} %or include some bibitems -\nocite{*} %include all the bibitems -\end{lstlisting} +你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 \hologo{biber} 编译。 -本模板还添加了 \lstinline{cite=numbers} 、\lstinline{cite=super} 和 \lstinline{cite=authoryear} 三个参考文献选项,用于设置参考文献格式的设置,默认为 \lstinline{numbers}。据我们所知,理工科类一般使用数字形式 \lstinline{numbers} 或者上标形式 \lstinline{super},而文科类使用作者-年份 \lstinline{authoryear} 比较多,所以我们将 \lstinline{numbers} 作为默认格式。如果需要改为 \lstinline{cite=super} 或者 \lstinline{authoryear} ,可以使用 +为了方便文献样式修改,模板引入了 \lstinline{bibstyle} 和 \lstinline{citestyle} 选项,默认均为数字格式(numeric),如果需要设置为国标 GB7714-2015,需要使用: \begin{lstlisting} -\documentclass[cite=super]{elegantbook} % set super style ref style -\documentclass[super]{elegantbook} -\documentclass[cite=authoryear]{elegantbook} % set author year ref style -\documentclass[authoryear]{elegantbook} + \documentclass[citestyle=gb7714-2015, bibstyle=gb7714-2015]{elegantbook} \end{lstlisting} -为了方便文献样式修改,模板引入了 \lstinline{bibstyle} 选项,默认为 apalike,更多的选择可以参考 \href{https://www.overleaf.com/learn/latex/Bibtex_bibliography_styles}{\hologo{BibTeX} Bibliography Styles}。用法为 +如果需要添加排序方式,可以在导言区加入 \begin{lstlisting} - \documentclass[bibstyle=apalike]{elegantbook} + \ExecuteBibliographyOptions{sorting=ynt} \end{lstlisting} +启用国标之后,可以加入 \lstinline{sorting=gb7714-2015}。 + \section{添加序章} 如果你想在第一章前面添序章,不改变原本章节序号,可以在第一章内容前面使用 @@ -596,7 +562,6 @@ The content of introduction. \end{remark} - \chapter{字体选项} 字体选项独立成章的原因是,我们希望本模板的用户关心模板使用的字体,知晓自己使用的字体以及遇到字体相关的问题能更加便捷地找到答案。 @@ -711,7 +676,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$ 是 $\mathcal{R}^n$ 中的可测集。 -\begin{definition}{可积性}{int} +\begin{definition}[可积性] \label{def:int} 设 $ f(x)=\sum\limits_{i=1}^{k} a_i \chi_{A_i}(x)$ 是 $E$ 上的非负简单函数,其中 $\{A_1,A_2,\ldots,A_k\}$ 是 $E$ 上的一个可测分割,$a_1,a_2,\ldots,a_k$ 是非负实数。定义 $f$ 在 $E$ 上的积分为 $\int_{a}^b f(x)$ \begin{equation} \label{inter} @@ -736,7 +701,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \label{ex:1} I(t) = \int_{\mathcal{R}^1} f(x+t)g(x)dx \quad t \in \mathcal{R}^1 \end{equation} -是 $\mathcal{R}^1$ 上的连续函数。 +是 $\mathcal{R}^1$ 上的连续函数。 \end{exercise} \begin{solution} @@ -747,7 +712,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 即 $D(x)$ 在 $[0,1]$ 上是 Lebesgue 可积的并且积分值为零。但 $D(x)$ 在 $[0,1]$ 上不是 Riemann 可积的。 \end{proof} -\begin{theorem}{Fubini 定理}{fubi} +\begin{theorem}[Fubini 定理] \label{thm:fubi} (1)若 $f(x,y)$ 是 $\mathcal{R}^p\times\mathcal{R}^q$ 上的非负可测函数,则对几乎处处的 $x\in \mathcal{R}^p$,$f(x,y)$ 作为 $y$ 的函数是 $\mathcal{R}^q$ 上的非负可测函数,$g(x)=\int_{\mathcal{R}^q}f(x,y) dy$ 是 $\mathcal{R}^p$ 上的非负可测函数。并且 \begin{equation} \label{eq:461} @@ -757,13 +722,15 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 (2)若 $f(x,y)$ 是 $\mathcal{R}^p\times\mathcal{R}^q$ 上的可积函数,则对几乎处处的 $x\in\mathcal{R}^p$,$f(x,y)$ 作为 $y$ 的函数是 $\mathcal{R}^q$ 上的可积函数,并且 $g(x)=\int_{\mathcal{R}^q}f(x,y) dy$ 是 $\mathcal{R}^p$ 上的可积函数。而且~\ref{eq:461} 成立。 \end{theorem} +\ref{thm:fubi} + \begin{note} 在本模板中,引理(lemma),推论(corollary)的样式和定理~\ref{thm:fubi} 的样式一致,包括颜色,仅仅只有计数器的设置不一样。 \end{note} 我们说一个实变或者复变量的实值或者复值函数是在区间上平方可积的,如果其绝对值的平方在该区间上的积分是有限的。所有在勒贝格积分意义下平方可积的可测函数构成一个希尔伯特空间,也就是所谓的 $L^2$ 空间,几乎处处相等的函数归为同一等价类。形式上,$L^2$ 是平方可积函数的空间和几乎处处为 0 的函数空间的商空间。 -\begin{proposition}{最优性原理}{max} +\begin{proposition}[最优性原理] \label{pro:max} 如果 $u^*$ 在 $[s,T]$ 上为最优解,则 $u^*$ 在 $[s, T]$ 任意子区间都是最优解,假设区间为 $[t_0, t_1]$ 的最优解为 $u^*$ ,则 $u(t_0)=u^{*}(t_0)$,即初始条件必须还是在 $u^*$ 上。 \end{proposition} @@ -771,7 +738,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \begin{figure}[htbp] \centering - \includegraphics[width=0.6\textwidth]{scatter.pdf} + \includegraphics[width=0.6\textwidth]{scatter.jpg} \caption{散点图示例 $\hat{y}=a+bx$ \label{fig:scatter}} \end{figure} @@ -802,18 +769,16 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \begin{enumerate}[itemsep=1.5ex] \item \question{有没有办法章节用“第一章,第一节,(一)”这种?} 见前文介绍,可以使用 \lstinline{scheme=chinese} 设置。 - \item \question{3.07 版本的 cls 的 natbib 加了numbers 编译完了没变化,群主设置了不可更改了?} - 之前在 3.07 版本中在引入 \lstinline{gbt7714} 宏包时,加入了 \lstinline{authoryear} 选项,这个使得 \lstinline{natbib} 设置了 \lstinline{numbers} 也无法生效。3.08 和 3.09 版本中,模板新增加了 \lstinline{numbers} 、\lstinline{super} 和 \lstinline{authoryear} 文献选项,你可以参考前文设置说明。 \item \question{大佬,我想把正文字体改为亮色,背景色改为黑灰色。} 页面颜色可以使用 \lstinline{\pagecolor} 命令设置,文本命令可以参考\href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{这里}进行设置。 \item \question{\lstinline[breaklines]{Package ctex Error: CTeX fontset `Mac' is unavailable.}} 在 Mac 系统下,中文编译请使用 \hologo{XeLaTeX}。 \item \question{\lstinline{! LaTeX Error: Unknown option `scheme=plain' for package `ctex'.}} - 你用的 C\TeX{} 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 C\TeX{} 套装了,请卸载并安装 \TeX{} Live 2019。 + 你用的 C\TeX{} 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 C\TeX{} 套装了,请卸载并安装 \TeX{} Live 2021。 \item \question{我该使用什么版本?} - 请务必使用\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{最新正式发行版},发行版间不定期可能会有更新(修复 bug 或者改进之类),如果你在使用过程中没有遇到问题,不需要每次更新\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版},但是在发行版更新之后,请尽可能使用最新版(发行版)!最新发行版可以在 GitHub 或者 \TeX{} Live 2019 内获取。 + 请务必使用\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{最新正式发行版},发行版间不定期可能会有更新(修复 bug 或者改进之类),如果你在使用过程中没有遇到问题,不需要每次更新\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版},但是在发行版更新之后,请尽可能使用最新版(发行版)!最新发行版可以在 GitHub 或者 \TeX{} Live 2021 内获取。 \item \question{我该使用什么编辑器?} - 你可以使用 \TeX{} Live 2019 自带的编辑器 \TeX{}works 或者使用 \TeX{}studio,\TeX works 的自动补全,你可以参考我们的总结 \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 自动补全}。推荐使用 \TeX{} Live 2019 + \TeX{}studio。我自己用 VS Code 和 Sublime Text,相关的配置说明,请参考 \href{https://github.com/EthanDeng/vscode-latex}{\LaTeX{} 编译环境配置:Visual Studio Code 配置简介} 和 \href{https://github.com/EthanDeng/sublime-text-latex}{Sublime Text 搭建 \LaTeX{} 编写环境}。 + 你可以使用 \TeX{} Live 2021 自带的编辑器 \TeX{}works 或者使用 \TeX{}studio,\TeX works 的自动补全,你可以参考我们的总结 \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 自动补全}。推荐使用 \TeX{} Live 2021 + \TeX{}studio。我自己用 VS Code 和 Sublime Text,相关的配置说明,请参考 \href{https://github.com/EthanDeng/vscode-latex}{\LaTeX{} 编译环境配置:Visual Studio Code 配置简介} 和 \href{https://github.com/EthanDeng/sublime-text-latex}{Sublime Text 搭建 \LaTeX{} 编写环境}。 \item \question{您好,我们想用您的 ElegantBook 模板写一本书。关于机器学习的教材,希望获得您的授权,谢谢您的宝贵时间。} 模板的使用修改都是自由的,你们声明模板来源以及模板地址(GitHub 地址)即可,其他未尽事宜按照开源协议 LPPL-1.3c。做好之后,如果方便的话,可以给我们一个链接,我把你们的教材放在 Elegant\LaTeX{} 用户作品集里。 \item \question{请问交叉引用是什么?} @@ -823,12 +788,25 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \item \question{代码高亮环境能用其他语言吗?} 可以的,ElegantBook 模板用的是 \lstinline{listings} 宏包,你可以在环境(\lstinline{lstlisting})之后加上语言(比如 Python 使用 \lstinline{language=Python} 选项),全局语言修改请使用 \lstinline{lsset} 命令,更多信息请参考宏包文档。 \item \question{群主,什么时候出 Beamer 的模板(主题),ElegantSlide 或者 ElegantBeamer?} - 由于 Beamer 中有一个很优秀的主题 \href{https://github.com/matze/mtheme}{Metropolis}。在找到非常好的创意之前不会发布正式的 Beamer 主题,如果你非常希望得到 Elegant\LaTeX{} “官方”的主题,请在用户 QQ 群内下载测试主题 PreElegantSlide。正式版制作计划在今年或者明年。 + 由于 Beamer 中有一个很优秀的主题 \href{https://github.com/matze/mtheme}{Metropolis}。后续确定不会再出任何主题/模板,请大家根据需要修改已有主题。 \end{enumerate} \chapter{版本更新历史} -根据用户的反馈,我们不断修正和完善模板。截止到此次更新,ElegantBook 模板在 GitHub 上有将近 100 次提交,正式发行版本(release)有 16 次。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。 +根据用户的反馈,我们不断修正和完善模板。截止到此次更新,ElegantBook 模板在 GitHub 上有将近 100 次提交,正式发行版本(release)有 17 次。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。 + + +\datechange{2021/05/02}{版本 4.1 正式发布。} + +\begin{change} + \item \textbf{重要改动}:由原先的 \hologo{BibTeX} 改为 biblatex 编译方式(后端为 \lstinline{biber}),请注意两者之间的差异; + \item \textbf{重要改进}:修改对于定理写法兼容方式,提高数学公式代码的兼容性; + \item 页面设置改动,默认页面更宽;方便书写和阅读; + \item 支持目录文字以及页码跳转; + \item 不再维护 \hologo{pdfLaTeX} 中文支持方式,请务必使用 \hologo{XeLaTeX} 编译中文文稿。 + \item 增加多个语言选项,法语 \lstinline{lang=fr}、荷兰语 \lstinline{lang=nl}、匈牙利语 \lstinline{lang=hu}、西班牙语 \lstinline{lang=es}、蒙古语 \lstinline{lang=mn} 等。 +\end{change} + \datechange{2020/04/12}{版本 3.11 正式发布,\textcolor{red}{此版本为 3.x 最后版本。}} @@ -858,7 +836,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \datechange{2019/08/18}{版本 3.09 正式发布} \begin{change} - \item 由于 \lstinline{\elegantpar} 存在一些问题,暂时性删除 \lstinline{\elegantpar} 命令,并提示用户改用 \lstinline{\marginnote} 和 \lstinline{\marginpar} 旁注/边注命令。 + \item \lstinline{\elegantpar} 存在 bug,删除 \lstinline{\elegantpar} 命令,建议用户改用 \lstinline{\marginnote} 和 \lstinline{\marginpar} 旁注命令。 \item 积分操作符统一更改为 \lstinline{esint} 宏包设置; \item 新增目录选项 \lstinline{toc},可选项为单栏 \lstinline{onecol} 和双栏 \lstinline{twocol}; \item 手动增加参考文献选项 \lstinline{cite},可选项为上标形式 \lstinline{super}; @@ -956,7 +934,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \end{change} \nocite{*} -\bibliography{reference} +\printbibliography \appendix \chapter{基本数学工具} diff --git a/macros/latex/contrib/elegantbook/elegantbook-en.pdf b/macros/latex/contrib/elegantbook/elegantbook-en.pdf Binary files differindex 132582d744..d1580ffb4d 100644 --- a/macros/latex/contrib/elegantbook/elegantbook-en.pdf +++ b/macros/latex/contrib/elegantbook/elegantbook-en.pdf diff --git a/macros/latex/contrib/elegantbook/elegantbook-en.tex b/macros/latex/contrib/elegantbook/elegantbook-en.tex index 6b62abc462..739a92f64d 100644 --- a/macros/latex/contrib/elegantbook/elegantbook-en.tex +++ b/macros/latex/contrib/elegantbook/elegantbook-en.tex @@ -1,12 +1,12 @@ -\documentclass[11pt,fancy,authoryear]{elegantbook} +\documentclass[11pt,fancy]{elegantbook} \title{An Elegant \LaTeX{} Template for Books} \subtitle{Classic Elegant\LaTeX{} Template} \author{Ethan Deng \& Liam Huang} \institute{Elegant\LaTeX{} Program} -\date{April 12, 2020} -\version{3.11} +\date{May. 2, 2021} +\version{4.1} \bioinfo{Bio}{Information} \extrainfo{Victory won\rq t come to us unless we go to it. } @@ -14,6 +14,9 @@ \logo{logo-blue.png} \cover{cover.jpg} +\definecolor{customcolor}{RGB}{32,178,170} +\colorlet{coverlinecolor}{customcolor} + \begin{document} @@ -23,6 +26,7 @@ \tableofcontents \mainmatter + \chapter{Elegant\LaTeX{} Templates} Elegant\LaTeX{} Program developers are intended to provide you beautiful, elegant, user-friendly templates. Currently, the Elegant\LaTeX{} is composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper}, designed for typesetting notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to contact us on GitHub \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} or email us at \email{elegantlatex2e@gmail.com}. @@ -40,24 +44,22 @@ Contact Infos: \end{itemize} + \section{ElegantBook Updates} -Version 3.11 is the last version of 3.x, it's base upon 3.10, mainly to resolve \TeX{} Live 2020 compilation errors caused by \lstinline{gbt7714} compatibility issues. What\rq s new in this version: +Version 4.1 is the first version of 3.x, we add support for biblatex, theorem, and multilingual translation. What\rq s new in this version: \begin{enumerate} - \item \textbf{Fix}: Fix \lstinline{natbib option clash} problems caused by \lstinline{gbt7714} updates; - \item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX{} Live 2020; - \item Fix spacing problem in some environments; - \item Add Italian language option, \lstinline{lang=it}. + \item \textbf{! Big Change}: Change the bibliography method from \hologo{BibTeX} to biblatex(with backend \lstinline{biber}); + \item \textbf{! Big Change}: Add support for the default theorem writing method (with optional name and label); + \item Add left and right space; + \item Support hyperlink from the text of TOC; + \item Remove the \hologo{pdfLaTeX} compatiblity check for Chinese. + \item Add multilingual support, for french \lstinline{lang=fr}, dutch \lstinline{lang=nl}, Hungarian \lstinline{lang=hu}, Spanish \lstinline{lang=es}, Mongolian \lstinline{lang=mn} etc. \end{enumerate} - -\begin{note} - If you are using previous version, please delete \lstinline|\hypersetup{pageanchor=true}| and add \lstinline{\frontmatter} after \lstinline{\maketitle} and before \lstinline{\tableofcontents}. Users for 2.x, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/wiki/convert}{conversion}. -\end{note} - \section{Installation and Update} -Both portable version and installation package are available for this template, online usage is optional as well. +Both portable version and installation package are available, online usage is optional as well. \subsection{To Use Templates Online} Visit \href{https://www.overleaf.com/}{Overleaf} to use our template online anywhere and anytime without local installation. To find our template, search \lstinline{elegantlatex} in the \lstinline{templates} or simply visit \href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{search result}, choose the template you prefer and \lstinline{Open as Template} to own a copy yourself to edit freely. To learn more about Overleaf, please refer to \href{https://www.overleaf.com/learn}{Documentation}. @@ -69,14 +71,6 @@ Visit \href{https://www.overleaf.com/}{Overleaf} to use our template online anyw \subsection{To Use Portable Version} For portable version, simply download lastest ElegantBook-master from GitHub or CTAN (to be more accurate, download \lstinline{elegantbook.cls}) and save the file(s) under your working directory. This way of installation is simple and convenient, but you have to manually update \lstinline{cls} now and then. -\subsection{To Use Local Installation Version} -If you are a \TeX{} Live 2019 user, using the \lstinline{tlshell}\footnote{namely, \TeX{} Live Manager} of \TeX{} Live 2019 direct installation package is strongly recommended. Simply search and open \lstinline{tlshell}, click on \lstinline{File -> Load Default Repository} or customize repository by \lstinline{Options}. Wait till the repository loads successfully, search \lstinline{elegantbook} by name, installation and update is just a click away. - -\begin{figure}[htbp] - \centering - \includegraphics[width=0.7\textwidth]{tlshell.png} - \caption{Use \TeX{} Live Shell to Install ElegantBook Template} -\end{figure} \subsection{Update Templates} If you fail to update templates using \lstinline{tlshell}, please use cmd to update all the packages or switch to portable version instead. @@ -90,104 +84,37 @@ tlmgr update --all To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?} \subsection{Other Release Versions} -If you are a \TeX{} Live 2018 user and would like to update to \TeX{} Live 2019, the official solution is to uninstall 2018. If you want to save the bother of uninstallation and installation, please copy \lstinline{elegantbook.cls} to the installation directory of \TeX{} Live 2018 (default: \lstinline|C:\texlive\2018\texmf-dist\tex\latex\elegantbook| ), run \lstinline{texhash} in cmd. - -Excuse me? You are a C\TeX{} user? Sorry, this template is incompatible with C\TeX{}. - -For more details about the installation and usage of \TeX{} Live 2019, the compatibility of C\TeX{} and \TeX{} Live, please refer to OG (Official Guide) and/or \href{https://github.com/OsbertWang/install_latex/releases}{Install LaTeX v5.1} by OsbertWang. - -\section{User\rq s Selected Works Plan} -Eight years have passed since the found of Elegant\LaTeX{} Program. It\rq s an honor that our templates are preferred by a lot of users. Hence, in order to promote more interactions among our users and know more about what you need, we are planning to provide a platform to display selected works of our users on GitHub or our homepage. If you want to show us your work(s), contact us via Email or other ways. Or if you have upload your work(s) on GitHub or Gitee etc., share the URL(s) with us. You can visit current available works \href{https://github.com/ElegantLaTeX/Archive/tree/master/Collections}{here}. +If you are a \TeX{} Live 2018/2019/2020 user and would like to update, the official solution is to uninstall the previous version. If you want to save the bother of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of \TeX{} Live 2021 (default: \lstinline|C:\texlive\2021\texmf-dist\tex\latex\elegantbook| ), run \lstinline{texhash} in cmd. \section{About Pull Request} For some reasons, pull requests will NOT by accepted since May 20, 2019. For those who want to help improve the templates, submit issues or clone to your own repository to modify under LPPL-1.3c. -\section{Recruit Support Members} -Recruit support members for Elegant\LaTeX{} to translate template OGs, maintain wiki entries using Markdown, update Wechat articles. No deadline for this recruitment. - -So far, Elegant\LaTeX{} has four Support Members: -\begin{itemize} - \item OG Translator: \href{https://github.com/peggy2006xzyz}{YPY}; - \item Wiki Maintainer: \href{https://github.com/izinngo}{Ingo Zinngo}, \href{https://github.com/xiaohao890809}{Xiaohao890809}; - \item QQ Group Manager \& FAQ Maintainer: \href{https://github.com/sikouhjw}{Sikouhjw}. -\end{itemize} - -BTW, thank \href{https://github.com/stone-zeng}{Xiangdong Zeng}, \href{https://github.com/latexers}{Zhuluren}, etc. for their help. - -\section{Acknowledgement} -The number of stars on GitHub for ElegantBook reached 100 on May 20, 2019\footnote{372 stars by February 8, 2020!}.Thank China\TeX{} and \href{http://www.latexstudio.net/}{\LaTeX{} studio} for their promotion. \LaTeX{} studio offers tons of valuable posts and templates for discovery. It is the most comprehensive website on \LaTeX{} in China. - -If you like our template, star on GitHub. - -\section{Donation} -To express your love for our templates and/or our developers, please do not hesitate to tip us. Since last release of 3.08, we have received about 1,500 RMB! (The emergence of a millionaire is on the way. Loading... ) -\begin{figure}[!htb] - \centering - \includegraphics[width=0.45\textwidth]{donate.jpg} -\end{figure} - -The explanation right of the tip usage belongs to Elegant\LaTeX{} with no supervision. Feel free to tip us. Those who donate more than 10 RMB will be recorded in the Donation List. Thank all the tippers! - -\begin{table}[!htb] - \centering - \caption{Donation List} - \begin{tabular}{*{4}{>{\scriptsize}c}|*{4}{>{\scriptsize}c}} - \toprule - \textbf{Tipper} & \textbf{Amount} & \textbf{Date} & \textbf{Channel} & \textbf{Tipper} & \textbf{Amount} & \textbf{Date} & \textbf{Channel} \\ - \midrule - Lerh & 10 RMB & 2019/05/15 & Wechat & yueguodipingxian & 10 RMB & 2019/05/15 & Wechat \\ - yinsang & 20 RMB & 2019/05/27 & Wechat & *kong & 10 RMB & 2019/05/30 & Wechat \\ - latexstudio.net & 666 RMB & 2019/06/05 & Alipay & A*n & 40 RMB & 2019/06/15 & Wechat \\ - * xia & 22 RMB & 2019/06/15 & Wechat & * qian & 21 RMB & 2019/06/15 & Wechat \\ - Cassis & 11 RMB & 2019/06/30 & Wechat & * jun & 10 RMB & 2019/07/23 & Wechat \\ - P*u & 50 RMB & 2019/07/30 & Wechat & * meng & 19 RMB & 2019/08/28 & Wechat \\ - Qu Doudou & 10 RMB & 2019/08/28 & Wechat & Li Bo & 100 RMB & 2019/10/06 & Wechat \\ - Njustsll & 10 RMB & 2019/10/11 & Wechat & Liu Zhikuo & 99.99 RMB & 2019/10/15 & Alipay \\ - * tao & 16 RMB & 2019/10/17 & Wechat & Chini & 12 RMB & 2019/10/17 & Alipay \\ - yuanfengjing & 10 RMB & 2019/10/28 & Wechat & Guo Deliang & 88 RMB & 2019/11/03 & Wechat \\ - ziqiangbuxi & 20 RMB & 2019/11/04 & Alipay & dushuzhichong & 20 RMB & 2019/11/18 & Wechat \\ - * deng & 10 RMB & 2019/11/18 & Wechat & * zhe & 20 RMB & 2019/11/18 & Wechat \\ - anonymous & 10 RMB & 2019/11/24 & Wechat & Jiye Qian & 66 RMB & 2019/12/04 & Wechat \\ - * yang & 20 RMB & 2019/12/05 & Wechat & Catcher & 11 RMB & 2019/12/08 & Alipay \\ - xierbotementu & 10 RMB & 2019/12/09 & Alipay & * wei & 10 RMB & 2019/12/09 & Wechat \\ - Simon & 20 RMB & 2019/12/11 & Alipay & liushangqianyi & 66.60 RMB & 2019/12/18 & Alipay \\ - yu & 10 RMB & 2019/12/20 & Alipay & *chen & 15 RMB & 2019/12/20 & Wechat \\ - suifeng & 20 RMB & 2019/12/27 & Alipay & Ws & 23.30 RMB & 2019/12/28 & Wechat \\ - chuba & 100 RMB & 2020/01/02 & Alipay & p*e & 20 RMB & 2020/01/03 & Wechat \\ - Shunmx & 100 RMB & 2020/01/03 & Wechat & hj & 10 RMB & 2020/01/03 & Wechat \\ - F*5 & 10 RMB & 2020/01/03 & Wechat & S*m & 20.20 RMB & 2020/01/03 & Wechat \\ - erdaiqingzhi & 13 RMB & 2020/01/14 & Alipay & *? & 66 RMB & 2020/01/15 & Wechat \\ - Mr. Xiong & 20 RMB & 2020/01/17 & Wechat & *bo & 15 RMB & 2020/01/18 & Wechat \\ - *Zhe & 10 RMB & 2020/02/02 & Wechat & Jackie & 88.80 RMB & 2020/02/09 & Wechat \\ - Henry\_Sun & 50 RMB & 2020/02/14 & Alipay & * Qiao & 50 RMB & 2020/02/21 & Wechat \\ - YunLian & 10 RMB & 2020/03/02 & Alipay & S*y & 10 RMB & 2020/03/15 & Wechat \\ - * Ge & 66.66 RMB & 2020/03/17 & Wechat & K*e & 30 RMB & 2020/03/30 & Wechat\\ - * Yang & 20 RMB & 2020/04/02 & Wechat & Shi*n & 30 RMB & 2020/04/11 & Wechat \\ - \bottomrule - \end{tabular}% - \label{tab:donation}% -\end{table}% - -BTW, we provide Certificate of Donation for those who donated, tippers please leave your name(nickname) and email address for us to send the certificates. - -\begin{figure}[!htb] - \centering - \includegraphics[width=0.7\textwidth]{cert.pdf} -\end{figure} \chapter{ElegantBook Settings} -This template is based on the Standard \LaTeX{} book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX{} Live is recommended. The test environment is Win10 + \TeX{} Live 2019, either \hologo{pdfLaTeX} or \lstinline{XeLaTeX} works fine. \lstinline{XeLaTeX} is preferred for Chinese articles. +This template is based on the Standard \LaTeX{} book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX{} Live is recommended. The test environment is Win10 + \TeX{} Live 2021, either \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine. \hologo{XeLaTeX} is preferred for Chinese articles. \section{Languages} -We defined one option named \lstinline{lang} which has three alternative values, \lstinline{lang=en} (default) , \lstinline{lang=cn} and \lstinline{lang=it}\footnote{Provided by \href{https://github.com/VincentMVV}{VincentMVV}, detail in \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{GitHub: Italian translation}.}. Different values will alter the captions of figure/table, abstract name, refname, etc. You can use this option as +We defined one option named \lstinline{lang} which has two basic values, \lstinline{lang=en} (default) , \lstinline{lang=cn}. Different values will alter the captions of figure/table, abstract name, refname, etc. You can use this option as \begin{lstlisting} \documentclass[en]{elegantbook} \documentclass[lang=en]{elegantbook} \end{lstlisting} +Besides the two basic language translation, our user provide more options, here is a short brief introduction to these translation. Since I am not familiar with these languages, I can't guarantee that the translations are correct, please comment on GitHub if you have some questions. + +\begin{itemize} + \item Italian translation \lstinline{lang=it}, provided by \href{https://github.com/VincentMVV}{VincentMVV} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation}; + \item French translation \lstinline{lang=fr}, provided by \href{https://github.com/abfek66}{abfek66} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation}; + \item Dutch Translation \lstinline{lang=nl}, provided by \href{https://github.com/inktvis75}{inktvis75} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/108}{Dutch Translation}; + \item Hungarian translation \lstinline{lang=hu}, provided by \href{https://github.com/palkotamas}{palkotamas}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/111}{Hungarian translation}; + \item Deutsch translation \lstinline{lang=de}, provided by Lisa, please refer to\href{https://github.com/ElegantLaTeX/ElegantBook/issues/113}{Deutsch translation}; + \item Spanish translation \lstinline{lang=es}, provided by Gustavo A. Corradi, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/133}{Spanish translation}; + \item Mongolian translation \lstinline{lang=mn}, provided by \href{https://github.com/Altantsooj}{Altantsooj}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/137}{Mongolian translation}. +\end{itemize} + \begin{remark} -Chinese Characters are acceptable \textbf{ONLY} in \lstinline{lang=cn}. If you would like to include Chinese characters under (\lstinline{lstlisting}) environment, please use \hologo{XeLaTeX} to compile. +Chinese Characters are acceptable \textbf{ONLY} in \lstinline{lang=cn}. \end{remark} \section{Device Mode Option} @@ -274,6 +201,12 @@ Besides, an extra command \lstinline{\bioinfo} is provided with two options--cap \bioinfo{Username}{115520} \end{lstlisting} +You can change the color of the horizontal bar of the cover by +\begin{lstlisting} + \definecolor{customcolor}{RGB}{32,178,170} + \colorlet{coverlinecolor}{customcolor} +\end{lstlisting} + \subsection{Cover Image} The cover image used in this template is from \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}. The image is completely free and can be used under any circumstance. The cover image size is $1280 \times 1024$. If you would like to change the cover, please crop it according to the size of the cover picture strictly. One free online image clipping site: \href{https://www.fotor.com/cn}{fotor.com}. Feel free to join our QQ Group to get more elegant covers. @@ -317,13 +250,24 @@ In this template, we defined four different theorem class environments \subsection{Theorem Class Environments} Since the template uses the \lstinline{tcolorbox} package to customize the theorem class environments, it is slightly different from the normal theorem environments. The usage is as follows: \begin{lstlisting} -\begin{theorem}{<theorem name>}{<label>} +\begin{theorem}{theorem name}{label text} The content of theorem. \end{theorem} \end{lstlisting} The first parameter \lstinline{<theorem name>} represents the name of the theorem, and the second parameter \lstinline{label} represents the label used in cross-reference with \verb|ref{thm:label}|. Note that cross-references must be prefixed with \lstinline{thm:}. +From version 4.1, you can write your theorem environments as follows: +\begin{lstlisting} +\begin{theorem}[theorem name]\label{thm:label text} + The content of theorem. +\end{theorem} +% or +\begin{theorem} + The content of theorem. +\end{theorem} +\end{lstlisting} + Other theorem class environments with the same usage includes: \begin{table}[htbp] @@ -398,27 +342,62 @@ This template uses \lstinline{tikz} to customize the list environments, with \ls \end{enumerate} \end{minipage} -\section{Bibliography} -This template uses \hologo{BibTeX} to generate the bibliography, the default bibliography style is \lstinline{aer}. Let's take a glance at the citation effect. ~\cite{en1} use data from a major peer-to-peer lending marketplace in China to study whether female and male investors evaluate loan performance differently. +\section{Fonts} +\textcolor{red}{\bfseries Alert} After v3.10, newtx is reset to cm, together with other two options, the \lstinline{math} font option offers: +\begin{enumerate} + \item \lstinline{math=cm}(default), use \LaTeX{} default math font (recommended). + \item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs). + \item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font. +\end{enumerate} -If you want to use \hologo{BibTeX}, you must create a file named \lstinline{reference.bib}, add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, then cite the bibkey in the \lstinline{tex} file. The Bib\TeX{} will automatically generate the bibliography for the reference you cited. If you want to add some noncited reference to the bibliography, you can use -\begin{lstlisting}[frame=single] -\nocite{EINAV2010,Havrylchyk2018} %or include some bibitems -\nocite{*} %include all the bibitems +If you use \lstinline{newtx} fonts, type in: +\begin{lstlisting} +\documentclass[math=newtx]{elegantbook} +\end{lstlisting} + +When you are using \lstinline{newtx}, please pay attention to the hyphens. For instance, +\begin{equation} +\int_{R^q} f(x,y) dy.\emph{of\kern0pt f} +\end{equation} + +The corresponding code is: +\begin{lstlisting} +\begin{equation} + \int_{R^q} f(x,y) dy.\emph{of \kern0pt f} +\end{equation} \end{lstlisting} -Three more options \lstinline{cite=numbers}, \lstinline{cite=super} and \lstinline{cite=authoryear} are available in this new version, with the default setting as \lstinline{numbers} since those major in science and technology use \lstinline{numbers} and/or \lstinline{cite=super} more often. For those who want to use \lstinline{cite=super} or \lstinline{authoryear}, please type in: +\subsection{Symbol Fonts} +Feedback from some 3.08 users claims that error occurs when using our templates with \lstinline{yhmath}, \lstinline{esvect} and other packages. +\begin{lstlisting} +LaTeX Error: +Too many symbol fonts declared. +\end{lstlisting} + +The reason is that the template redefines font for math so that no new math font is allowed to be added. To use \lstinline{yhmath} and/or \lstinline{esvect}, please locate \lstinline{yhmath} or \lstinline{esvect} in \lstinline{elegantbook.cls}, uncomment corresponding related code. + \begin{lstlisting} -\documentclass[cite=super]{elegantbook} % set cite for super style -\documentclass[super]{elegantbook} -\documentclass[cite=authoryear]{elegantbook} % set cite for author-year style -\documentclass[authoryear]{elegantbook} +%%% use yhmath pkg, uncomment following code +% \let\oldwidering\widering +% \let\widering\undefined +% \RequirePackage{yhmath} +% \let\widering\oldwidering + +%%% use esvect pkg, uncomment following code +% \RequirePackage{esvect} \end{lstlisting} -To change the bibliography style, this version introduces \lstinline{bibstyle} with default option apalike, for more options, refer to \href{https://www.overleaf.com/learn/latex/Bibtex_bibliography_styles}{\hologo{BibTeX} Bibliography Styles}. Type in +\section{Bibliography} + +This template uses biblatex to generate the bibliography, the default citestyle and bibliography style are both \lstinline{numeric}. Let's take a glance at the citation effect. ~\cite{en1} use data from a major peer-to-peer lending \cite{en3} marketplace in China to study whether female and male investors evaluate loan performance differently \parencite{en2}. + +If you want to use biblatex, you must create a file named \lstinline{reference.bib}, add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, then cite the bibkey in the \lstinline{tex} file. The biber will automatically generate the bibliography for the reference you cited. + + +To change the bibliography style, this version introduces \lstinline{citestyle} and \lstinline{bibstyle}, please refer to \href{https://ctan.org/pkg/biblatex}{CTAN:biblatex} for more detail about these options. You can change your bibliography style as \begin{lstlisting} -\documentclass[bibstyle=apalike]{elegantbook} +\documentclass[citestyle=numeric-comp, bibstyle=authoryear]{elegantbook} \end{lstlisting} \section{Preface} @@ -431,18 +410,13 @@ The content of introduction. \end{lstlisting} \section{Content Option and Depth} -This version adds an option for content \lstinline{toc}, you can choose either one column(\lstinline{onecol}) or two columns(\lstinline{twocol}). For two columns: +Option for content \lstinline{toc}, you can choose either one column(\lstinline{onecol}) or two columns(\lstinline{twocol}). For two columns: \begin{lstlisting} \documentclass[twocol]{elegantbook} \documentclass[toc=twocol]{elegantbook} \end{lstlisting} -Default content depth is 1, use -\begin{lstlisting} -\setcounter{tocdepth}{2} -\end{lstlisting} -to make it 2. - +Default content depth is 1, use to use \lstinline|\setcounter{tocdepth}{2}|. \section{Introduction Environment} We create a introduction environment to display the structure of chapter. The basic useage is as follows: @@ -471,7 +445,7 @@ You can change the title of this environment by modifying the optional argument \end{introduction} \end{lstlisting} -\section{Problem Set} +%\section{Problem Set} The environment \lstinline{problemset} is used at the end of each chapter to display corresponding exercises. Just type in the following sentences: \begin{lstlisting} \begin{problemset} @@ -537,59 +511,6 @@ For tables and figures, note that floating environment is not allowed. You have \end{remark} -\chapter{Fonts} -Leave one chapter to introduce fonts to help users to solve font problems conveniently. - -\textcolor{red}{\bfseries Alert} After v3.10, newtx is reset to cm and \lstinline{chinesefont} option is added. - -\section{Math Fonts} -This template defines a new command(\lstinline{math}), with three options: -\begin{enumerate} - \item \lstinline{math=cm}(default), use \LaTeX{} default math font (recommended). - \item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs). - \item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font. -\end{enumerate} - -\section{Use newtx fonts} -If you use \lstinline{newtx} fonts, type in: - -\begin{lstlisting} -\documentclass[math=newtx]{elegantbook} -\end{lstlisting} - - -\subsection{Hyphens} -Since the template uses \lstinline{newtx}, please pay attention to the hyphens. For instance, -\begin{equation} -\int_{R^q} f(x,y) dy.\emph{of\kern0pt f} -\end{equation} - -The corresponding code is: -\begin{lstlisting} -\begin{equation} -\int_{R^q} f(x,y) dy.\emph{of \kern0pt f} -\end{equation} -\end{lstlisting} - -\section{Symbol Fonts} -Feedback from some 3.08 users claims that error occurs when using our templates with \lstinline{yhmath}, \lstinline{esvect} and other packages. -\begin{lstlisting} -LaTeX Error: -Too many symbol fonts declared. -\end{lstlisting} - -The reason is that the template redefines font for math so that no new math font is allowed to be added. To use \lstinline{yhmath} and/or \lstinline{esvect}, please locate \lstinline{yhmath} or \lstinline{esvect} in \lstinline{elegantbook.cls}, uncomment corresponding related code. - -\begin{lstlisting} -%%% use yhmath pkg, uncomment following code -% \let\oldwidering\widering -% \let\widering\undefined -% \RequirePackage{yhmath} -% \let\widering\oldwidering - -%%% use esvect pkg, uncomment following code -% \RequirePackage{esvect} -\end{lstlisting} \chapter{ElegantBook Writing Sample} @@ -611,7 +532,7 @@ The reason is that the template redefines font for math so that no new math font We will define the integral of a measurable function in three steps. First, we define the integral of a nonnegative simple function. Let $E$ be the measurable set in $\mathcal{R}^N$. -\begin{definition}{Left Coset}{} +\begin{definition}[Left Coset] Let $H$ be a subgroup of a group~$G$. A \emph{left coset} of $H$ in $G$ is a subset of $G$ that is of the form $xH$, where $x \in G$ and $xH = \{ xh : h \in H \}$. Similarly a \emph{right coset} of $H$ in $G$ is a subset of $G$ that is of the form $Hx$, where $Hx = \{ hx : h \in H \}$ $\hbar$ \end{definition} @@ -621,14 +542,15 @@ Note that a subgroup~$H$ of a group $G$ is itself a left coset of $H$ in $G$. \lipsum[2] -\begin{theorem}{Lagrange's Theorem}{} +\begin{theorem}[Lagrange's Theorem] \label{thm:lg} Let $G$ be a finite group, and let $H$ be a subgroup of $G$. Then the order of $H$ divides the order of $G$. \end{theorem} +\ref{thm:lg} \lipsum[3] -\begin{proposition}{Size of Left Coset}{} +\begin{proposition}[Size of Left Coset] Let $H$ be a finite subgroup of a group $G$. Then each left coset of $H$ in $G$ has the same number of elements as $H$. \end{proposition} @@ -638,7 +560,7 @@ Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and \begin{figure}[htbp] \centering - \includegraphics[width=0.6\textwidth]{scatter.pdf} + \includegraphics[width=0.6\textwidth]{scatter.jpg} \caption{Matplotlib: Scatter Plot Example\label{fig:scatter}} \end{figure} @@ -646,6 +568,10 @@ Regression analysis is a powerful statistical method that allows you to examine Let's continue using our application training example. In this case, we'd want to measure the historical levels of satisfaction with the events from the past three years or so, as well as any information possible in regards to the independent variables. +\section{Second section} +This second section\index{S!section} may include some special word, +and expand the ones already used\index{keywords!used}. + \begin{table}[htbp] \small @@ -681,6 +607,7 @@ Let's continue using our application training example. In this case, we'd want t \item Distributed storage and search. \end{itemize} +%\problemset \begin{problemset} \item Solve the equation $5(- 3x - 2) - (x - 3) = -4(4x + 5) + 13$. \item Find the distance between the points $(-4 , -5)$ and $(-1 , -1)$. @@ -696,9 +623,9 @@ We list some FAQs for users to refer to: \item \question{I want to customize font and background color.} Please use \lstinline{pagecolor} to change background color, refer to \href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{this} to customize font. \item \question{Which version should I choose?} - Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2019. + Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2021. \item \question{Which editor should I choose?} - You can use \TeX{} Live 2019 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2019 + \TeX{}studio is strongly recommended. I myself use VS Code and Sublime Text. Related configurations can be found at \href{https://github.com/EthanDeng/vscode-latex}{vscode-latex} and \href{https://github.com/EthanDeng/sublime-text-latex}{sublime-text-latex}. + You can use \TeX{} Live 2021 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2021 + \TeX{}studio is strongly recommended. I myself use VS Code and Sublime Text. Related configurations can be found at \href{https://github.com/EthanDeng/vscode-latex}{vscode-latex} and \href{https://github.com/EthanDeng/sublime-text-latex}{sublime-text-latex}. \item \question{Hello, we want to use ElegantBook to write a book about machine learning and would like your authorization.} Feel free to use our templates by pointing out our copyright. For other issues, please refer to LPPL-1.3c. If you want to show us your work, share the URL with us afterwards. \item \question{What is cross reference?} @@ -706,20 +633,33 @@ We list some FAQs for users to refer to: \item \question{Is the language for code highlighting optional?} Yes, \lstinline{listings} package is used in ElegantBook, hence language is optional(e.g. \lstinline{language=Python}). For global setting, use \lstinline{lstset}. For more information, please refer to package documentations. \item \question{When will Beamer template (ElegantSlide or ElegantBeamer) forthcoming?} - Since there is an excellent theme \href{https://github.com/matze/mtheme}{Metropolis}, a Beta theme PreElegantSlide is available in QQ group. Feel free to download. A formal version is forthcoming in this year or next year. + Since there is an excellent theme \href{https://github.com/matze/mtheme}{Metropolis}, no plan for Beamer theme. \end{enumerate} \chapter{Version History} -We revised our templates now and then. This section shows the version story of ElegantBook. We have nearly 100 submits and 16 releases on GitHub since uploaded. +We revised our templates now and then. This section shows the version story of ElegantBook. We have nearly 100 submits and 17 releases on GitHub since uploaded. + + +\datechange{2021/05/02}{release of v4.1.} + +\begin{change} + \item \textbf{! Big Change}: Change the bibliography method from \hologo{BibTeX} to biblatex(with backend \lstinline{biber}); + \item \textbf{! Big Change}: Add support for the default theorem writing method (with optional name and label); + \item Add left and right space; + \item Support hyperlink from the text of TOC; + \item Remove the \hologo{pdfLaTeX} compatiblity check for Chinese. + \item Add multilingual support, for french \lstinline{lang=fr}, dutch \lstinline{lang=nl}, Hungarian \lstinline{lang=hu}, Spanish \lstinline{lang=es}, Mongolian \lstinline{lang=mn} etc. +\end{change} \datechange{2020/04/12}{release of v3.11, \textcolor{red}{\textbf{LAST} version of 3.x}.} -\begin{enumerate} - \item \textbf{Fix}: Fix \lstinline{natbib option clash} problems caused by \lstinline{gbt7714} updates; - \item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX{} Live 2020; - \item Fix spacing problem in some environments; - \item Add Italian language option, \lstinline{lang=it}. -\end{enumerate} + +\begin{change} + \item \textbf{! Fix}: Fix \lstinline{natbib option clash} problems caused by \lstinline{gbt7714} updates. + \item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX{} Live 2020. + \item Fix spacing problem in some environments. + \item Introduce language option for Italian, \lstinline{lang=it}. +\end{change} \datechange{2020/02/10}{release of v3.10} @@ -748,8 +688,10 @@ We revised our templates now and then. This section shows the version story of E \end{change} \nocite{en2,en3} -\bibliography{reference} +\printbibliography + \appendix +% \renewcommand\chaptername{\eappendix \thechapter} \chapter{Mathematical Tools} @@ -763,4 +705,5 @@ This appendix covers some of the basic mathematics used in econometrics. We brie \sum_{i=1}^n x_i \equiv x_1 + x_2 +\cdots + x_n \end{equation} + \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/elegantbook/elegantbook.cls b/macros/latex/contrib/elegantbook/elegantbook.cls index 08e6716fca..ae05a7c3a5 100644 --- a/macros/latex/contrib/elegantbook/elegantbook.cls +++ b/macros/latex/contrib/elegantbook/elegantbook.cls @@ -1,6 +1,6 @@ %%%%%%%%%%%%%%%%%%%%%% %% start of file `elegantbook.cls'. -%% Copyright 2013-2020 ElegantLaTeX (elegantlatex2e@gmail.com) +%% Copyright 2013-2021 ElegantLaTeX (elegantlatex2e@gmail.com) %% %% This work may be distributed and/or modified freely %% available at https://github.com/ElegantLaTeX/ElegantBook @@ -8,7 +8,7 @@ %%%%%%%%%%%%%%%%%%%%% % % !Mode:: "TeX:UTF-8" \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{elegantbook}[2020/04/12 v3.11 ElegantBook document class] +\ProvidesClass{elegantbook}[2021/05/02 v4.1 ElegantBook document class] \RequirePackage{kvoptions} \RequirePackage{etoolbox} @@ -53,12 +53,9 @@ \DeclareVoidOption{normal}{\ekv{device=normal}} \DeclareVoidOption{pad}{\ekv{device=pad}} -\DeclareStringOption[numbers]{cite} -\DeclareVoidOption{numbers}{\ekv{cite=numbers}} -\DeclareVoidOption{authoryear}{\ekv{cite=authoryear}} -\DeclareVoidOption{super}{\ekv{cite=super}} +\DeclareStringOption[numeric-comp]{citestyle} +\DeclareStringOption[numeric]{bibstyle} -\DeclareStringOption[apalike]{bibstyle} \DeclareVoidOption{newtx}{\ekv{math=newtx}} \DeclareVoidOption{mtpro2}{\ekv{math=mtpro2}} @@ -67,9 +64,11 @@ \DeclareVoidOption{margintrue}{\ekv{marginpar=margintrue}} \DeclareVoidOption{marginfalse}{\ekv{marginpar=marginfalse}} + \DeclareVoidOption{onecol}{\ekv{toc=onecol}} \DeclareVoidOption{twocol}{\ekv{toc=twocol}} + % ----- Math option ----- \newcommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}} @@ -86,6 +85,10 @@ \LoadClass[a4paper,oneside]{book} \RequirePackage{setspace} + +\RequirePackage{csquotes} + + \RequirePackage{hyperref} \hypersetup{ breaklinks, @@ -110,6 +113,7 @@ \geometry{ a4paper, top=25.4mm, bottom=25.4mm, + left=20mm, right=20mm, headheight=2.17cm, headsep=4mm, footskip=12mm @@ -137,6 +141,7 @@ }{\relax} \setcounter{tocdepth}{1} +\renewcommand{\baselinestretch}{1.2} \PassOptionsToPackage{no-math}{fontspec} \RequirePackage{iftex} @@ -167,7 +172,15 @@ \fi \AfterEndPreamble{ % \renewcommand{\itshape}{\kaishu} - \setlength\parindent{2\ccwd}}}{\relax} + \setlength\parindent{2\ccwd}} +}{\relax} + +\ifcsname heiti\endcsname + \newcommand{\cbfseries}{\heiti} +\else + \newcommand{\cbfseries}{\bfseries} +\fi + \ifcsname kaishu\endcsname \newcommand{\citshape}{\kaishu} @@ -210,7 +223,7 @@ % ----- Handle Colors ----- %% 章节以及页脚图形 -\RequirePackage{xcolor} +\RequirePackage[table]{xcolor} \ifdefstring{\ELEGANT@color}{green}{ \definecolor{structurecolor}{RGB}{0,120,2}% \definecolor{main}{RGB}{0,120,2}% @@ -271,6 +284,8 @@ % corlor definition \definecolor{winered}{rgb}{0.5,0,0} \definecolor{bule}{RGB}{18,29,57} +\colorlet{coverlinecolor}{second} + % ----- Title Style ----- \ifdefstring{\ELEGANT@titlestyle}{hang}{\def\style{hang}}{\relax} @@ -295,15 +310,12 @@ \newcommand{\question}[1]{{\par\citshape #1}\\[0.2ex]} -\ifdefstring{\ELEGANT@lang}{cn}{\relax}{ - \RequirePackage[\ELEGANT@cite,sort&compress]{natbib}} - \RequirePackage{enumerate} % list/itemize/enumerate setting \RequirePackage[shortlabels,inline]{enumitem} \setlist{nolistsep} -\RequirePackage[font=small,labelfont={bf,color=structurecolor}]{caption} +\RequirePackage[labelfont={bf,color=structurecolor}]{caption} \captionsetup[table]{skip=3pt} \captionsetup[figure]{skip=3pt} @@ -314,18 +326,7 @@ \setlength{\footnotesep}{12pt} } -\ifdefstring{\ELEGANT@toc}{twocol}{ -\renewcommand{\tableofcontents}{% -\setlength{\columnsep}{2em} -%\setlength{\columnseprule}{.8pt} -\begin{multicols}{2}[\chapter*{\contentsname}]% - \@starttoc{toc}% -\end{multicols}} -}{\relax} - -%% 常用宏包 -\linespread{1.3} \RequirePackage{graphicx} %\RequirePackage{enumerate} @@ -334,11 +335,24 @@ % \renewcommand{\qed}{\hfill\ensuremath{\square}} \RequirePackage{booktabs} \RequirePackage{multicol,multirow} -\RequirePackage{xcolor} + \RequirePackage{fancyvrb} \RequirePackage{makecell,lipsum,hologo} %%中文结构名字 + +\RequirePackage[ + backend=biber, + citestyle=\ELEGANT@citestyle, + bibstyle=\ELEGANT@bibstyle]{biblatex} + + + +%% 章节设置 + +\RequirePackage{appendix} + \ifdefstring{\ELEGANT@lang}{cn}{ + \renewcommand{\baselinestretch}{1.3} \renewcommand{\contentsname}{目录} \renewcommand{\figurename}{图} \renewcommand{\tablename}{表} @@ -347,26 +361,19 @@ \renewcommand{\listfigurename}{插图目录} \renewcommand{\listtablename}{表格目录} \renewcommand{\bibname}{参考文献} - \renewcommand{\appendixname}{附录~\thechapter} + \renewcommand{\appendixname}{附录} \renewcommand{\indexname}{索\hspace{2em}引} \newcommand\figref[1]{\textbf{图}~\ref{#1}} \newcommand\tabref[1]{\textbf{表}~\ref{#1}} \ifdefstring{\ELEGANT@scheme}{chinese}{ - \renewcommand{\chaptername}{第~\zhnumber{\arabic{chapter}}~章}}{ - \renewcommand{\chaptername}{第~\thechapter{}~章}} + \renewcommand{\chaptername}{第\zhnumber{\arabic{chapter}}章}}{ + \renewcommand{\chaptername}{第 \thechapter{} 章}} \newcommand{\authorname}{\citshape 作者:} \newcommand{\institutename}{\citshape 组织:} \newcommand{\datename}{\citshape 时间:} \newcommand{\versionname}{\citshape 版本:} - \RequirePackage{gbt7714} - \ifdefstring{\ELEGANT@cite}{authoryear}{ - \bibliographystyle{gbt7714-author-year}}{ - \bibliographystyle{gbt7714-numerical}} - \ifdefstring{\ELEGANT@cite}{numbers}{ - \citestyle{numbers}}{\relax} \newcommand{\notename}{笔记} \renewcommand*{\proofname}{证明} - \newcommand{\problemname}{例题} \newcommand{\definitionname}{定义} \newcommand{\theoremname}{定理} \newcommand{\axiomname}{公理} @@ -374,28 +381,30 @@ \newcommand{\lemmaname}{引理} \newcommand{\propositionname}{命题} \newcommand{\corollaryname}{推论} - \newcommand{\examplename}{例} - \newcommand{\exercisename}{练习} + \newcommand{\examplename}{例题} % + \newcommand{\instancename}{示例} % + \newcommand{\problemname}{问题} % 问题 + \newcommand{\exercisename}{练习} % 练习=习题 \newcommand{\remarkname}{注} \newcommand{\assumptionname}{假设} \newcommand{\conclusionname}{结论} \newcommand{\solutionname}{解} \newcommand{\propertyname}{性质} \newcommand{\introductionname}{内容提要} - \newcommand{\problemsetname}{习题} \newcommand\bioinfo[2]{\gdef\@bioinfo{{\citshape #1}:#2}} \newcommand{\updatename}{更新:} - \newcommand{\historyname}{版本更新历史}}{\relax} + \newcommand{\historyname}{版本更新历史} + }{\relax} \ifdefstring{\ELEGANT@lang}{en}{ \setlength\parindent{2em} \newcommand\figref[1]{\textbf{Figure}~\ref{#1}} \newcommand\tabref[1]{\textbf{Table}~\ref{#1}} \renewcommand{\chaptername}{Chapter \thechapter} + \renewcommand{\partname}{\color{structurecolor} Part} \newcommand{\authorname}{\textbf{Author: }} \newcommand{\institutename}{\textbf{Institute: }} \newcommand{\datename}{\textbf{Date: }} \newcommand{\versionname}{\textbf{Version: }} - \bibliographystyle{\ELEGANT@bibstyle} \newcommand{\notename}{Note} \newcommand{\proofname}{Proof} \newcommand{\problemname}{Problem} @@ -414,23 +423,25 @@ \newcommand{\solutionname}{Solution} \newcommand{\propertyname}{Property} \newcommand{\introductionname}{Introduction} - \newcommand{\problemsetname}{Exercise} + \renewcommand{\appendixname}{Appendix} + % \newcommand{\problemsetname}{Exercise} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Updates:} \newcommand{\historyname}{Version History} }{\relax} \ifdefstring{\ELEGANT@lang}{it}{ + % \RequirePackage[utf8]{inputenc} \RequirePackage[italian]{babel} + % \RequirePackage[T1]{fontenc} \setlength\parindent{2em} \newcommand\figref[1]{\textbf{Figura}~\ref{#1}} \newcommand\tabref[1]{\textbf{Tabella}~\ref{#1}} - \renewcommand{\chaptername}{Capitolo \thechapter} + \renewcommand{\chaptername}{Chapter \thechapter} \newcommand{\authorname}{\textbf{Autore: }} \newcommand{\institutename}{\textbf{Istituto: }} \newcommand{\datename}{\textbf{Data: }} \newcommand{\versionname}{\textbf{Versione: }} - \bibliographystyle{\ELEGANT@bibstyle} \newcommand{\notename}{Nota} \newcommand{\proofname}{Dimostrazione} \newcommand{\problemname}{Problema} @@ -449,27 +460,229 @@ \newcommand{\solutionname}{Soluzione} \newcommand{\propertyname}{Proprietà} \newcommand{\introductionname}{Introduzione} - \newcommand{\problemsetname}{Esercizio} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Aggiornamenti:} \newcommand{\historyname}{Cronologia delle versioni} }{\relax} -\setlength{\bibsep}{0.0pt} -\def\bibfont{\footnotesize} +\ifdefstring{\ELEGANT@lang}{fr}{ + \RequirePackage[utf8]{inputenc} + \RequirePackage[T1]{fontenc} + \RequirePackage[french]{babel} + \setlength\parindent{2em} + \renewcommand\figref[1]{\textbf{Figure}\ref{#1}} + \renewcommand\tabref[1]{\textbf{Tableau}\ref{#1}} + \renewcommand{\chaptername}{Chapitre \thechapter} + \renewcommand{\authorname}{\textbf{Auteur: }} + \renewcommand{\institutename}{\textbf{Institut: }} + \renewcommand{\datename}{\textbf{Date: }} + \renewcommand{\versionname}{\textbf{Version: }} + \renewcommand{\notename}{Note} + \renewcommand{\proofname}{Démonstration} + \renewcommand{\problemname}{Problème} + \renewcommand{\definitionname}{Définition} + \renewcommand{\theoremname}{Théorème} + \renewcommand{\axiomname}{Axiôme} + \renewcommand{\postulatename}{Postulat} + \renewcommand{\lemmaname}{Lemme} + \renewcommand{\propositionname}{Proposition} + \renewcommand{\corollaryname}{Corollaire} + \renewcommand{\examplename}{Exemple} + \renewcommand{\exercisename}{Exercice} + \renewcommand{\remarkname}{Remarque} + \renewcommand{\assumptionname}{Supposition} + \renewcommand{\conclusionname}{Conclusion} + \renewcommand{\solutionname}{Solution} + \renewcommand{\propertyname}{Propriété} + \renewcommand{\introductionname}{Introduction} + \renewcommand{\problemsetname}{Exercice} + \renewcommand{\updatename}{Mises à jour:} + \renewcommand{\historyname}{Historique des versions} +}{\relax} + + +\ifdefstring{\ELEGANT@lang}{nl}{ + \RequirePackage[dutch]{babel} + \setlength\parindent{2em} + \newcommand\figref[1]{\textbf{Figuur}~\ref{#1}} + \newcommand\tabref[1]{\textbf{Tabel}~\ref{#1}} + \renewcommand{\chaptername}{Hoofdstuk \arabic{chapter}} + \newcommand{\authorname}{\textbf{Auteur: }} + \newcommand{\institutename}{\textbf{Instituut: }} + \newcommand{\datename}{\textbf{Datum: }} + \newcommand{\versionname}{\textbf{Versie: }} + \newcommand{\notename}{Opmerking} + \newcommand{\proofname}{Bewijs} + \newcommand{\problemname}{Probleem} + \newcommand{\definitionname}{Definitie} + \newcommand{\theoremname}{Stelling} + \newcommand{\axiomname}{Uitgangspunt} + \newcommand{\postulatename}{Hypothese} + \newcommand{\lemmaname}{Lemma} + \newcommand{\propositionname}{Voorstel} + \newcommand{\corollaryname}{Gevolgtrekking} + \newcommand{\examplename}{Voorbeeld} + \newcommand{\exercisename}{Oefening} + \newcommand{\remarkname}{Commentaar} + \newcommand{\assumptionname}{Veronderstelling} + \newcommand{\conclusionname}{Besluit} + \newcommand{\solutionname}{Oplossing} + \newcommand{\propertyname}{Eigenschap} + \newcommand{\introductionname}{Introductie} + \newcommand{\problemsetname}{Probleemcomplex} + \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} + \newcommand{\updatename}{Update:} + \newcommand{\historyname}{Versie Geschiedenis} +}{\relax} + + +\ifdefstring{\ELEGANT@lang}{hu}{ + \RequirePackage[magyar]{babel} + \setlength\parindent{2em} + \newcommand\figref[1]{\ref{#1}~\textbf{Ábra}} + \newcommand\tabref[1]{\ref{#1}~\textbf{Táblázat}} + \renewcommand{\chaptername}{\thechapter ~ fejezet} + \newcommand{\authorname}{\textbf{Szerző: }} + \newcommand{\institutename}{\textbf{Intézmény: }} + \newcommand{\datename}{\textbf{Dátum: }} + \newcommand{\versionname}{\textbf{Verziószám: }} + \newcommand{\notename}{Jegyzet} + \newcommand{\proofname}{Bizonyítás} + \newcommand{\problemname}{Probléma} + \newcommand{\definitionname}{Definíció} + \newcommand{\theoremname}{Tétel} + \newcommand{\axiomname}{Axióma} + \newcommand{\postulatename}{Követelmény} + \newcommand{\lemmaname}{Lemma} + \newcommand{\propositionname}{Előzmény} + \newcommand{\corollaryname}{Következmény} + \newcommand{\examplename}{Példa} + \newcommand{\exercisename}{Feladat} + \newcommand{\remarkname}{Megjegyzés} + \newcommand{\assumptionname}{Sejtés} + \newcommand{\conclusionname}{Összefoglalás} + \newcommand{\solutionname}{Megoldás} + \newcommand{\propertyname}{Tulajdonság} + \newcommand{\introductionname}{Bevezetés} + \newcommand{\problemsetname}{Feladatok} + \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} + \newcommand{\updatename}{Frissítve:} + \newcommand{\historyname}{Korábbi verziók} +}{\relax} + +\ifdefstring{\ELEGANT@lang}{de}{ + \setlength\parindent{2em} + \renewcommand{\contentsname}{Inhaltsverzeichnis} + \newcommand\figref[1]{\textbf{Figur}~\ref{#1}} + \newcommand\tabref[1]{\textbf{Tabelle}~\ref{#1}} + \renewcommand{\partname}{\color{structurecolor} Teil} + \renewcommand{\listfigurename}{Abbildungsverzeichnis} + \renewcommand{\listtablename}{Tabellenverzeichnis} + \renewcommand{\bibname}{Bibliographie} + \renewcommand{\appendixname}{Anhang} + \renewcommand{\chaptername}{Kapitel \thechapter} + \newcommand{\authorname}{\textbf{Autor: }} + \newcommand{\institutename}{\textbf{Institut: }} + \newcommand{\datename}{\textbf{Datum: }} + \newcommand{\versionname}{\textbf{Version: }} + \newcommand{\notename}{Notiz} + \newcommand{\proofname}{Beweis} + \newcommand{\problemname}{Problem} + \newcommand{\definitionname}{Definition} + \newcommand{\theoremname}{Theorem} + \newcommand{\axiomname}{Axiom} + \newcommand{\postulatename}{Postulat} + \newcommand{\lemmaname}{Lemma} + \newcommand{\propositionname}{Behauptung} + \newcommand{\corollaryname}{Corollary} + \newcommand{\examplename}{Beispiel} + \newcommand{\instancename}{Beispiel} % + \newcommand{\exercisename}{\"{U}bung} + \newcommand{\remarkname}{Anmerkung} + \newcommand{\assumptionname}{Annahme} + \newcommand{\conclusionname}{Abschluss} + \newcommand{\solutionname}{Aufl\"{o}sung} + \newcommand{\propertyname}{Property} + \newcommand{\introductionname}{Einleitung} + \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} + \newcommand{\updatename}{Updates:} + \newcommand{\historyname}{Version der Geschichte} +}{\relax} + +\ifdefstring{\ELEGANT@lang}{es}{ + \RequirePackage[spanish]{babel} + \setlength\parindent{2em} + \newcommand\figref[1]{\textbf{Figura}~\ref{#1}} + \newcommand\tabref[1]{\textbf{Tabla}~\ref{#1}} + \renewcommand{\spanishchaptername}{Capítulo \thechapter} + \newcommand{\authorname}{\textbf{Autor: }} + \newcommand{\institutename}{\textbf{Instituto: }} + \newcommand{\datename}{\textbf{Fecha: }} + \newcommand{\versionname}{\textbf{Versión: }} + \newcommand{\notename}{Nota} + \newcommand{\proofname}{Demostración} + \newcommand{\problemname}{Problema} + \newcommand{\definitionname}{Definición} + \newcommand{\theoremname}{Teorema} + \newcommand{\axiomname}{Axioma} + \newcommand{\postulatename}{Postulado} + \newcommand{\lemmaname}{Lema} + \newcommand{\propositionname}{Proposición} + \newcommand{\corollaryname}{Corolario} + \newcommand{\examplename}{Ejemplo} + \newcommand{\exercisename}{Ejercicio} + \newcommand{\remarkname}{Comentario} + \newcommand{\assumptionname}{Asunto} + \newcommand{\conclusionname}{Conclusión} + \newcommand{\solutionname}{Solución} + \newcommand{\propertyname}{Propiedad} + \newcommand{\introductionname}{Introducción} + \newcommand{\problemsetname}{Ejercicio} + \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} + \newcommand{\updatename}{Actualización:} + \newcommand{\historyname}{Historial de versiones} +}{\relax} -\RequirePackage{xpatch} -\xpatchcmd{\part}{ - \thispagestyle{plain}}{ - \thispagestyle{plain}}{}{} -\xpatchcmd{\@endpart}{ - \vfil\newpage}{ - \vfil\newpage}{}{} +\ifdefstring{\ELEGANT@lang}{mn}{ + \RequirePackage[mongolian]{babel} + \RequirePackage[utf8]{inputenc} + \RequirePackage[T2A]{fontenc} + \setlength\parindent{2em} + \newcommand\figref[1]{\textbf{Зураг}\ref{#1}} + \newcommand\tabref[1]{\textbf{Хүснэгт}\ref{#1}} + \renewcommand{\chaptername}{Бүлэг \thechapter} + \newcommand{\authorname}{\textbf{Зохиогч: }} + \newcommand{\institutename}{\textbf{Сургууль: }} + \newcommand{\datename}{\textbf{Огноо: }} + \newcommand{\versionname}{\textbf{Хувилбар: }} + \newcommand{\notename}{Тэмдэглэл} + \newcommand{\proofname}{Баталгаа} + \newcommand{\problemname}{Бодлого} + \newcommand{\definitionname}{Тодорхойлолт} + \newcommand{\theoremname}{Томьёо} + \newcommand{\axiomname}{Аксиом} + \newcommand{\postulatename}{Постулат} + \newcommand{\lemmaname}{Лемма} + \newcommand{\propositionname}{Таамаглал} + \newcommand{\corollaryname}{Үр дүн} + \newcommand{\examplename}{Жишээ} + \newcommand{\exercisename}{Дасгал} + \newcommand{\remarkname}{Тайлбар} + \newcommand{\assumptionname}{Урьдчилсан нөхцөл} + \newcommand{\conclusionname}{Дүгнэлт} + \newcommand{\solutionname}{Хариулт} + \newcommand{\propertyname}{Шинж чанар} + \newcommand{\introductionname}{Удиртгал} + \newcommand{\problemsetname}{Бодлогууд} + \newcommand\bioinfo[2]{\gdef@bioinfo{\textbf{#1}: #2}} + \newcommand{\updatename}{Шинэчлэлтүүд:} + \newcommand{\historyname}{Хувилбарын түүх} +}{\relax} \graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}} -\usepackage{tikz} %% load tikz without tikz -\usetikzlibrary{backgrounds,calc,shadows} +\RequirePackage{tikz} %% load tikz without tikz +\usetikzlibrary{backgrounds,calc,shadows,positioning,fit} \newcommand*\circled[1]{\tikz[baseline=(char.base)]{ \node[shape=circle,draw,inner sep=1pt] (char) {#1};}} % https://tex.stackexchange.com/questions/7032/good-way-to-make-textcircled-numbers @@ -486,16 +699,12 @@ \setlist[itemize,3]{label={\eitemiii}} -%% 章节设置 \RequirePackage[center,pagestyles]{titlesec} \RequirePackage{apptools} -\RequirePackage[toc,page,title,titletoc]{appendix} - \setcounter{secnumdepth}{5} - -\titleformat{\chapter}[\style]{\bfseries} -{\filcenter\LARGE\enspace\bfseries{\color{structurecolor}\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\bfseries\color{structurecolor}\LARGE\filcenter}[] - +\titleformat{\chapter}[\style]{\bfseries}{ + \filcenter\LARGE\enspace\bfseries{\color{structurecolor} \IfAppendix{\appendixname\;\thechapter}{\chaptername}\;}}{1pt}{ + \LARGE\bfseries\color{structurecolor}\filcenter}[] \titleformat{\section}[hang]{\bfseries}{ \Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{% \color{structurecolor}\Large\bfseries\filright} @@ -506,15 +715,15 @@ \large\bfseries\color{structurecolor}\thesubsubsection\enspace}{1pt}{% \color{structurecolor}\large\bfseries\filright} - \titlespacing{\chapter}{0pt}{-20pt}{1.3\baselineskip} %\titlespacing{\subsection}{0pt}{0.5\baselineskip}{-\baselineskip} + + + %%define the note and proof environment \RequirePackage{pifont,manfnt,bbding} - \RequirePackage[many]{tcolorbox} - % \newlength{\normalparindent} % \setlength{\normalparindent}{\parindent} \ifdefstring{\ELEGANT@mode}{fancy}{ @@ -564,15 +773,42 @@ overlay unbroken and last={ \node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) { \textcolor{third}{$\spadesuit$}};}},} + % \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def} + \DeclareTColorBox[auto counter,number within=chapter]{definition}{ o t\label g }{ + common,defstyle, + IfValueTF={#1}{title={\definitionname~\thetcbcounter\ (#1)}}{title=\definitionname~\thetcbcounter}, + IfBooleanTF={#2}{label=#3}{}} + % \newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm} + \DeclareTColorBox[auto counter,number within=chapter]{theorem}{ o t\label g }{ + common,thmstyle, + IfValueTF={#1}{title={\theoremname~\thetcbcounter\ (#1)}}{title=\theoremname~\thetcbcounter}, + IfBooleanTF={#2}{label=#3}{}} + % \newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos} + \DeclareTColorBox[auto counter,number within=chapter]{postulate}{ o t\label g }{ + common,thmstyle, + IfValueTF={#1}{title={\postulatename~\thetcbcounter\ (#1)}}{title=\postulatename~\thetcbcounter}, + IfBooleanTF={#2}{label=#3}{}} + % \newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi} + \DeclareTColorBox[auto counter,number within=chapter]{axiom}{ o t\label g }{ + common,thmstyle, + IfValueTF={#1}{title={\axiomname~\thetcbcounter\ (#1)}}{title=\axiomname~\thetcbcounter}, + IfBooleanTF={#2}{label=#3}{}} + % \newtcbtheorem[auto counter,number within=chapter]{corollary}{\corollaryname}{thmstyle}{cor} + \DeclareTColorBox[auto counter,number within=chapter]{corollary}{ o t\label g }{ + common,thmstyle, + IfValueTF={#1}{title={\corollaryname~\thetcbcounter\ (#1)}}{title=\corollaryname~\thetcbcounter}, + IfBooleanTF={#2}{label=#3}{}} + % \newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem} + \DeclareTColorBox[auto counter,number within=chapter]{lemma}{ o t\label g }{ + common,thmstyle, + IfValueTF={#1}{title={\lemmaname~\thetcbcounter\ (#1)}}{title=\lemmaname~\thetcbcounter}, + IfBooleanTF={#2}{label=#3}{}} + % \newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro} + \DeclareTColorBox[auto counter,number within=chapter]{proposition}{ o t\label g }{ + common,propstyle, + IfValueTF={#1}{title={\propositionname~\thetcbcounter\ (#1)}}{title=\propositionname~\thetcbcounter}, + IfBooleanTF={#2}{label=#3}{}}}{\relax} - \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def} - \newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm} - \newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos} - \newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi} - \newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro} - \newtcbtheorem[auto counter,number within=chapter]{corollary}{\corollaryname}{thmstyle}{cor} - \newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem} -}{\relax} \ifdefstring{\ELEGANT@mode}{simple}{ \let\openbox\relax @@ -580,56 +816,28 @@ \let\proof\relax % \let\proofname\relax \let\endproof\relax - + % declare a new theorem style - \newtheoremstyle{edefstyle}{3pt}{3pt}{\citshape}{-3pt}{ + \newtheoremstyle{defstyle}{3pt}{3pt}{\citshape}{-3pt}{ \bfseries\color{main}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}} - \newtheoremstyle{ethmstyle}{3pt}{3pt}{\citshape}{-3pt}{ + \newtheoremstyle{thmstyle}{3pt}{3pt}{\citshape}{-3pt}{ \bfseries\color{second}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}} - \newtheoremstyle{eprostyle}{3pt}{3pt}{\citshape}{-3pt}{ + \newtheoremstyle{prostyle}{3pt}{3pt}{\citshape}{-3pt}{ \bfseries\color{third}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}} - \theoremstyle{edefstyle} % definition style - - \newtheorem{edefinition}{\definitionname}[chapter] - \newenvironment{definition}[2]{ - \ifstrempty{#1}{\edefinition}{\edefinition[#1]}\ifstrempty{#2}{}{\label{def:#2}}}{ - \endedefinition} - - - \theoremstyle{ethmstyle} %theorem style - - \newtheorem{etheorem}{\theoremname}[chapter] - \newenvironment{theorem}[2]{ - \ignorespaces\ifstrempty{#1}{\etheorem}{\etheorem[#1]}\ifstrempty{#2}{}{\label{thm:#2}}}{ - \endetheorem} - - \newtheorem{elemma}{\lemmaname}[chapter] - \newenvironment{lemma}[2]{ - \ignorespaces\ifstrempty{#1}{\elemma}{\elemma[#1]}\ifstrempty{#2}{}{\label{lem:#2}}}{ - \endelemma} - - \newtheorem{ecorollary}{\corollaryname}[chapter] - \newenvironment{corollary}[2]{ - \ignorespaces\ifstrempty{#1}{\ecorollary}{\ecorollary[#1]}\ifstrempty{#2}{}{\label{cor:#2}}}{ - \endecorollary} - - \newtheorem{epostulate}{\postulatename}[chapter] - \newenvironment{postulate}[2]{ - \ifstrempty{#1}{\epostulate}{\epostulate[#1]}\ifstrempty{#2}{}{\label{pos:#2}}}{ - \endepostulate} - - \newtheorem{eaxiom}{\axiomname}[chapter] - \newenvironment{axiom}[2]{ - \ifstrempty{#1}{\eaxiom}{\eaxiom[#1]}\ifstrempty{#2}{}{\label{axi:#2}}}{ - \endaxiom} - - \theoremstyle{eprostyle} - \newtheorem{eproposition}{\propositionname}[chapter] - \newenvironment{proposition}[2]{ - \ifstrempty{#1}{\eproposition}{\eproposition[#1]}\ifstrempty{#2}{}{\label{pro:#2}}}{ - \endeproposition} + \theoremstyle{defstyle} % definition style + \newtheorem{definition}{\definitionname}[chapter] + + \theoremstyle{thmstyle} %theorem style + \newtheorem{theorem}{\theoremname}[chapter] + \newtheorem{lemma}{\lemmaname}[chapter] + \newtheorem{corollary}{\corollaryname}[chapter] + \newtheorem{postulate}{\postulatename}[chapter] + \newtheorem{axiom}{\axiomname}[chapter] + + \theoremstyle{prostyle} % proposition style + \newtheorem{proposition}{\propositionname}[chapter] }{\relax} % main(green-def): example exercise problem solution @@ -712,9 +920,12 @@ \end{tcolorbox}} \RequirePackage{adforn} -\newenvironment{problemset}[1][\chaptername~\problemsetname]{ + +\newenvironment{problemset}[1][\chaptername~\;\exercisename]{ \begin{center} - \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\chaptername\;\problemsetname}{\problemsetname}} + \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\chaptername\;\exercisename}{\exercisename}} + % \markboth{#1}{\rightmark} + \markright{#1} \textcolor{structurecolor}{\Large\bfseries\adftripleflourishleft~#1~\adftripleflourishright} \end{center} \begin{enumerate}}{ @@ -739,8 +950,8 @@ \fancyfoot[c]{\color{structurecolor}\scriptsize\thepage} \if@twoside - \fancyhead[ER]{\color{structurecolor}\cnormal\leftmark} - \fancyhead[OL]{\color{structurecolor}\cnormal\rightmark} + \fancyhead[EL]{\color{structurecolor}\cnormal\leftmark} + \fancyhead[OR]{\color{structurecolor}\cnormal\rightmark} \else \fancyhead[R]{\color{structurecolor}\cnormal\rightmark} \fi @@ -750,10 +961,10 @@ \renewcommand{\headrulewidth}{1pt} % \renewcommand{\headrule}{} \fancypagestyle{plain}{\renewcommand{\headrulewidth}{0pt}\fancyhf{}\renewcommand{\headrule}{}} -\renewcommand{\sectionmark}[1]{\markright{\thesection\, #1}{} } -\renewcommand{\chaptermark}[1]{\markboth{\chaptername \, #1\,}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\, #1}{}} +\renewcommand{\chaptermark}[1]{\markboth{\chaptername\, #1}{}} + -\renewcommand{\baselinestretch}{1.35} \renewcommand*{\maketitle}{% \hypersetup{pageanchor=false} @@ -776,7 +987,7 @@ \fi }{\relax} \setlength{\fboxsep}{0pt} - \colorbox{second}{\makebox[\linewidth][c]{\shortstack[c]{\vspace{0.5in}}}} + \colorbox{coverlinecolor}{\makebox[\linewidth][c]{\shortstack[c]{\vspace{0.5in}}}} \vfill \vskip-2ex \hspace{2em} @@ -826,6 +1037,7 @@ \thispagestyle{empty}} +\newcommand{\dollar}{\mbox{\textdollar}} \RequirePackage{listings} \renewcommand{\ttdefault}{cmtt} @@ -842,11 +1054,11 @@ \lstset{language=[LaTeX]TeX, texcsstyle=*\color{winered}, numbers=none, - mathescape, + mathescape=false, breaklines=true, keywordstyle=\color{winered}, commentstyle=\color{gray}, - emph={elegantpaper,fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,natbib,pgfornament}, + emph={elegantpaper,fontenc,fontspec,xeCJK,citestyle,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,natbib,pgfornament}, emphstyle={\color{frenchplum}}, morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,definecolor,extrainfo,logo,cover,subtitle,appendix,chapter,hypersetup,mainmatter,frontmatter,tableofcontents,elegantpar,heiti,kaishu,lstset,pagecolor,zhnumber,marginpar,part,equote,marginnote,bioinfo,datechange,listofchange,lvert,lastpage,songti,heiti,fangsong,setCJKfamilyfont,textbf}, frame=single, @@ -863,8 +1075,9 @@ % add the list of change history \newcommand{\dateinfoline}[2]{ \noindent\makebox[0pt][r]{% - \makebox[-5em][r]{% - \textbf{\textcolor{structurecolor}{#1}}}\quad}% + \makebox[-3em][r]{% + \small + \textbf{\textcolor{structurecolor}{#1}}}\;\;}% {\citshape\updatename\ignorespaces#2}} \newcommand{\datechange}[2]{% @@ -884,4 +1097,31 @@ \newenvironment{change}{ \begin{enumerate}[label=\small\protect\circled{\arabic*}]}{ - \end{enumerate}}
\ No newline at end of file + \end{enumerate}} + +\addbibresource[location=local]{reference.bib} + +\renewcommand\tableofcontents{% + \hypersetup{linktoc=all, linkcolor=black} + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\contentsname + \@mkboth{% + \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}% + \ifdefstring{\ELEGANT@toc}{twocol}{ + \setlength{\columnsep}{2em} + \begin{multicols}{2}% + \@starttoc{toc} + \end{multicols}}{ + \@starttoc{toc}} + \if@restonecol\twocolumn\fi} + + +\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else +\hbox{}% +\thispagestyle{empty}% +\newpage% +\if@twocolumn\hbox{}\newpage\fi\fi\fi} diff --git a/macros/latex/contrib/elegantbook/figure/logo.png b/macros/latex/contrib/elegantbook/figure/logo.png Binary files differdeleted file mode 100644 index 1252e91ece..0000000000 --- a/macros/latex/contrib/elegantbook/figure/logo.png +++ /dev/null diff --git a/macros/latex/contrib/elegantbook/image/scatter.jpg b/macros/latex/contrib/elegantbook/image/scatter.jpg Binary files differnew file mode 100644 index 0000000000..6692f1f454 --- /dev/null +++ b/macros/latex/contrib/elegantbook/image/scatter.jpg diff --git a/macros/latex/contrib/elegantbook/image/scatter.pdf b/macros/latex/contrib/elegantbook/image/scatter.pdf Binary files differdeleted file mode 100644 index b217cdc055..0000000000 --- a/macros/latex/contrib/elegantbook/image/scatter.pdf +++ /dev/null diff --git a/macros/latex/contrib/elegantbook/image/scatter.py b/macros/latex/contrib/elegantbook/image/scatter.py deleted file mode 100644 index 576e6b07df..0000000000 --- a/macros/latex/contrib/elegantbook/image/scatter.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file is the source file of the scatter.pdf -# source page: https://matplotlib.org/gallery/shapes_and_collections/scatter.html -import numpy as np -import matplotlib.pyplot as plt - -# Fixing random state for reproducibility -np.random.seed(19680801) - - -N = 50 -x = np.random.rand(N) -y = np.random.rand(N) -colors = np.random.rand(N) -area = (30 * np.random.rand(N))**2 # 0 to 15 point radii - -ax = plt.subplot(111) -ax.scatter(x, y, s=area, c=colors, alpha=0.5) - -# Hide the right and top spines -ax.spines['right'].set_visible(False) -ax.spines['top'].set_visible(False) - -# Only show ticks on the left and bottom spines -ax.yaxis.set_ticks_position('left') -ax.xaxis.set_ticks_position('bottom') - -plt.savefig('scatter.pdf', transparent=True) diff --git a/macros/latex/contrib/elegantbook/image/tlshell.png b/macros/latex/contrib/elegantbook/image/tlshell.png Binary files differdeleted file mode 100644 index 6df5fd988c..0000000000 --- a/macros/latex/contrib/elegantbook/image/tlshell.png +++ /dev/null |