summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/noindentafter/README47
-rw-r--r--Master/texmf-dist/doc/latex/noindentafter/noindentafter-dry.sty (renamed from Master/texmf-dist/doc/latex/noindentafter/dry.sty)22
-rw-r--r--Master/texmf-dist/doc/latex/noindentafter/noindentafter-packagedoc.cls (renamed from Master/texmf-dist/doc/latex/noindentafter/packagedoc.cls)2
-rw-r--r--Master/texmf-dist/doc/latex/noindentafter/noindentafter.pdfbin214935 -> 223162 bytes
-rw-r--r--Master/texmf-dist/doc/latex/noindentafter/noindentafter.tex18
-rw-r--r--Master/texmf-dist/doc/latex/noindentafter/with.sty309
-rw-r--r--Master/texmf-dist/tex/latex/noindentafter/noindentafter.sty90
7 files changed, 130 insertions, 358 deletions
diff --git a/Master/texmf-dist/doc/latex/noindentafter/README b/Master/texmf-dist/doc/latex/noindentafter/README
index c88754ff185..1eb4449dbf5 100644
--- a/Master/texmf-dist/doc/latex/noindentafter/README
+++ b/Master/texmf-dist/doc/latex/noindentafter/README
@@ -1,33 +1,50 @@
-LaTeX Package : noindentafter 0.0.1
+latex-noindentafter
+===============
-Last Modified : 2013-08-02
+LaTeX Package : noindentafter 0.2.2
+
+Last Modified : 2014/11/30
Author : Michiel Helvensteijn (www.mhelvens.net)
-===== Prerequisites =====
-To use this package, you need only 'etoolbox', though to generate
+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.
+Installation
+-------------
-(noindentafter.sty is not generated, but manually maintained; you
- may use docstrip to remove the documentation, but you don't
+`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.
+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)
-(noindentafter.tex does not contain the package code itself; it inputs
- noindentafter.sty directly to document the implementation)
-===== License =====
+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/Master/texmf-dist/doc/latex/noindentafter/dry.sty b/Master/texmf-dist/doc/latex/noindentafter/noindentafter-dry.sty
index d2b723393c1..27ba1a3077c 100644
--- a/Master/texmf-dist/doc/latex/noindentafter/dry.sty
+++ b/Master/texmf-dist/doc/latex/noindentafter/noindentafter-dry.sty
@@ -1,45 +1,43 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse %%%%
% %
-% Copyright (c) 2013 - Michiel Helvensteijn (www.mhelvens.net) %
+% Copyright (c) 2014 - Michiel Helvensteijn - www.mhelvens.net %
% %
-% http://latex-noindentafter.googlecode.com %
+% 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 %
+% 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'. %
+% This work has the LPPL maintenance status 'maintained'. %
% %
% The Current Maintainer of this work is Michiel Helvensteijn. %
% %
-% This work consists of the file dry.sty. %
-% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \fi %%%%
-% I will 'officially' release this package at some point in the future. For
+% 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{dry}
- [2012/12/19 convenience macros for reusing LaTeX code]
+\ProvidesPackage{noindentafter-dry}
+ [2013/10/11 convenience macros for reusing LaTeX code]
\RequirePackage{filecontents}
\RequirePackage{xparse}
\RequirePackage{etoolbox}
-\RequirePackage{with}
+\RequirePackage{withargs}
\newcommand\minput[1]{%
\input{#1}\unskip%
}
\NewDocumentCommand{\NewDRYer}{m +m}{%
- \with{un} [#1] [#2] {%
+ \withargs [\uniquecsname] [#2] {%
\newenvironment{#1}{%
\begingroup%
\@tempswafalse\filec@ntents{##1.tmp}%
@@ -48,7 +46,7 @@
\endgroup%
}%
\AfterEndEnvironment{#1}{%
- \with{xn} [##1.tmp] [\minput{##1.tmp}] {%
+ \withargs (xn) [##1.tmp] [\minput{##1.tmp}] {%
##2%
}%
}%
diff --git a/Master/texmf-dist/doc/latex/noindentafter/packagedoc.cls b/Master/texmf-dist/doc/latex/noindentafter/noindentafter-packagedoc.cls
index bfbd129136f..1eb80d548cf 100644
--- a/Master/texmf-dist/doc/latex/noindentafter/packagedoc.cls
+++ b/Master/texmf-dist/doc/latex/noindentafter/noindentafter-packagedoc.cls
@@ -45,7 +45,7 @@
\RequirePackage{listings}
\RequirePackage{textcomp}
\RequirePackage[colorlinks=true]{hyperref}
-\RequirePackage{dry}
+\RequirePackage{noindentafter-dry}
\RequirePackage{needspace}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/doc/latex/noindentafter/noindentafter.pdf b/Master/texmf-dist/doc/latex/noindentafter/noindentafter.pdf
index 0e915825c57..b8d1d8aad13 100644
--- a/Master/texmf-dist/doc/latex/noindentafter/noindentafter.pdf
+++ b/Master/texmf-dist/doc/latex/noindentafter/noindentafter.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/noindentafter/noindentafter.tex b/Master/texmf-dist/doc/latex/noindentafter/noindentafter.tex
index aba9eacff2b..6aac2ebe06f 100644
--- a/Master/texmf-dist/doc/latex/noindentafter/noindentafter.tex
+++ b/Master/texmf-dist/doc/latex/noindentafter/noindentafter.tex
@@ -1,6 +1,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
-% Copyright (c) 2013 - Michiel Helvensteijn - www.mhelvens.net %
+% Copyright (c) 2014 - Michiel Helvensteijn - www.mhelvens.net %
% %
% http://latex-noindentafter.googlecode.com %
% %
@@ -20,7 +20,7 @@
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\documentclass[a4paper]{packagedoc}
+\documentclass[a4paper]{noindentafter-packagedoc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup %
@@ -39,6 +39,10 @@
\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} %
@@ -186,10 +190,16 @@ Eventually I asked a question on \url{http://tex.stackexchange.com}:
\end{itemize}
I received two excellent answers -- one from cgnieder and one from lockstep.
-This package is based on the technique proposed by cgnieder, as it is
-simpler and more generally applicable. Still, the answer by 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/Master/texmf-dist/doc/latex/noindentafter/with.sty b/Master/texmf-dist/doc/latex/noindentafter/with.sty
deleted file mode 100644
index dcaa976b281..00000000000
--- a/Master/texmf-dist/doc/latex/noindentafter/with.sty
+++ /dev/null
@@ -1,309 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse %%%%
-% %
-% Copyright (c) 2013 - Michiel Helvensteijn (www.mhelvens.net) %
-% %
-% http://latex-with.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 `author-maintained'. %
-% %
-% The Current Maintainer of this work is Michiel Helvensteijn. %
-% %
-% This work consists of the file with.sty and with.tex. %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \fi %%%%
-
-% \CheckSum{0}
-%
-% \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}
-\RequirePackage{expl3}
-\ProvidesExplPackage{with}{2012/12/23}{0.0.1}
- {an inline construct for passing token lists as parameters}
-% \end{macrocode}
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \subsection{Required Packages} %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-
-% \begin{macrocode}
-\RequirePackage{xparse}
-\RequirePackage{l3regex}
-% \end{macrocode}
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \subsection{Package Code} %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-
-% \begin{macrocode}
-\cs_generate_variant:Nn \cs_generate_variant:Nn {cn}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\cs_new:Nn \gen_use:nn {
- \cs_generate_variant:cn
- { #1 : \prg_replicate:nn{\tl_count:n{#2}}{n} }
- { #2 }
- \use:c{ #1 : #2 }
-}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\cs_new_protected:Nn \with:n {#1}
-\cs_new_protected:Nn \with:nn {
- \cs_set:Npn \__with:n ##1 {#2}
- \__with:n {#1} }
-\cs_new_protected:Nn \with:nnn {
- \cs_set:Npn \__with:nn ##1##2 {#3}
- \__with:nn {#1}{#2} }
-\cs_new_protected:Nn \with:nnnn {
- \cs_set:Npn \__with:nnn ##1##2##3 {#4}
- \__with:nnn {#1}{#2}{#3} }
-\cs_new_protected:Nn \with:nnnnn {
- \cs_set:Npn \__with:nnnn ##1##2##3##4 {#5}
- \__with:nnnn {#1}{#2}{#3}{#4} }
-\cs_new_protected:Nn \with:nnnnnn {
- \cs_set:Npn \__with:nnnnn ##1##2##3##4##5 {#6}
- \__with:nnnnn {#1}{#2}{#3}{#4}{#5} }
-\cs_new_protected:Nn \with:nnnnnnn {
- \cs_set:Npn \__with:nnnnnn ##1##2##3##4##5##6 {#7}
- \__with:nnnnnn {#1}{#2}{#3}{#4}{#5}{#6} }
-\cs_new_protected:Nn \with:nnnnnnnn {
- \cs_set:Npn \__with:nnnnnnn ##1##2##3##4##5##6##7 {#8}
- \__with:nnnnnnn {#1}{#2}{#3}{#4}{#5}{#6}{#7} }
-\cs_new_protected:Nn \with:nnnnnnnnn {
- \cs_set:Npn \__with:nnnnnnnn ##1##2##3##4##5##6##7##8 {#9}
- \__with:nnnnnnnn {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8} }
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\msg_new:nnnn{with}{invalid-parameter-specs}{
- The~argument~specification~'#1'~is~not~valid.
-}{
- The~argument~specification~should~consist~of~between~
- one~and~seven~of~the~letters~'n',~'o',~'f',~'x',~'u'~or~'U'.
-}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\msg_new:nnnn{with}{invalid-parameter-number}{
- You~specified~#1~arguments~but~provided~#2.
-}{
- Your~argument~specification~is~'#3',~which~means~you~should~
- provide~#1~optional~arguments.~However,~you~provided~only~#2.
-}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\tl_new:N \l__with_argspec_tl
-\tl_new:c {l__with_p_1_tl} \tl_new:c {l__with_p_2_tl}
-\tl_new:c {l__with_p_3_tl} \tl_new:c {l__with_p_4_tl}
-\tl_new:c {l__with_p_5_tl} \tl_new:c {l__with_p_6_tl}
-\tl_new:c {l__with_p_7_tl}
-\tl_new:N \l__with_code_tl
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\int_new:N \l__with_arg_int
-\cs_new:Nn \__with_param_name: {
- l__with_p_
- \int_use:N\l__with_arg_int
- _tl
-}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\tl_new:N \l__with_unique_counter_tl
-\tl_new:N \l__with_param_tl
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\cs_generate_variant:Nn \with:nn {xn}
-\cs_generate_variant:Nn \with:nnnnnnnnn {oooooooon}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
-\NewDocumentCommand \with {m +o +o +o +o +o +o +o +m} {
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
- \regex_match:nnF {^[noxfuU]{1,7}$} {#1}
- { \msg_critical:nnn{with}{invalid-parameter-specs}{#1} }
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
- \tl_set:Nn \l__with_argspec_tl {#1}
- \int_zero:N \l__with_arg_int
- \IfValueT{#2} {
- \tl_set:cn {l__with_p_1_tl} {#2} \int_incr:N \l__with_arg_int
- \IfValueT{#3} {
- \tl_set:cn {l__with_p_2_tl} {#3} \int_incr:N \l__with_arg_int
- \IfValueT{#4} {
- \tl_set:cn {l__with_p_3_tl} {#4} \int_incr:N \l__with_arg_int
- \IfValueT{#5} {
- \tl_set:cn {l__with_p_4_tl} {#5} \int_incr:N \l__with_arg_int
- \IfValueT{#6} {
- \tl_set:cn {l__with_p_5_tl} {#6} \int_incr:N \l__with_arg_int
- \IfValueT{#7} {
- \tl_set:cn {l__with_p_6_tl} {#7} \int_incr:N \l__with_arg_int
- \IfValueT{#8} {
- \tl_set:cn {l__with_p_7_tl} {#8} \int_incr:N \l__with_arg_int
- }}}}}}}
- \tl_set:Nn \l__with_code_tl {#9}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
- \int_compare:nNnF {\tl_count:n{#1}} = {\l__with_arg_int} {
- \msg_error:nnxxx{with}{invalid-parameter-number}
- { \tl_count:n{#1} }
- { \int_use:N \l__with_arg_int }
- { #1 }
- }
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
- \tl_replace_all:Nnn \l__with_argspec_tl {u} {x}
- \tl_replace_all:Nnn \l__with_argspec_tl {U} {c}
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
- \int_zero:N \l__with_arg_int
- \tl_map_inline:nn {#1} {
- \int_incr:N \l__with_arg_int
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
- \tl_if_in:nnT {uU} {##1} {
- \tl_set:Nx \l__with_unique_counter_tl
- { g__with_unique_ \use:c{\__with_param_name:} _count_int }
-
- \int_if_exist:cF {\l__with_unique_counter_tl}
- { \int_new:c {\l__with_unique_counter_tl} }
-
- \int_incr:c {\l__with_unique_counter_tl}
-
- \tl_put_left:cx {\__with_param_name:}
- { g_with_unique_ }
-
- \tl_put_right:cx {\__with_param_name:}
- { _ \int_use:c{\l__with_unique_counter_tl} }
- }
-% \end{macrocode}
-
-
-
-% \uninteresting\begin{macrocode}
- }
-% \end{macrocode}
-
-
-
-% \begin{macrocode}
- \with:oooooooon {\l__with_argspec_tl}
- {\cs:w l__with_p_1_tl \cs_end:}
- {\cs:w l__with_p_2_tl \cs_end:}
- {\cs:w l__with_p_3_tl \cs_end:}
- {\cs:w l__with_p_4_tl \cs_end:}
- {\cs:w l__with_p_5_tl \cs_end:}
- {\cs:w l__with_p_6_tl \cs_end:}
- {\cs:w l__with_p_7_tl \cs_end:} {
- \with:oooooooon {##1o}{##2}{##3}{##4}
- {##5}{##6}{##7}{##8} {
- \int_case:nnn {\l__with_arg_int} {
- {1} { \gen_use:nn{with}{####1}
- {####2} {\l__with_code_tl} }
- {2} { \gen_use:nn{with}{####1}
- {####2}{####3} {\l__with_code_tl} }
- {3} { \gen_use:nn{with}{####1}
- {####2}{####3}{####4} {\l__with_code_tl} }
- {4} { \gen_use:nn{with}{####1}
- {####2}{####3}{####4}
- {####5} {\l__with_code_tl} }
- {5} { \gen_use:nn{with}{####1}
- {####2}{####3}{####4}
- {####5}{####6} {\l__with_code_tl} }
- {6} { \gen_use:nn{with}{####1}
- {####2}{####3}{####4}
- {####5}{####6}{####7} {\l__with_code_tl} }
- {7} { \gen_use:nn{with}{####1}
- {####2}{####3}{####4}
- {####5}{####6}{####7}
- {####8} {\l__with_code_tl} }
- }{}
- }
- }
-% \end{macrocode}
-
-
-
-% \uninteresting\begin{macrocode}
-}
-% \end{macrocode}
-
-
diff --git a/Master/texmf-dist/tex/latex/noindentafter/noindentafter.sty b/Master/texmf-dist/tex/latex/noindentafter/noindentafter.sty
index ef0131d85c2..2ea6e22b37d 100644
--- a/Master/texmf-dist/tex/latex/noindentafter/noindentafter.sty
+++ b/Master/texmf-dist/tex/latex/noindentafter/noindentafter.sty
@@ -1,6 +1,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse %%%%
% %
-% Copyright (c) 2013 - Michiel Helvensteijn - www.mhelvens.net %
+% Copyright (c) 2014 - Michiel Helvensteijn - www.mhelvens.net %
% %
% http://latex-noindentafter.googlecode.com %
% %
@@ -19,7 +19,7 @@
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \fi %%%%
-% \CheckSum{0}
+% \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
@@ -47,7 +47,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{noindentafter}[2013/08/02 0.0.1
+\ProvidesPackage{noindentafter}[2014/11/30 0.2.2
prevent paragraph indentation after specific environments or macros]
% \end{macrocode}
%
@@ -63,10 +63,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% We only need |etoolbox|. The definitions below can probably
-% be rewritten not to need it, but for me it has not been
-% worth the effort.
-%
% \begin{macrocode}
\RequirePackage{etoolbox}
% \end{macrocode}
@@ -76,10 +72,69 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \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}
@@ -88,11 +143,7 @@
% indentation for whatever follows.
%
% \begin{macrocode}
-\newrobustcmd*{\NoIndentAfterThis}{%
- \par%
- \@afterindentfalse%
- \@afterheading%
-}
+\newrobustcmd*{\NoIndentAfterThis}{\@NoIndentAfter\par\par}
% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -102,12 +153,12 @@
% \needspace{5\baselineskip}\begin{macro}{\NoIndentAfterEnv}
%%% \marg{environment}\\
%
-% \noindent Append |\NoIndentAfterThis| to the output of
-% \meta{environment}.
+% \noindent Append |\@NoIndentAfter| to the output of
+% \meta{environment} by using the new environment hook.
%
% \begin{macrocode}
-\newrobustcmd*{\NoIndentAfterEnv}[1]{%
- \AfterEndEnvironment{#1}{\NoIndentAfterThis}%
+\newrobustcmd{\NoIndentAfterEnv}[1]{%
+ \csdef{@noindent@#1@hook}{\@NoIndentAfter}%
}
% \end{macrocode}
%
@@ -123,7 +174,12 @@
%
% \begin{macrocode}
\newrobustcmd*{\NoIndentAfterCmd}[1]{%
- \apptocmd{#1}{\NoIndentAfterThis}{}{}%
+ \apptocmd{#1}{\NoIndentAfterThis}{}{%
+ \PackageWarning{noindentafter}{%
+ Patching `\string#1' failed!\MessageBreak%
+ `\string\NoIndentAfterCmd' won't work%
+ }%
+ }%
}
% \end{macrocode}
%