From ff5439d00ba53d3e4b82d79f78ce65524f3684fd Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 15 May 2021 03:01:02 +0000 Subject: CTAN sync 202105150301 --- macros/latex/contrib/noindentafter/README | 50 --- macros/latex/contrib/noindentafter/README.md | 41 +++ macros/latex/contrib/noindentafter/doc/LICENSE.md | 21 ++ .../contrib/noindentafter/doc/noindentafter.pdf | Bin 0 -> 406986 bytes .../contrib/noindentafter/noindentafter-dry.sty | 54 --- .../noindentafter/noindentafter-packagedoc.cls | 313 ---------------- .../latex/contrib/noindentafter/noindentafter.pdf | Bin 223162 -> 0 bytes .../latex/contrib/noindentafter/noindentafter.sty | 189 ---------- .../latex/contrib/noindentafter/noindentafter.tex | 205 ----------- .../contrib/noindentafter/source/noindentafter.dtx | 407 +++++++++++++++++++++ 10 files changed, 469 insertions(+), 811 deletions(-) delete mode 100644 macros/latex/contrib/noindentafter/README create mode 100644 macros/latex/contrib/noindentafter/README.md create mode 100644 macros/latex/contrib/noindentafter/doc/LICENSE.md create mode 100644 macros/latex/contrib/noindentafter/doc/noindentafter.pdf delete mode 100644 macros/latex/contrib/noindentafter/noindentafter-dry.sty delete mode 100644 macros/latex/contrib/noindentafter/noindentafter-packagedoc.cls delete mode 100644 macros/latex/contrib/noindentafter/noindentafter.pdf delete mode 100644 macros/latex/contrib/noindentafter/noindentafter.sty delete mode 100644 macros/latex/contrib/noindentafter/noindentafter.tex create mode 100644 macros/latex/contrib/noindentafter/source/noindentafter.dtx (limited to 'macros/latex/contrib/noindentafter') diff --git a/macros/latex/contrib/noindentafter/README b/macros/latex/contrib/noindentafter/README deleted file mode 100644 index 1eb4449dbf..0000000000 --- a/macros/latex/contrib/noindentafter/README +++ /dev/null @@ -1,50 +0,0 @@ -latex-noindentafter -=============== - -LaTeX Package : noindentafter 0.2.2 - -Last Modified : 2014/11/30 - -Author : Michiel Helvensteijn (www.mhelvens.net) - - -Summary -------- - -This pack­age, as the name sug­gests, sup­plies tools to au­to­mat­i­cally -sup­press in­den­ta­tion in para­graphs, specif­i­cally those fol­low­ing -par­tic­u­lar macros or en­vi­ron­ments. - - -Prerequisites -------------- - -To use this package, you need only `etoolbox`, though to generate -the documentation some other packages are needed. - - -Installation -------------- - -`noindentafter.sty` is provided directly in the package archive. -Put it in a place where your LaTeX distribution can find it. -(`noindentafter.sty` is not generated, but manually maintained; - you may use docstrip to remove the documentation, but you don't - have to; it will just work the way it is) - - -Documentation -------------- -`noindentafter.pdf` is provided directly in the package archive. -To generate the documentation yourself, run LaTeX on `noindentafter.tex`. -(`noindentafter.tex` does not contain the package code itself; it inputs - `noindentafter.sty` directly to document the implementation) - - -License -------- - -This material is subject to the LaTeX Project Public License. See -http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html -for the details of that license. - diff --git a/macros/latex/contrib/noindentafter/README.md b/macros/latex/contrib/noindentafter/README.md new file mode 100644 index 0000000000..bee02a49cc --- /dev/null +++ b/macros/latex/contrib/noindentafter/README.md @@ -0,0 +1,41 @@ + + noindentafter – purposefully prevention of paragraph indentation +------------------------------------------------------------------------------- + + Copyright (C) Michiel Helvensteijn, 2014-2021
+ Copyright (C) Falk Hanisch , 2021-2021 + + **noindentafter 2021-05-14 v1.00** + + The current release is shiped via CTAN: https://www.ctan.org/pkg/noindentafter + +------------------------------------------------------------------------------- + + This material is subject to the LaTeX Project Public License version 1.3c + or later. See http://www.latex-project.org/lppl.txt for details. + +------------------------------------------------------------------------------- + + +Summary +------- + +The **noindentafter** package, as the name suggests, supplies functionallity to +purposefully prevent indentation of paragraphs, specifically those following +particular macros or environments in an automated manner. To use this package, +only packages `etoolbox` and `xpatch` are required. + + +Versions +-------- +**v1.00** (2021-05-14) ++ new maintainer: Falk Hanisch ++ fix for `LaTeXe 2019-10-01` and later + +**v0.2.0** (2014-11-30) ++ new implementation, fixing a spacing issue + +**v0.0.1** (2013-08-02) ++ initial version by Michiel Helvensteijn + + diff --git a/macros/latex/contrib/noindentafter/doc/LICENSE.md b/macros/latex/contrib/noindentafter/doc/LICENSE.md new file mode 100644 index 0000000000..de6e53039e --- /dev/null +++ b/macros/latex/contrib/noindentafter/doc/LICENSE.md @@ -0,0 +1,21 @@ + + noindentafter – purposefully prevention of paragraph indentation +---------------------------------------------------------------------------- + + Copyright (C) Michiel Helvensteijn, 2014-2021
+ Copyright (C) Falk Hanisch , 2021-2021 + +---------------------------------------------------------------------------- + + This work may be distributed and/or modified under the conditions of the + LaTeX Project Public License, version 1.3c of the license. The latest + version of this license is in
+    http://www.latex-project.org/lppl.txt
+ and version 1.3c or later is part of all distributions of + LaTeX version 2008-05-04 or later. + + This work has the LPPL maintenance status "author-maintained". + + The current maintainer and author of this work is Falk Hanisch. + +---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/noindentafter/doc/noindentafter.pdf b/macros/latex/contrib/noindentafter/doc/noindentafter.pdf new file mode 100644 index 0000000000..3f332ad399 Binary files /dev/null and b/macros/latex/contrib/noindentafter/doc/noindentafter.pdf differ diff --git a/macros/latex/contrib/noindentafter/noindentafter-dry.sty b/macros/latex/contrib/noindentafter/noindentafter-dry.sty deleted file mode 100644 index 27ba1a3077..0000000000 --- a/macros/latex/contrib/noindentafter/noindentafter-dry.sty +++ /dev/null @@ -1,54 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse %%%% -% % -% Copyright (c) 2014 - Michiel Helvensteijn - www.mhelvens.net % -% % -% https://github.com/mhelvens/latex-delta-modules % -% % -% This work 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. % -% % -% This work has the LPPL maintenance status 'maintained'. % -% % -% The Current Maintainer of this work is Michiel Helvensteijn. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \fi %%%% - -% I will 'officially' release this file at some point in the future. For -% now I'm just using it to document a couple of packages. Still, it's -% released under LPPL, so use it as you will. -% -% -- Michiel Helvensteijn - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{noindentafter-dry} - [2013/10/11 convenience macros for reusing LaTeX code] - -\RequirePackage{filecontents} -\RequirePackage{xparse} -\RequirePackage{etoolbox} -\RequirePackage{withargs} - -\newcommand\minput[1]{% - \input{#1}\unskip% -} - -\NewDocumentCommand{\NewDRYer}{m +m}{% - \withargs [\uniquecsname] [#2] {% - \newenvironment{#1}{% - \begingroup% - \@tempswafalse\filec@ntents{##1.tmp}% - }{% - \endfilecontents% - \endgroup% - }% - \AfterEndEnvironment{#1}{% - \withargs (xn) [##1.tmp] [\minput{##1.tmp}] {% - ##2% - }% - }% - }% -} diff --git a/macros/latex/contrib/noindentafter/noindentafter-packagedoc.cls b/macros/latex/contrib/noindentafter/noindentafter-packagedoc.cls deleted file mode 100644 index 1eb80d548c..0000000000 --- a/macros/latex/contrib/noindentafter/noindentafter-packagedoc.cls +++ /dev/null @@ -1,313 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% Copyright (C) 2012-2013 by Michiel Helvensteijn - www.mhelvens.net % -% % -% This work 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. % -% % -% This work has the LPPL maintenance status `author-maintained'. % -% % -% The Current Maintainer of this work is Michiel Helvensteijn. % -% % -% This work consists of the file packagedoc.cls. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\let\packagename\jobname - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Document Class % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\LoadClassWithOptions{ltxdoc} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Importing The Relevant Package % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\RequirePackage{\packagename} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Importing Other Packages % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\RequirePackage[hyphens]{url} - -\RequirePackage{etoolbox} -\RequirePackage[xcolor]{mdframed} -\RequirePackage{marginnote} -\RequirePackage{listings} -\RequirePackage{textcomp} -\RequirePackage[colorlinks=true]{hyperref} -\RequirePackage{noindentafter-dry} -\RequirePackage{needspace} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Documentation Options % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\EnableCrossrefs -\CodelineIndex -\RecordChanges - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% File Info % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\GetFileInfo{\packagename.sty} - -\title{The \textsf{\packagename} package\thanks{% - This document corresponds to \textsf{\packagename}~\fileversion, - dated \filedate.% -}} - -\author{ - Michiel Helvensteijn\\ - \href{mailto:mhelvens+latex@gmail.com}{mhelvens+latex@gmail.com} -} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Development Info % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\newmdenv[ - leftline = false, - rightline = false -]{bannerframe} - -\apptocmd{\maketitle}{ - \begin{bannerframe} - \small - \begin{center} - Development of this package is organized at - \href{http://latex-\packagename.googlecode.com} - {latex-\packagename.googlecode.com}.\\ - I am happy to receive feedback there! - \end{center} - \end{bannerframe} -}{}{} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Example Environment Setup % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%% Extra keywords for LaTeX -% -\newcommand{\moretexcs}[1]{ - \lstdefinelanguage{latex}{ - language=[LaTeX]tex, - alsoletter={\[,\],\$}, - moretexcs={ExplSyntaxOn,ExplSyntaxOff,lstinputlisting,detokenize,[,],#1}, - keywords={\$} - } -} - -%%% Code formatting -% -\lstdefinestyle{examplecode}{% - language=latex,% - basicstyle=\ttfamily\small,% - texcsstyle=*\bfseries,% - keywordstyle=*\bfseries,% - upquote=true% -} - -%%% Setting up example code block -% -\definecolor{examplecodelinecolor}{rgb}{0,0,0} -\definecolor{examplecodebackgroundcolor}{rgb}{.9,.9,.9} -\newmdenv[ - linecolor = examplecodelinecolor, - backgroundcolor = examplecodebackgroundcolor, - skipabove = 0pt, - skipbelow = 0pt, - innertopmargin = -1pt, - innerrightmargin = 1pt, - innerbottommargin = -1pt, - innerleftmargin = 1pt -]{examplecodeframe} - -%%% Defining example output block -% -\definecolor{exampleoutputbackgroundcolor}{rgb}{1,1,1} -\newmdenv[ - linecolor = examplecodelinecolor, - backgroundcolor = exampleoutputbackgroundcolor, - skipabove = 0pt, - skipbelow = 0pt, - innertopmargin = 6pt, - innerrightmargin = 6pt, - innerbottommargin = 6pt, - innerleftmargin = 6pt, - nobreak = true -]{exampleoutputframe} - -%%% Macros for counting lines in file, adapted from -%%% http://andreas.scherbaum.la/blog/archives/ -%%% 670-Read-number-lines-in-a-file-in-LaTeX.html -% -\RequirePackage{ifthen} -\newboolean{packagedoc@restfile} -\newcommand*{\packagedoc@fileline}{} -\newread\packagedoc@file -\newcommand*{\packagedoc@readnextline}[1]{% - \ifthenelse{\boolean{packagedoc@restfile}}{% - \read#1 to \packagedoc@fileline% - \ifeof#1\setboolean{packagedoc@restfile}{false}% - \else\fi% - }{}% -} -\newcommand*{\countlinesinfile}[2]{% - \setboolean{packagedoc@restfile}{true}% - \setcounter{packagedoc@linecount}{0}% - \openin\packagedoc@file=#1% - \whiledo{\boolean{packagedoc@restfile}}{% - \packagedoc@readnextline{\packagedoc@file}% - \ifthenelse{\boolean{packagedoc@restfile}}{% - \stepcounter{packagedoc@linecount}% - }{}% - }% - \closein\packagedoc@file% - \edef#2{\thepackagedoc@linecount}% -} - -\newcounter{packagedoc@linecount} -\newlength{\packagedoc@spacetoreserve} - -%%% DRYer without output -% -\NewDRYer{latex-example}{% - \vskip\abovedisplayskip% - {% - \ttfamily\small% - \countlinesinfile{#1}{\countedlines}% - \setlength{\packagedoc@spacetoreserve}{\countedlines\baselineskip}% - \addtolength{\packagedoc@spacetoreserve}{-1pt}% - \needspace{\packagedoc@spacetoreserve}% - }% - \begin{examplecodeframe}% - \renewcommand{\ttdefault}{pcr}% - \lstinputlisting[style=examplecode]{#1}% - \end{examplecodeframe}% - #2% - \vskip\belowdisplayskip% -} - -%%% DRYer WITH output but WITHOUT side-effects -% -\NewDRYer{latex-example-show}{% - \vskip\abovedisplayskip% - {% - \ttfamily\small% - \countlinesinfile{#1}{\countedlines}% - \setlength{\packagedoc@spacetoreserve}{\countedlines\baselineskip}% - \addtolength{\packagedoc@spacetoreserve}{\baselineskip}% - \needspace{\packagedoc@spacetoreserve}% - }% - \begin{examplecodeframe}% - \renewcommand{\ttdefault}{pcr}% - \lstinputlisting[style=examplecode]{#1}% - \end{examplecodeframe}\vspace{-1pt}% - \begin{exampleoutputframe}% - #2% - \end{exampleoutputframe}% - \vskip\belowdisplayskip% -} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Implementation Code Box Setup % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%% Saving old implementation code block font -% -\AtBeginDocument{\let\old@macro@font\macro@font} - -%%% Setup for 'interesting' implementation code blocks -% -\definecolor{interestingcodebackgroundcolor}{rgb}{.9,.9,.9} -\definecolor{interestingcodelinecolor}{rgb}{0,0,0} -\mdfdefinestyle{interestingcode}{ - linecolor = interestingcodelinecolor, - backgroundcolor = interestingcodebackgroundcolor -} -\newcommand*{\interesting}{% - \def\codestyle{interestingcode}% - \def\codeskipabove{2pt}% - \let\macro@font\old@macro@font% -} - -%%% Setup for 'UNinteresting' implementation code blocks -% -\definecolor{uninterestingcodebackgroundcolor}{rgb}{.97,.97,.97} -\definecolor{uninterestingcodelinecolor}{rgb}{.5,.5,.5} -\definecolor{uninterestingcodecolor}{rgb}{.4,.4,.4} -\mdfdefinestyle{uninterestingcode}{ - linecolor = uninterestingcodelinecolor, - backgroundcolor = uninterestingcodebackgroundcolor, -} -\newcommand*{\uninteresting}{% - \def\codestyle{uninterestingcode}% - \def\codeskipabove{-2pt}% - \def\macro@font{\color{uninterestingcodecolor}\old@macro@font}% -} - -%%% Actually surround 'macrocode' with the frame -% -\surroundwithmdframed[ - style = \codestyle, - skipabove = \abovedisplayskip, - skipbelow = \belowdisplayskip, - splittopskip = 4pt, - splitbottomskip = 1pt, - innertopmargin = -2pt, - innerrightmargin = 1pt, - innerbottommargin = 5pt, - innerleftmargin = 4pt -]{macrocode} - -%%% Start out with 'interesting' code status and -%%% always go back to it after one code block -% -\interesting -\AfterEndEnvironment{macrocode}{\interesting} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Argument Specifiers and such % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\newcommand*{\movarg}[1]{[ \texttt{#1} ]} -\newcommand*{\momarg}[1]{[ \meta{#1} ]} - -\newcommand{\describemacro}[2]{% - \needspace{3\baselineskip}% - \noindent\\\DescribeMacro{#1} #2\\% -} - -\newcommand{\describemetamacro}[2]{% - \needspace{3\baselineskip}% - \noindent\\\marginnote{\meta{#1}} #2\\% -} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Automatic Implementation Docs % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\AtEndDocument{ - \section{Implementation} - - \StopEventually {\PrintChanges} - - We now show and explain the entire implementation from \texttt{\packagename.sty}. - - \DocInput{\packagename.sty} - - \Finale - - \PrintIndex -} diff --git a/macros/latex/contrib/noindentafter/noindentafter.pdf b/macros/latex/contrib/noindentafter/noindentafter.pdf deleted file mode 100644 index b8d1d8aad1..0000000000 Binary files a/macros/latex/contrib/noindentafter/noindentafter.pdf and /dev/null differ diff --git a/macros/latex/contrib/noindentafter/noindentafter.sty b/macros/latex/contrib/noindentafter/noindentafter.sty deleted file mode 100644 index 2ea6e22b37..0000000000 --- a/macros/latex/contrib/noindentafter/noindentafter.sty +++ /dev/null @@ -1,189 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse %%%% -% % -% Copyright (c) 2014 - Michiel Helvensteijn - www.mhelvens.net % -% % -% http://latex-noindentafter.googlecode.com % -% % -% This work 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. % -% % -% This work has the LPPL maintenance status `maintained'. % -% % -% The Current Maintainer of this work is Michiel Helvensteijn. % -% % -% This work consists of the files noindentafter.tex and noindentafter.sty. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \fi %%%% - -% \CheckSum{50} -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \subsection{Package Info} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{noindentafter}[2014/11/30 0.2.2 - prevent paragraph indentation after specific environments or macros] -% \end{macrocode} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \subsection{Packages} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% \begin{macrocode} -\RequirePackage{etoolbox} -% \end{macrocode} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \subsection{Patches} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% \needspace{5\baselineskip}\begin{macro}{\end} -% -% The package |etoolbox| provides the command -% |\AfterEndEnvironment| which creates a hook executed at a -% very late point inside the |\end| command. However, this -% hook is still located before |\ignorespaces|, which is -% too early to properly suppress the indention after an -% environment. Therefore another hook is now added to |\end| -% using |\patchcmd|. This new hook puts new code at the very -% end. -% -% \begin{macrocode} -\patchcmd\end{% - \if@ignore\@ignorefalse\ignorespaces\fi% -}{% - \if@ignore\@ignorefalse\ignorespaces\fi% - \csuse{@noindent@#1@hook}% -}{}{% - \PackageWarningNoLine{noindentafter}{% - Patching `\string\end' failed!\MessageBreak% - `\string\NoIndentAfter...' commands won't work% - }% -} -% \end{macrocode} -% -%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \subsection{Macros} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% \needspace{5\baselineskip}\begin{macro}{\@NoIndentAfter} -% -% \noindent This command implements the main principle -% behind this package. It checks whether it is followed by -% a paragraph. If so, the command |\par| is temporarily -% changed using |\everypar|, so that the following paragraph -% is not indented. Immediately afterwards, default paragraph -% behavior is restored with |\@restorepar| (from the \LaTeX{} -% base). -% -% \begin{macrocode} -\newcommand*\@NoIndentAfter{% - \@ifnextchar\par{% - \def\par{% - \everypar{\setbox\z@\lastbox\everypar{}}% - \@restorepar% - }% - }{}% -} -% \end{macrocode} -% -%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% \needspace{5\baselineskip}\begin{macro}{\NoIndentAfterThis} -% -% \noindent Enforce a paragraph break and suppress -% indentation for whatever follows. -% -% \begin{macrocode} -\newrobustcmd*{\NoIndentAfterThis}{\@NoIndentAfter\par\par} -% \end{macrocode} -% -%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % \needspace{5\baselineskip}\begin{macro}{\NoIndentAfterEnv} -%%% \marg{environment}\\ -% -% \noindent Append |\@NoIndentAfter| to the output of -% \meta{environment} by using the new environment hook. -% -% \begin{macrocode} -\newrobustcmd{\NoIndentAfterEnv}[1]{% - \csdef{@noindent@#1@hook}{\@NoIndentAfter}% -} -% \end{macrocode} -% -%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % \needspace{5\baselineskip}\begin{macro}{\NoIndentAfterCmd} -%%% \marg{command}\\ -% -% \noindent Append |\NoIndentAfterThis| to the output of -% \meta{command}. -% -% \begin{macrocode} -\newrobustcmd*{\NoIndentAfterCmd}[1]{% - \apptocmd{#1}{\NoIndentAfterThis}{}{% - \PackageWarning{noindentafter}{% - Patching `\string#1' failed!\MessageBreak% - `\string\NoIndentAfterCmd' won't work% - }% - }% -} -% \end{macrocode} -% -%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - diff --git a/macros/latex/contrib/noindentafter/noindentafter.tex b/macros/latex/contrib/noindentafter/noindentafter.tex deleted file mode 100644 index 6aac2ebe06..0000000000 --- a/macros/latex/contrib/noindentafter/noindentafter.tex +++ /dev/null @@ -1,205 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% Copyright (c) 2014 - Michiel Helvensteijn - www.mhelvens.net % -% % -% http://latex-noindentafter.googlecode.com % -% % -% This work 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. % -% % -% This work has the LPPL maintenance status `maintained'. % -% % -% The Current Maintainer of this work is Michiel Helvensteijn. % -% % -% This work consists of the files noindentafter.tex and noindentafter.sty. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\documentclass[a4paper]{noindentafter-packagedoc} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Setup % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\NoIndentAfterEnv{latex-example-show} -\NoIndentAfterCmd{\describemacro} - -\moretexcs{% - NoIndentAfterThis,NoIndentAfterEnv,NoIndentAfterCmd -} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Global Changes % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\changes{0.0.1}{2013/08/02} - {initial version} -\changes{0.2.0}{2014/11/30} - {new implementation, fixing a spacing issue} -\changes{0.2.2}{2014/11/30} - {fixed version number in the README} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{document} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\maketitle - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Introduction} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Some people prefer certain LaTeX environments ---such as |itemize| or -|theorem|--- never to be followed by an indented paragraph. It is of course -possible to manually add the |\noindent| command to each occurrence, but -it's easy to forget to do this. Also, all those |\noindent| commands leave -your \TeX{} code just a little bit more chaotic and more burdensome to read. - -There are a number of solutions floating around, but many of them are not -particularly robust, or only work in specific cases. - -The |noindentafter| package provides a few simple commands which can be used -to patch existing macros and environments. They work as expected in all cases -I've encountered. - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Usage} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\noindent\DescribeMacro{\NoIndentAfterThis} -% -This is the most primitive macro offered by the package. It forces a -paragraph break and suppresses indentation for whatever follows: - -\begin{latex-example-show} - Lorem ipsum dolor sit amet, consectetur adipiscing - elit. \NoIndentAfterThis Pellentesque hendrerit volutpat - feugiat. Ut purus leo, pulvinar sit amet vehicula non, - pulvinar eu lacus. Curabitur id mollis ligula. -\end{latex-example-show} - - - -\pagebreak % Hack to make the footnote appear on page 1. - - - -\describemacro{\NoIndentAfterEnv}{\marg{environment}} - -This is probably the command most people will want to use. -The \meta{environment} argument should contain an environment -name. After using this command, any paragraph following such -an environment will remain unindented. - -\begin{latex-example-show} - Lorem ipsum dolor sit amet, consectetur adipiscing elit. - - \begin{itemize} - \item First Item - \item Second Item - \end{itemize} - - Pellentesque hendrerit volutpat feugiat. Ut purus - leo, pulvinar sit amet vehicula non, pulvinar eu - lacus. Curabitur id mollis ligula. - - \NoIndentAfterEnv{itemize} - - Vestibulum id erat venenatis, facilisis enim non, - consectetur felis. Quisque iaculis eu arcu non pretium. - - \begin{itemize} - \item Third Item - \item Fourth Item - \end{itemize} - - Curabitur est elit, posuere pulvinar laoreet sed, varius - id mi. Nam lobortis elit nec mauris condimentum gravida. -\end{latex-example-show} - -You'll probably want to use these commands in the document -preamble but, as you can see, you don't really have to. - -\needspace{10\baselineskip} -Note that using the |\NoIndentAfterEnv| command on your own -environment is not the same as adding |\NoIndentAfterThis| -to the end of it: - -\begin{latex-example-show} - \newenvironment{test}{\itshape}{\NoIndentAfterThis} - - \begin{test} - Lorem ipsum dolor sit amet, consectetur - adipiscing elit. - \end{test} - - Pellentesque hendrerit volutpat feugiat. Ut purus - leo, pulvinar sit amet vehicula non, pulvinar eu - lacus. Curabitur id mollis ligula. -\end{latex-example-show} - -|\NoIndentAfterEnv| works because it bypasses the group -that surrounds every \LaTeX{} environment (and localizes -declarations). - - - -\describemacro{\NoIndentAfterCmd}{\marg{command}} - -Finally, you may also patch command sequences using the -|\NoIndentAfterCmd| command. There may not be many situations -where this is useful, but for me, there is at least one: - -\begin{latex-example-show} - Lorem ipsum dolor sit amet, consectetur adipiscing elit: - - \[ 1 + 1 = 2 \] - - Pellentesque hendrerit volutpat feugiat. Ut purus leo: - - \NoIndentAfterCmd \] - - \[ 2 + 2 = 4 \] - - Vestibulum id erat venenatis, facilisis enim non, - consectetur felis. -\end{latex-example-show} - -Note that braces around the \meta{command} argument are -optional, as always when an argument in \TeX{} consists -of only a single token. - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Acknowledgements} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -I had been looking for a solution like this for quite a while. I came up -with a number of hacks that workedin some situations but not in others. -Eventually I asked a question on \url{http://tex.stackexchange.com}: -\begin{itemize} - \item \url{http://tex.stackexchange.com/questions/112404} -\end{itemize} - -I received two excellent answers -- one from cgnieder and one from lockstep. -This package was originally based on the technique proposed by cgnieder, as -it is simpler and more generally applicable. Still, the answer by lockstep -is definitely worth a read. - -Most recently, a better approach was implemented by tudscr to fix the spacing -above headers: -\begin{itemize} - \item \url{https://github.com/mhelvens/latex-noindentafter/pull/1} -\end{itemize} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\end{document} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/macros/latex/contrib/noindentafter/source/noindentafter.dtx b/macros/latex/contrib/noindentafter/source/noindentafter.dtx new file mode 100644 index 0000000000..4b86ee68c7 --- /dev/null +++ b/macros/latex/contrib/noindentafter/source/noindentafter.dtx @@ -0,0 +1,407 @@ +% \iffalse meta-comment +% noindentafter.dtx +%<*identify> +% +% noindentafter -- purposefully prevention of paragraph indentation +% +%% ---------------------------------------------------------------------------- +%% +%% Copyright (C) Michiel Helvensteijn, 2014-2021 +%% Copyright (C) Falk Hanisch , 2021-2021 +%% +%% ---------------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License, version 1.3c of the license. The latest +%% version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of +%% LaTeX version 2008-05-04 or later. +%% +%% This work has the LPPL maintenance status "author-maintained". +%% +%% The current maintainer and author of this work is Falk Hanisch. +%% +%% This work consists of the main source file README.md, LICENSE.md, +%% noindentafter.dtx and the derived documentation noindentafter.pdf +%% +%% ---------------------------------------------------------------------------- +%% +% +% \fi +% +% \iffalse +%<*dtx> +\ifx\documentclass\undefined +\input docstrip.tex +\keepsilent + +\preamble + +noindentafter -- purposefully prevention of paragraph indentation + +\endpreamble +\askforoverwritefalse +\usedir{tex/latex/noindentafter} +\generate{% + \usepreamble\defaultpreamble + \file{noindentafter.sty}{ + \from{noindentafter.dtx}{package,identify} + \from{noindentafter.dtx}{package,body} + } +} +\else +\let\endbatchfile\relax +\fi +\endbatchfile +% +% \fi +% +% \iffalse +%<*dtx|package&identify> +\NeedsTeXFormat{LaTeX2e}[2020-10-01] +%<*dtx> +\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi +\ProvidesFile{noindentafter.dtx} +% +%\ProvidesPackage{noindentafter} + [2021-05-14 v1.00 purposefully prevention of paragraph indentation] +% +% \fi +% +% \iffalse +%<*dtx> +\documentclass[english,xindy]{tudscrdoc} +\KOMAoptions{parskip=false} +\usepackage{iftex} +\iftutex + \usepackage{fontspec} +\else + \usepackage[T1]{fontenc} +\fi +\usepackage{babel} +% normalized vskip for listings +\newlength\niavskip +\AtBeginDocument{% + \ifdim\parskip>\bigskipamount% + \setlength\niavskip{\parskip}% + \else% + \setlength\niavskip{\bigskipamount}% + \fi% +} +\newcommand*\nianormalizedvskip{\vskip\glueexpr\niavskip-\parskip\relax} +% listings style +\usepackage{xcolor} +\usepackage{quoting} +\usepackage{listings} +\lstset{% + inputencoding=utf8,extendedchars=true,% + literate=% + {ä}{{\"a}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 + {Ä}{{\"A}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 + {ß}{{\ss}}1 {~}{{\textasciitilde}}1 + {»}{{\guillemetright}}1 {«}{{\guillemetleft}}1 +} +\lstdefinestyle{noindentafter}{% + language=[LaTeX]tex,% + columns=flexible,% + frame=single,% + xleftmargin=\fboxsep,% + xrightmargin=\fboxsep,% + escapechar=§,% + aboveskip=\niavskip,% + belowskip=0pt,% + backgroundcolor=\color{yellow!10},% + basicstyle=\color{darkgray}\small\ttfamily,% + moretexcs=[2]{NoIndentAfterThis,NoIndentAfterCmd,NoIndentAfterEnv},% + texcsstyle=*\color{black},% + texcsstyle=*[2]\color{red}\bfseries,% +} +\lstnewenvironment{niaexample}[1][]{% + \lstset{style=noindentafter,#1}% +}{% + \nianormalizedvskip% +} +\makeatletter +% suppress overwriting warning +\providecommand*\filec@ntents@silent{% + \let\@latex@warning@no@line\@gobble% +} +% environment for listing and inclusion, unused guard necessary +\newenvironment{niashow}{% + \csuse{filecontents*}[force,nosearch,silent]{\jobname-lst.aux}% +}{% + \csuse{endfilecontents*}% +}% +\AfterEndEnvironment{niashow}{% + \begin{quoting}[rightmargin=0pt,vskip=0pt] + \lstinputlisting[style=noindentafter]{\jobname-lst.aux}% + \nianormalizedvskip% + \input{\jobname-lst.aux}% + \nianormalizedvskip% + \end{quoting}% +} +\newcommand*\niaagain[1][\relax]{% + #1% + \begin{quoting}[rightmargin=0pt,vskip=0pt] + \nianormalizedvskip% + \input{\jobname-lst.aux}% + \nianormalizedvskip% + \end{quoting}% +} +% TODO l3doc + l3build +\NewDocumentCommand\DescribeMacroExtended{m !o}{% + \ifhmode% + \vskip\niavskip% + \else% + \addpenalty{\@beginparpenalty}% + \addvspace{\niavskip}% + \fi% + \noindent% + \DescribeMacro{#1}% + \IfValueT{#2}{% + \expandafter\cs\expandafter{\expandafter\@gobble\string#1}#2% + \vskip\smallskipamount% + }% + \noindent\ignorespaces% +} +\makeatother + +\usepackage{bookmark} +\usepackage[babel]{microtype} + +\usepackage{noindentafter} +\NoIndentAfterEnv{niaexample} +\NoIndentAfterEnv{niashow} +\NoIndentAfterCmd{\niaagain} + + +%\EnableCrossrefs +\CodelineIndex +\RecordChanges +\GetFileInfo{noindentafter.dtx} + + + +\begin{document} + \title{The package \pkg{noindentafter}} + \author{% + Michiel Helvensteijn (2014-2021)\\% + Falk Hanisch (2021--)\\% + \url{https://github.com/mrpiggi/noindentafter}\\% + \mailto{hanisch.latex@outlook.com}% + } + \date{\fileversion\nobreakspace(\filedate)} + \maketitle% + \begin{abstract} + \noindent + For certain environments---such as \env{itemize} or \env{theorem}---as + well as specific commands, indentation of the following paragraph is not + desired. It is of course possible to manually add \cs{noindent} to each + occurrence, but it is very easy to forget this at one point or another. + This package provides a few simple commands which can be used to patch + existing macros and environments in order to get rid of manually using + \cs{noindent} after these. Therefore, both packages \pkg{etoolbox} and + \pkg{xpatch} are required. + \end{abstract} + %\tableofcontents + \setcounter{secnumdepth}{0} + \DocInput{\filename} +\end{document} +% \fi +% +\changes{v0.0.1}{2013-08-02}{initial version by Michiel Helvensteijn} +\changes{v0.2.0}{2014-11-30}{new implementation, fixing a spacing issue} +\changes{v0.2.2}{2014-11-30}{fixed version number in the README} +\changes{v1.00}{2021-05-11}{new maintainer: Falk Hanisch}^^A +\changes{v1.00}{2021-05-14}{fix for \LaTeXe\ 2019-10-01 and later} + + + +\section{Usage} + +The package does not provide additional options and is used in the simplest way +possible: + +\begin{niaexample} +\usepackage{noindentafter} +\end{niaexample} + +In order to ensure a consistent layout throughout the document, it is +recommended---but not mandatory---to use the commands described below within +the preamble after loading package \pkg{noindentafter}. + + + +\DescribeMacroExtended{\NoIndentAfterEnv}[\marg{environment}] +This is probably the most frequently needed functionality. After using this +command, any paragraph following such an \marg{environment} will remain +unindented. The example below shows the default output without the involvement +of \pkg{noindentafter}. + +\begin{niashow} +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. + +\begin{itemize} + \item First Item + \item Second Item +\end{itemize} + +Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer +id, vulputate a, magna. Donec vehicula augue eu neque. + +Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac +turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. +\end{niashow} + +Once \lstinline[style=noindentafter]|\NoIndentAfterEnv{itemize}| has been +executed, the output differs by the \emph{unintended} paragraph directly after +the \env{itemize} environment: \niaagain[\NoIndentAfterEnv{itemize}] + +Note that using the \cs{NoIndentAfterEnv} command on an environment is not the +same as adding \cs{NoIndentAfterThis} to the end of it:^^A +\footnote{\cs{NoIndentAfterEnv} bypasses the group that surrounds environments} + +\begin{niashow} +\newenvironment{mytestenv}{\itshape}{\NoIndentAfterThis} +\begin{mytestenv} +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. +\end{mytestenv} + +Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer +id, vulputate a, magna. Donec vehicula augue eu neque. +\end{niashow} + + + + +\DescribeMacroExtended{\NoIndentAfterCmd}[\marg{command}] +By using \cs{NoIndentAfterCmd}, macros can be modified. There probably may not +be many situations where this is useful, but perhaps this one: + +\begin{niashow} +Lorem ipsum dolor sit amet, consectetuer adipiscing elit: + +\[ 1 + 1 = 2 \] + +Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur +dictum gravida mauris: + +\NoIndentAfterCmd{\]} + +\[ 2 + 2 = 4 \] + +Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec +vehicula augue eu neque. +\end{niashow} + + + +\DescribeMacroExtended{\NoIndentAfterThis} +Finally, this is the most primitive macro offered by the package. It forces a +paragraph break and suppresses indentation for whatever follows: + +\begin{niashow} +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida +mauris. \NoIndentAfterThis Nam arcu libero, nonummy eget, consectetuer id, +vulputate a, magna. Donec vehicula augue eu neque. +\end{niashow} + + + +\section{Acknowledgements} +This package resulted from \url{http://tex.stackexchange.com/q/112404} and the +excellent responses to it by \textsc{cgnieder} and \textsc{lockstep}. Although +it initially based on the proposed solution by \textsc{cgnieder}---as it was +simpler and more generally applicable---the answer by \textsc{lockstep} is +definitely worth reading. + + + +\StopEventually{^^A + \cleardoublepage\PrintIndex^^A + \PrintChanges^^A + \PrintToDos^^A +} +% +% \iffalse +% +%<*package&body> +% \fi +% +%^^A \cleardoublepage +%^^A \appendix +% \section{Implementation} +% The only required packages are \pkg{etoolbox} as well as \pkg{xpatch}. +% \begin{macrocode} +\RequirePackage{etoolbox} +\RequirePackage{xpatch} +% \end{macrocode} +% +% \begin{macro}{\nia@scan} +% This command implements the main principle behind this package. It checks +% whether it is followed by a paragraph. If so, the command \cs{par} is +% temporarily changed using \cs{everypar}, so that the following paragraph is +% not indented. Immediately afterwards, default paragraph behavior is restored +% with \cs{@restorepar} (from the \LaTeXe\ kernel). +% \begin{macrocode} +\newcommand*\nia@scan{% + \kernel@ifnextchar\par{% + \par% + \def\par{% + \everypar{\setbox\z@\lastbox\everypar{}}% + \@restorepar% + }% + }{}% +} +% \end{macrocode} +% \end{macro}^^A \nia@scan +% +% \begin{macro}{\nia@afterendenv} +% This command is used for hooking into the ending routine of an environment at +% the latest possible point after \cs{ignorespaces}. It is heavily inspired by +% David Carlisle\footnote{\url{https://tex.stackexchange.com/a/179034/38481}} +% and uses a delimited argument in order to apply \cs{nia@scan} last. +% +% It is invoked via hook \cs{AfterEndEnvironment} provided by \pkg{etoolbox} +% and leaves everything between its invocation and \cs{ignorespaces}|\fi| at +% the very end of \cs{end} unchanged---even additonal material given through +% the same hook---and finally executes \cs{nia@scan}. +% \begin{macrocode} +\newcommand*\nia@afterendenv{} +\def\nia@afterendenv#1\ignorespaces\fi{#1\ignorespaces\fi\nia@scan} +% \end{macrocode} +% \end{macro}^^A \nia@afterendenv +% +% \begin{macro}{\NoIndentAfterThis} +% \begin{macro}{\NoIndentAfterCmd} +% \begin{macro}{\NoIndentAfterEnv} +% These are finally the user-level commands to activate the funtionality of +% \pkg{noindetafter} for the given \marg{environment}/\marg{macro} as well as +% immediate execution. +% \begin{macrocode} +\newrobustcmd*\NoIndentAfterThis{\nia@scan\par} +\newcommand*\NoIndentAfterCmd[1]{% + \xapptocmd#1{\NoIndentAfterThis}{}{% + \PackageWarning{noindentafter}{% + Patching `\string#1' failed!\MessageBreak% + `\string\NoIndentAfterCmd{\string#1}' won't work% + }% + }% +} +\newcommand*\NoIndentAfterEnv[1]{\AfterEndEnvironment{#1}{\nia@afterendenv}} +% \end{macrocode} +% \end{macro}^^A \NoIndentAfterEnv +% \end{macro}^^A \NoIndentAfterCmd +% \end{macro}^^A \NoIndentAfterThis +% +% \iffalse +% +% \fi +% +% \Finale +% +\endinput -- cgit v1.2.3