summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/sidenotesplus/sidenotesplus.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/sidenotesplus/sidenotesplus.dtx')
-rw-r--r--macros/latex/contrib/sidenotesplus/sidenotesplus.dtx72
1 files changed, 69 insertions, 3 deletions
diff --git a/macros/latex/contrib/sidenotesplus/sidenotesplus.dtx b/macros/latex/contrib/sidenotesplus/sidenotesplus.dtx
index 7e76cd609d..4d559deb3f 100644
--- a/macros/latex/contrib/sidenotesplus/sidenotesplus.dtx
+++ b/macros/latex/contrib/sidenotesplus/sidenotesplus.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2022 by Anton Vrba
+% Copyright (C) 2022/23 by Anton Vrba
%
% Home Page: https://github.com/anton-vrba/sidenotesplus
% Issues: https://github.com/anton-vrba/sidenotesplus/issues
@@ -36,7 +36,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%<package>\ProvidesPackage{sidenotesplus}
%<*package>
- [2022/07/09 1.02 rich text marginal notes, tables and figures ]
+ [2023/10/05 1.03 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)
@@ -97,6 +97,7 @@
% \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}
+% \changes{1.03}{2023/10/05}{added commands sidecitebefore, sideciteafter and sidcitemark}
%
% \begin{abstract}
% \noindent A package to manage the margin notes, figures, tables and captions.
@@ -146,7 +147,7 @@
% that is on the left page the mark is on the right hand side of the note.
% The option |classic| always places the mark to the left of the marginal note.
% This requires that the margin separator on the left page is slightly reduced if not
-% enough space is availabe to the page outer edge.
+% enough space is available to the page outer edge.
%
% \subsection{Modified \LaTeX\xspace commands}
%
@@ -288,11 +289,16 @@
%
%
% \DescribeMacro{\sidecite}
+% \DescribeMacro{\sidecitebefore}
+% % \DescribeMacro{\sidecitemark}
+% \DescribeMacro{\sideciteafter}
% \DescribeMacro{\sidecitet}
% \DescribeMacro{\sidecitet*}
% The |\sidecite|, |\sidecitet| and |\sidecitet*| provide citing
% references in the margin and uses the package |biblatex| which has to be setup
% outside the |sitenotesplus| package.
+% Use |sidecitebefore| or |sideciteafter| to place the marginalia reference
+% before or after the |sidenotemark|
% Example settings in the document preamble:
%
% ~~~~|\usepackage[english]{babel}|
@@ -1291,6 +1297,66 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\sidecitebefore}
+% --
+%
+% \begin{macrocode}
+\NewDocumentCommand \sidecitebefore {s d|| d<> d() d!! o o m }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+{ \IfNoValueOrEmptyTF{#6}
+ {\RenewDocumentCommand \snp@before {} {}}
+ {\RenewDocumentCommand \snp@before {} {#6}}
+ \IfNoValueOrEmptyTF{#7}
+ {\RenewDocumentCommand \snp@after {} {}}
+ {\RenewDocumentCommand \snp@after {} {#7}}
+ \sidenotetextbefore|#2|<#3>(#4)!#5!{\kern-2.3pt\upshape\fullcite[\snp@before][\snp@after]{#8}}
+}
+% \end{macrocode}
+%
+% \begin{macro}{\sideciteafter}
+% --
+%
+% \begin{macrocode}
+\NewDocumentCommand \sideciteafter {s d|| d<> d() d!! o o m }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+{ \IfNoValueOrEmptyTF{#6}
+ {\RenewDocumentCommand \snp@before {} {}}
+ {\RenewDocumentCommand \snp@before {} {#6}}
+ \IfNoValueOrEmptyTF{#7}
+ {\RenewDocumentCommand \snp@after {} {}}
+ {\RenewDocumentCommand \snp@after {} {#7}}
+ \sidenotetext|#2|<#3>(#4)!#5!{\kern-2.3pt\upshape\fullcite[\snp@before][\snp@after]{#8}}
+}
+% \end{macrocode}
+%
+%
+% \begin{macro}{\sidecitemark}
+% --
+%
+% \begin{macrocode}
+\NewDocumentCommand \sidecitemark {s d() d!! }
+{
+ \IfBooleanTF{#1}
+ { % starred
+ \relax}
+ {% unstarred
+ \IfNoValueOrEmptyTF{#3}
+ {\snp@sidenotemark (#2)}
+ {\snp@sidenotemark !#3!( #2)}
+ }
+ \xspace
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
\ExplSyntaxOff
%
%%