%% %% 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/11 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 \DeclareBoolOption[false]{twocolumn} % Two column \DeclareBoolOption[false]{incolumn} % Separation line fits in the column \ProcessKeyvalOptions*\relax \if@mindflow@twocolumn \@mindflow@incolumntrue \fi %%================================ %% Initialization %%================================ \RequirePackage{lineno} \RequirePackage{xcolor} \colorlet{mfSavedColor}{.} \colorlet{mindflowText}{mfSavedColor!30} \colorlet{mindflowNum}{mfSavedColor!8} \newcommand{\mindflowTextFont}{\normalfont\footnotesize} \newcommand{\mindflowNumFont}{\normalfont\scriptsize\ttfamily} \newcommand{\mindflowLeft}{*} \newcommand{\mindflowRight}{*} %%================================ %% The mindflow environment %%================================ \newif\ifLNturnsON \newcommand*{\mfSepLine}{% \parskip=0pt \LNturnsONfalse% \ifLineNumbers\LNturnsONtrue\fi\nolinenumbers% \par\noindent\nopagebreak% \if@mindflow@incolumn% \makebox[\linewidth]{\rule{\linewidth}{0.4pt}}% \else% \hspace*{-\paperwidth}\makebox[\linewidth]{\rule{4\paperwidth}{0.4pt}}% \fi% \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% \mindflowTextFont\color{mindflowText}% \mfSepLine% \linenumbers% \renewcommand\makeLineNumber{% \hss\color{mindflowNum}% \if@mindflow@linenumber% \mindflowNumFont\LineNumber~% \fi% \if@mindflow@leftmarker% \mindflowLeft\hspace{1em}% \fi% \if@mindflow@rightmarker% \rlap{\hskip\textwidth\hspace{1em}\mindflowRight}% \fi% }% } {% \par% \vspace{-.5\baselineskip}\mfSepLine% \ifLNturnsON\linenumbers\fi% \setcounter{mfLN}{\value{linenumber}} \setcounter{linenumber}{\value{recordLN}} } \fi \endinput %% %% End of file `mindflow.sty'.