From 118cb5bbc5236bf86ca1088b9b3bae04c7b09beb Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 8 Nov 2022 03:01:43 +0000 Subject: CTAN sync 202211080301 --- macros/latex/contrib/acmart/README | 4 + macros/latex/contrib/acmart/acmart.dtx | 35 +- macros/latex/contrib/acmart/acmart.pdf | Bin 905284 -> 906356 bytes macros/latex/contrib/acmart/acmguide.pdf | Bin 431697 -> 432050 bytes .../latex/contrib/acmart/samples/sample-acmcp.pdf | Bin 208463 -> 208466 bytes .../contrib/acmart/samples/sample-acmengage.pdf | Bin 395897 -> 395897 bytes .../contrib/acmart/samples/sample-acmlarge.pdf | Bin 606046 -> 606046 bytes .../acmart/samples/sample-acmsmall-biblatex.pdf | Bin 628568 -> 628568 bytes .../acmart/samples/sample-acmsmall-conf.pdf | Bin 1050111 -> 1050111 bytes .../acmart/samples/sample-acmsmall-submission.pdf | Bin 618407 -> 618407 bytes .../contrib/acmart/samples/sample-acmsmall.pdf | Bin 615912 -> 615912 bytes .../latex/contrib/acmart/samples/sample-acmtog.pdf | Bin 563306 -> 563306 bytes .../contrib/acmart/samples/sample-authordraft.pdf | Bin 1043265 -> 1043261 bytes .../contrib/acmart/samples/sample-lualatex.pdf | Bin 780905 -> 780905 bytes .../contrib/acmart/samples/sample-manuscript.pdf | Bin 618126 -> 618126 bytes .../acmart/samples/sample-sigconf-biblatex.pdf | Bin 615682 -> 615682 bytes .../contrib/acmart/samples/sample-sigconf-i13n.pdf | Bin 1055067 -> 1055541 bytes .../contrib/acmart/samples/sample-sigconf.pdf | Bin 1039467 -> 1039467 bytes .../contrib/acmart/samples/sample-sigplan.pdf | Bin 1048138 -> 1048138 bytes .../contrib/acmart/samples/sample-xelatex.pdf | Bin 659258 -> 659259 bytes .../biblatex-gb7714-2015/README.md | 3 +- .../biblatex-gb7714-2015/biblatex-gb7714-2015.pdf | Bin 1689051 -> 1687196 bytes .../biblatex-gb7714-2015/biblatex-gb7714-2015.tex | 137 +-- .../biblatex-gb7714-2015/gb7714-2015.bbx | 4 +- .../biblatex-gb7714-2015/gb7714-2015ay.bbx | 20 +- .../biblatex-gb7714-2015/gb7714-2015ms.bbx | 4 +- .../biblatex-gb7714-2015/gb7714-2015mx.bbx | 5 +- macros/latex/contrib/hvfloat/Changes | 1 + macros/latex/contrib/hvfloat/doc/hvfloat.pdf | Bin 5040712 -> 5044788 bytes macros/latex/contrib/hvfloat/latex/hvfloat.sty | 20 +- macros/latex/contrib/songproj/LICENSE | 24 + macros/latex/contrib/songproj/Makefile | 31 + macros/latex/contrib/songproj/README.md | 66 ++ .../latex/contrib/songproj/examples/clementine.txt | 39 + macros/latex/contrib/songproj/song2tex.py | 101 ++ macros/latex/contrib/songproj/songproj.dtx | 1024 ++++++++++++++++++++ macros/latex/contrib/songproj/songproj.ins | 83 ++ macros/latex/contrib/songproj/songproj.pdf | Bin 0 -> 100783 bytes macros/latex/contrib/stealcaps/README.md | 9 +- macros/latex/contrib/stealcaps/stealcaps.dtx | 61 +- macros/latex/contrib/stealcaps/stealcaps.ins | 8 +- macros/latex/contrib/stealcaps/stealcaps.pdf | Bin 146839 -> 164457 bytes .../stealcaps/testfile/CormorantSC-Regular.ttf | Bin 0 -> 368936 bytes .../stealcaps/testfile/EBGaramond-Regular.ttf | Bin 0 -> 560560 bytes .../contrib/stealcaps/testfile/brelaregular.otf | Bin 15764 -> 0 bytes .../stealcaps/testfile/stealcapitals-test.pdf | Bin 15452 -> 0 bytes .../stealcaps/testfile/stealcapitals-test.tex | 22 - .../contrib/stealcaps/testfile/stealcaps-test.pdf | Bin 0 -> 15750 bytes .../contrib/stealcaps/testfile/stealcaps-test.tex | 26 + 49 files changed, 1606 insertions(+), 121 deletions(-) create mode 100644 macros/latex/contrib/songproj/LICENSE create mode 100644 macros/latex/contrib/songproj/Makefile create mode 100644 macros/latex/contrib/songproj/README.md create mode 100644 macros/latex/contrib/songproj/examples/clementine.txt create mode 100755 macros/latex/contrib/songproj/song2tex.py create mode 100644 macros/latex/contrib/songproj/songproj.dtx create mode 100644 macros/latex/contrib/songproj/songproj.ins create mode 100644 macros/latex/contrib/songproj/songproj.pdf create mode 100644 macros/latex/contrib/stealcaps/testfile/CormorantSC-Regular.ttf create mode 100644 macros/latex/contrib/stealcaps/testfile/EBGaramond-Regular.ttf delete mode 100644 macros/latex/contrib/stealcaps/testfile/brelaregular.otf delete mode 100644 macros/latex/contrib/stealcaps/testfile/stealcapitals-test.pdf delete mode 100644 macros/latex/contrib/stealcaps/testfile/stealcapitals-test.tex create mode 100644 macros/latex/contrib/stealcaps/testfile/stealcaps-test.pdf create mode 100644 macros/latex/contrib/stealcaps/testfile/stealcaps-test.tex (limited to 'macros') diff --git a/macros/latex/contrib/acmart/README b/macros/latex/contrib/acmart/README index b30dc5e1fd..12b8265bfd 100644 --- a/macros/latex/contrib/acmart/README +++ b/macros/latex/contrib/acmart/README @@ -12,6 +12,10 @@ The production version is the one on CTAN and ACM sites. Changes +Version 1.88 New ISSNs + Documentation updates + New journal: PACMNET + Version 1.87 CC license is allowed for non-acm documents and ACM Engage documents only New format acmcp for the cover page diff --git a/macros/latex/contrib/acmart/acmart.dtx b/macros/latex/contrib/acmart/acmart.dtx index f8221dcccb..ee6d4557c8 100644 --- a/macros/latex/contrib/acmart/acmart.dtx +++ b/macros/latex/contrib/acmart/acmart.dtx @@ -304,7 +304,8 @@ % manuscript & A manuscript. This is the default. \\ % acmsmall & Small single-column format. Used for ACMJCSS, CIE, CSUR, % DLT, FAC, GAMES, JACM, JATS, JDIQ, JDS, JEA, JERIC, -% JETC, JRC, PACMCGIT, PACMHCI, PACMPL, TAAS, TACCESS, TACO, +% JETC, JRC, PACMCGIT, PACMHCI, PACMNET, +% PACMPL, TAAS, TACCESS, TACO, % TALG, TALLIP (formerly TALIP), TCPS, TDS, % TEAC, TECS, TELO, THRI, TIIS, TIOT, TISSEC, TIST, TKDD, TMIS, % TOCE, TOCHI, TOCL, @@ -568,6 +569,14 @@ % Note that some formats do not typeset e-mails or ORCID identifiers. % Do not worry: the metadata tools will get them. % +% ACM strongly encourages that you include ORCIDs for all authors +% before compiling or submitting for review and/or production +% processing. +% +% If you do not have an ORCID, you may get one for free by +% registering at \url{http://www.orcid.org/}. +% +% % Sometimes an author has several affiliations. In this case, the % \cs{affiliation} command should be repeated: % \begin{verbatim} @@ -2107,6 +2116,7 @@ % PACMCGIT & Proceedings of the ACM on Computer Graphics and % Interactive Techniques\\ % PACMHCI & PACM on Human-Computer Interaction\\ +% PACMNET & PACM on Networking\\ % PACMPL & PACM on Programming Languages \\ % POMACS & PACM on Measurement and Analysis of Computing Systems \\ % TAAS & ACM Transactions on Autonomous and Adaptive Systems\\ @@ -2229,7 +2239,7 @@ \ProvidesFile{acmart.dtx} % %\ProvidesClass{acmart} -[2022/10/18 v1.87 Typesetting articles for the Association for Computing Machinery] +[2022/10/24 v1.88 Typesetting articles for the Association for Computing Machinery] % \end{macrocode} % % \changes{v1.00}{2016/04/14}{First released version} @@ -3293,7 +3303,7 @@ % \end{macro} % % \begin{macro}{\@startsection} -% \changes{v1.31}{2017/03/04}{Rededined macro} +% \changes{v1.31}{2017/03/04}{Redefined macro} % \changes{v1.43}{2017/07/09}{Added \cs{makeatletter}} % The |amsart| package redefines \cs{startsection}. Here we redefine % it again to make the table of contents work. @@ -4276,7 +4286,10 @@ % several journals} % \changes{1.84}{2022/04/09}{New journals: JDS, GAMES} % \changes{1.85}{2022/05/08}{New journal: JRC} -% \changes{1.85}{2022/10/18}{New journals: ACMJCSS, JATS, TORS} +% \changes{1.87}{2022/10/18}{New journals: ACMJCSS, JATS, TORS} +% \changes{1.88}{2022/10/19}{Added ISSN for GAMES} +% \changes{1.88}{2022/10/23}{Added ISSN for ACMJCSS} +% \changes{1.88}{2022/10/24}{Added PACMNET} % % We use the |xkeyval| interface to define journal titles and the relevant % information @@ -4303,6 +4316,7 @@ JRC,% PACMCGIT,% PACMHCI,% + PACMNET,% PACMPL,% POMACS,% TAAS,% @@ -4356,7 +4370,7 @@ \relax % ACMJCSS \def\@journalName{ACM Journal on Computing and Sustainable Societies}% \def\@journalNameShort{ACM J. Comput. Sustain. Soc.}% - \def\@permissionCodeOne{}% + \def\@permissionCodeOne{2834-5533}% \or % CIE \def\@journalName{ACM Computers in Entertainment}% \def\@journalNameShort{ACM Comput. Entertain.}% @@ -4385,6 +4399,7 @@ \or % GAMES \def\@journalName{ACM Games: Research and Practice}% \def\@journalNameShort{ACM Games}% + \def\@permissionCodeOne{2832-5516}% \or % HEALTH \def\@journalName{ACM Transactions on Computing for Healthcare}% \def\@journalNameShort{ACM Trans. Comput. Healthcare}% @@ -4446,6 +4461,10 @@ \def\@permissionCodeOne{2573-0142}% \@ACM@screentrue \PackageInfo{\@classname}{Using screen mode due to \@journalCode}% +\or % PACMNET + \def\@journalName{Proceedings of the ACM on Networkng}% + \def\@journalNameShort{Proc. ACM Netw.}% + \def\@permissionCodeOne{2834-5509}% \or % PACMPL \def\@journalName{Proceedings of the ACM on Programming Languages}% \def\@journalNameShort{Proc. ACM Program. Lang.}% @@ -4933,7 +4952,7 @@ % \begin{macro}{\orcid} % \changes{v1.15}{2016/06/25}{Introduced macro} % \changes{v1.76}{2021/03/15}{Added code for orcid links} -% We rededine the command to typeset the current author +% We redefine the command to typeset the current author % \begin{macrocode} \def\orcid#1{\unskip\ignorespaces% \IfBeginWith{#1}{http}{% @@ -6532,6 +6551,7 @@ % \changes{v1.83}{2022/02/20}{Added \cs{translatedtitle} and % \cs{translatedsubtitle}} % \changes{v1.87}{2022/08/14}{Special treatment for acmcp} +% \changes{v1.88}{2022/10/24}{Moved down title for acmcp} % The version of \cs{mktitle} for most journals % \begin{macrocode} \def\@mktitle@i{\hsize=\textwidth @@ -6553,6 +6573,9 @@ \includegraphics[width=\@ACM@badge@width]{\@acmBadgeL@image}}}% \hskip\@ACM@badge@skip \fi + \if@ACM@acmcp + \vspace*{108.5\p@}\par\noindent + \fi \parbox[t]{\@ACM@title@width}{\raggedright \@titlefont\noindent \@title\@translatedtitle% diff --git a/macros/latex/contrib/acmart/acmart.pdf b/macros/latex/contrib/acmart/acmart.pdf index 606574db26..b2b2885b6b 100644 Binary files a/macros/latex/contrib/acmart/acmart.pdf and b/macros/latex/contrib/acmart/acmart.pdf differ diff --git a/macros/latex/contrib/acmart/acmguide.pdf b/macros/latex/contrib/acmart/acmguide.pdf index 70313fded3..1501ce4da7 100644 Binary files a/macros/latex/contrib/acmart/acmguide.pdf and b/macros/latex/contrib/acmart/acmguide.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmcp.pdf b/macros/latex/contrib/acmart/samples/sample-acmcp.pdf index c3993bfd61..dd16095b9c 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmcp.pdf and b/macros/latex/contrib/acmart/samples/sample-acmcp.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmengage.pdf b/macros/latex/contrib/acmart/samples/sample-acmengage.pdf index 6c12412fcd..b0e607be30 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmengage.pdf and b/macros/latex/contrib/acmart/samples/sample-acmengage.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmlarge.pdf b/macros/latex/contrib/acmart/samples/sample-acmlarge.pdf index 606a977bda..002e2ea098 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmlarge.pdf and b/macros/latex/contrib/acmart/samples/sample-acmlarge.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmsmall-biblatex.pdf b/macros/latex/contrib/acmart/samples/sample-acmsmall-biblatex.pdf index cbb483fe0b..8b6e58a143 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmsmall-biblatex.pdf and b/macros/latex/contrib/acmart/samples/sample-acmsmall-biblatex.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmsmall-conf.pdf b/macros/latex/contrib/acmart/samples/sample-acmsmall-conf.pdf index 02ac97731e..4631786f96 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmsmall-conf.pdf and b/macros/latex/contrib/acmart/samples/sample-acmsmall-conf.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmsmall-submission.pdf b/macros/latex/contrib/acmart/samples/sample-acmsmall-submission.pdf index 776edd55f0..d42e040ba0 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmsmall-submission.pdf and b/macros/latex/contrib/acmart/samples/sample-acmsmall-submission.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmsmall.pdf b/macros/latex/contrib/acmart/samples/sample-acmsmall.pdf index b996692fa2..3e4d4eac4e 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmsmall.pdf and b/macros/latex/contrib/acmart/samples/sample-acmsmall.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-acmtog.pdf b/macros/latex/contrib/acmart/samples/sample-acmtog.pdf index e3512e0b46..16ce82202b 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-acmtog.pdf and b/macros/latex/contrib/acmart/samples/sample-acmtog.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-authordraft.pdf b/macros/latex/contrib/acmart/samples/sample-authordraft.pdf index efcebebee7..15386cdc3a 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-authordraft.pdf and b/macros/latex/contrib/acmart/samples/sample-authordraft.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-lualatex.pdf b/macros/latex/contrib/acmart/samples/sample-lualatex.pdf index 54d7f0fae7..0f17db119c 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-lualatex.pdf and b/macros/latex/contrib/acmart/samples/sample-lualatex.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-manuscript.pdf b/macros/latex/contrib/acmart/samples/sample-manuscript.pdf index b51259c8ba..4415bfe8e9 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-manuscript.pdf and b/macros/latex/contrib/acmart/samples/sample-manuscript.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-sigconf-biblatex.pdf b/macros/latex/contrib/acmart/samples/sample-sigconf-biblatex.pdf index 86affdb954..ab2fbdff87 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-sigconf-biblatex.pdf and b/macros/latex/contrib/acmart/samples/sample-sigconf-biblatex.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-sigconf-i13n.pdf b/macros/latex/contrib/acmart/samples/sample-sigconf-i13n.pdf index d1a809306c..f3b1268ee4 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-sigconf-i13n.pdf and b/macros/latex/contrib/acmart/samples/sample-sigconf-i13n.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-sigconf.pdf b/macros/latex/contrib/acmart/samples/sample-sigconf.pdf index 2431f25131..ade6b5e21c 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-sigconf.pdf and b/macros/latex/contrib/acmart/samples/sample-sigconf.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-sigplan.pdf b/macros/latex/contrib/acmart/samples/sample-sigplan.pdf index a9a992f2a9..9809c87490 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-sigplan.pdf and b/macros/latex/contrib/acmart/samples/sample-sigplan.pdf differ diff --git a/macros/latex/contrib/acmart/samples/sample-xelatex.pdf b/macros/latex/contrib/acmart/samples/sample-xelatex.pdf index a39b085482..f8898be8a0 100644 Binary files a/macros/latex/contrib/acmart/samples/sample-xelatex.pdf and b/macros/latex/contrib/acmart/samples/sample-xelatex.pdf differ diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md index 1fd012bf04..8400ad2a7e 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md @@ -1,4 +1,4 @@ -Date of last change: 2022-08-29 to version v1.1j +Date of last change: 2022-11-07 to version v1.1k # biblatex-gb7714-2015: a biblatex style package @@ -1592,6 +1592,7 @@ please see the file 'biblatex-gb7714-2015.pdf' for further information! * 2022/04/16 v1.1h,ctan,github * 2022/05/17 v1.1i,ctan,github * 2022/08/29 v1.1j,ctan,github +* 2022/11/07 v1.1k,ctan,github --------------------------------------------------------- ## Update history: diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf index 7c1e2439bd..6fa77022da 100644 Binary files a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf and b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf differ diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex index 3de096d3f9..8cc383e940 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex @@ -416,7 +416,8 @@ perl gb7714texttobib.pl in=textfilename out=bibfilename \item gbalign=gb7714-2015,数字序号标签,是项对齐方式,即段落环境中标签使用原始宽度,标签与条目内容等间距。 \item gbalign=gb7714-2015ay,无数字序号标签,是author-year风格的文献表,是gb7714-2015ay样式的默认选项。 \end{itemize} - 该选项对\textbf{著者年份制、顺序编码制均有效}。使用序号标签对齐方式的测试, + 该选项对\textbf{著者年份制、顺序编码制均有效},也就是说当使用著者年份制时,加上gbalign选项后同样可以实现文献表的顺序序号标签(比如: + \lstinline[breaklines=true]!\usepackage[style=gb7714-2015ay, gbalign=left]{biblatex}!,可以实现\emph{著者年份制格式的带左对齐的顺序序号标签的文献表})。 序号标签对齐方式的测试,包括: 数字在标签内居中见: \href{run:./example/opt-gbalign-center.tex}{opt-gbalign-center.tex}, 标签左对齐见: @@ -1412,18 +1413,35 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt] \paragraph{\heiti 文献表水平间距(缩进)控制} 增加了尺寸\verb|\bibitemindent| 用于控制参考文献条目在文献表中的缩进, 其意义与 list 环境中 \verb|\itemindent| 相同。 -文献表的水平缩进控制,两种编制方式下是不同的。对于\emph{著者-出版年}制文献表,bibitemindent表示 -\emph{一条文献中第一行相对后面各行的缩进},bibhang 表示\emph{页边到文献各行起始位置的距离}。因此要调整缩进就是要设置这两尺寸。 +文献表的水平缩进控制,两种编制方式下是不同的。 -对于\emph{顺序编码}制文献表,由于存在数字标签,且其宽度与参考文献数量相关,所以这个宽度是动态变的,无能提前设定的,而是在文献表生成时给出,所以调整缩进需要在文献表输出环境中调整。由于顺序编码样式使用了两类输出环境,所以需要根据设定的选项区分处理: +(a) 对于\emph{著者-出版年}制文献表,bibitemindent表示 +\emph{一条文献中第一行相对后面各行的缩进},bibhang 表示\emph{页边到文献各行起始位置的距离}。因此要调整缩进则直接设置这两尺寸。 + +当使用著者-出版年样式又需要使用顺序编码数字标签的文献表时(此时使用gbalign选项),缩进方式与顺序编码制文献表类似,但又略有差异。 +数字标签盒子默认宽度为2em,可以调整biblabelextend来增大或缩小(使用正或负的长度)该宽度,数字标签的盒子与文献内容之间的间距为4.5pt,通过直接设置biblabelsep尺寸来调整。 + + +(b) 对于\emph{顺序编码}制文献表,由于存在数字标签,且其宽度与参考文献数量相关,所以这个宽度是动态变化的,不能提前设定,而是在文献表生成时给出,所以调整缩进需要根据文献表输出环境的情况做针对性处理。 + +顺序编码样式使用了两类输出环境,所以设定选项也区分两类: + +一是采用list环境的文献表,即设置gbalign=left、right、center时(即顺序编码标签是左对齐、右对齐和居中对齐的情况)。 + +此时文献表环境,数字标签盒子默认宽度为labelnumberwidth,由biblatex根据文献数量自动计算后设定,因此改变缩进主要通过调整biblabelsep和bibitemindent两个尺寸来实现。biblabelsep设置数字标签的盒子与文献内容之间的间距。bibitemindent设置第一行和后面其它行的缩进,默认情况下bibitemindent为0pt,则一条文献内所有行缩进相同,若bibitemindent>0pt则第一行相比后面各行缩进,若bibitemindent<0pt则后面各行相比第一行缩进。 + +顺序编码样式下bibitemindent与bibhang的意义与著者-出版年制下相同,但由于数字标签盒子的存在,所以页边到各行起始位置的距离bibhang=labelnumberwidth +biblabelsep -bibitemindent。 + +当采用某些字体导致计算的标签宽度不足时,可以设置biblabelextend尺寸,来增加labelnumberwidth的宽度避免缩进格式产生问题,使得:bibhang=labelnumberwidth +biblabelextend +biblabelsep -bibitemindent。默认情况下biblabelextend尺寸为0pt。 + +二是采用正常段落环境的文献表,即设置gbalign=gb7714-2015时(即项对齐情况,就是各条文献是自身对齐的情况)。 + +此时数字标签盒子默认宽度根据标签实际宽度自动设定,因此不会存在数字标签盒子宽度不足的情况,所以不用设置biblabelextend尺寸。数字标签的盒子与文献内容之间的间距通过调整biblabelsep可设置。\emph{每条参考文献第二行开始的缩进距离}通过调整bibitemindent尺寸设置,bibitemindent默认为0pt,则一条文献内所有行缩进相同,若bibitemindent>0pt则第一行相比后面各行缩进,若bibitemindent<0pt则后面各行相比第一行缩进。 -一是采用list环境的文献表,即设置gbalign=left、right、center时(即顺序编码标签是左对齐、右对齐和居中对齐的情况),在重定义的文献表环境中,调整bibitemindent和biblabelsep两个尺寸,默认情况下bibhang=biblabelsep+labelnumberwidth的长度是页边到各行起始位置的距离。当采用某些字体导致计算计算的标签宽度不足时,可以设置biblabelextend尺寸,来增加labelnumberwidth的宽度,避免缩进格式产生问题,默认情况下biblabelextend尺寸为0pt。 -二是采用正常段落环境的文献表,即设置gbalign=gb7714-2015时(即项对齐情况,就是各条文献是自身对齐的情况),在重定义的命令中通过调整lengthid尺寸来设置\emph{每条参考文献第二行开始的缩进距离}。 调整方法见例\ref{eg:biblist:hspace}。 -除了使用这种段落形式的文献表外,也有生成\emph{表格文献表}的需求,即把文献表放到一个表格里面,要求每一条文献占据表格的一行。这也是能实现的,具体参考我的博客文章 -\href{https://blog.csdn.net/xenonhu/article/details/121696116}{latex中生成表格形式的参考文献表}。 + \begin{example}{文献表水平缩进控制}{eg:biblist:hspace} \begin{texlist} @@ -1436,56 +1454,65 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt] % 【顺序编码制】文献表缩进控制 % 调整顺序标签与文献内容的间距 \setlength{\biblabelsep}{2mm} - -% 调整各条文献的缩进: -%-1-----gbalign=left、right、center时,重定义 bibenvironment -\defbibenvironment{bibliography}%修改对齐环境-调整缩进 - {\list - {\printtext[labelnumberwidth]{% - \printfield{labelprefix}% - \printfield{labelnumber}}} -{%默认设置 - \setlength{\bibhang}{\biblabelsep}% - \addtolength{\bibhang}{\labelnumberwidth}% - % -%这里是所做的调整,通过设置\bibitemindent,\bibhang调整缩进 -\addtolength{\bibitemindent}{\labelnumberwidth}% -\addtolength{\bibitemindent}{\biblabelsep}% -\addtolength{\bibhang}{-\labelnumberwidth} % -\addtolength{\bibhang}{-\biblabelsep}% - % - %以下是默认的设置 - \setlength{\labelwidth}{\labelnumberwidth}% - \setlength{\labelsep}{\biblabelsep}% - \setlength{\leftmargin}{\bibhang}% - \addtolength{\leftmargin}{\labelnumberwidth}% - \setlength{\itemindent}{\bibitemindent}% - \setlength{\itemsep}{\bibitemsep}% - \setlength{\parsep}{\bibparsep}}% - \renewcommand*{\makelabel}[1]{\hss##1}} - {\endlist} - {\item} - -%-2-----gbalign=gb7714-2015时,重定义 \itemcmd命令 -\renewcommand{\itemcmd}{%%修改对齐环境-调整缩进 -\settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} -% -%%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 -\setlength{\lengthid}{0pt} -\addtolength{\lengthid}{-\biblabelsep} -% -%如下是默认设置 -\addtolength{\lengthid}{\biblabelsep} -\setlength{\lengthlw}{\textwidth} -\addtolength{\lengthlw}{-\lengthid} -\addvspace{\bibitemsep}%恢复\bibitemsep的作用 -%\parshape 2 0em \textwidth \lengthid \lengthlw -\hangindent\lengthid -\mkgbnumlabel{\printfield{labelnumber}}% -\hspace{\biblabelsep}} +\setlength{\bibitemindent}{0pt} +\setlength{\biblabelextend}{0pt} \end{texlist} \end{example} +(c) 其它形式的文献表。 + +除了使用这种段落形式的文献表外,也有生成\emph{表格文献表}的需求,即把文献表放到一个表格里面,要求每一条文献占据表格的一行。这也是能实现的,具体参考我的博客文章 +\href{https://blog.csdn.net/xenonhu/article/details/121696116}{latex中生成表格形式的参考文献表}。 + + +%% 调整各条文献的缩进: +%%-1-----gbalign=left、right、center时,重定义 bibenvironment +%\defbibenvironment{bibliography}%修改对齐环境-调整缩进 +% {\list +% {\printtext[labelnumberwidth]{% +% \printfield{labelprefix}% +% \printfield{labelnumber}}} +%{%默认设置 +% \setlength{\bibhang}{\biblabelsep}% +% \addtolength{\bibhang}{\labelnumberwidth}% +% % +%%这里是所做的调整,通过设置\bibitemindent,\bibhang调整缩进 +%\addtolength{\bibitemindent}{\labelnumberwidth}% +%\addtolength{\bibitemindent}{\biblabelsep}% +%\addtolength{\bibhang}{-\labelnumberwidth} % +%\addtolength{\bibhang}{-\biblabelsep}% +% % +% %以下是默认的设置 +% \setlength{\labelwidth}{\labelnumberwidth}% +% \setlength{\labelsep}{\biblabelsep}% +% \setlength{\leftmargin}{\bibhang}% +% \addtolength{\leftmargin}{\labelnumberwidth}% +% \setlength{\itemindent}{\bibitemindent}% +% \setlength{\itemsep}{\bibitemsep}% +% \setlength{\parsep}{\bibparsep}}% +% \renewcommand*{\makelabel}[1]{\hss##1}} +% {\endlist} +% {\item} +% +%%-2-----gbalign=gb7714-2015时,重定义 \itemcmd命令 +%\renewcommand{\itemcmd}{%%修改对齐环境-调整缩进 +%\settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} +%% +%%%这里是所做的调整,以下两句通过调整\lengthid来调整缩进 +%\setlength{\lengthid}{0pt} +%\addtolength{\lengthid}{-\biblabelsep} +%% +%%如下是默认设置 +%\addtolength{\lengthid}{\biblabelsep} +%\setlength{\lengthlw}{\textwidth} +%\addtolength{\lengthlw}{-\lengthid} +%\addvspace{\bibitemsep}%恢复\bibitemsep的作用 +%%\parshape 2 0em \textwidth \lengthid \lengthlw +%\hangindent\lengthid +%\mkgbnumlabel{\printfield{labelnumber}}% +%\hspace{\biblabelsep}} + + \paragraph{\heiti 文献表中的标点控制} 文献表中有时需要调整标点为中文的全角标点,可以通过不同机制下的标点设置来调整。 调整方式如例\ref{eg:biblist:separator}所示。有时在本地化字符串中也可以实现标点调整,比如and,in等本地化字符串。有时在域格式中也可能出现标点调整,比如title域格式。而且因为不同语言的处理,可能内部也存在标点的调整。具体情况是比较复杂的,这里不再一一列举,一些修改示例可以参考: \href{run:./chinese-erj.bbx}{chinese-erj.bbx}, diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx index e7cd2c5000..e5e4c99360 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx @@ -11,7 +11,7 @@ % % 版本和时间信息 % -\def\versionofgbtstyle{2022/08/29 v1.1j} +\def\versionofgbtstyle{2022/11/07 v1.1k} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -2175,6 +2175,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 % % 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。 \def\setaligngbstyle{% +\setlength{\bibitemindent}{0pt}% \def\blx@bibitem##1{% \blx@ifdata{##1} {\begingroup @@ -2209,6 +2210,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 \newcommand{\itemcmd}{% \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} \addtolength{\lengthid}{\biblabelsep} +\addtolength{\lengthid}{-\bibitemindent} \setlength{\lengthlw}{\textwidth} \addtolength{\lengthlw}{-\lengthid} \addvspace{\bibitemsep}%恢复\bibitemsep的作用 diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx index c1aa141644..db66e248c2 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx @@ -10,7 +10,7 @@ % % 版本和时间信息 % -\def\versionofgbtstyle{2022/08/29 v1.1j} +\def\versionofgbtstyle{2022/11/07 v1.1k} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -1994,13 +1994,14 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 % v1.0w,20210311,hzz % v1.0x,20210411,hzz,整合到gbalign选项中。 \newcounter{refnumeric} +\newlength{\biblabelbox} +\setlength{\biblabelbox}{2em} \newlength{\biblabelextend} \def\setaligngbnumeric{% +\setlength{\bibitemindent}{0pt}% +\setlength{\biblabelextend}{0pt}% \defbibenvironment{bibliography} - {\setlength{\labelnumberwidth}{2em}% - \setlength{\bibitemindent}{0pt}% - \setlength{\biblabelextend}{0pt}% - \setlength{\biblabelextend}{0pt}% + {\setlength{\labelnumberwidth}{\biblabelbox}% \list {\printtext[labelnumberwidth]{\arabic{refnumeric}}} {\usecounter{refnumeric}% @@ -2019,10 +2020,9 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 } \defbibenvironment{numerical}%作者年制中数字标签的文献表环境 - {\setlength{\labelnumberwidth}{2em}% - \setlength{\bibitemindent}{0pt}% - \setlength{\biblabelextend}{0pt}% - \setlength{\biblabelextend}{0pt}% + {\setlength{\labelnumberwidth}{\biblabelbox}% + \setlength{\bibitemindent}{0pt}% + \setlength{\biblabelextend}{0pt}% \list {\printtext[labelnumberwidth]{\arabic{refnumeric}}} {\usecounter{refnumeric}% @@ -2051,6 +2051,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 % % 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。 \def\setaligngbstyle{% +\setlength{\bibitemindent}{0pt}% \def\blx@bibitem##1{% \blx@ifdata{##1} {\begingroup @@ -2085,6 +2086,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 \newcommand{\itemcmd}{% \settowidth{\lengthid}{\mkgbnumlabel{\arabic{refnumeric}}} \addtolength{\lengthid}{\biblabelsep} +\addtolength{\lengthid}{-\bibitemindent} \setlength{\lengthlw}{\textwidth} \addtolength{\lengthlw}{-\lengthid} \addvspace{\bibitemsep}%恢复\bibitemsep的作用 diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx index d8fe13aa06..f60044ae8a 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx @@ -11,7 +11,7 @@ % % 版本和时间信息 % -\def\versionofgbtstyle{2022/08/29 v1.1j} +\def\versionofgbtstyle{2022/11/07 v1.1k} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015ms.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -1338,6 +1338,7 @@ % % 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。 \def\setaligngbstyle{% +\setlength{\bibitemindent}{0pt}% \def\blx@bibitem##1{% \blx@ifdata{##1} {\begingroup @@ -1372,6 +1373,7 @@ \newcommand{\itemcmd}{% \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}}% \addtolength{\lengthid}{\biblabelsep}% +\addtolength{\lengthid}{-\bibitemindent}% \setlength{\lengthlw}{\textwidth}% \addtolength{\lengthlw}{-\lengthid}% \addvspace{\bibitemsep}%恢复\bibitemsep的作用 diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx index 84729ef0fd..7f090e434a 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx @@ -11,7 +11,7 @@ % % 版本和时间信息 % -\def\versionofgbtstyle{2022/08/29 v1.1j} +\def\versionofgbtstyle{2022/11/07 v1.1k} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015mx.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -1626,6 +1626,7 @@ % % 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。 \def\setaligngbstyle{% +\setlength{\bibitemindent}{0pt}% \def\blx@bibitem##1{% \blx@ifdata{##1} {\begingroup @@ -1660,6 +1661,7 @@ \newcommand{\itemcmd}{% \settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}} \addtolength{\lengthid}{\biblabelsep} +\addtolength{\lengthid}{-\bibitemindent} \setlength{\lengthlw}{\textwidth} \addtolength{\lengthlw}{-\lengthid} \addvspace{\bibitemsep}%恢复\bibitemsep的作用 @@ -1696,7 +1698,6 @@ {\setlength{\labelnumberwidth}{2em}% \setlength{\bibitemindent}{0pt}% \setlength{\biblabelextend}{0pt}% - \setlength{\biblabelextend}{0pt}% \list {\printtext[labelnumberwidth]{\arabic{refnumeric}}} {\usecounter{refnumeric}% diff --git a/macros/latex/contrib/hvfloat/Changes b/macros/latex/contrib/hvfloat/Changes index eb0e9277b8..2987bc5ebb 100644 --- a/macros/latex/contrib/hvfloat/Changes +++ b/macros/latex/contrib/hvfloat/Changes @@ -1,4 +1,5 @@ hvfloat.sty: +2.43 2022-11-07 - fix for empty caption: don't use \caption 2.42 2022-10-02 - fix for twoColumnCaption and multi(sub)floats 2.41 2022-09-01 - another fix full page floats without pagenumber and without using package floatpag diff --git a/macros/latex/contrib/hvfloat/doc/hvfloat.pdf b/macros/latex/contrib/hvfloat/doc/hvfloat.pdf index 69b0e9a1a5..49c502e55e 100644 Binary files a/macros/latex/contrib/hvfloat/doc/hvfloat.pdf and b/macros/latex/contrib/hvfloat/doc/hvfloat.pdf differ diff --git a/macros/latex/contrib/hvfloat/latex/hvfloat.sty b/macros/latex/contrib/hvfloat/latex/hvfloat.sty index 2d2765308e..b22e5f0198 100644 --- a/macros/latex/contrib/hvfloat/latex/hvfloat.sty +++ b/macros/latex/contrib/hvfloat/latex/hvfloat.sty @@ -1,4 +1,4 @@ -%% $Id: hvfloat.sty 617 2022-10-02 14:25:10Z herbert $ +%% $Id: hvfloat.sty 651 2022-11-07 07:04:33Z herbert $ %% %% %% IMPORTANT NOTICE: @@ -16,8 +16,8 @@ %% `hvfloat' offers rotating of captions and objects for floats %% \NeedsTeXFormat{LaTeX2e} -\def\fileversion{2.42} -\def\filedate{2022/10/02} +\def\fileversion{2.43} +\def\filedate{2022/11/07} \ProvidesPackage{hvfloat}[\filedate\space v\fileversion\space special floating objects (hv)] \let\hvFloatFileVersion\fileversion % @@ -676,7 +676,7 @@ \savebox\hvCaptionBox{% NO rotation \minipage[b]{\hvCapWidth}%% minipage, to get hyphenation % \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi - \ifhv@nonFloat + \ifhv@nonFloat \ifhv@onlyText \hv@longCap \else @@ -698,10 +698,12 @@ \ifhv@onlyText \hv@longCap \else + \expandafter\ifx\hv@longCap\@empty \else \let\@captype\hv@floatType \ifx\hv@shortCap\@empty\caption{\hv@longCap}\else\caption[\hv@shortCap]{\hv@longCap}\fi \ifx\hv@label\@empty\else\label{\hv@label}\fi \fi + \fi \fi \endminipage }% end CaptionBox without rotation @@ -721,6 +723,7 @@ \fi \fi \else + \expandafter\ifx\hv@longCap\@empty \else \ifhv@onlyText \hv@longCap \else @@ -729,6 +732,7 @@ \fi \fi \fi + \fi \ifx\hv@label\@empty\else\label{\hv@label}\fi \endminipage }% rotatebox @@ -1982,9 +1986,15 @@ \else \edef\@captype{\hv@floatType}% \expandafter\ifx\expandafter\relax\hv@shortCap\relax - \caption{\hv@longCap}% + \expandafter\ifx\hv@longCap\@empty \else % empty caption? + \caption{\hv@longCap}% + \fi \else + \expandafter\ifx\hv@longCap\@empty + \caption[\hv@shortCap]{}% + \else \caption[\hv@shortCap]{\hv@longCap}% + \fi \fi \fi \ifx\hv@label\@empty\else\label{\hv@label-cap}\fi diff --git a/macros/latex/contrib/songproj/LICENSE b/macros/latex/contrib/songproj/LICENSE new file mode 100644 index 0000000000..9b4bccb254 --- /dev/null +++ b/macros/latex/contrib/songproj/LICENSE @@ -0,0 +1,24 @@ +Copyright (C) 2022 by Tanguy Ortolo + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/macros/latex/contrib/songproj/Makefile b/macros/latex/contrib/songproj/Makefile new file mode 100644 index 0000000000..48edf01b51 --- /dev/null +++ b/macros/latex/contrib/songproj/Makefile @@ -0,0 +1,31 @@ +all: sty pdf + +sty: songproj.sty + +pdf: songproj.pdf + +%.pdf: %.dtx %.gls %.ind + xelatex $< + +%.glo %.aux %.idx: %.dtx + xelatex $< + +%.gls: %.glo + makeindex -s gglo.ist -o $@ $< + +%.ind: %.idx + makeindex -s gind.ist -o $@ $< + +%.sty: %.ins %.dtx + xelatex $< + +mostlyclean: + rm -f *.aux *.glo *.gls *.hd *.idx *.ilg *.ind *.log *.out + +clean: mostlyclean + rm -f *.pdf + +maintainer-clean: clean + rm -f *.sty + +.PHONY: all sty doc mostlyclean clean maintainer-clean diff --git a/macros/latex/contrib/songproj/README.md b/macros/latex/contrib/songproj/README.md new file mode 100644 index 0000000000..1c3c073b52 --- /dev/null +++ b/macros/latex/contrib/songproj/README.md @@ -0,0 +1,66 @@ +songproj +======== + +Commands and environments for generating Beamer slideshows with song lyrics, +typically for religious services with a projector. + +Author: Tanguy Ortolo +License: 3-Clause BSD + +Description +----------- + +This package, together with the Beamer class, is used to generate slideshows +with song lyrics. This is typically used in religious services in churches +equipped with a projector, for which this package has been written, but it can +be useful for any type of singing assembly. It provides environments to +describe a song in a natural way, and formatting it into slides with overlays. + +Example +------- + +Detailed usage can be found in the PDF documentation. Here is a simple example: + +```latex +\documentclass{beamer} +\usepackage{songproj} +\begin{document} + \begin{frame} + \begin{song}{2} + \longest{Light she was, and like a fairy,} + \begin{couplet} + In a cavern, in a canyon, \\ + Excavating for a mine. \\ + Dwelt a miner, forty-niner, \\ + And his daughter, Clementine. \\ + \end{couplet} + \begin{refrain} + Oh my darling, oh my darling, \\ + Oh my darling Clementine, \\ + You are lost and gone forever, \\ + Dreadful sorry, Clementine. \\ + \end{refrain} + \begin{couplet} + Light she was, and like a fairy, \\ + And her shoes were number nine, \\ + Herring boxes, without topses, \\ + Sandals were for Clementine. \\ + \end{couplet} + \begin{couplet} + […] + \end{couplet} + \end{song} + \end{frame} +\end{document} +``` + +Add-on script +------------- + +This package comes with an additional script, `song2tex.py`, that can be used +to convert plain-text song lyrics to the expected LaTeX markup. The file +`example/clementine.txt` can be used to test it: + +```sh +./song2tex.py examples/clementine.txt /tmp/clementine.tex +``` diff --git a/macros/latex/contrib/songproj/examples/clementine.txt b/macros/latex/contrib/songproj/examples/clementine.txt new file mode 100644 index 0000000000..d0cc0f8aa8 --- /dev/null +++ b/macros/latex/contrib/songproj/examples/clementine.txt @@ -0,0 +1,39 @@ +1. In a cavern, in a canyon, +Excavating for a mine. +Dwelt a miner, forty-niner, +And his daughter, Clementine. + +C. Oh my darling, oh my darling, +Oh my darling Clementine, +You are lost and gone forever, +Dreadful sorry, Clementine. + +2. Light she was, and like a fairy, +And her shoes were number nine, +Herring boxes, without topses, +Sandals were for Clementine. + +3. Drove she ducklings to the water, +Ev'ry morning just at nine, +Hit her foot against a splinter +Fell into the foaming brine. + +4. Ruby lips above the water, +Blowing bubbles, soft and fine, +Alas, for me! I was no swimmer, +So I lost my Clementine. + +5. In a churchyard, near the canyon, +Where the myrtle boughs entwine, +There grow roses, and other posies, +Fertilized by Clementine. + +6. Then the miner, forty-niner, +Soon began to peak and pine, +Thought he "oughter jine" his daughter, +Now he's with his Clementine. + +7. In my dreams she still doth haunt me, +Robed in garments soaked in brine; +Though in life I used to hug her, +Now she's dead, I'll draw the line. diff --git a/macros/latex/contrib/songproj/song2tex.py b/macros/latex/contrib/songproj/song2tex.py new file mode 100755 index 0000000000..dc32da2b3f --- /dev/null +++ b/macros/latex/contrib/songproj/song2tex.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python3 + +import argparse +import enum +import re + + +# The following regexp match the typical markers of refrain and couplet: +re_refrain = re.compile(r'(R(efrain)?|C(horus)?)( |[-./] ?)', re.IGNORECASE) +re_couplet = re.compile(r'\d+( |[-./] ?)') + + +def match_rest(regexp, s): + """Match the start of string s against the given regexp: + * if it matches, return the non-matching part; + * it it does not matches, return None.""" + if (m := regexp.match(s)) is not None: + return s[m.end():] + else: + return None + + +class State(enum.Enum): + """A state indicates in what context we are while parsing a song.""" + LIMBO = 0 # Not in the refrain or in a couplet + REFRAIN = 1 # In the refrain + COUPLET = 2 # In a couplet + + +def parse_song(lines, re_refrain, re_couplet): + # At the beginning of the song, we are not in the refrain or in a couplet. + state = State.LIMBO + # This variable will be used to record the longest line seen so far. + longest = '' + for line in lines: + line = line.rstrip() + if state == State.LIMBO: + # We are not in the refrain or in a couplet. Depending on what we find: + if (rest := match_rest(re_refrain, line)) is not None: + # when a refrain start marker is found, enter the refrain. + yield '\\begin{refrain}\n' + state = State.REFRAIN + line = rest + yield ' {} \\\\\n'.format(line) + elif (rest := match_rest(re_couplet, line)) is not None: + # when a couplet start marker is found, enter a couplet. + yield '\\begin{couplet}\n' + state = State.COUPLET + line = rest + yield ' {} \\\\\n'.format(line) + elif line != '': + # when a non-empty line is found, also enter a couplet as all. + yield '\\begin{couplet}\n' + state = State.COUPLET + yield ' {} \\\\\n'.format(line) + elif state == State.REFRAIN: + # We are in the refrain. Depending on what we find: + if line != '': + # when a non-empty line is found, stay in the refrain. + yield ' {} \\\\\n'.format(line) + else: + # when an empty line is found, leave the refrain. + yield '\\end{refrain}\n\n' + state = State.LIMBO + elif state == State.COUPLET: + # We are in a couplet. Depending on what we find: + if line != '': + # when a non-empty line is found, stay in the couplet. + yield ' {} \\\\\n'.format(line) + else: + # when an empty line is found, leave the couplet. + yield '\\end{couplet}\n\n' + state = State.LIMBO + # No matter what we found, we have a song line, possibly empty, that we + # have to check to see if it could not be the new longest line seen so far. + if len(line) > len(longest): + longest = line + # The song text file is now finished. We may still be in the refrain or in a + # couplet, that we have to close. + if state == State.REFRAIN: + yield '\\end{refrain}\n\n' + elif state == State.COUPLET: + yield '\\end{couplet}\n\n' + # Now print the longest line of the entire song. + yield '\\longest{{{}}}\n'.format(longest) + + +def main(args=None): + parser = argparse.ArgumentParser(description="Convert song text to LaTeX songproj markup") + parser.add_argument("--refrain", '-r', type=re.compile, default=re_refrain, metavar="REGEXP", + help="specify the refrain marker (regexp, default to \"{}\")".format(re_refrain.pattern)) + parser.add_argument("--couplet", '-c', type=re.compile, default=re_couplet, metavar="REGEXP", + help="specify the couplet marker (regexp, default \"{}\")".format(re_couplet.pattern)) + parser.add_argument("infile", help="input song text file", type=argparse.FileType('r')) + parser.add_argument("outfile", help="output LaTeX file", type=argparse.FileType('w')) + args = parser.parse_args(args) + for line in parse_song(args.infile, args.refrain, args.couplet): + args.outfile.write(line) + +if __name__ == "__main__": + main() diff --git a/macros/latex/contrib/songproj/songproj.dtx b/macros/latex/contrib/songproj/songproj.dtx new file mode 100644 index 0000000000..7c1783fe15 --- /dev/null +++ b/macros/latex/contrib/songproj/songproj.dtx @@ -0,0 +1,1024 @@ +% \iffalse meta-comment +% +% Copyright (C) 2022 by Tanguy Ortolo +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% 3. Neither the name of the copyright holder nor the names of its +% contributors may be used to endorse or promote products derived from this +% software without specific prior written permission. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGE. +% +% \fi +% +% \iffalse +%<*driver> +\ProvidesFile{songproj.dtx} +% +%\NeedsTeXFormat{LaTeX2e}[2020/10/01] +%\ProvidesPackage{songproj} +%<*package> + [2022/11/07 v1.0.1 Song projection] +% +% +%<*driver> +\documentclass{l3doc} +\usepackage{fontspec} +\usepackage{bookmark} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{songproj.dtx} + \PrintChanges + \PrintIndex +\end{document} +% +% \fi +% +% \CheckSum{256} +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% +% \changes{v0.1.0}{2021/09/19}{Initial version} +% \changes{v0.3.0}{2021/09/26}{Use \textsf{expl3} naming conventions} +% \changes{v1.0.0}{2021/11/07}{First public release} +% \changes{v1.0.1}{2021/11/07}{Add the generated extension file to Git} +% +% \GetFileInfo{songproj.dtx} +% +% \DoNotIndex{\newcommand,\newenvironment} +% \DoNotIndex{\begin,\end} +% \DoNotIndex{\bool,\bool_gset_false:N,\bool_gset_true:N,\bool_if:NTF,\bool_new:N} +% \DoNotIndex{\cs_gset:Npn,\cs_new:Npn} +% \DoNotIndex{\dim,\dim_compare:nNnTF,\dim_new:N,\dim_zero:N} +% \DoNotIndex{\int,\int_compare:nNnTF,\int_gset_eq:NN,\int_new:N,\int_step_function:nN,\int_eval:n,\int_mod:nn,\int_step_inline:nn,\int_use:N} +% \DoNotIndex{\seq,\seq_count:N,\seq_gclear:N,\seq_gput_right:Nn,\seq_gset_from_clist:Nn,\seq_if_empty:NTF,\seq_item:Nn,\seq_map_function:NN,\seq_new:N} +% \DoNotIndex{\tl,\tl_gclear:N,\tl_gset:Nn,\tl_new:N,\tl_use:N,\tl_if_empty:NTF} +% \DoNotIndex{\IfNoValueTF,\NewDocumentCommand,\NewDocumentEnvironment} +% \DoNotIndex{\env,\cmd,\textsf,\vfill} +% +% +% \title{The \textsf{songproj} package\thanks{This document +% corresponds to \textsf{songproj}~\fileversion, dated \filedate.}} +% \author{Tanguy Ortolo \\ \texttt{tanguy+latex@ortolo.eu}} +% +% \maketitle +% \section{Introduction} +% +% This package, together with the \cls{beamer} class, is used to generate +% slideshows with song lyrics. This is typically used in religious services in +% churches equipped with a projector, for which this package has been written, +% but it can be useful for any type of singing assembly\footnote{Indeed, the +% song used here as an example is not really a religious one! It was chosen +% because it is in the public domain and the author likes it.}. It provides +% environments to describe a song in a natural way, and formatting it into +% slides with overlays. +% +% \section{Usage} +% +% \subsection{The \env{song} environment} +% +% The main feature of this package is the \env{song}, that allows the user to +% describe an entire song that will be formatted into slides. +% +% \paragraph{} +% \DescribeEnv{song} +% The \env{song}\marg{stanzas per slide}\oarg{couplet list} environment is used +% around an entire song. It takes a mandatory argument, \meta{stanzas per +% slide}, to specify whether the user wants to show one or two +% stanzas\footnote{including the refrain} on the slide. An optional argument, +% \meta{couplet list} is a comma-separated list of couplet (or verse) indexes, +% that allows the user to indicate that they want to include only these +% couplets of a large song: without this, all couplets will be included. +% +% Inside of the \env{song} environment, the user will use the \cs{longest} +% command and the \env{intro}, \env{refrain}, \env{couplet}\footnote{We +% chose to use the French words \emph{refrain} and \emph{couplet} for several +% reason: the author is French, these words are understandable in English and +% their English equivalents, \emph{chorus} and \emph{verse}, have multiple +% meanings that would make them very ambiguous in both usage and implementation +% of this package.} and \env{final} environments. +% +% \paragraph{Warning} Inside a \env{song} environment, it is an error to write +% anything that is not an \env{intro}, \env{refrain}, \env{couplet}, +% \env{final} environment or a \cs{longest} command. Direct text would be +% typeset in a way that would disrupt the song formatting. +% +% \paragraph{} +% \begin{function}{\longest} +% \begin{syntax} +% \cs{longest}\marg{song line} +% \end{syntax} +% Inside a \env{song} environment, the \cs{longest}\marg{song line} command is +% used to declare the longest line of a song, that will be used to properly +% center the song stanzas, as allowed by the \pkg{verse} package. That line +% is only used to compute and record its length, and will not be typeset. +% \end{function} +% +% \changes{v0.4.0}{2021/09/29}{Document \env{intro} and \env{final} environments} +% +% \paragraph{} +% \DescribeEnv{intro} +% Inside a \env{song} environment, the optional \env{intro} environment +% declares a number of lines meant to be sung once, at the beginning of the +% song. In a psalm, this may be an antiphon. +% +% \paragraph{} +% \DescribeEnv{refrain} +% Inside a \env{song} environment, the optional \env{refrain} environment +% declares the song refrain (or chorus). A song may start with its refrain, or +% with a first couplet, followed by the refrain. It is not useful to declare +% the refrain several time, as the \env{song} environment will take care of +% repeating between the couplets. +% +% \paragraph{} +% \DescribeEnv{couplet} +% Inside a \env{song} environment, the \env{couplet} environment declares each +% couplet (or verse) of the song. +% +% \paragraph{} +% \DescribeEnv{final} +% Inside a \env{song} environment, the optional \env{final} environment +% declares a number of lines meant to be sung once, at the end of the song. In +% an hymn, that may be a doxology. +% +% \paragraph{Example} \label{example/song} +% The following song is defined with three couplets and a refrain. Since its +% begins with a couplet, it will be formatted with the first couplet, the +% refrain, the second couplet, the refrain, and so on. +% +% The \env{song} environment is given two arguments, |{2}[1,2]|. The first one +% tells it to show two stanzas, that is, both a couplet and the refrain, on the +% generated slide. The second argument tells it to include only the first two +% couplets in the output. +% +% \begin{verbatim} +% \begin{frame} +% \begin{song}{2}[1,2] +% \longest{Light she was, and like a fairy,} +% \begin{couplet} +% In a cavern, in a canyon, \\ +% Excavating for a mine. \\ +% Dwelt a miner, forty-niner, \\ +% And his daughter, Clementine. \\ +% \end{couplet} +% \begin{refrain} +% Oh my darling, oh my darling, \\ +% Oh my darling Clementine, \\ +% You are lost and gone forever, \\ +% Dreadful sorry, Clementine. \\ +% \end{refrain} +% \begin{couplet} +% Light she was, and like a fairy, \\ +% And her shoes were number nine, \\ +% Herring boxes, without topses, \\ +% Sandals were for Clementine. \\ +% \end{couplet} +% \begin{couplet} +% […] +% \end{couplet} +% \end{song} +% \end{frame} +% \end{verbatim} +% +% \subsection{The \cs{inputsong} command} +% \changes{v1.0.0}{2021/11/07}{Document the \cs{inputsong} command} +% +% \begin{function}{\inputsong} +% \begin{syntax} +% \cs{inputsong}\marg{file}\marg{stanzas per slide}\oarg{couplet list} +% \end{syntax} +% +% The \cs{inputsong} command environment is used as a shortcut for +% typesetting a song written in an external file. That file should contain the +% song content, including intro, refrain, couplet or final as needed, but +% \emph{without} being wrapped in a \env{song} environment. +% +% For instance, one could write a file named \file{clementine.tex} containing +% the \emph{content} of the \env{song} environment shown in example +% page~\pageref{example/song}, and use it in a slideshow: +% +% \begin{verbatim} +% \frame{\inputsong{clementine.tex}{2}[1,2]} +% \end{verbatim} +% \end{function} +% +% \subsection{The \env{refrain}, \env{couplet}, \env{intro} and \env{final} environments} +% +% \changes{v0.4.0}{2021/09/29}{Document \env{intro} and \env{final} environments} +% +% These commands are also usable outside of a \env{song} environment. In that +% case, they simply format a refrain or couplet, which can be useful when you +% need more manual control. +% +% \paragraph{} +% \DescribeEnv{refrain} +% Outside of a \env{song} environment, this environment simply wraps its +% content inside a \env{structure} and a \env{verse} environment. It takes an +% optional \meta{verse width} argument, that is used to properly center the +% refrain, as allowed by the \pkg{verse} package. +% +% \paragraph{} +% \DescribeEnv{couplet} +% Outside of a \env{song} environment, this environment simply wraps its +% content inside a \env{verse} environment. It takes an optional \meta{verse +% width} argument, that is used to properly center the refrain, as allowed by +% the \pkg{verse} package. +% +% \paragraph{} +% \DescribeEnv{intro} +% \DescribeEnv{final} +% Outside of a \env{song} environment, these environments simply wrap their +% content inside a \env{em} and a \env{verse} environment. They takes an +% optional \meta{verse width} argument, that is used to properly center the +% refrain, as allowed by the \pkg{verse} package. +% +% \subsection{Usage tips} +% +% For regular offices, there are several suggestions that can ease the creation +% and usage of lyric slideshows. +% +% \subsubsection{Using dedicated song files} +% +% It is suggested to write song lyrics in dedicated files, each containing a +% single the \emph{content} of a \env{song} environment, without the +% environment wrapping itself. They can then be used with the \cs{inputsong} +% command. +% +% For instance, one could write a file named \file{clementine.tex} containing +% the \emph{content} of the \env{song} environment shown in example +% page~\pageref{example/song}. It would then be used in a slideshow such as: +% +% \begin{verbatim} +% \documentclass{beamer} +% \usepackage{songproj} +% +% \begin{document} +% \begin{frame} +% \inputsong{clementine.tex}{2}[1,2,3] +% \end{frame} +% \end{document} +% \end{verbatim} +% +% \subsubsection{Importing text lyrics} +% +% Song lyrics are often found in text format with basic markup: +% +% \begin{verbatim} +% 1. In a cavern, in a canon, +% Excavating for a mine. +% Dwelt a miner, forty-niner, +% And his daughter, Clementine. +% +% C. Oh my darling, oh my darling, +% Oh my darling Clementine +% You are lost and gone forever, +% Dreadful sorry Clementine. +% +% 2. Light she was, and like a fairy, +% And her shoes were number nine, +% Herring boxes, without topses, +% Sandals were for Clementine. +% +% […] +% \end{verbatim} +% +% To avoid the tedious task of manually removing text and adding \LaTeX{} +% markup, we provide the \file{song2tex.py} helper. Please refer to its +% embedded help for detailed instructions about its usage: +% +% \begin{verbatim} +% $ ./song2tex.py --help +% $ ./song2tex.py clementine.txt clementine.tex +% \end{verbatim} +% +% \subsubsection{Projection layout advice} +% \changes{v1.0.0}{2021/11/07}{Add projection layout advice} +% +% During a religious service, a song lyrics projection is only a support, and +% should not draw their attention away from the main feature, which is the +% common prayer. +% +% I therefore suggest using a very simple Beamer theme, such as its default one +% with the \href{https://github.com/rchurchley/beamercolortheme-owl}{owl} color +% theme, and removing the navigation symbols. I also suggest not showing song +% titles (or anything else that is not actually sung by the assembly) unless +% there is a good reason to do so, such as getting used to a song or set of +% songs you intend to reuse often. +% +% \begin{verbatim} +% \documentclass{beamer} +% \usecolortheme{owl} +% \setbeamertemplate{navigation symbols}{} +% \usepackage{songproj} +% \begin{document} +% […] +% \end{document} +% \end{verbatim} +% +% \subsubsection{Projection advice} +% \changes{v1.0.0}{2021/11/07}{Add projection advice} +% +% For projecting song lyrics, you can take advantage of using a PDF +% presentation software able to show a presenter console on your laptop screen, +% and the current slide on the projector. Software like as +% \href{https://pdfpc.github.io/}{pdfpc} or +% \href{https://github.com/Cimbali/pympress/}{Pympress} can also understand and +% adapt their display to the concept of Beamer overlay. +% +% \StopEventually{} +% +% \section{Implementation} +% +% \subsection{Dependencies} +% +% This module is written using \LaTeX3 programming interfaces and command +% definitions: +% +% \begin{macrocode} +\RequirePackage{expl3} +\RequirePackage{xparse} +% \end{macrocode} +% +% The implementation of the \env{song} environment and its friends is mainly +% based on the \textsf{verse} package: +% +% \begin{macrocode} +\RequirePackage{verse} +% \end{macrocode} +% +% \subsection{Internal definitions} +% +% Almost all definitions use the \textsf{expl3} syntax: +% +% \begin{macrocode} +\ExplSyntaxOn +% \end{macrocode} +% +% \subsubsection{Internal variables} +% +% \changes{v0.2.0}{2021/09/23}{Use \texttt{sp} prefix for functions and +% variables} +% +% We define a number of internal variables, that are used when reading and +% formatting a song. All of these variables are meant to be set globally: since +% there is no notion of a song within a song, we are certain that we will +% always be either outside of a song or inside a single song. +% +% \begin{macrocode} +\bool_new:N \g__sp_song_bool % are we in a song? +\bool_new:N \g__sp_song_start_bool % are we at the start of a song? +\bool_new:N \g__sp_refrain_first_bool % does current song start with the + % refrain? +\int_new:N \g__sp_stanzas_per_slide_int % number of stanzas to show on each + % slide (1 or 2) +\dim_new:N \g__sp_linewidth_dim % length of the longest line in current + % song +\tl_new:N \g__sp_intro_tl % current song intro +\tl_new:N \g__sp_refrain_tl % current song refrain +\seq_new:N \g__sp_couplets_seq % current song couplets +\tl_new:N \g__sp_final_tl % current song final +\seq_new:N \g__sp_couplet_indexes_seq % indexes of couplets to include +% \end{macrocode} +% +% \subsubsection{Internal environments} +% +% These are high-level internal environments, that are used in the +% implementation of user interface environments. +% +% \begin{environment}{__sp_refrain} +% This environment simply formats a song refrain. It is used in the user interface +% \env{refrain} environment. +% +% \begin{macrocode} +\NewDocumentEnvironment {__sp_refrain} {} + % The environment opening may be followed by a [length], in fact part of its + % body, and will appear just after the opening of the verse environment and + % constitute its optional argument. + { + \begin{structureenv} + \begin{verse} + } + { + \end{verse} + \end{structureenv} + } +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{__sp_couplet} +% This environment simply formats a song couplet. It is used in the user interface +% \env{couplet} environment. +% +% \begin{macrocode} +\NewDocumentEnvironment {__sp_couplet} {} + % The environment opening may be followed by a [length], in fact part of its + % body, and will appear just after the opening of the verse environment and + % constitute its optional argument. + { \begin{verse} } + { \end{verse} } +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{__sp_special} {} +% +% \changes{v0.4.0}{2021/09/29}{Add an environment to format intro and final} +% +% This environments simply formats a song intro of final. It is used in the +% user interface \env{intro} and \env{final} environments. +% +% \begin{macrocode} +\NewDocumentEnvironment {__sp_special} {} + % The environment opening may be followed by a [length], in fact part of its + % body, and will appear just after the opening of the verse environment and + % constitute its optional argument. + { + \begin{em} + \begin{verse} + } + { + \end{verse} + \end{em} + } +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Internal macros} +% \changes{v0.3.0}{2021/09/26}{Define aux functions at top-level} +% +% These are macros that are used in the implementation of the \env{song} +% environment. +% +% \begin{macro}{\__sp_song_refrain} +% +% This macro uses the \env{__sp_refrain} environment to format the current song +% refrain. +% +% \begin{macrocode} +\tl_gset:Nn \__sp_song_refrain + { + % Do we know the width of the longest song line? + \dim_compare:nNnTF \g__sp_linewidth_dim {=} {0pt} + { \begin{__sp_refrain} } + { \begin{__sp_refrain} [\g__sp_linewidth_dim] } + \tl_use:N \g__sp_refrain_tl + \end{__sp_refrain} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\__sp_song_couplet:n} +% +% This macro uses the \env{__sp_couplet} environment to a specified couplet of +% the current song. It takes a single argument: +% +% \begin{arguments} +% \item index of the couplet to format. +% \end{arguments} +% +% \begin{macrocode} +\cs_gset:Npn \__sp_song_couplet:n #1 + { + % Do we know the width of the longest song line? + \dim_compare:nNnTF \g__sp_linewidth_dim {=} {0pt} + { \begin{__sp_couplet} } + { \begin{__sp_couplet} [\g__sp_linewidth_dim] } + \seq_item:Nn \g__sp_couplets_seq {#1} + \end{__sp_couplet} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\__sp_song_couplets:n} +% +% This macro inserts an containing all couplets of the current song in an +% \env{overprint} environment, in groups separated with \cs{onslide} +% commands. It takes a single argument: +% +% \begin{arguments} +% \item number of couplets to show together on each slide. +% \end{arguments} +% +% \begin{macrocode} +\cs_gset:Npn \__sp_song_couplets:n #1 + { + \begin{overprint} + % Loop on all specified couplets + \int_step_inline:nn + { \seq_count:N \g__sp_couplet_indexes_seq } + { + % Before every #1 lines, i.e. when (##1 - 1) mod #1 == 0), + % insert an \onslide + \int_compare:nNnTF + { \int_mod:nn { \int_eval:n{##1 - 1} } {#1} } { = } { 0 } + { \onslide<+> } + { \vskip \stanzaskip } + \__sp_song_couplet:n { \seq_item:Nn \g__sp_couplet_indexes_seq {##1} } + } + \end{overprint} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\__sp_song_intro} +% +% \changes{v0.4.0}{2021/09/29}{Add an environment to format current song intro} +% +% This macro uses the \env{__sp_special} environment to format the current song +% intro. +% +% \begin{macrocode} +\tl_gset:Nn \__sp_song_intro + { + % Do we know the width of the longest song line? + \dim_compare:nNnTF \g__sp_linewidth_dim {=} {0pt} + { \begin{__sp_special} } + { \begin{__sp_special} [\g__sp_linewidth_dim] } + \tl_use:N \g__sp_intro_tl + \end{__sp_special} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\__sp_song_final} +% +% \changes{v0.4.0}{2021/09/29}{Add an environment to format current song final} +% +% This macro uses the \env{__sp_refrain} environment to format the current song +% final. +% +% \begin{macrocode} +\tl_gset:Nn \__sp_song_final + { + % Do we know the width of the longest song line? + \dim_compare:nNnTF \g__sp_linewidth_dim {=} {0pt} + { \begin{__sp_special} } + { \begin{__sp_special} [\g__sp_linewidth_dim] } + \tl_use:N \g__sp_final_tl + \end{__sp_special} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\__sp_song} +% +% \changes{v0.4.0}{2021/09/29}{Include intro and final in complete song} +% +% This macro inserts the entire song, alternating refrain and couplets in an +% \env{overprint} environment. +% +% \begin{macrocode} +\tl_gset:Nn \__sp_song + { + % Is there a song intro? + \tl_if_empty:NTF \g__sp_intro_tl + {} + { + \visible<1> {\__sp_song_intro} + % The combination of overprint with verse that comes next somehow adds + % extra vertical space that needs to be removed. + \vskip -\stanzaskip + } + + \begin{overprint} + + % Does the song begin with the refrain? + \bool_if:NTF \g__sp_refrain_first_bool + { + % If so, print an initial refrain + \onslide<+> + \__sp_song_refrain + } + {} + + % Is there a refrain? + \tl_if_empty:NTF \g__sp_refrain_tl + { + % No refrain, loop on all specified couplets and insert them + \seq_map_inline:Nn + \g__sp_couplet_indexes_seq + { + \onslide<+> + \__sp_song_couplet:n {#1} + } + } + { + % There is a refrain, loop on all specified couplets and, each time, + % insert both a couplet and the refrain + \seq_map_inline:Nn + \g__sp_couplet_indexes_seq + { + \onslide<+> + \__sp_song_couplet:n {#1} + \onslide<+> + \__sp_song_refrain + } + } + \end{overprint} + + % Is there a song final? + \tl_if_empty:NTF \g__sp_final_tl + {} + { + % Add extra spacing + \vskip \stanzaskip + \visible<.> {\__sp_song_final} + } + } +% \end{macrocode} +% \end{macro} +% +% \subsection{User interface} +% +% These environments constitute our user interface. They allow the user to +% define songs, refrains and couplets. +% +% \begin{environment}{refrain} +% This environment handles a refrain : +% \begin{itemize} +% \item outside of a song, it uses the \env{__sp_refrain} environment to +% directly format it ; +% \item inside a song, it stores it into \cs{g__sp_retrain_tl}, so it can +% be formatted by the end of the \env{song} environment. +% \end{itemize} +% +% \begin{macrocode} +\NewDocumentEnvironment {refrain} { +b } + % The environment opening may be followed by a [length], in fact part of its + % body, and will appear just after the opening of the __sp_refrain + % environment and constitute its optional argument. + { + % Are we in a song? + \bool_if:NTF \g__sp_song_bool + { + % We are in a song, are we at its start? + \bool_if:NTF \g__sp_song_start_bool + { + % Indicate that we are no longer at the start of the song + \bool_gset_false:N\g__sp_song_start_bool + % and that the refrain comes first + \bool_gset_true:N\g__sp_refrain_first_bool + } + {} + % Anyway, store the refrain + \tl_gset:Nn \g__sp_refrain_tl {#1} + } + { + % We are not in a song, use __sp_refrain to format the refrain + \begin{__sp_refrain} + #1 + \end{__sp_refrain} + } + } + {} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{couplet} +% This environment handles a couplet, in a similar way: +% \begin{itemize} +% \item outside of a song, it uses the \env{__sp_couplet} environment to +% directly format it ; +% \item inside a song, it stores it by appending it to to +% \cs{g__sp_couplets_seq}, so it can be formatted by the end of the +% \env{song} environment. +% \end{itemize} +% +% \begin{macrocode} +\NewDocumentEnvironment {couplet} { +b } + % The environment opening may be followed by a [length], in fact part of its + % body, and will appear just after the opening of the __sp_couplet + % environment and constitute its optional argument. + { + % Are we in a song? + \bool_if:NTF \g__sp_song_bool + { + % Are we at in a song, are we at its start? + \bool_if:NTF \g__sp_song_start_bool + { + % Indicate that we are no longer at the start of the song + \bool_gset_false:N \g__sp_song_start_bool + % and that the refrain does not come first + \bool_gset_false:N \g__sp_refrain_first_bool + } + {} + % Anyway, store this couplet + \seq_gput_right:Nn \g__sp_couplets_seq { {#1} } + } + { + % We are not in a song, use __sp_couplet to format this couplet + \begin{__sp_couplet} + #1 + \end{__sp_couplet} + } + } + {} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{intro} +% +% \changes{v0.4.0}{2021/09/29}{Add an \env{intro} environment} +% +% This environment handles a song intro, in a similar way: +% \begin{itemize} +% \item outside of a song, it uses the \env{__sp_special} environment to +% directly format it; +% \item inside a song, it stores it into \cs{g__sp_intro_tl} so it can be +% formatted by the end of the \env{song} environment. +% \end{itemize} +% +% \begin{macrocode} +\NewDocumentEnvironment {intro} { +b } + % The environment opening may be followed by a [length], in fact part of its + % body, and will appear just after the opening of the __sp_special + % environment and constitute its optional argument. + { + % Are we in a song? + \bool_if:NTF \g__sp_song_bool + { + % We are in a song, store its intro + \tl_gset:Nn \g__sp_intro_tl {#1} + } + { + % We are not in a song, use __sp_special to format the intro + \begin{__sp_special} + #1 + \end{__sp_special} + } + } + {} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{final} +% +% \changes{v0.4.0}{2021/09/29}{Add a \env{final} environment} +% +% This environment handles a song final, in a similar way: +% \begin{itemize} +% \item outside of a song, it uses the \env{__sp_special} environment to +% directly format it; +% \item inside a song, it stores it into \cs{g__sp_final_tl} so it can be +% formatted by the end of the \env{song} environment. +% \end{itemize} +% +% \begin{macrocode} +\NewDocumentEnvironment {final} { +b } + % The environment opening may be followed by a [length], in fact part of its + % body, and will appear just after the opening of the __sp_special + % environment and constitute its optional argument. + { + % Are we in a song? + \bool_if:NTF \g__sp_song_bool + { + % We are in a song, store its intro + \tl_gset:Nn \g__sp_final_tl {#1} + } + { + % We are not in a song, use __sp_special to format the intro + \begin{__sp_special} + #1 + \end{__sp_special} + } + } + {} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\longest} +% This macro measures the length of a song line and stores it, so it can be +% used by the \env{song} environment to properly center refrain and couplets. +% It takes a single argument: +% +% \begin{arguments} +% \item a song line to measure. +% \end{arguments} +% +% \begin{macrocode} +\NewDocumentCommand {\longest} { m } { \settowidth {\g__sp_linewidth_dim} {#1} } +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{song} +% +% This environment is used as a container for entire songs. On opening, it does several things: +% \begin{enumerate} +% \item its stores its arguments into variables with a descriptive name; +% \item it clears out any previously stored refrain, couplet, intro, final +% and longest song line; +% \item it sets the \cs{g__sp_song_bool} variable to indicate that we +% are inside a song, which will alter the behaviour of the +% \env{refrain} and \env{couplet} environments so they record their +% content rather than directly formatting it into the document; +% \item it sets the \cs{g__sp_song_start_bool} variable to indicate that +% we are at the start of the song, which will allow the next +% \env{refrain} or \env{couplet} to tell if the song starts with the +% refrain or with a couplet; +% \end{enumerate} +% +% This environment takes two arguments: +% +% \begin{arguments} +% \item number of stanzas (counting couplets and refrain, when there is one) per slide; +% \item list of couplets to include (defaults to all), for instance |1,3,4|. +% \end{arguments} +% +% \begin{macrocode} +\NewDocumentEnvironment {song} { m o } + % {number of stanzas per slide (1 or 2)} + % [list of couplets to include (defaults to all)] + { + % Put arguments into variables with understandable names + \int_gset_eq:NN {\g__sp_stanzas_per_slide_int} {#1} + \IfNoValueTF {#2} + { \seq_gclear:N \g__sp_couplet_indexes_seq } + { \seq_gset_from_clist:Nn \g__sp_couplet_indexes_seq {#2} } + + % Clear out intro, refrain, couplet, final and longest song line + \tl_gclear:N \g__sp_intro_tl + \tl_gclear:N \g__sp_refrain_tl + \seq_gclear:N \g__sp_couplets_seq + \tl_gclear:N \g__sp_final_tl + \dim_zero:N {\g__sp_linewidth_dim} + + % Indicate that we are in a song, and at its start + \bool_gset_true:N \g__sp_song_bool + \bool_gset_true:N \g__sp_song_start_bool + } +% \end{macrocode} +% +% And on closing: +% \begin{itemize} +% \item if no list of couplet indexes to use have been given, it generates one +% covering all couplets in order; +% \item it uses internal functions to insert the intro, refrain, couplets and +% final into the document, in the right order according to the song +% structure (refrain or couplet first) and to the formatting instructions +% (one or two stanzas per slide). +% \end{itemize} +% +% \changes{v0.4.0}{2021/09/29}{Include intro and final in formatted song} +% +% \begin{macrocode} + { + % Have we been given indexes of specific couplets to use? + \seq_if_empty:NTF \g__sp_couplet_indexes_seq + { + % If not, generate it from the list of couplets + \int_step_inline:nn + { \seq_count:N \g__sp_couplets_seq } + { \seq_gput_right:Nn \g__sp_couplet_indexes_seq {##1} } + } + {} + + % Now we actually start inserting things into the document. + % How many stanzas per side did the user request? + \int_compare:nNnTF \g__sp_stanzas_per_slide_int {>} {1} + { + % More than one stanza per slide + % + % Is there an intro? + \tl_if_empty:NTF \g__sp_intro_tl + {} + { + \visible<1> {\__sp_song_intro} + % Adjust vertical spacing depending on whether the refrain or the + % couplets follow. + \bool_if:NTF\g__sp_refrain_first_bool + { + % Refrain comes next, add extra space + \vskip \parsep + } + { + % Couplets come next, the combination of their overprint and + % verse environment somehow adds extra vertical space that + % needs to be removed. + \vskip -\stanzaskip + } + } + + % Is there a refrain? + \tl_if_empty:NTF \g__sp_refrain_tl + { + % If there is no refrain, we use \__sp_song_couplets:n to write the + % couplets, \g__sp_stanzas_per_slide_int at a time. + \__sp_song_couplets:n { \int_use:N \g__sp_stanzas_per_slide_int } + } + { + % If there is a refrain, we use \__sp_song_refrain to write the + % refrain and \__sp_song_couplets:n to write overprint with all + % couplets. + + % Does the song begin with the refrain? + \bool_if:NTF\g__sp_refrain_first_bool + { + \__sp_song_refrain + \vskip -\stanzaskip + \__sp_song_couplets:n 1 + } + { + \__sp_song_couplets:n 1 + \vskip \stanzaskip + \__sp_song_refrain + } + } + + % Is there a final? + \tl_if_empty:NTF \g__sp_final_tl + {} + { + % Adjust vertical spacing depending on whether we follow the + % refrain or the couplets. + \tl_if_empty:NTF \g__sp_refrain_tl + { + % No refrain, we follow the couplets, add extra space + \vskip \stanzaskip + } + { + % There was a refrain, did it come first? + \bool_if:NTF \g__sp_refrain_first_bool + { + % Refrain came first, we follow the couplets, add extra space + \vskip \stanzaskip + } + { + % Refrain came last, we follow it, add extra space + \vskip \parsep + } + } + \visible<.> {\__sp_song_final} + } + } + { + % If the user requested one stanza per slide, we use \__sp_song to + % write the entire song in a single overprint environment. + \__sp_song + } + % Indicate that we are no longer in a song + \bool_gset_false:N\g__sp_song_bool + } +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\inputsong} +% \changes{v1.0.0}{2021/11/07}{Add a \cs{inputsong} command} +% +% This macro starts a \env{song} environment and \cs{input}s the song content +% from an external file. +% +% \begin{macrocode} +\NewDocumentCommand {\inputsong} { m m o } + { + \IfNoValueTF {#3} + { \begin{song} {#2} } + { \begin{song} {#2} [#3] } + \input{#1} + \end{song} + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Wrapping up} +% +% Now that we have defined everything we need, we can leave the \textsf{expl3} +% syntax and return to normal \TeX{} syntax: +% +% \begin{macrocode} +\ExplSyntaxOff +% \end{macrocode} +% +% \Finale +\endinput diff --git a/macros/latex/contrib/songproj/songproj.ins b/macros/latex/contrib/songproj/songproj.ins new file mode 100644 index 0000000000..ca332e122c --- /dev/null +++ b/macros/latex/contrib/songproj/songproj.ins @@ -0,0 +1,83 @@ +%% +%% Copyright (C) 2022 by Tanguy Ortolo +%% +%% Redistribution and use in source and binary forms, with or without +%% modification, are permitted provided that the following conditions are met: +%% 1. Redistributions of source code must retain the above copyright notice, +%% this list of conditions and the following disclaimer. +%% 2. Redistributions in binary form must reproduce the above copyright notice, +%% this list of conditions and the following disclaimer in the documentation +%% and/or other materials provided with the distribution. +%% +%% 3. Neither the name of the copyright holder nor the names of its +%% contributors may be used to endorse or promote products derived from this +%% software without specific prior written permission. +%% +%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +%% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +%% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +%% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +%% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +%% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +%% POSSIBILITY OF SUCH DAMAGE. +%% + +\input docstrip.tex +\keepsilent + +\usedir{tex/latex/songproj} + +\preamble + +This is a generated file. + +Copyright (C) 2022 by Tanguy Ortolo + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +\endpreamble + +\generate{\file{songproj.sty}{\from{songproj.dtx}{package}}} + +\obeyspaces +\Msg{*************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following *} +\Msg{* file into a directory searched by TeX: *} +\Msg{* *} +\Msg{* songproj.sty *} +\Msg{* *} +\Msg{* To produce the documentation run the file songproj.dtx *} +\Msg{* through LaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{*************************************************************} + +\endbatchfile diff --git a/macros/latex/contrib/songproj/songproj.pdf b/macros/latex/contrib/songproj/songproj.pdf new file mode 100644 index 0000000000..24216ce150 Binary files /dev/null and b/macros/latex/contrib/songproj/songproj.pdf differ diff --git a/macros/latex/contrib/stealcaps/README.md b/macros/latex/contrib/stealcaps/README.md index 28c939d8d7..bbd43e2fa2 100644 --- a/macros/latex/contrib/stealcaps/README.md +++ b/macros/latex/contrib/stealcaps/README.md @@ -11,11 +11,16 @@ In case you use pdfLaTeX the font name has to be NFSS compliant. With XeLaTeX or LuaLaTeX, correpsondingly, it has to be `fontspec` compliant. +Furthermore in Xe(La)TeX or Lua(La)TeX you can use `\renewcaps{}` +to load a dedicated only small capitals font like + + \renewcaps{Cormorant SC}. + Package dependencies: `pgfopts`, `iftex`, `fontspec`. -This is version 1.0 of the package. +This is version 1.1 of the package. -Copyright (C) 2018 by Ruben Giannotti +Copyright (C) 2018-2022 by Ruben Giannotti --- diff --git a/macros/latex/contrib/stealcaps/stealcaps.dtx b/macros/latex/contrib/stealcaps/stealcaps.dtx index 335fcac307..1bb6557a97 100644 --- a/macros/latex/contrib/stealcaps/stealcaps.dtx +++ b/macros/latex/contrib/stealcaps/stealcaps.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2018 by Ruben Giannotti +% Copyright (C) 2018-2022 by Ruben Giannotti % % ------------------------------------------------------- % @@ -30,13 +30,14 @@ %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{stealcaps} %<*package> - [2018/01/21 v1.0 Steal small capitals (RG)] + [2022/11/07 v1.1 Steal small capitals (RG)] % % %<*driver> \documentclass{ltxdoc} \usepackage{amssymb,parskip} \providecommand*\pkg{\textsf} +\providecommand*\vrs{\textsf} \providecommand*\option{\textit} \providecommand*\url{\texttt} \providecommand*\email{\texttt} @@ -49,7 +50,7 @@ % % \fi % -% \CheckSum{43} +% \CheckSum{59} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -69,6 +70,7 @@ % % % \changes{v1.0}{2018/01/21}{Initial version} +% \changes{v1.1}{2022/11/07}{Added the renewcaps macro for Xe(La)\TeX or Lua(La)\TeX} % % \GetFileInfo{stealcaps.dtx} % @@ -113,6 +115,17 @@ % In the first case you have to make sure the font name is NFSS compliant. % Otherwise, it has to be \pkg{fontspec} compliant. % +% As for \vrs{v1.1} in Xe\LaTeX{} and Lua\LaTeX{} you are able +% to use +% +% |\renewcaps{|\(\langle\)\textit{font name}\(\rangle\)|}| +% +% to override |\scshape| alltogether. +% This is mainly meant to be used if you have a single purpose font +% that provides only small capitals, e.g.: +% +% |\renewcaps{Cormorant SC}|. +% % \StopEventually{} % % The implementation is rather simple and straightforward. @@ -140,7 +153,7 @@ % \begin{macrocode} \pgfkeys{ /stc/.cd, - from/.store in=\font@wildcard@stc + from/.store in=\font@from@stc } \ProcessPgfOptions{/stc} % \end{macrocode} @@ -164,20 +177,42 @@ \fi % \end{macrocode} % -% At last, we load the replacement font +% The replacement font is loaded by % employing |\font@stc| inside a group -% and substitute the small captials fonts. +% and substituting the small captials fonts +% employing |\DeclareFontShape| with 'ssub'. % % \begin{macrocode} \begingroup - \font@stc\font@wildcard@stc\selectfont@or@relax@stc - \DeclareFontShape{\f@encoding}{\rmdefault}{m}{sc}{% - <-> ssub * \f@family/m/sc - }{} - \DeclareFontShape{\f@encoding}{\rmdefault}{bx}{sc}{% - <-> ssub * \f@family/bx/sc - }{} + \ifx\font@from@stc\@empty\else + \font@stc\font@from@stc\selectfont@or@relax@stc + \DeclareFontShape{\f@encoding}{\rmdefault}{m}{sc}{% + <-> ssub * \f@family/m/sc + }{} + \DeclareFontShape{\f@encoding}{\rmdefault}{bx}{sc}{% + <-> ssub * \f@family/bx/sc + }{} + \fi \endgroup % \end{macrocode} +% +% At last there is a user macro for XeTeX and LuaTeX environments +% to renew |\scshape| to a dedicated only small capitals TrueType +% or OpenType font, e.g. |\renewcaps{Cormorant SC}|. +% +% \begin{macrocode} +\newcommand*\renewcaps[1]{% + \ifPDFTeX + \typeout{% + You tried to use |\renewcaps| in pdfLaTeX, + which isn't needed. + Or did you mean to use XeLaTeX or LuaLaTeX? + } + \else + \providefontfamily\scshape{#1}% + \renewfontfamily\scshape{#1}% + \fi +} +% \end{macrocode} %\Finale \endinput diff --git a/macros/latex/contrib/stealcaps/stealcaps.ins b/macros/latex/contrib/stealcaps/stealcaps.ins index 76f993dd89..b2c6517470 100644 --- a/macros/latex/contrib/stealcaps/stealcaps.ins +++ b/macros/latex/contrib/stealcaps/stealcaps.ins @@ -1,4 +1,4 @@ -% Copyright (C) 2018 by Ruben Giannotti +% Copyright (C) 2018-2022 by Ruben Giannotti % % ------------------------------------------------------- % @@ -28,7 +28,7 @@ This is a generated file. -Copyright (C) 2018 by Ruben Giannotti +Copyright (C) 2018-2022 by Ruben Giannotti ------------------------------------------------------- @@ -62,10 +62,10 @@ and the derived file stealcaps.sty. \Msg{* To finish the installation you have to move the following *} \Msg{* file into a directory searched by TeX: *} \Msg{* *} -\Msg{* stealcaps.sty *} +\Msg{* stealcaps.sty *} \Msg{* *} \Msg{* To produce the documentation run the file *} -\Msg{* stealcaps.dtx through LaTeX. *} +\Msg{* stealcaps.dtx through LaTeX. *} \Msg{* *} \Msg{* Happy TeXing! *} \Msg{* *} diff --git a/macros/latex/contrib/stealcaps/stealcaps.pdf b/macros/latex/contrib/stealcaps/stealcaps.pdf index f4ebdd4cc3..5f902d0d51 100644 Binary files a/macros/latex/contrib/stealcaps/stealcaps.pdf and b/macros/latex/contrib/stealcaps/stealcaps.pdf differ diff --git a/macros/latex/contrib/stealcaps/testfile/CormorantSC-Regular.ttf b/macros/latex/contrib/stealcaps/testfile/CormorantSC-Regular.ttf new file mode 100644 index 0000000000..a51caaa710 Binary files /dev/null and b/macros/latex/contrib/stealcaps/testfile/CormorantSC-Regular.ttf differ diff --git a/macros/latex/contrib/stealcaps/testfile/EBGaramond-Regular.ttf b/macros/latex/contrib/stealcaps/testfile/EBGaramond-Regular.ttf new file mode 100644 index 0000000000..47f6537515 Binary files /dev/null and b/macros/latex/contrib/stealcaps/testfile/EBGaramond-Regular.ttf differ diff --git a/macros/latex/contrib/stealcaps/testfile/brelaregular.otf b/macros/latex/contrib/stealcaps/testfile/brelaregular.otf deleted file mode 100644 index 74457a5085..0000000000 Binary files a/macros/latex/contrib/stealcaps/testfile/brelaregular.otf and /dev/null differ diff --git a/macros/latex/contrib/stealcaps/testfile/stealcapitals-test.pdf b/macros/latex/contrib/stealcaps/testfile/stealcapitals-test.pdf deleted file mode 100644 index 7e9d85b23d..0000000000 Binary files a/macros/latex/contrib/stealcaps/testfile/stealcapitals-test.pdf and /dev/null differ diff --git a/macros/latex/contrib/stealcaps/testfile/stealcapitals-test.tex b/macros/latex/contrib/stealcaps/testfile/stealcapitals-test.tex deleted file mode 100644 index 996106df7f..0000000000 --- a/macros/latex/contrib/stealcaps/testfile/stealcapitals-test.tex +++ /dev/null @@ -1,22 +0,0 @@ -% arara: xelatex -\documentclass{article} -\usepackage{lipsum} -\usepackage{iftex} -\ifPDFTeX - \usepackage[from=ppl]{stealcaps} -\else - \usepackage{fontspec} - \setmainfont{Brela} - \usepackage[from={EB Garamond}]{stealcaps} -\fi - -\providecommand*\pkg{\textsc} - -\title{Testing the \pkg{stealcaps} package} -\author{Ruben Giannotti} -\date{\today} - -\begin{document} -\maketitle -\lipsum -\end{document} diff --git a/macros/latex/contrib/stealcaps/testfile/stealcaps-test.pdf b/macros/latex/contrib/stealcaps/testfile/stealcaps-test.pdf new file mode 100644 index 0000000000..8d4cefe782 Binary files /dev/null and b/macros/latex/contrib/stealcaps/testfile/stealcaps-test.pdf differ diff --git a/macros/latex/contrib/stealcaps/testfile/stealcaps-test.tex b/macros/latex/contrib/stealcaps/testfile/stealcaps-test.tex new file mode 100644 index 0000000000..42b2b22367 --- /dev/null +++ b/macros/latex/contrib/stealcaps/testfile/stealcaps-test.tex @@ -0,0 +1,26 @@ +% arara: xelatex +\documentclass{article} +\usepackage[from={EB Garamond}]{stealcaps} +% or try +% \usepackage{stealcaps} +% \renewcaps{Cormorant SC} + +\usepackage{titlesec} + \titleformat{\section} + {\scshape\normalsize\MakeLowercase}{\thesection}{1em}{} + +\usepackage{lipsum} + +\newcommand*\pkg{\textsc} + +\title{Test file for the \pkg{stealcaps} package} +\author{Ruben Giannotti} +\date{\today} + +\begin{document} +\maketitle + +\section{Lorem ipsum} + +\lipsum[3] +\end{document} \ No newline at end of file -- cgit v1.2.3