summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mindflow
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-10 22:20:23 +0000
committerKarl Berry <karl@freefriends.org>2021-03-10 22:20:23 +0000
commit18dd7002cc4041d250905f6967866a43de6547cd (patch)
tree9ae0361b1d3b8635e219ee365ae583e592054b9e /Master/texmf-dist/tex/latex/mindflow
parent16377a3bcee200f22dff083eef26a0baa2d8b399 (diff)
mindflow (10mar21)
git-svn-id: svn://tug.org/texlive/trunk@58255 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mindflow')
-rw-r--r--Master/texmf-dist/tex/latex/mindflow/mindflow.sty110
1 files changed, 110 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mindflow/mindflow.sty b/Master/texmf-dist/tex/latex/mindflow/mindflow.sty
new file mode 100644
index 00000000000..230340c4905
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/mindflow/mindflow.sty
@@ -0,0 +1,110 @@
+%%
+%% This is file `mindflow.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mindflow.dtx (with options: `package')
+%%
+%% Copyright (C) 2021 by Jinwen XU
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3 of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{mindflow}
+ [2021/03/09 Mindflow environment]
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{%
+ family = @mindflow,
+ prefix = @mindflow@
+}
+\DeclareBoolOption[false]{off} % Turn off mindflow
+\DeclareBoolOption[false]{leftmarker} % Left marker
+\DeclareBoolOption[false]{rightmarker} % Right marker
+\DeclareBoolOption[false]{linenumber} % Line numbers
+
+\ProcessKeyvalOptions*\relax
+
+%%================================
+%% Initialization
+%%================================
+\newcommand{\mindflowFont}{\normalfont\footnotesize}
+\newcommand{\mindflowNumFont}{\normalfont\scriptsize\ttfamily}
+
+\RequirePackage{lineno}
+\RequirePackage{xcolor}
+
+\colorlet{mfSavedColor}{.}
+\colorlet{mindflow}{mfSavedColor!30}
+
+\newcommand{\mindflowLeft}{%
+ \if@mindflow@leftmarker%
+ {*}%
+ \fi%
+}
+\newcommand{\mindflowRight}{%
+ \if@mindflow@rightmarker%
+ {*}%
+ \fi%
+}
+
+%%================================
+%% The mindflow environment
+%%================================
+\newif\ifLNturnsON
+
+\newcommand*{\mfSepLine}{%
+ \parskip=0pt
+ \LNturnsONfalse%
+ \ifLineNumbers\LNturnsONtrue\fi\nolinenumbers%
+ \par\noindent\nopagebreak%
+ \makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}%
+ \nopagebreak\par%
+ \ifLNturnsON\linenumbers\fi%
+}
+
+\newcounter{recordLN}
+\newcounter{mfLN}
+\setcounter{mfLN}{1}
+
+\if@mindflow@off
+ \RequirePackage{verbatim}
+ \let\mindflow=\comment
+ \let\endmindflow=\endcomment
+\else
+ \newenvironment{mindflow}
+ {%
+ \setcounter{recordLN}{\value{linenumber}}
+ \setcounter{linenumber}{\value{mfLN}}
+ \LNturnsONfalse%
+ \ifLineNumbers\LNturnsONtrue\fi\nolinenumbers%
+ \mindflowFont\color{mindflow}%
+ \mfSepLine%
+ \linenumbers%
+ \renewcommand\makeLineNumber{%
+ \hss\color{mindflow!25}%
+ \if@mindflow@linenumber%
+ \mindflowNumFont\LineNumber~%
+ \fi%
+ \mindflowLeft\hspace{1em}\rlap{\hskip\textwidth\hspace{1em}\mindflowRight}%
+ }%
+ }
+ {%
+ \par%
+ \vspace{-.5\baselineskip}\mfSepLine%
+ \ifLNturnsON\linenumbers\fi%
+ \setcounter{mfLN}{\value{linenumber}}
+ \setcounter{linenumber}{\value{recordLN}}
+ }
+\fi
+\endinput
+%%
+%% End of file `mindflow.sty'.