From 18dd7002cc4041d250905f6967866a43de6547cd Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 10 Mar 2021 22:20:23 +0000 Subject: mindflow (10mar21) git-svn-id: svn://tug.org/texlive/trunk@58255 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/mindflow/mindflow.sty | 110 ++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/mindflow/mindflow.sty (limited to 'Master/texmf-dist/tex/latex/mindflow') 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'. -- cgit v1.2.3