texlive[63867] Master/texmf-dist: sidenotesplus (10jul22)
commits+karl at tug.org
commits+karl at tug.org
Sun Jul 10 21:59:27 CEST 2022
Revision: 63867
http://tug.org/svn/texlive?view=revision&revision=63867
Author: karl
Date: 2022-07-10 21:59:27 +0200 (Sun, 10 Jul 2022)
Log Message:
-----------
sidenotesplus (10jul22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/sidenotesplus/README.txt
trunk/Master/texmf-dist/doc/latex/sidenotesplus/sidenotesplus.pdf
trunk/Master/texmf-dist/doc/latex/sidenotesplus/tests-sidenoteplus.pdf
trunk/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx
trunk/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty
Modified: trunk/Master/texmf-dist/doc/latex/sidenotesplus/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sidenotesplus/README.txt 2022-07-10 19:58:58 UTC (rev 63866)
+++ trunk/Master/texmf-dist/doc/latex/sidenotesplus/README.txt 2022-07-10 19:59:27 UTC (rev 63867)
@@ -2,7 +2,7 @@
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 @@
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
Modified: trunk/Master/texmf-dist/doc/latex/sidenotesplus/sidenotesplus.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sidenotesplus/tests-sidenoteplus.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx 2022-07-10 19:58:58 UTC (rev 63866)
+++ trunk/Master/texmf-dist/source/latex/sidenotesplus/sidenotesplus.dtx 2022-07-10 19:59:27 UTC (rev 63867)
@@ -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 at size\snp at shape\snp at font\leavevmode%
\lineskip=0pt \lineskiplimit=0pt %
\tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
- \doublehyphendemerits=100000%
+ \doublehyphendemerits=300%
\finalhyphendemerits=\doublehyphendemerits
}
\NewDocumentCommand \snp at sideformat {} {}
@@ -385,6 +393,7 @@
\bool_new:N \l at snp@alerton
\bool_new:N \l at snp@alertmarkon
\bool_new:N \l at snp@ragged
+\bool_new:N \l at snp@Ragged
\bool_new:N \l at snp@symmetric
\bool_new:N \l at snp@page
@@ -392,6 +401,7 @@
\bool_set_false:N \l at snp@alerton
\bool_set_false:N \l at snp@alertmarkon
\bool_set_false:N \l at snp@ragged
+\bool_set_false:N \l at snp@Ragged
\bool_set_true:N \l at snp@symmetric
@@ -430,9 +440,19 @@
ragged .code:n = { \RenewDocumentCommand \snp at leftmarginstyle {}{\raggedleft}
\RenewDocumentCommand \snp at rightmarginstyle {}{\raggedright}
\bool_set_true:N \l at snp@ragged },
+ Ragged .code:n = { \RenewDocumentCommand \snp at leftmarginstyle {}{\RaggedLeft}
+ \RenewDocumentCommand \snp at rightmarginstyle {}{\RaggedRight}
+ \bool_set_true:N \l at snp@Ragged
+ \bool_set_true:N \l at snp@ragged },
alerton .code:n = {\bool_set_true:N \l at snp@alerton},
}
\ProcessKeysOptions { sidenoteplus }
+\bool_if:NTF \l at snp@Ragged
+ {
+ \@ifpackageloaded{ragged2e}
+ {\relax}{\RequirePackage{ragged2e}}
+ }
+ {\relax}
\bool_if:NTF \l at snp@ragged
{\setlength{\snp at marginsepdiff}{0pt} \bool_set_false:N \l at 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 at sidenotemark (#2)}
{\snp at sidenotemark !#3!( #2)}
}
@@ -1213,19 +1233,14 @@
% \begin{macrocode}
\RenewDocumentEnvironment{table*}{O{htbp} }
{
- \begin{table}[#1]
- \begin{@snp at autoadjustwidth}{}{\d at snp@extrawidth}
- \if at twoside
- \snp at isoddpage{\raggedright}{\raggedleft}
- \snp at isoddpage
- {\captionsetup{margin={0pt,0pt}} }
- {\captionsetup{margin={-\d at snp@extrawidth,\d at snp@extrawidth}} }
- \else
- \raggedright \captionsetup{margin={0pt,0pt}}
- \fi
-}
-{ % end part
- \end{@snp at autoadjustwidth}
+ \begin{table}[#1]
+ \begin{@snp at autoadjustwidth}{}{\d at snp@extrawidth}
+ \begin{minipage}[c]{\linewidth}
+ \centering
+ \captionsetup{ margin={\d at snp@extrawidth/2,\d at snp@extrawidth/2}}
+}{ % end part
+ \end{minipage}
+ \end{@snp at autoadjustwidth}
\end{table}
}
% \end{macrocode}
Modified: trunk/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty 2022-07-10 19:58:58 UTC (rev 63866)
+++ trunk/Master/texmf-dist/tex/latex/sidenotesplus/sidenotesplus.sty 2022-07-10 19:59:27 UTC (rev 63867)
@@ -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 at size\snp at shape\snp at font\leavevmode%
\lineskip=0pt \lineskiplimit=0pt %
\tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
- \doublehyphendemerits=100000%
+ \doublehyphendemerits=300%
\finalhyphendemerits=\doublehyphendemerits
}
\NewDocumentCommand \snp at sideformat {} {}
@@ -72,6 +72,7 @@
\bool_new:N \l at snp@alerton
\bool_new:N \l at snp@alertmarkon
\bool_new:N \l at snp@ragged
+\bool_new:N \l at snp@Ragged
\bool_new:N \l at snp@symmetric
\bool_new:N \l at snp@page
@@ -79,6 +80,7 @@
\bool_set_false:N \l at snp@alerton
\bool_set_false:N \l at snp@alertmarkon
\bool_set_false:N \l at snp@ragged
+\bool_set_false:N \l at snp@Ragged
\bool_set_true:N \l at snp@symmetric
\newlength{\snp at marginsepdiff}
@@ -112,9 +114,19 @@
ragged .code:n = { \RenewDocumentCommand \snp at leftmarginstyle {}{\raggedleft}
\RenewDocumentCommand \snp at rightmarginstyle {}{\raggedright}
\bool_set_true:N \l at snp@ragged },
+ Ragged .code:n = { \RenewDocumentCommand \snp at leftmarginstyle {}{\RaggedLeft}
+ \RenewDocumentCommand \snp at rightmarginstyle {}{\RaggedRight}
+ \bool_set_true:N \l at snp@Ragged
+ \bool_set_true:N \l at snp@ragged },
alerton .code:n = {\bool_set_true:N \l at snp@alerton},
}
\ProcessKeysOptions { sidenoteplus }
+\bool_if:NTF \l at snp@Ragged
+ {
+ \@ifpackageloaded{ragged2e}
+ {\relax}{\RequirePackage{ragged2e}}
+ }
+ {\relax}
\bool_if:NTF \l at snp@ragged
{\setlength{\snp at marginsepdiff}{0pt} \bool_set_false:N \l at snp@symmetric}
{\relax}
@@ -280,13 +292,13 @@
{\relax}
\bool_set_false:N \l at snp@alertmarkon
}
-\NewDocumentCommand \sidenotemark {s d() d!! m }
+\NewDocumentCommand \sidenotemark {s d() d!! }
{
\IfBooleanTF{#1}
{ % starred
\relax}
{% unstarred
- \IfNoValueOrEmptyT{#3}
+ \IfNoValueOrEmptyTF{#3}
{\snp at sidenotemark (#2)}
{\snp at sidenotemark !#3!( #2)}
}
@@ -623,19 +635,14 @@
}
\RenewDocumentEnvironment{table*}{O{htbp} }
{
- \begin{table}[#1]
- \begin{@snp at autoadjustwidth}{}{\d at snp@extrawidth}
- \if at twoside
- \snp at isoddpage{\raggedright}{\raggedleft}
- \snp at isoddpage
- {\captionsetup{margin={0pt,0pt}} }
- {\captionsetup{margin={-\d at snp@extrawidth,\d at snp@extrawidth}} }
- \else
- \raggedright \captionsetup{margin={0pt,0pt}}
- \fi
-}
-{ % end part
- \end{@snp at autoadjustwidth}
+ \begin{table}[#1]
+ \begin{@snp at autoadjustwidth}{}{\d at snp@extrawidth}
+ \begin{minipage}[c]{\linewidth}
+ \centering
+ \captionsetup{ margin={\d at snp@extrawidth/2,\d at snp@extrawidth/2}}
+}{ % end part
+ \end{minipage}
+ \end{@snp at autoadjustwidth}
\end{table}
}
\NewDocumentCommand \snp at before {} {}
More information about the tex-live-commits
mailing list.