Debian Codegraph @

texmf-dist/source/latex/mindflow/mindflow.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2021-2022 by Jinwen XU
4 % -------------------------------
5 %
6 % This file may be distributed and/or modified under the conditions of the LaTeX
7 % Project Public License, either version 1.3c of this license or (at your option)
8 % any later version. The latest version of this license is in:
9 %
10 % http://www.latex-project.org/lppl.txt
11 %
12 % \fi
13 %
14 % \iffalse
15 %<*driver>
16 \ProvidesFile{mindflow.dtx}
17 %</driver>
18 %<package>\NeedsTeXFormat{LaTeX2e}
19 %<package>\ProvidesPackage{mindflow}
20 %<*package>
21 [2022/12/06 The mindflow environment]
22 %</package>
23 %
24 %<*driver>
25 \documentclass{article}
26 \usepackage{doc}
27 \usepackage[a4paper,top=1.2in,bottom=1.2in,left=1.6in,right=1.2in]{geometry}
28 \usepackage{titlesec}
29 \titleformat{\section}{\large\scshape\centering}{\textcolor{black!55}{$\thesection$}}{.5em}{}
30 \titleformat{\subsection}{\normalsize\scshape}{\textcolor{black!55}{$\thesubsection$}}{.5em}{}
31 \titlespacing{\section}{0pt}{.75pc}{.5pc}
32 \titlespacing{\subsection}{0pt}{.75pc}{.5pc}
33 \usepackage{titling}
34 \setlength{\droptitle}{-.75in}
35 \usepackage{enumitem}
36 \setlist{noitemsep}
37 \setlist[itemize,1]{label=\textcolor{black!55}{$\bullet$}}
38 \usepackage{newpxtext}
39 \useosf
40 \usepackage{mathtools,amssymb}
41 \usepackage[euler-digits]{eulervm}
42 % \usepackage{ebgaramond,ebgaramond-maths}
43 \usepackage[symbol]{footmisc}
44 \usepackage{microtype}
45 \usepackage[mathlines,linenumber,rightmarker]{mindflow}
46 \usepackage{parskip}
47 \usepackage{listings}
48 \definecolor{maintheme}{RGB}{50,100,150}
49 \definecolor{forestgreen}{RGB}{21,122,81}
50 \definecolor{lightergray}{gray}{0.99}
51 \lstset{language=[LaTeX]TeX,
52 keywordstyle=\color{maintheme},
53 basicstyle=\ttfamily,
54 commentstyle=\color{forestgreen}\ttfamily,
55 stringstyle=\rmfamily,
56 showstringspaces=false,
57 breaklines=true,
58 frame=lines,
59 backgroundcolor=\color{lightergray},
60 flexiblecolumns=true,
61 escapeinside={(*}{*)},
62 % numbers=left,
63 % numberstyle=\scriptsize, stepnumber=1, numbersep=5pt,
64 % firstnumber=last,
65 }
66 \providecommand{\meta}[1]{$\langle${\normalfont\itshape#1}$\rangle$}
67 \lstset{moretexcs=%
68 {linenumbers,nolinenumbers,mindflowLeft,mindflowRight,mindflowTextFont,mindflowNumFont,mindflowMarkerFont,mindflowLineHeight,setlength,colorlet,color,
69 RequirePackage,SetupKeyvalOptions,DeclareBoolOption,ProcessKeyvalOptions,PassOptionsToPackage,
70 PackageWarning,MessageBreak,
71 @mindflow@incolumntrue,if@mindflow@linenumber,@mindflow@leftlinenumbertrue,if@mindflow@on,if@mindflow@off,@mindflow@offfalse,if@mindflow@incolumn,if@mindflow@leftlinenumber,if@mindflow@rightlinenumber,if@mindflow@leftmarker,if@mindflow@rightmarker,if@mindflow@nonbreakable,if@mindflow@mathlines,
72 mindflow@parindent,mindflow@parskip,
73 ifLNturnsON,LNturnsONtrue,LNturnsONfalse,ifLineNumbers,
74 mindflowset,
75 mindflow,endmindflow,comment,endcomment,
76 mindflowON,endmindflowON,mindflowOFF,endmindflowOFF,
77 mfSepLine,makeLineNumber,LineNumber,
78 mindflow@makeLineNumber,LocallyStopLineNumbers,ResumeLineNumbers,
79 if@twocolumn,
80 ifICturnsON,ICturnsONtrue,ICturnsONfalse,AutoIncolumn,ResumeIncolumn,
81 newtcolorbox,
82 define@key,setkeys,
83 nowidow,
84 }
85 }
86 \lstnewenvironment{code*}%
87 {\setkeys{lst}{columns=fullflexible,keepspaces=true}}{}
88 \lstnewenvironment{code-with-linenumber}%
89 {\setkeys{lst}{columns=fullflexible,keepspaces=true,numbers=left,numberstyle=\scriptsize, stepnumber=1, numbersep=5pt,lastline=236}}{}
90 \EnableCrossrefs
91 \CodelineIndex
92 \RecordChanges
93 \begin{document}
94 \DocInput{mindflow.dtx}
95 \end{document}
96 %</driver>
97 % \fi
98 %
99 % \CheckSum{0}
100 %
101 % \GetFileInfo{mindflow.dtx}
102 %
103 %
104 % \title{{\huge\scshape\textsf{mindflow}}\\[.15\baselineskip]\itshape\large write your ideas in a clear way\smallskip}
105 % \author{\scshape Jinwen XU}
106 % \footnotetext{\hspace*{-1em}Corresponding to: \textsf{mindflow} \ttfamily\filedate}
107 % \date{\normalsize December 2022, in Paris}
108 %
109 % \maketitle
110 %
111 % \section{Introduction}
112 %
113 % The \textsf{mindflow} package provides you a way to write your ideas
114 % and annotations clearly. For example, with the options \verb|linenumber|
115 % and \verb|rightmarker|, you will get something like this:
116 % \begin{mindflow}
117 % What to write next:
118 % \begin{itemize}
119 % \item usage: the initialization, options and configuration;
120 % \item an example maybe;
121 % \item some word on the line numbering feature;
122 % \item some internal macros and the complete code.
123 % \end{itemize}
124 % \end{mindflow}
125 % This example only shows the default effect. You can customize it further according to the instructions in the next section.
126 %
127 % \section{The usage}
128 %
129 % \subsection{How to load it\,?}
130 % Simply load the package with
131 % \iffalse
132 %<*example>
133 % \fi
134 \begin{code*}
135 \usepackage{mindflow}
136 \end{code*}
137 % \iffalse
138 %</example>
139 % \fi
140 %
141 % By default, there are no decorations like line numbers or markers. To enable
142 % them, you can use the following options (they can be specified directly, like
143 % \verb|off|, or as a boolean optional, like \verb|off=false|):
144 %
145 % \begin{center}
146 % \begin{tabular}{ll}
147 % \verb|linenumber|\hspace{5em} & Enable line numbering feature, same as \verb|leftlinenumber|\\
148 % \verb|mathlines| & Enable line numbers for displayed equations\\
149 % \verb|leftlinenumber| & Enable left line numbers\\
150 % \verb|rightlinenumber| & Enable right line numbers\\
151 % \verb|leftmarker| & Enable left marker, by default it is an asterisk ``\verb|*|''\\
152 % \verb|rightmarker| & Enable right marker, by default it is an asterisk ``\verb|*|''\\
153 % \verb|incolumn| & The separation line would fit in the column \\&(\emph{automatically applied in two-column documents})\\
154 % \verb|off|, \verb|on| & Turn the \verb|mindflow| environments \emph{off} or \emph{on}
155 % \end{tabular}
156 % \end{center}
157 %
158 % There is also an option \verb|nonbreakable|, which enables the \textsf{tcolorbox} version, permitting a background color, but is not breakable and does not support line numbering quite well.
159 %
160 % \subsection{How to use it\,?}
161 % \DescribeEnv{\{mindflow\}}
162 % You can then use the \verb|mindflow| environment as
163 % \iffalse
164 %<*example>
165 % \fi
166 \begin{code*}
167 \begin{mindflow}
168 (*{\normalfont\meta{text}}*)
169 \end{mindflow}
170 \end{code*}
171 % \iffalse
172 %</example>
173 % \fi
174 %
175 % \subsection{Further configurations}
176 %
177 % \DescribeMacro{\mindflowset}
178 % You can use \lstinline|\mindflowset{|\meta{configuration}\lstinline|}| to
179 % further configure the \texttt{mindflow} environment. The available keys are
180 % listed at the top of the next page.
181 % \clearpage
182 %
183 % \begin{center}
184 % \begin{tabular}{ll|ll}
185 % \hline
186 % \verb|left| & The left marker & \verb|right| & The right marker\\
187 % \verb|textcolor| & Color of the text & \verb|textfont| & Font of the text\\
188 % \verb|numcolor| & Color of line numbers & \verb|numfont| & Font of line numbers\\
189 % \verb|markercolor| & Color of the markers & \verb|markerfont| & Font of the marker\\
190 % \verb|linecolor| & Color of the separation line & \verb|lineheight| & Height of the separation line\\
191 % \hline
192 % \end{tabular}
193 % \end{center}
194 %
195 % Additionally, most of the options mentioned in the previous section (except for \verb|nonbreakable| and \verb|mathlines|) can be set with \lstinline|\mindflowset|.%
196 % \footnote{If the package option \texttt{nonbreakable} is enabled, then there is also a key \texttt{backgroundcolor}, similar to \texttt{textcolor}, for configuring the background color of the \texttt{mindflow} environments.}
197 %
198 % \section{An example}
199 % With the following settings:
200 % \iffalse
201 %<*example>
202 % \fi
203 \begin{code*}
204 \mindflowset{
205 leftlinenumber, rightlinenumber, leftmarker, rightmarker,
206 linecolor = green!50!black,
207 textcolor = blue!50!cyan,
208 numcolor = red!50!orange,
209 markercolor = orange,
210 textfont = \footnotesize\sffamily\itshape,
211 numfont = \small\footnotesize\ttfamily,
212 markerfont = \footnotesize\sffamily,
213 left = \hspace{1em}\(\succ\),
214 right = \(\prec\)\hspace{1em},
215 lineheight = 1pt
216 }
217 \end{code*}
218 % \iffalse
219 %</example>
220 % \fi
221 % \vspace{-.5\baselineskip}
222 % One will get something like this (a little bit exaggerated, to be honest):
223 % \begingroup
224 % \makeatletter
225 % \@mindflow@leftmarkertrue
226 % \@mindflow@rightlinenumbertrue
227 % \makeatother
228 % \colorlet{mindflowLine}{green!50!black}
229 % \colorlet{mindflowText}{blue!50!cyan}
230 % \colorlet{mindflowNum}{red!50!orange}
231 % \colorlet{mindflowMarker}{orange}
232 % \renewcommand{\mindflowTextFont}{\footnotesize\sffamily\itshape}
233 % \renewcommand{\mindflowNumFont}{\small\footnotesize\ttfamily}
234 % \renewcommand{\mindflowMarkerFont}{\footnotesize\sffamily}
235 % \renewcommand{\mindflowLeft}{\hspace{1em}\(\succ\)}
236 % \renewcommand{\mindflowRight}{\(\prec\)\hspace{1em}}
237 % \setlength{\mindflowLineHeight}{1pt}
238 % \begin{mindflow}
239 % Hello, here is some text without a meaning. This text should show what a printed text will look like at this place. If you read this text, you will get no information. Really? Is there no information? Is there a difference between this text and some nonsense like “Huardest gefburn”? Kjift – not at all! A blind text like this gives you information about the selected font, how the letters are written and an impression of the look.
240 % \end{mindflow}
241 % \endgroup
242 %
243 % \section{About the line numbers}
244 % \linenumbers
245 %
246 % You can also add line numbers to the other part of your document in the usual
247 % way. For example, line numbers have been turned on for this paragraph with
248 % \lstinline|\linenumbers|.
249 %
250 % \begin{mindflow}
251 % Line numbers within the \textsf{mindflow} environments are independent from
252 % those of the main text.
253 % \end{mindflow}
254 % (\emph{I recommend that you put an empty line before and after the mindflow
255 % environments, i.e.~make the \emph{\textsf{mindflow}} environment a paragraph
256 % of its own. This way, your paragraph structure won't get changed when you use
257 % the} \verb|off|\emph{ option.})
258 %
259 % \nolinenumbers
260 %
261 % The line numbering feature is provided by package \textsf{lineno}. For
262 % more details, please refer to its documentation. Notice that
263 % displayed equations are not numbered by default. To enable the line numbers for them, you can use the option \verb|mathlines|. The result would be like:
264 %
265 % \begin{mindflow}\vspace{-\baselineskip}
266 % \begin{align*}
267 % \sum_{i_1 < \cdots < i_n} \prod_{1 \leqslant j \leqslant n} i_j^{-2} &= \frac{\pi^{2n}}{(2n+1)!}\\
268 % \implies \frac{e^{\pi}-e^{-\pi}}{2\pi} &= 1+ \sum_{n \geqslant 1} \sum_{i_1 < \cdots < i_n} \prod_{1 \leqslant j \leqslant n} i_j^{-2}
269 % \end{align*}
270 % \end{mindflow}
271 %
272 % \clearpage
273 % {\color{black!55}
274 % \makebox[\linewidth]{\rule{4\paperwidth}{\mindflowLineHeight}}%
275 % \centerline{\itshape ---~~Readers who are not interested in technical details can skip the rest~~---}
276 %
277 % \vspace{-\baselineskip}
278 % \makebox[\linewidth]{\rule{4\paperwidth}{\mindflowLineHeight}}%
279 % }
280 %
281 % \section{Some \TeX{}nical details}
282 %
283 % \subsection{Internal macros for text elements}
284 % \DescribeMacro{\mindflowTextFont}
285 % \DescribeMacro{\mindflowNumFont}
286 % \DescribeMacro{\mindflowMarkerFont}
287 % The font for text, line numbers and markers within the \verb|mindflow|
288 % environments can be specified by redefining \lstinline|\mindflowTextFont|,
289 % \lstinline|\mindflowNumFont| and \lstinline|\mindflowMarkerFont|. By default,
290 % they are defined as:
291 % \iffalse
292 %<*example>
293 % \fi
294 \begin{code*}
295 \newcommand{\mindflowTextFont}{\footnotesize}
296 \newcommand{\mindflowNumFont}{\scriptsize\ttfamily}
297 \newcommand{\mindflowMarkerFont}{\scriptsize\ttfamily}
298 \end{code*}
299 % \iffalse
300 %</example>
301 % \fi
302 % \vspace{-.5\baselineskip}
303 %
304 % \DescribeMacro{\mindflowLeft}
305 % \DescribeMacro{\mindflowRight}
306 % The left and right markers is defined by
307 % \lstinline|\mindflowLeft| and \lstinline|\mindflowRight|. Both have the default
308 % value ``\verb|*|''.
309 %
310 % \DescribeMacro{\mindflowLineHeight}
311 % The height of the separation lines is a length macro named \lstinline|\mindflowLineHeight|,
312 % with default value \verb|0.4pt|. You can change this with \lstinline|\setlength|.
313 %
314 % \subsection{Internal names of the colors}
315 % \DescribeMacro{mindflowLine}
316 % \DescribeMacro{mindflowText}
317 % \DescribeMacro{mindflowNum}
318 % \DescribeMacro{mindflowMarker}
319 % And finally, the colors for the separation lines, text, line numbers and
320 % markers within the \verb|mindflow| environments are called
321 % \verb|mindflowLine|, \verb|mindflowText|, \verb|mindflowNum| and
322 % \verb|mindflowMarker|, respectively. By default, they have the same color as
323 % the context, with opacity 40\% for the separation lines and text, 20\% for
324 % the markers, and 8\% for line numbers.
325 %
326 % \DescribeMacro{*mindflowBackground}
327 % If the package option \verb|nonbreakable| is enabled, then there is also the background color \verb|mindflowBackground|, which by default is white.
328 %
329 % \section{The same example revisited}
330 % With option \verb|leftlinenumber, rightlinenumber, leftmarker, rightmarker|
331 % and the following settings:
332 % \iffalse
333 %<*example>
334 % \fi
335 \begin{code*}
336 \colorlet{mindflowLine}{green!50!black}
337 \colorlet{mindflowText}{blue!50!cyan}
338 \colorlet{mindflowNum}{red!50!orange}
339 \colorlet{mindflowMarker}{orange}
340 \renewcommand{\mindflowTextFont}{\footnotesize\sffamily\itshape}
341 \renewcommand{\mindflowNumFont}{\small\footnotesize\ttfamily}
342 \renewcommand{\mindflowMarkerFont}{\footnotesize\sffamily}
343 \renewcommand{\mindflowLeft}{\hspace{1em}\(\succ\)}
344 \renewcommand{\mindflowRight}{\(\prec\)\hspace{1em}}
345 \setlength{\mindflowLineHeight}{1pt}
346 \end{code*}
347 % \iffalse
348 %</example>
349 % \fi
350 % \vspace{-.5\baselineskip}
351 % One will get the same result as in the previous example.
352 %
353 % \section{Known issues}
354 %
355 % \begin{itemize}
356 % \item There is no absolute guarantee that the separation lines will not fall alone at the top or bottom of the page, though great effort has been made to reduce the occurrence of such situation.
357 % \item The \texttt{nonbreakable} version does not support line numbering quite well, especially for displayed equations. This is due to the usage of \verb|internallinenumbers|.
358 % \end{itemize}
359 %
360 % \StopEventually{}
361 %
362 % \clearpage
363 % \section{Implementation}
364 % Below is the complete source code of this package.
365 %
366 % \begin{code-with-linenumber}
367 \RequirePackage{kvoptions}
368 \SetupKeyvalOptions{%
369 family = @mindflow,
370 prefix = @mindflow@
371 }
372 \DeclareBoolOption[true]{on} % Turn on mindflow
373 \DeclareBoolOption[false]{off} % Turn off mindflow
374 \DeclareBoolOption[false]{leftmarker} % Left marker
375 \DeclareBoolOption[false]{rightmarker} % Right marker
376 \DeclareBoolOption[false]{linenumber} % Left line numbers
377 \DeclareBoolOption[false]{leftlinenumber} % Left line numbers
378 \DeclareBoolOption[false]{rightlinenumber} % Right line numbers
379 \DeclareBoolOption[false]{incolumn} % Separation line fits in column
380 \DeclareBoolOption[false]{nonbreakable} % Use the tcolorbox version
381 \DeclareBoolOption[false]{mathlines} % Add line numbers to equations
382
383 \ProcessKeyvalOptions*\relax
384
385 \if@mindflow@on
386 \@mindflow@offfalse
387 \fi
388 \if@mindflow@linenumber
389 \@mindflow@leftlinenumbertrue
390 \fi
391 \if@mindflow@mathlines
392 \PassOptionsToPackage{mathlines}{lineno}
393 \fi
394
395 %%================================
396 %% Initialization
397 %%================================
398 \RequirePackage{lineno}
399 \RequirePackage{xcolor}
400
401 \colorlet{mfSavedColor}{.}
402 \colorlet{mindflowLine}{mfSavedColor!40}
403 \colorlet{mindflowText}{mfSavedColor!40}
404 \colorlet{mindflowMarker}{mfSavedColor!20}
405 \colorlet{mindflowNum}{mfSavedColor!8}
406
407 \newcommand{\mindflowTextFont}{\footnotesize}
408 \newcommand{\mindflowNumFont}{\scriptsize\ttfamily}
409 \newcommand{\mindflowMarkerFont}{\scriptsize\ttfamily}
410 \newcommand{\mindflowLeft}{*}
411 \newcommand{\mindflowRight}{*}
412 \newlength{\mindflowLineHeight}
413 \setlength{\mindflowLineHeight}{0.4pt}
414
415 %%================================
416 %% The mindflow environment
417 %%================================
418 \PassOptionsToPackage{all}{nowidow}
419 \RequirePackage{nowidow}
420 \RequirePackage{verbatim}
421
422 \newif\ifLNturnsON
423 \def\LocallyStopLineNumbers{\LNturnsONfalse%
424 \ifLineNumbers\LNturnsONtrue\fi\nolinenumbers}
425 \def\ResumeLineNumbers{\ifLNturnsON\linenumbers\fi}
426
427 \newif\ifICturnsON
428 \def\AutoIncolumn{\ICturnsONfalse%
429 \if@mindflow@incolumn\ICturnsONtrue\fi%
430 \if@twocolumn\@mindflow@incolumntrue\fi%
431 }
432 \def\ResumeIncolumn{\ifICturnsON\@mindflow@incolumntrue\fi}
433
434 \newcounter{recordLN}
435 \newcounter{mfLN}
436 \setcounter{mfLN}{1}
437
438 \newcommand*{\mfSepLine}{%
439 \par%\nobreak%
440 \LocallyStopLineNumbers%
441 \vspace*{-.5\baselineskip}%
442 \noindent%
443 \if@mindflow@incolumn%
444 \makebox[\linewidth]{\color{mindflowLine}\rule{\linewidth}{\mindflowLineHeight}}%
445 \else%
446 \hspace*{-\paperwidth}%
447 \makebox[\linewidth]{\color{mindflowLine}\rule{4\paperwidth}{\mindflowLineHeight}}%
448 \fi%
449 \par%\nobreak%
450 \ResumeLineNumbers%
451 }
452
453 \newcommand{\mindflow@makeLineNumber}{%
454 \hss%
455 \if@mindflow@leftlinenumber%
456 \normalfont\mindflowNumFont\color{mindflowNum}\LineNumber\hspace{1em}%
457 \fi%
458 \color{mindflowMarker}%
459 \if@mindflow@leftmarker%
460 \normalfont\mindflowMarkerFont\mindflowLeft\hspace{1em}%
461 \fi%
462 \rlap{\hskip\textwidth%
463 \if@mindflow@rightmarker%
464 \hspace{1em}\mindflowRight%
465 \fi%
466 \if@mindflow@rightlinenumber%
467 \hspace{1em}%
468 \normalfont\mindflowNumFont\color{mindflowNum}\LineNumber%
469 \fi%
470 }%
471 }%
472
473 \let\mindflowOFF=\comment
474 \let\endmindflowOFF=\endcomment
475
476 \def\mindflowON{%
477 \postdisplaypenalty=10000
478 \parskip=0pt
479 \medskip%
480 \setcounter{recordLN}{\value{linenumber}}%
481 \setcounter{linenumber}{\value{mfLN}}%
482 \AutoIncolumn%
483 \mfSepLine%
484 \normalfont\mindflowTextFont\color{mindflowText}%
485 \linenumbers%
486 \let\makeLineNumber\mindflow@makeLineNumber%
487 \nopagebreak%
488 }
489 \def\endmindflowON{%
490 \nowidow[3]%
491 \mfSepLine%
492 \setcounter{mfLN}{\value{linenumber}}%
493 \setcounter{linenumber}{\value{recordLN}}%
494 \ResumeIncolumn%
495 \medskip%
496 }
497
498 \colorlet{mindflowBackground}{white}
499
500 \if@mindflow@nonbreakable
501 \PassOptionsToPackage{many}{tcolorbox}
502 \RequirePackage{tcolorbox}
503 \newlength{\mindflow@parindent}
504 \newlength{\mindflow@parskip}
505 \newtcolorbox{mindflow@nonbreakable}[1]{
506 enhanced jigsaw,
507 colback=mindflowBackground,colframe=mindflowLine,
508 leftrule=0pt, rightrule=0pt, sharp corners,
509 toprule=\mindflowLineHeight, bottomrule=\mindflowLineHeight,
510 boxsep=0pt, top=.3\baselineskip, bottom=.3\baselineskip,
511 fontupper=\mindflowTextFont,extras={colupper={mindflowText}},
512 before upper={
513 \setlength{\parindent}{\mindflow@parindent}%
514 \setlength{\parskip}{\mindflow@parskip}%
515 },#1
516 }
517 \def\mindflowON{%
518 \LocallyStopLineNumbers%
519 \setcounter{recordLN}{\value{linenumber}}%
520 \setcounter{linenumber}{\value{mfLN}}%
521 \AutoIncolumn%
522 \setlength{\mindflow@parindent}{\parindent}%
523 \setlength{\mindflow@parskip}{\parskip}%
524 \if@mindflow@incolumn%
525 \begin{mindflow@nonbreakable}{left=0pt,right=0pt}
526 \else%
527 \begin{mindflow@nonbreakable}{%
528 grow to left by=\linewidth,left=\linewidth,
529 grow to right by=\linewidth,right=\linewidth}
530 \fi
531 \begin{internallinenumbers}%
532 \let\makeLineNumber\mindflow@makeLineNumber%
533 }
534 \def\endmindflowON{%
535 \nowidow[3]%
536 \end{internallinenumbers}%
537 \end{mindflow@nonbreakable}\par%
538 \ResumeLineNumbers%
539 \setcounter{mfLN}{\value{linenumber}}%
540 \setcounter{linenumber}{\value{recordLN}}%
541 \ResumeIncolumn%
542 }
543 \fi
544
545 \if@mindflow@off
546 \let\mindflow=\mindflowOFF
547 \let\endmindflow=\endmindflowOFF
548 \else
549 \let\mindflow=\mindflowON
550 \let\endmindflow=\endmindflowON
551 \fi
552
553 %%================================
554 %% \mindflowset
555 %%================================
556 \define@key{mindflow}{on}[true]{%
557 \csname @mindflow@on#1\endcsname%
558 \if@mindflow@off%
559 \let\mindflow=\mindflowOFF%
560 \let\endmindflow=\endmindflowOFF%
561 \else%
562 \let\mindflow=\mindflowON%
563 \let\endmindflow=\endmindflowON%
564 \fi%
565 }
566 \define@key{mindflow}{off}[true]{%
567 \csname @mindflow@off#1\endcsname%
568 \if@mindflow@off%
569 \let\mindflow=\mindflowOFF%
570 \let\endmindflow=\endmindflowOFF%
571 \else%
572 \let\mindflow=\mindflowON%
573 \let\endmindflow=\endmindflowON%
574 \fi%
575 }
576 \define@key{mindflow}{leftmarker}[true]{\csname @mindflow@leftmarker#1\endcsname}
577 \define@key{mindflow}{rightmarker}[true]{\csname @mindflow@rightmarker#1\endcsname}
578 \define@key{mindflow}{linenumber}[true]{\csname @mindflow@leftlinenumber#1\endcsname}
579 \define@key{mindflow}{leftlinenumber}[true]{\csname @mindflow@leftlinenumber#1\endcsname}
580 \define@key{mindflow}{rightlinenumber}[true]{\csname @mindflow@rightlinenumber#1\endcsname}
581 \define@key{mindflow}{incolumn}[true]{\csname @mindflow@incolumn#1\endcsname}
582 \define@key{mindflow}{linecolor}{\colorlet{mindflowLine}{#1}}
583 \define@key{mindflow}{textcolor}{\colorlet{mindflowText}{#1}}
584 \define@key{mindflow}{numcolor}{\colorlet{mindflowNum}{#1}}
585 \define@key{mindflow}{markercolor}{\colorlet{mindflowMarker}{#1}}
586 \define@key{mindflow}{backgroundcolor}{
587 \if@mindflow@nonbreakable
588 \colorlet{mindflowBackground}{#1}
589 \else
590 \PackageWarning{mindflow}{The key ``backgroundcolor'' is only available when the package option\MessageBreak ``nonbreakable'' is enabled.}
591 \fi
592 }
593 \define@key{mindflow}{textfont}{\renewcommand{\mindflowTextFont}{#1}}
594 \define@key{mindflow}{numfont}{\renewcommand{\mindflowNumFont}{#1}}
595 \define@key{mindflow}{markerfont}{\renewcommand{\mindflowMarkerFont}{#1}}
596 \define@key{mindflow}{left}{\renewcommand{\mindflowLeft}{#1}}
597 \define@key{mindflow}{right}{\renewcommand{\mindflowRight}{#1}}
598 \define@key{mindflow}{lineheight}{\setlength{\mindflowLineHeight}{#1}}
599
600 \newcommand{\mindflowset}[1]{%
601 \setkeys{mindflow}{#1}%
602 }
603 % \end{code-with-linenumber}
604 %
605 % \Finale
606 \endinput