diff options
author | Karl Berry <karl@freefriends.org> | 2022-07-10 19:59:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-07-10 19:59:27 +0000 |
commit | ef2d4cbbeae7ccacb977dc42a4df7f44f61ee1a8 (patch) | |
tree | df9cce6c7308c38add7d457a3dc1c24660085099 /Master | |
parent | 1110e94ef8664eae9c9ad31b63a7d0bb1dc964df (diff) |
sidenotesplus (10jul22)
git-svn-id: svn://tug.org/texlive/trunk@63867 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/sidenotesplus/README.txt | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/sidenotesplus/sidenotesplus.pdf | bin | 213799 -> 233491 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/sidenotesplus/tests-sidenoteplus.pdf | bin | 218699 -> 218822 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx | 55 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty | 41 |
5 files changed, 62 insertions, 39 deletions
diff --git a/Master/texmf-dist/doc/latex/sidenotesplus/README.txt b/Master/texmf-dist/doc/latex/sidenotesplus/README.txt index e602b7cd34e..c2a416610f0 100644 --- a/Master/texmf-dist/doc/latex/sidenotesplus/README.txt +++ b/Master/texmf-dist/doc/latex/sidenotesplus/README.txt @@ -2,7 +2,7 @@ LaTeX package sidenotesplus Copyright (c) Anton Vrba, 2022 ------------------------------------------------------------------- Version: - 2022/05/31 1.01 + 2022/07/09 1.02 added Ragged option Licence: This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, version 1.3c of the license. @@ -17,5 +17,6 @@ Abstract: For biblatex users, routines for side references are provided. ------------------------------------------------------------------- -Previous Versions: +Previous Versions: + 2022/05/31 1.01 Minor bug fix 2022/05/15 1.00 Initial release diff --git a/Master/texmf-dist/doc/latex/sidenotesplus/sidenotesplus.pdf b/Master/texmf-dist/doc/latex/sidenotesplus/sidenotesplus.pdf Binary files differindex 5237810fea0..46bd149c760 100644 --- a/Master/texmf-dist/doc/latex/sidenotesplus/sidenotesplus.pdf +++ b/Master/texmf-dist/doc/latex/sidenotesplus/sidenotesplus.pdf diff --git a/Master/texmf-dist/doc/latex/sidenotesplus/tests-sidenoteplus.pdf b/Master/texmf-dist/doc/latex/sidenotesplus/tests-sidenoteplus.pdf Binary files differindex e9cf85133f1..dcf7635717a 100644 --- a/Master/texmf-dist/doc/latex/sidenotesplus/tests-sidenoteplus.pdf +++ b/Master/texmf-dist/doc/latex/sidenotesplus/tests-sidenoteplus.pdf diff --git a/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx b/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx index b6c51d20d25..7e76cd609db 100644 --- a/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx +++ b/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx @@ -36,7 +36,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[2020/10/01] %<package>\ProvidesPackage{sidenotesplus} %<*package> - [2022/05/31 v1.01 rich text marginal notes, tables and figures ] + [2022/07/09 1.02 rich text marginal notes, tables and figures ] %</package> %<package>\RequirePackage{marginnote} % provides an offset option for the marginals instead of a float %<package>\RequirePackage{caption} % handles the captions (in the margin) @@ -94,8 +94,9 @@ % % \maketitle % -% \changes{v1.0}{2022/05/15}{Initial Release} -% \changes{v1.01}{2022/05/31}{Environment text* improved} +% \changes{1.0}{2022/05/15}{Initial Release} +% \changes{1.01}{2022/05/31}{Environment text* improved} +% \changes{1.02}{2022/07/09}{added Ragged option} % % \begin{abstract} % \noindent A package to manage the margin notes, figures, tables and captions. @@ -124,6 +125,7 @@ % |size=| & |footnote, normal, small, script| \\ % |shape=| & | up, it, sl|\\ % |ragged| & switches to ragged outer margins\\ +% |Ragged| & switches to ragged outer margins but uses ragged2e package\\ % |classic| & switches to a classic look\\ % |sepdiff=| & |1em|, or a valid length within reason \\ % |alerton| & switches on the rendering of the margin alerts \\ @@ -132,9 +134,13 @@ % ~ % % The normal page style is that margin notes are left-right justified with the -% last line ragged to the outer edge. The option |ragged| changes this +% last line ragged to the outer edge. The option |ragged| or |Ragged| changes this % style to ragged-outer, that is the left page's marginal notes are |\raggedleft| % and the right page's are |\raggedright|. +% If you opt to use |Ragged| the package |ragged2e| is loaded and |RaggedLeft/Right| +% is used instead of |raggedleft/right|. Load package |ragged2e| with required +% options before |sidenotesplus| is loaded, otherwise |sidenotesplus| loads +% |ragged2e| without any options. % % The marginal note's reference number or mark is placed in the margin separator, % that is on the left page the mark is on the right hand side of the note. @@ -325,6 +331,8 @@ % \item[ifoddpage] provides the command |\ifoddpage| % \item[etoolbox] provides the command |\patchcmd| % \item[calc] provides calculation such as adding lengths +% \item[ragged2e] if |Ragged| option is used, and provides hyphenation +% to prevent very short lines % % \end{description}% @@ -360,7 +368,7 @@ \snp@size\snp@shape\snp@font\leavevmode% \lineskip=0pt \lineskiplimit=0pt % \tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300% - \doublehyphendemerits=100000% + \doublehyphendemerits=300% \finalhyphendemerits=\doublehyphendemerits } \NewDocumentCommand \snp@sideformat {} {} @@ -385,6 +393,7 @@ \bool_new:N \l@snp@alerton \bool_new:N \l@snp@alertmarkon \bool_new:N \l@snp@ragged +\bool_new:N \l@snp@Ragged \bool_new:N \l@snp@symmetric \bool_new:N \l@snp@page @@ -392,6 +401,7 @@ \bool_set_false:N \l@snp@alerton \bool_set_false:N \l@snp@alertmarkon \bool_set_false:N \l@snp@ragged +\bool_set_false:N \l@snp@Ragged \bool_set_true:N \l@snp@symmetric @@ -430,9 +440,19 @@ ragged .code:n = { \RenewDocumentCommand \snp@leftmarginstyle {}{\raggedleft} \RenewDocumentCommand \snp@rightmarginstyle {}{\raggedright} \bool_set_true:N \l@snp@ragged }, + Ragged .code:n = { \RenewDocumentCommand \snp@leftmarginstyle {}{\RaggedLeft} + \RenewDocumentCommand \snp@rightmarginstyle {}{\RaggedRight} + \bool_set_true:N \l@snp@Ragged + \bool_set_true:N \l@snp@ragged }, alerton .code:n = {\bool_set_true:N \l@snp@alerton}, } \ProcessKeysOptions { sidenoteplus } +\bool_if:NTF \l@snp@Ragged + { + \@ifpackageloaded{ragged2e} + {\relax}{\RequirePackage{ragged2e}} + } + {\relax} \bool_if:NTF \l@snp@ragged {\setlength{\snp@marginsepdiff}{0pt} \bool_set_false:N \l@snp@symmetric} {\relax} @@ -683,13 +703,13 @@ % -- % % \begin{macrocode} -\NewDocumentCommand \sidenotemark {s d() d!! m } +\NewDocumentCommand \sidenotemark {s d() d!! } { \IfBooleanTF{#1} { % starred \relax} {% unstarred - \IfNoValueOrEmptyT{#3} + \IfNoValueOrEmptyTF{#3} {\snp@sidenotemark (#2)} {\snp@sidenotemark !#3!( #2)} } @@ -1213,19 +1233,14 @@ % \begin{macrocode} \RenewDocumentEnvironment{table*}{O{htbp} } { - \begin{table}[#1] - \begin{@snp@autoadjustwidth}{}{\d@snp@extrawidth} - \if@twoside - \snp@isoddpage{\raggedright}{\raggedleft} - \snp@isoddpage - {\captionsetup{margin={0pt,0pt}} } - {\captionsetup{margin={-\d@snp@extrawidth,\d@snp@extrawidth}} } - \else - \raggedright \captionsetup{margin={0pt,0pt}} - \fi -} -{ % end part - \end{@snp@autoadjustwidth} + \begin{table}[#1] + \begin{@snp@autoadjustwidth}{}{\d@snp@extrawidth} + \begin{minipage}[c]{\linewidth} + \centering + \captionsetup{ margin={\d@snp@extrawidth/2,\d@snp@extrawidth/2}} +}{ % end part + \end{minipage} + \end{@snp@autoadjustwidth} \end{table} } % \end{macrocode} diff --git a/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty b/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty index c2573aab68c..20627123db2 100644 --- a/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty +++ b/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty @@ -25,7 +25,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020/10/01] \ProvidesPackage{sidenotesplus} - [2022/05/31 v1.01 rich text marginal notes, tables and figures ] + [2022/07/09 1.02 rich text marginal notes, tables and figures ] \RequirePackage{marginnote} % provides an offset option for the marginals instead of a float \RequirePackage{caption} % handles the captions (in the margin) \RequirePackage{xparse} % new LaTeX3 syntax to define macros and environments @@ -55,7 +55,7 @@ \snp@size\snp@shape\snp@font\leavevmode% \lineskip=0pt \lineskiplimit=0pt % \tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300% - \doublehyphendemerits=100000% + \doublehyphendemerits=300% \finalhyphendemerits=\doublehyphendemerits } \NewDocumentCommand \snp@sideformat {} {} @@ -72,6 +72,7 @@ \bool_new:N \l@snp@alerton \bool_new:N \l@snp@alertmarkon \bool_new:N \l@snp@ragged +\bool_new:N \l@snp@Ragged \bool_new:N \l@snp@symmetric \bool_new:N \l@snp@page @@ -79,6 +80,7 @@ \bool_set_false:N \l@snp@alerton \bool_set_false:N \l@snp@alertmarkon \bool_set_false:N \l@snp@ragged +\bool_set_false:N \l@snp@Ragged \bool_set_true:N \l@snp@symmetric \newlength{\snp@marginsepdiff} @@ -112,9 +114,19 @@ ragged .code:n = { \RenewDocumentCommand \snp@leftmarginstyle {}{\raggedleft} \RenewDocumentCommand \snp@rightmarginstyle {}{\raggedright} \bool_set_true:N \l@snp@ragged }, + Ragged .code:n = { \RenewDocumentCommand \snp@leftmarginstyle {}{\RaggedLeft} + \RenewDocumentCommand \snp@rightmarginstyle {}{\RaggedRight} + \bool_set_true:N \l@snp@Ragged + \bool_set_true:N \l@snp@ragged }, alerton .code:n = {\bool_set_true:N \l@snp@alerton}, } \ProcessKeysOptions { sidenoteplus } +\bool_if:NTF \l@snp@Ragged + { + \@ifpackageloaded{ragged2e} + {\relax}{\RequirePackage{ragged2e}} + } + {\relax} \bool_if:NTF \l@snp@ragged {\setlength{\snp@marginsepdiff}{0pt} \bool_set_false:N \l@snp@symmetric} {\relax} @@ -280,13 +292,13 @@ {\relax} \bool_set_false:N \l@snp@alertmarkon } -\NewDocumentCommand \sidenotemark {s d() d!! m } +\NewDocumentCommand \sidenotemark {s d() d!! } { \IfBooleanTF{#1} { % starred \relax} {% unstarred - \IfNoValueOrEmptyT{#3} + \IfNoValueOrEmptyTF{#3} {\snp@sidenotemark (#2)} {\snp@sidenotemark !#3!( #2)} } @@ -623,19 +635,14 @@ } \RenewDocumentEnvironment{table*}{O{htbp} } { - \begin{table}[#1] - \begin{@snp@autoadjustwidth}{}{\d@snp@extrawidth} - \if@twoside - \snp@isoddpage{\raggedright}{\raggedleft} - \snp@isoddpage - {\captionsetup{margin={0pt,0pt}} } - {\captionsetup{margin={-\d@snp@extrawidth,\d@snp@extrawidth}} } - \else - \raggedright \captionsetup{margin={0pt,0pt}} - \fi -} -{ % end part - \end{@snp@autoadjustwidth} + \begin{table}[#1] + \begin{@snp@autoadjustwidth}{}{\d@snp@extrawidth} + \begin{minipage}[c]{\linewidth} + \centering + \captionsetup{ margin={\d@snp@extrawidth/2,\d@snp@extrawidth/2}} +}{ % end part + \end{minipage} + \end{@snp@autoadjustwidth} \end{table} } \NewDocumentCommand \snp@before {} {} |