summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-17 21:52:07 +0000
committerKarl Berry <karl@freefriends.org>2021-03-17 21:52:07 +0000
commit73abfb457db8ded202920028d88efc0ac5c90374 (patch)
treecfed527ab880aeaf5ea418d11af0a29289290df0 /Master/texmf-dist
parentcb37e5a6b26541a5c9e4c66cf287d2179c698d23 (diff)
mindflow (17mar21) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58489 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/mindflow/README.md11
-rw-r--r--Master/texmf-dist/doc/latex/mindflow/mindflow.pdfbin168685 -> 198276 bytes
-rw-r--r--Master/texmf-dist/source/latex/mindflow/mindflow.dtx153
-rw-r--r--Master/texmf-dist/tex/latex/mindflow/mindflow.sty47
4 files changed, 159 insertions, 52 deletions
diff --git a/Master/texmf-dist/doc/latex/mindflow/README.md b/Master/texmf-dist/doc/latex/mindflow/README.md
index 728aa95efd3..5b8f135fb02 100644
--- a/Master/texmf-dist/doc/latex/mindflow/README.md
+++ b/Master/texmf-dist/doc/latex/mindflow/README.md
@@ -1,15 +1,10 @@
<!-- Copyright (C) 2021 by Jinwen XU -->
-[Github](https://github.com/Jinwen-XU/mindflow) | [CTAN](https://ctan.org/pkg/mindflow) | [Download](https://github.com/Jinwen-XU/mindflow/releases)
-
-![License](https://img.shields.io/ctan/l/mindflow.svg) ![CTAN Version](https://img.shields.io/ctan/v/mindflow.svg) ![Github Version](https://img.shields.io/github/release/Jinwen-XU/mindflow.svg) ![Repo Size](https://img.shields.io/github/repo-size/Jinwen-XU/mindflow.svg)
-
----
-
# The mindflow package
-This package provides an environment that is separated from the main text and
-has its own line numbers, for writing ideas or annotations.
+`mindflow` is a LaTeX package that allows you to write your ideas and annotations in a clear way.
+
+More specifically, it provides a LaTeX environment with its own line numbers or markers, which can be well distinguished from the main text.
# License
diff --git a/Master/texmf-dist/doc/latex/mindflow/mindflow.pdf b/Master/texmf-dist/doc/latex/mindflow/mindflow.pdf
index b9448dbd483..753bb680539 100644
--- a/Master/texmf-dist/doc/latex/mindflow/mindflow.pdf
+++ b/Master/texmf-dist/doc/latex/mindflow/mindflow.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/mindflow/mindflow.dtx b/Master/texmf-dist/source/latex/mindflow/mindflow.dtx
index 43fadef53e1..8fa703d9383 100644
--- a/Master/texmf-dist/source/latex/mindflow/mindflow.dtx
+++ b/Master/texmf-dist/source/latex/mindflow/mindflow.dtx
@@ -18,15 +18,16 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{mindflow}
%<*package>
- [2021/03/12 Mindflow environment]
+ [2021/03/17 Mindflow environment]
%</package>
%
%<*driver>
\documentclass{article}
\usepackage{doc}
-\usepackage[a4paper,top=1.2in,bottom=1.2in,left=1.5in,right=1.2in]{geometry}
+\usepackage[a4paper,top=1.2in,bottom=1.2in,left=1.6in,right=1.2in]{geometry}
\usepackage{titling}
\setlength{\droptitle}{-.5in}
+\PassOptionsToPackage{mathlines}{lineno}
\usepackage[linenumber,rightmarker]{mindflow}
\usepackage{enumitem}
\setlist{noitemsep}
@@ -42,7 +43,7 @@
%</driver>
% \fi
%
-% \CheckSum{125}
+% \CheckSum{186}
%
% \GetFileInfo{mindflow.dtx}
%
@@ -55,11 +56,9 @@
%
% \section{Introduction}
%
-% The \textsf{mindflow} package provides you a way to write your ideas,
-% annotations or writing plans.
-
-% For example (with option
-% \verb|linenumber| and \verb|rightmarker|):
+% The \textsf{mindflow} package provides you a way to write your ideas
+% and annotations clearly. For exmaple, with the options
+% \verb|linenumber| and \verb|rightmarker|, you will get:
% \begin{mindflow}
% What to write next:
% \begin{itemize}
@@ -69,14 +68,15 @@
% \item the complete code.
% \end{itemize}
% \end{mindflow}
-% You can also add line numbers to the other part of your document in the usual way.
-% Line numbers within the \textsf{mindflow} environments are independent from
-% those of the main text.
%
% \section{Usage}
%
-% Simply load the package with \verb|\usepackage{mindflow}|. By default
-% it has no line numbers or markers. You can use the following options:
+% Simply load the package with
+% \begin{verbatim}
+% \usepackage{mindflow}
+% \end{verbatim}
+% \vspace{-.5\baselineskip}
+% By default, it has no line numbers or markers. You can use the following options:
%
% \begin{tabular}{ll}
% \verb|linenumber| & Enable line numbers\\
@@ -87,58 +87,106 @@
% \end{tabular}
%
% \DescribeEnv{mindflow}
-% Then you can use the mindflow environment as
+% Then you can use the \verb|mindflow| environment as
% \begin{verbatim}
% \begin{mindflow}
% ...
% \end{mindflow}
% \end{verbatim}
%
-% \section{Some technical details}
+% \linenumbers
+%
+% You can also add line numbers to the other part of your document in the usual
+% way. For example, line numbers have been turned on for this paragraph with
+% \verb|\linenumbers|.
+%
+% \begin{mindflow}
+% Line numbers within the \textsf{mindflow} environments are independent from
+% those of the main text.
+% \end{mindflow}
+% (\emph{I recommend that you put an empty line before and after the mindflow
+% environments. This way, your paragraph structure won't get changed when you
+% use the }\verb|off|\emph{ option.})
+%
+% \nolinenumbers
+%
+% The feature of line numbering is provided by the package \textsf{lineno}. You
+% can read its documentation to learn more about it. Notice that, by default,
+% displayed equations are not numbered. You can add the following line before
+% \verb|\usepackage{mindflow}|:\\[.5\baselineskip]
+% \null\hspace{1.5em}{\small\verb|\PassOptionsToPackage{mathlines}{lineno}|}\\[.5\baselineskip]
+% to enable the line numbers for displayed equations.
+%
+% \begin{mindflow}\vspace{-\baselineskip}
+% \begin{align*}
+% (a + b)^2 &= a^2 + 2ab + b^2\\
+% (a + b)^3 &= a^3 + 3a^2b + 3ab^2 + b^3
+% \end{align*}
+% \end{mindflow}
+%
+%
+% \section{Some \TeX{}nical details}
%
% \DescribeMacro{\mindflowTextFont}
% \DescribeMacro{\mindflowNumFont}
-% The font for texts and line numbers within the \verb|mindflow|
-% environments can be specified by redefining \verb|\mindflowTextFont| and
-% \verb|\mindflowNumFont|. By default they are defined as:
+% The font for text, line numbers and markers within the \verb|mindflow|
+% environments can be specified by redefining \verb|\mindflowTextFont|,
+% \verb|\mindflowNumFont| and \verb|\mindflowMarkerFont|. By default,
+% they are defined as:
% \begin{verbatim}
% \newcommand{\mindflowTextFont}{\normalfont\footnotesize}
% \newcommand{\mindflowNumFont}{\normalfont\scriptsize\ttfamily}
+% \newcommand{\mindflowMarkerFont}{\normalfont\scriptsize\ttfamily}
% \end{verbatim}
+% \vspace{-.5\baselineskip}
+%
% \DescribeMacro{\mindflowLeft}
% \DescribeMacro{\mindflowRight}
-% The left and right marker can be changed by redefining
+% The left and right markers can be changed by redefining
% \verb|\mindflowLeft| and \verb|\mindflowRight|. Both have the default
% value as ``\verb|*|''.
%
% \DescribeMacro{\mindflowLineHeight}
-% The height of the separation line is a length macro named \verb|\mindflowLineHeight|,
+% The height of the separation lines is a length macro named \verb|\mindflowLineHeight|,
% with default value \verb|0.4pt|. You can change this with \verb|\setlength|.
%
-% And finally, the color for texts and line numbers within the \verb|mindflow|
-% environments are called \verb|mindflowText| and \verb|mindflowNum|,
-% respectively. By default, they have the same color as the context, with
-% opacity 30\% and 8\%, respectively.
-
+% \DescribeMacro{mindflowLine}
+% \DescribeMacro{mindflowText}
+% \DescribeMacro{mindflowNum}
+% \DescribeMacro{mindflowMarker}
+% And finally, the colors for the separation lines, text, line numbers and
+% markers within the \verb|mindflow| environments are called
+% \verb|mindflowLine|, \verb|mindflowText|, \verb|mindflowNum| and
+% \verb|mindflowMarker|, respectively. By default, they have the same color as
+% the context, with opacity 30\% for the separation lines, text and markers, and
+% 8\% for the line numbers.
+%
% \section{An example}
% With option \verb|linenumber, leftmarker, rightmarker| and the following settings:
% \begin{verbatim}
-% \colorlet{mindflowText}{blue!50!cyan!80}
-% \colorlet{mindflowNum}{blue!50!cyan!80}
+% \colorlet{mindflowLine}{green!50!black}
+% \colorlet{mindflowText}{blue!50!cyan}
+% \colorlet{mindflowNum}{red!50!orange}
+% \colorlet{mindflowMarker}{orange}
% \renewcommand{\mindflowTextFont}{\normalfont\footnotesize\sffamily\itshape}
-% \renewcommand{\mindflowNumFont}{\normalfont\footnotesize\sffamily}
+% \renewcommand{\mindflowNumFont}{\normalfont\small\footnotesize\sffamily}
+% \renewcommand{\mindflowMarkerFont}{\normalfont\footnotesize\sffamily}
% \renewcommand{\mindflowLeft}{\hspace{1em}\(\succ\)}
% \renewcommand{\mindflowRight}{\(\prec\)}
% \setlength{\mindflowLineHeight}{1pt}
% \end{verbatim}
+% \vspace{-.5\baselineskip}
% One gets:
% \makeatletter
% \@mindflow@leftmarkertrue
% \makeatother
-% \colorlet{mindflowText}{blue!50!cyan!80}
-% \colorlet{mindflowNum}{blue!50!cyan!80}
+% \colorlet{mindflowLine}{green!50!black}
+% \colorlet{mindflowText}{blue!50!cyan}
+% \colorlet{mindflowNum}{red!50!orange}
+% \colorlet{mindflowMarker}{orange}
% \renewcommand{\mindflowTextFont}{\normalfont\footnotesize\sffamily\itshape}
-% \renewcommand{\mindflowNumFont}{\normalfont\footnotesize\sffamily}
+% \renewcommand{\mindflowNumFont}{\normalfont\small\footnotesize\sffamily}
+% \renewcommand{\mindflowMarkerFont}{\normalfont\footnotesize\sffamily}
% \renewcommand{\mindflowLeft}{\hspace{1em}\(\succ\)}
% \renewcommand{\mindflowRight}{\(\prec\)}
% \setlength{\mindflowLineHeight}{1pt}
@@ -177,11 +225,14 @@
\RequirePackage{xcolor}
\colorlet{mfSavedColor}{.}
+\colorlet{mindflowLine}{mfSavedColor!30}
\colorlet{mindflowText}{mfSavedColor!30}
+\colorlet{mindflowMarker}{mfSavedColor!30}
\colorlet{mindflowNum}{mfSavedColor!8}
\newcommand{\mindflowTextFont}{\normalfont\footnotesize}
\newcommand{\mindflowNumFont}{\normalfont\scriptsize\ttfamily}
+\newcommand{\mindflowMarkerFont}{\normalfont\scriptsize\ttfamily}
\newcommand{\mindflowLeft}{*}
\newcommand{\mindflowRight}{*}
\newlength{\mindflowLineHeight}
@@ -221,16 +272,17 @@
\setcounter{linenumber}{\value{mfLN}}%
\LNturnsONfalse%
\ifLineNumbers\LNturnsONtrue\fi\nolinenumbers%
+ \color{mindflowLine}\mfSepLine%
\mindflowTextFont\color{mindflowText}%
- \mfSepLine%
\linenumbers%
\renewcommand\makeLineNumber{%
- \hss\color{mindflowNum}%
+ \hss%
\if@mindflow@linenumber%
- \mindflowNumFont\LineNumber~%
+ \mindflowNumFont\color{mindflowNum}\LineNumber\hspace{1em}%
\fi%
+ \color{mindflowMarker}%
\if@mindflow@leftmarker%
- \mindflowLeft\hspace{1em}%
+ \mindflowMarkerFont\mindflowLeft\hspace{1em}%
\fi%
\if@mindflow@rightmarker%
\rlap{\hskip\textwidth\hspace{1em}\mindflowRight}%
@@ -239,12 +291,41 @@
}
{%
\par%
- \vspace{-.5\baselineskip}\mfSepLine%
+ \vspace{-.5\baselineskip}\color{mindflowLine}\mfSepLine%
\ifLNturnsON\linenumbers\fi%
\setcounter{mfLN}{\value{linenumber}}%
\setcounter{linenumber}{\value{recordLN}}%
}
\fi
+
+\ifdefined\linenomathpatch\else
+ \RequirePackage{amsmath}
+ \RequirePackage{etoolbox}
+ \newcommand*\linenomathpatch[1]{%
+ \cspreto{#1}{\linenomath}%
+ \cspreto{#1*}{\linenomath}%
+ \cspreto{end#1}{\endlinenomath}%
+ \cspreto{end#1*}{\endlinenomath}%
+ }
+ \newcommand*\linenomathpatchAMS[1]{%
+ \cspreto{#1}{\linenomathAMS}%
+ \cspreto{#1*}{\linenomathAMS}%
+ \csappto{end#1}{\endlinenomath}%
+ \csappto{end#1*}{\endlinenomath}%
+ }
+ \expandafter\ifx\linenomath\linenomathWithnumbers
+ \let\linenomathAMS\linenomathWithnumbers
+ \patchcmd\linenomathAMS{\advance\postdisplaypenalty\linenopenalty}{}{}{}
+ \else
+ \let\linenomathAMS\linenomathNonumbers
+ \fi
+ \linenomathpatch{equation}
+ \linenomathpatchAMS{gather}
+ \linenomathpatchAMS{multline}
+ \linenomathpatchAMS{align}
+ \linenomathpatchAMS{alignat}
+ \linenomathpatchAMS{flalign}
+\fi
% \end{macrocode}
%
% \Finale
diff --git a/Master/texmf-dist/tex/latex/mindflow/mindflow.sty b/Master/texmf-dist/tex/latex/mindflow/mindflow.sty
index 13f8f51f2ee..e585ae53d9e 100644
--- a/Master/texmf-dist/tex/latex/mindflow/mindflow.sty
+++ b/Master/texmf-dist/tex/latex/mindflow/mindflow.sty
@@ -17,9 +17,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mindflow}
- [2021/03/12 Mindflow environment]
-
-
+ [2021/03/17 Mindflow environment]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{%
family = @mindflow,
@@ -45,11 +43,14 @@
\RequirePackage{xcolor}
\colorlet{mfSavedColor}{.}
+\colorlet{mindflowLine}{mfSavedColor!30}
\colorlet{mindflowText}{mfSavedColor!30}
+\colorlet{mindflowMarker}{mfSavedColor!30}
\colorlet{mindflowNum}{mfSavedColor!8}
\newcommand{\mindflowTextFont}{\normalfont\footnotesize}
\newcommand{\mindflowNumFont}{\normalfont\scriptsize\ttfamily}
+\newcommand{\mindflowMarkerFont}{\normalfont\scriptsize\ttfamily}
\newcommand{\mindflowLeft}{*}
\newcommand{\mindflowRight}{*}
\newlength{\mindflowLineHeight}
@@ -89,16 +90,17 @@
\setcounter{linenumber}{\value{mfLN}}%
\LNturnsONfalse%
\ifLineNumbers\LNturnsONtrue\fi\nolinenumbers%
+ \color{mindflowLine}\mfSepLine%
\mindflowTextFont\color{mindflowText}%
- \mfSepLine%
\linenumbers%
\renewcommand\makeLineNumber{%
- \hss\color{mindflowNum}%
+ \hss%
\if@mindflow@linenumber%
- \mindflowNumFont\LineNumber~%
+ \mindflowNumFont\color{mindflowNum}\LineNumber\hspace{1em}%
\fi%
+ \color{mindflowMarker}%
\if@mindflow@leftmarker%
- \mindflowLeft\hspace{1em}%
+ \mindflowMarkerFont\mindflowLeft\hspace{1em}%
\fi%
\if@mindflow@rightmarker%
\rlap{\hskip\textwidth\hspace{1em}\mindflowRight}%
@@ -107,12 +109,41 @@
}
{%
\par%
- \vspace{-.5\baselineskip}\mfSepLine%
+ \vspace{-.5\baselineskip}\color{mindflowLine}\mfSepLine%
\ifLNturnsON\linenumbers\fi%
\setcounter{mfLN}{\value{linenumber}}%
\setcounter{linenumber}{\value{recordLN}}%
}
\fi
+
+\ifdefined\linenomathpatch\else
+ \RequirePackage{amsmath}
+ \RequirePackage{etoolbox}
+ \newcommand*\linenomathpatch[1]{%
+ \cspreto{#1}{\linenomath}%
+ \cspreto{#1*}{\linenomath}%
+ \cspreto{end#1}{\endlinenomath}%
+ \cspreto{end#1*}{\endlinenomath}%
+ }
+ \newcommand*\linenomathpatchAMS[1]{%
+ \cspreto{#1}{\linenomathAMS}%
+ \cspreto{#1*}{\linenomathAMS}%
+ \csappto{end#1}{\endlinenomath}%
+ \csappto{end#1*}{\endlinenomath}%
+ }
+ \expandafter\ifx\linenomath\linenomathWithnumbers
+ \let\linenomathAMS\linenomathWithnumbers
+ \patchcmd\linenomathAMS{\advance\postdisplaypenalty\linenopenalty}{}{}{}
+ \else
+ \let\linenomathAMS\linenomathNonumbers
+ \fi
+ \linenomathpatch{equation}
+ \linenomathpatchAMS{gather}
+ \linenomathpatchAMS{multline}
+ \linenomathpatchAMS{align}
+ \linenomathpatchAMS{alignat}
+ \linenomathpatchAMS{flalign}
+\fi
\endinput
%%
%% End of file `mindflow.sty'.