summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/hardwrap/README20
-rw-r--r--Master/texmf-dist/doc/latex/hardwrap/hardwrap.pdfbin118655 -> 120291 bytes
-rw-r--r--Master/texmf-dist/source/latex/hardwrap/hardwrap.dtx80
-rw-r--r--Master/texmf-dist/source/latex/hardwrap/hardwrap.ins4
-rw-r--r--Master/texmf-dist/tex/latex/hardwrap/hardwrap.sty10
5 files changed, 87 insertions, 27 deletions
diff --git a/Master/texmf-dist/doc/latex/hardwrap/README b/Master/texmf-dist/doc/latex/hardwrap/README
index 315ef9fd2c8..d6e2e594a9e 100644
--- a/Master/texmf-dist/doc/latex/hardwrap/README
+++ b/Master/texmf-dist/doc/latex/hardwrap/README
@@ -1,9 +1,10 @@
The HARDWRAP package
-=======================
+====================
-This package facilitates wrapping text to a specific character width,
-breaking lines by words rather than, as done by TeX, by characters.
+This package facilitates wrapping plain text to a specific number of
+characters per line, while breaking lines by words rather than, as done by
+TeX, by characters.
The primary use for these facilities is to aid the generation of messages
sent to the log file or console output to display messages to the user.
@@ -12,13 +13,21 @@ to an external file.
For more information see the documentation hardwrap.pdf.
+
Change History
--------------
+v0.2
+
+ * Bug fix thanks to Ulrich Diez; newlines at the end of messages are
+ now allowed
+ * Minor documentation improvements
+
v0.1
* Initial release
-
+
+
Maintenance
-----------
@@ -34,6 +43,7 @@ Please report bugs and feature suggestions to the issue tracker:
* <http://github.com/wspr/hardwrap/issues>
+
Licence
-------
@@ -41,7 +51,7 @@ The hardwrap package is released under the
[LaTeX Project Public License](http://www.latex-project.org/lppl/)
version 1.3c or greater. The current maintainer is Will Robertson.
-Copyright 2010 Will Robertson
+Copyright 2010-2011 Will Robertson
Copyright 2010 Kevin Godby
diff --git a/Master/texmf-dist/doc/latex/hardwrap/hardwrap.pdf b/Master/texmf-dist/doc/latex/hardwrap/hardwrap.pdf
index 7856df39232..4b0cd06be82 100644
--- a/Master/texmf-dist/doc/latex/hardwrap/hardwrap.pdf
+++ b/Master/texmf-dist/doc/latex/hardwrap/hardwrap.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/hardwrap/hardwrap.dtx b/Master/texmf-dist/source/latex/hardwrap/hardwrap.dtx
index 83389f6f28d..4a8617f6d1b 100644
--- a/Master/texmf-dist/source/latex/hardwrap/hardwrap.dtx
+++ b/Master/texmf-dist/source/latex/hardwrap/hardwrap.dtx
@@ -9,7 +9,7 @@
\preamble
____________________________
The HARDWRAP package
- (C) 2010 Will Robertson
+ (C) 2010-2011 Will Robertson
(C) 2010 Kevin Godby
License information appended
@@ -51,7 +51,7 @@ This work consists of the file hardwrap.dtx
%</driver>
%<package>\ProvidesPackage{hardwrap}
%<*package>
- [2010/11/11 v0.1 Hard wrap messages]
+ [2011/02/12 v0.2 Hard wrap messages]
%</package>
% \end{macrocode}
%
@@ -191,6 +191,32 @@ This work consists of the file hardwrap.dtx
\newcommand*{\secref}[1]{\hyperref[#1]{section~}\ref{#1}}
+% Hang the code line numbers in the margin
+\def\macro@code{%
+ \topsep \MacrocodeTopsep
+ \@beginparpenalty \predisplaypenalty
+ \if@inlabel\leavevmode\fi
+ \trivlist \parskip \z@ \item[]%
+ \macro@font
+ \leftskip\@totalleftmargin% \advance\leftskip-\MacroIndent
+ \rightskip\z@ \parindent\z@ \parfillskip\@flushglue
+ \blank@linefalse \def\par{\ifblank@line
+ \leavevmode\fi
+ \blank@linetrue\@@par
+ \penalty\interlinepenalty}
+ \obeylines
+ \let\do\do@noligs \verbatim@nolig@list
+ \let\do\@makeother \dospecials
+ \global\@newlistfalse
+ \global\@minipagefalse
+ \ifcodeline@index
+ \everypar{\global\advance\c@CodelineNo\@ne
+ \llap{\theCodelineNo\ \hskip\@totalleftmargin}%
+ \check@module}%
+ \else \everypar{\check@module}%
+ \fi
+ \init@crossref}
+
\definecolor{niceblue}{rgb}{0.1,0.3,0.9}
\def\theCodelineNo{\textcolor{niceblue}{\sffamily\tiny\arabic{CodelineNo}}}
\newcommand*\pkg[1]{\textsf{#1}}
@@ -215,7 +241,8 @@ This work consists of the file hardwrap.dtx
%
% \begin{abstract}
% \noindent This package provides facilities for hard-wrapping text to a certain
-% line width. The primary purpose is to make it easier for package authors to write
+% number of characters per line.
+% The primary purpose is to make it easier for package authors to write
% readable informational messages to the console and log file;
% wrappers around \cs{PackageWarning} \etal\ are provided for this.
% \end{abstract}
@@ -227,7 +254,8 @@ This work consists of the file hardwrap.dtx
% \part{User documentation}
% \section{Introduction}
%
-% The \pkg{\jobname} package provides a macro for word-wrapping text. In
+% The \pkg{\jobname} package provides a macro for word-wrapping text to a
+% certain number of characters per line. In
% addition, helper macros are available for package and document class authors
% to use in automatically wrapping informational, warning, and error messages.
% This package requires \hologo{eTeX}.
@@ -310,10 +338,12 @@ This work consists of the file hardwrap.dtx
%
% \section{Changing the line lengths}
%
-% While \pkg{\jobname} attempts to determine the appropriate line
-% lengths, you may wish to override the value found using
+% While \pkg{\jobname} attempts to determine the maximum line
+% lengths based on where \TeX\ will wrap its console and log output,
+% you may wish to override the value found using
% \cs{setmaxprintline}\marg{value}.
-% This macro takes an integer value which is subsequently used as the
+% This macro takes an integer value which is subsequently used by the
+% commands generated with \cs{GenerateLogMacros} as the
% maximum line width allowed in the terminal output and log file. By default
% this value is~\texttt{79}.
%
@@ -360,7 +390,15 @@ This work consists of the file hardwrap.dtx
% \end{Verbatim}
% to write the text to a file after being hard-wrapped with carriage returns (\verb|^^J|) after each line.
%
-% \newpage
+% \section{Support}
+%
+% Development and historical versions are available from GitHub at
+% \url{http://github.com/wspr/hardwrap/}.
+%
+% Please report bugs and feature suggestions to the issue tracker at
+% \url{http://github.com/wspr/hardwrap/issues}.
+%
+% \clearpage
% \splittoc
% \part{Implementation}
%
@@ -538,7 +576,7 @@ This work consists of the file hardwrap.dtx
% \begin{macrocode}
\newcommand*\HardWrap[5]{%
\begingroup
- \hw@maxprintline=#2\relax
+ \hw@maxprintline=\numexpr#2\relax
% \end{macrocode}
% Replacements for user commands:
% \begin{macrocode}
@@ -563,7 +601,7 @@ This work consists of the file hardwrap.dtx
% \end{macrocode}
% Now scan over the text token by token, transforming it into an
% intermediate representation of fully wrapped text.
-% Then fully expand this intermediate for into its final form,
+% Then fully expand this intermediate form into its final form,
% ready to be processed by the input function \verb|#1|.
% \begin{macrocode}
\expandafter\hw@scan\@tempa\hw@scanstop
@@ -588,9 +626,9 @@ This work consists of the file hardwrap.dtx
%
% \begin{macro}{\hw@process}
% The \cs{hw@process} macro contains the actual word-wrapping algorithm.
-% The text is scanned token by token. Each token falls into one of four
+% The text is scanned token by token. Each token falls into one of five
% categories: (1)~the stop token \cs{hw@scanstop}, (2)~a space token,
-% (3)~a newline insertion, or (4)~anything else.
+% (3)~a newline insertion, (4)~an opening brace, or (5)~anything else.
%
% \begin{enumerate}
% \item
@@ -604,6 +642,10 @@ This work consists of the file hardwrap.dtx
% the current word is the last one that can fit on the line.
% To continue, skip the actual token that is the `newline' and then start scanning again.
% \item
+% If we find an opening brace \verb|{|, we read in the entire brace group, and then
+% re-insert it in the scanner surrounded with brace-strings. I.e., braces are printed
+% in the output.
+% \item
% If the token doesn't fall into one of the above special cases, we'll just append it to
% the current word and continue reading tokens.
% \end{enumerate}
@@ -617,10 +659,10 @@ This work consists of the file hardwrap.dtx
\def\next{\afterassignment\hw@scan\let\@tempa= }%
\else\ifx\let@token\hw@insert@newline
\hw@process@messagebreak
- \def\next{\expandafter\hw@dochar\@gobble}%
+ \def\next{\expandafter\hw@scan\@gobble}%
\else\ifx\let@token^^J
\hw@process@messagebreak
- \def\next{\expandafter\hw@dochar\@gobble}%
+ \def\next{\expandafter\hw@scan\@gobble}%
\else\ifx\let@token\bgroup
\def\next{\expandafter\hw@dochar\hw@process@group}%
\else
@@ -912,7 +954,7 @@ This work consists of the file hardwrap.dtx
}%
}
% \end{macrocode}
-% Here are our wrappers for \cs{PackageInfo} \etal, which are
+% Here are our wrappers for \cs{ClassInfo} \etal, which are
% used above to generalise the code a little. Note that these macros are
% \cs{protected}, which allows them to be used in an expanding context
% without a preceding \cs{noexpand}.
@@ -923,6 +965,7 @@ This work consists of the file hardwrap.dtx
\protected\def\hw@class@warning@noline#1#2{\ClassWarning{#1}{#2\@gobbletwo}}
\protected\def\hw@class@error #1#2{\ClassError {#1}{#2\@gobble}}
% \end{macrocode}
+% And package messages:
% \begin{macrocode}
\protected\def\hw@package@info #1#2{\PackageInfo {#1}{#2\hw@suffix}}
\protected\def\hw@package@info@noline #1#2{\PackageInfo {#1}{#2\@gobbletwo}}
@@ -1033,6 +1076,13 @@ This work consists of the file hardwrap.dtx
\end{qstest}
% \end{macrocode}
%
+% \begin{macrocode}
+\begin{qstest}{trailing newline bug}{}
+\HardWrap{\xdef\TMP}{20}{}{N}{a\\b\\c\\}%
+\Expect*{\TMP}*{aNbNcN}
+\end{qstest}
+% \end{macrocode}
+%
% \GenerateLogMacros{package}[HW]{hardwrap}
% \GenerateLogMacros{class}[HWC]{hardwrap}
% ^^A\HW@error{Please ignore this error!\\ I'm only testing things out.}{(Go away.)}
diff --git a/Master/texmf-dist/source/latex/hardwrap/hardwrap.ins b/Master/texmf-dist/source/latex/hardwrap/hardwrap.ins
index a028f0d44d3..6874b31f17f 100644
--- a/Master/texmf-dist/source/latex/hardwrap/hardwrap.ins
+++ b/Master/texmf-dist/source/latex/hardwrap/hardwrap.ins
@@ -7,7 +7,7 @@
%% hardwrap.dtx (with options: `batchfile')
%% ____________________________
%% The HARDWRAP package
-%% (C) 2010 Will Robertson
+%% (C) 2010-2011 Will Robertson
%% (C) 2010 Kevin Godby
%% License information appended
%%
@@ -16,7 +16,7 @@
\preamble
____________________________
The HARDWRAP package
- (C) 2010 Will Robertson
+ (C) 2010-2011 Will Robertson
(C) 2010 Kevin Godby
License information appended
diff --git a/Master/texmf-dist/tex/latex/hardwrap/hardwrap.sty b/Master/texmf-dist/tex/latex/hardwrap/hardwrap.sty
index b8158647723..8a50abd9083 100644
--- a/Master/texmf-dist/tex/latex/hardwrap/hardwrap.sty
+++ b/Master/texmf-dist/tex/latex/hardwrap/hardwrap.sty
@@ -7,12 +7,12 @@
%% hardwrap.dtx (with options: `package')
%% ____________________________
%% The HARDWRAP package
-%% (C) 2010 Will Robertson
+%% (C) 2010-2011 Will Robertson
%% (C) 2010 Kevin Godby
%% License information appended
%%
\ProvidesPackage{hardwrap}
- [2010/11/11 v0.1 Hard wrap messages]
+ [2011/02/12 v0.2 Hard wrap messages]
\IfFileExists{ifplatform.sty}{%
\RequirePackage{ifplatform}
}{%
@@ -67,7 +67,7 @@
}
\newcommand*\HardWrap[5]{%
\begingroup
- \hw@maxprintline=#2\relax
+ \hw@maxprintline=\numexpr#2\relax
\let\space\hw@protected@space
\def\ {\space}%
\let\\\hw@insert@newline
@@ -97,10 +97,10 @@
\def\next{\afterassignment\hw@scan\let\@tempa= }%
\else\ifx\let@token\hw@insert@newline
\hw@process@messagebreak
- \def\next{\expandafter\hw@dochar\@gobble}%
+ \def\next{\expandafter\hw@scan\@gobble}%
\else\ifx\let@token^^J
\hw@process@messagebreak
- \def\next{\expandafter\hw@dochar\@gobble}%
+ \def\next{\expandafter\hw@scan\@gobble}%
\else\ifx\let@token\bgroup
\def\next{\expandafter\hw@dochar\hw@process@group}%
\else