[latex3-commits] [git/LaTeX3-latex3-latex3] master: add \NB and \begin{NOTE} to l3doc (616e501)
Will Robertson
wspr81 at gmail.com
Tue Feb 26 13:27:59 CET 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/616e50143529131b8347bf08fd4fdda84369ec6d
>---------------------------------------------------------------
commit 616e50143529131b8347bf08fd4fdda84369ec6d
Author: Will Robertson <wspr81 at gmail.com>
Date: Tue Feb 26 22:57:59 2019 +1030
add \NB and \begin{NOTE} to l3doc
as per Frank's suggestion with two args
>---------------------------------------------------------------
616e50143529131b8347bf08fd4fdda84369ec6d
l3kernel/l3doc.dtx | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 8cc7655..74c6525 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -334,6 +334,17 @@ and all files in that bundle must be distributed together.
% class names, respectively.
% \end{function}
%
+% \begin{function}{\NB, \NOTE}
+% \begin{syntax}
+% \cs{NB} \marg{tag} \marg{comments}
+% \verb|\begin{NOTE}| \marg{tag}
+% \qquad\meta{comments}
+% \verb|\end{NOTE}|
+% \end{syntax}
+% Make notes in the source that are not typeset by default. When the \verb|show-notes|
+% class option is active, the comments are typeset in a detokenized and verbatim mode, respectively.
+% \end{function}
+%
% \subsection{Describing functions in the documentation}
%
% \DescribeEnv{function}
@@ -694,6 +705,7 @@ and all files in that bundle must be distributed together.
% \g_@@_checkfunc_bool,
% \g_@@_checktest_bool,
% \g_@@_cs_break_bool,
+% \g_@@_show_notes_bool,
% \g_@@_kernel_bool
% }
% Information about package options.
@@ -703,6 +715,7 @@ and all files in that bundle must be distributed together.
\bool_new:N \g_@@_checktest_bool
\bool_new:N \g_@@_kernel_bool
\bool_new:N \g_@@_cs_break_bool
+\bool_new:N \g_@@_show_notes_bool
\bool_gset_true:N \g_@@_cs_break_bool
% \end{macrocode}
% \end{variable}
@@ -1430,6 +1443,13 @@ and all files in that bundle must be distributed together.
% \end{macrocode}
%
% \begin{macrocode}
+\DeclareOption { show-notes }
+ { \bool_gset_true:N \g_@@_show_notes_bool }
+\DeclareOption { hide-notes }
+ { \bool_gset_false:N \g_@@_show_notes_bool }
+% \end{macrocode}
+%
+% \begin{macrocode}
\DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } }
\ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default }
\PassOptionsToClass { a4paper } { article }
@@ -3435,6 +3455,57 @@ and all files in that bundle must be distributed together.
% \end{environment}
% \end{environment}
%
+% \subsubsection{NB and NOTE}
+%
+% These macros are intended for additional notes added to the source that are not typeset.
+%
+% \begin{macro}{\NB}
+% \NB{wspr}{this is what I think about this!}
+% \begin{verbatim}
+% \NB{wspr}{this is what I think about this!}
+% \end{verbatim}
+% \begin{macrocode}
+\bool_if:NTF \g_@@_show_notes_bool
+ {
+ \NewDocumentCommand\NB{mm}
+ {
+ (\emph{Note}\footnote{\ttfamily [#1]:~\detokenize{#2}})
+ }
+ }
+ {
+ \NewDocumentCommand\NB{mm}{}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{\NOTE}
+% \begin{NOTE}{wspr}
+% this is what I #$%& think about this!
+% \end{NOTE}
+% \begin{verbatim}
+% \begin{NOTE}{wspr}
+% this is what I #$%& think about this!
+% \end{NOTE}
+% \end{verbatim}
+% \begin{macrocode}
+\bool_if:NTF \g_@@_show_notes_bool
+ {
+ \NewDocumentEnvironment{NOTE}{m}
+ {
+ \par\noindent (\emph{Note}~[\texttt{#1}]:\par
+ \verbatim
+ }
+ {
+ \endverbatim
+ \par\noindent \emph{Note~end})\par
+ }
+ }
+ {
+ \NewDocumentEnvironment{NOTE}{m}{\comment}{\endcomment}
+ }
+% \end{macrocode}
+% \end{environment}
+%
% \subsection{Documenting templates}
%
% \begin{macrocode}
More information about the latex3-commits
mailing list