diff options
author | Karl Berry <karl@freefriends.org> | 2016-08-25 23:02:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-08-25 23:02:05 +0000 |
commit | b4ca047b96a502350b025c4541bc5d479b2f86f3 (patch) | |
tree | ebab119783c535c852bcae9886832cae878436b5 /Master/texmf-dist/doc | |
parent | fea2f0eb388007dabe52654e6355a8448c929e55 (diff) |
comment (25aug16)
git-svn-id: svn://tug.org/texlive/trunk@41927 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/Makefile | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/README | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comm_bug.tex | 32 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comm_test.pdf | bin | 0 -> 38450 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comm_test.tex (renamed from Master/texmf-dist/doc/latex/comment/comm_latest.tex) | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comm_test_ivo.tex | 32 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comm_test_l.tex | 78 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comment.pdf | bin | 259457 -> 236600 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comment.tex | 211 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/comment_plain.tex | 263 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/t1test.pdf | bin | 0 -> 11855 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/t1test.tex | 24 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/writeup.pdf | bin | 0 -> 244307 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/comment/writeup.tex | 244 |
14 files changed, 851 insertions, 83 deletions
diff --git a/Master/texmf-dist/doc/latex/comment/Makefile b/Master/texmf-dist/doc/latex/comment/Makefile new file mode 100644 index 00000000000..d405592566f --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/Makefile @@ -0,0 +1,6 @@ +info : + @echo "there is nothing to make here" +clean : + @/bin/rm -f *~ *.{aux,log,out} *.cut +zip : clean + @cd .. ; zip comment.zip comment/* diff --git a/Master/texmf-dist/doc/latex/comment/README b/Master/texmf-dist/doc/latex/comment/README index 068ba6f0dd0..41ffe8ab844 100644 --- a/Master/texmf-dist/doc/latex/comment/README +++ b/Master/texmf-dist/doc/latex/comment/README @@ -1,3 +1,7 @@ -files: -comment.sty -- the latest version (August 1998) -comm_latest.tex -- a LaTeX test file for comment.sty +Files: +- comment.sty : LaTeX comment style +- comment_plain.tex : plain TeX version, no longer maintained +- comment.{tex,pdf} : description of how the style works + +- comm_test.tex : illustrative test +- t1test.tex : test of T1 non-ascii characters diff --git a/Master/texmf-dist/doc/latex/comment/comm_bug.tex b/Master/texmf-dist/doc/latex/comment/comm_bug.tex new file mode 100644 index 00000000000..f0e8473b044 --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/comm_bug.tex @@ -0,0 +1,32 @@ +\documentclass[12pt]{article} + +\usepackage{comment} +\excludecomment{conditional} + +\specialcomment{redcomment}{\begingroup\em\Large}{\endgroup\tiny} + +\begin{document} + +plain text. + +\newcommand{\Redcomment}[1]{Original Definition. (#1).} + +\begin{conditional} +Conditional Text. + +More Conditional Text in next paragraph. + +\renewcommand{\Redcomment}[1]{Redefinition Worked! (#1).} +\end{conditional} + +\begin{redcomment} +the first redcomment paragraph. + +the second redcomment paragraph. +\end{redcomment} + +Because redcomment has ended, this should be tiny. + +\Redcomment{This is the command line version.} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/comment/comm_test.pdf b/Master/texmf-dist/doc/latex/comment/comm_test.pdf Binary files differnew file mode 100644 index 00000000000..ecee94c27ec --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/comm_test.pdf diff --git a/Master/texmf-dist/doc/latex/comment/comm_latest.tex b/Master/texmf-dist/doc/latex/comment/comm_test.tex index 4974f5f2f14..ec1feb3a51e 100644 --- a/Master/texmf-dist/doc/latex/comment/comm_latest.tex +++ b/Master/texmf-dist/doc/latex/comment/comm_test.tex @@ -1,12 +1,11 @@ % An illustration of comment.sty by Victor Eijkhout, % version 3.4 and later. % -% For use with LaTeX2.09, and LaTeX2e in compatibility mode. -% -\documentstyle{article} -\begin{document} +\documentclass{article} -\input comment.sty +\usepackage{comment} + +\begin{document} \includecomment{thisone} \excludecomment{notthisone} @@ -61,11 +60,11 @@ We switch to inside \rm a comment. (The phrase `bold face inside' should be bold.) \newcount\comlines -\processcomment{countedcomment} - {\comlines=0\relax +\specialcomment{countedcomment} + {\comlines=0\relax \def\ProcessCutFile{}% \def\ThisComment##1{\global\advance\comlines1\relax}} - {}{**Comment: \number\comlines\ line(s) removed**} - + {**Comment: \number\comlines\ line(s) removed**} + This is a line of text \begin{countedcomment} Oneline @@ -78,4 +77,21 @@ Three line \end{countedcomment} last line of text. +\specialcomment + {underlinecomment} + {% + \def\ProcessCutFile{\input{\CommentCutFile}\relax}% Bug! this + % should not be necessary. + \def\ThisComment##1{\WriteCommentLine{u: \underline{##1}\par}} + \par + } + {\par} + +A block of two underlined lines in between this line +\begin{underlinecomment} +line 1 +line 2 +\end{underlinecomment} +and before this line. + \end{document} diff --git a/Master/texmf-dist/doc/latex/comment/comm_test_ivo.tex b/Master/texmf-dist/doc/latex/comment/comm_test_ivo.tex new file mode 100644 index 00000000000..87920525586 --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/comm_test_ivo.tex @@ -0,0 +1,32 @@ +\documentclass[12pt]{article} + +\usepackage{comment} +\excludecomment{conditional} + +\specialcomment{redcomment}{\em\Large}{\tiny} + +\begin{document} + +plain text. + +\newcommand{\Redcomment}[1]{Original Definition. (#1).} + +\begin{conditional} +Conditional Text. + +More Conditional Text in next paragraph. + +\renewcommand{\Redcomment}[1]{Redefinition Worked! (#1).} +\end{conditional} + +\begin{redcomment} +the first redcomment paragraph. + +the second redcomment paragraph. +\end{redcomment} + +Because redcomment has ended, this should be tiny. + +\Redcomment{This is the command line version.} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/comment/comm_test_l.tex b/Master/texmf-dist/doc/latex/comment/comm_test_l.tex new file mode 100644 index 00000000000..ac9778b1763 --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/comm_test_l.tex @@ -0,0 +1,78 @@ +% An illustration of comment.sty by Victor Eijkhout. +% This file belongs to comment.sty version 3.0 or later, +% it is meant to be used with LaTeX + +\documentstyle[comment]{article} +\begin{document} + +\excludecomment{begone} + +\includecomment{thisone} +\excludecomment{notthisone} + +% under development \leveledcomment{maybethis}{1} + +\parskip=20pt +This sentence +\begin{comment} +has +\end{comment} +no verb. + +Check for\begin{notthisone} +superfluous +\end{notthisone} +spaces, and +\begin{thisone} +inclusion +\end{thisone} +of proper texts. + +% a test of the special comments +\newcount\comlines +\processcomment{countedcomment} + {\comlines=0\relax + \def\ThisComment##1{\global\advance\comlines1\relax}} + {}{\endgraf **Comment: \number\comlines\ line(s) removed**\endgraf} + +This is a line of text +\begin{countedcomment} +Oneline +\end{countedcomment} +another line of text +\begin{countedcomment} +One line +Two line +Three line +\end{countedcomment} +last line of text + +Let's test paragraphs: +\begin{notthisone} +This one is missing. + +As is this one. +\end{notthisone} +For starters. + +On the other hand: +\begin{thisone} +This is one is present. + +As is this one. +\end{thisone} +And that's it. + +\begin{comment} % future project +\maybethis 0 +Level zero. +\endmaybethis +\maybethis 1 +Level one. +\endmaybethis +\maybethis 2 +Level two. +\endmaybethis +\end{comment} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/comment/comment.pdf b/Master/texmf-dist/doc/latex/comment/comment.pdf Binary files differindex cbf24fa173e..afd81732469 100644 --- a/Master/texmf-dist/doc/latex/comment/comment.pdf +++ b/Master/texmf-dist/doc/latex/comment/comment.pdf diff --git a/Master/texmf-dist/doc/latex/comment/comment.tex b/Master/texmf-dist/doc/latex/comment/comment.tex index 0c1f3597896..e6f3d5422c5 100644 --- a/Master/texmf-dist/doc/latex/comment/comment.tex +++ b/Master/texmf-dist/doc/latex/comment/comment.tex @@ -1,4 +1,4 @@ -\documentclass[parskip=false, DIV=8, headings=normal, pagesize=auto]{scrartcl} +\documentclass[parskip=false, DIV=8, headings=normal, pagesize=auto]{artikel3}%{scrartcl} \usepackage{fixltx2e} \usepackage{etex} @@ -27,11 +27,12 @@ \newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} \newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} -\addtokomafont{title}{\rmfamily} +%\addtokomafont{title}{\rmfamily} -\title{The \pkg{comment} package\thanks{This manual corresponds to \pkg{comment}~v3.6, dated~October 1999.}} -\author{Victor Eijkhout\\\mail{victor@eijkhout.net}} -\date{October 1999} +\title{The \pkg{comment} package\thanks{This manual corresponds to + \pkg{comment}~v3.8 of July 2016.}} +% +\author{Victor Eijkhout\\\mail{victor@eijkhout.net}} \date{August 2016} \begin{document} @@ -40,27 +41,25 @@ \section{Purpose:} -selectively in/exclude pieces of text: the user can define new +Selectively in/exclude pieces of text: the user can define new comment versions, and each is controlled separately. Special comments can be defined where the user specifies the action that is to be taken with each comment line. -This style can be used with plain \TeX\ or \LaTeX, and probably -most other packages too. +Plain \TeX\ support has been phased out. +As of 3.8 the package will increasingly use e\TeX\ features, for +instance to solve Unicode support issues. \section{Usage:} +The `\env{comment}' environment is defined by default: all text included between % \begin{verbatim} -\comment ... \endcomment -\end{verbatim} -% -or -% -\begin{verbatim} -\begin{comment} ... \end{comment} +\begin{comment} + ... +\end{comment} \end{verbatim} % is discarded. @@ -81,27 +80,32 @@ and are selected/deselected with These environments are used as % \begin{verbatim} -\versiona ... \endversiona -\end{verbatim} -% -or -% -\begin{verbatim} -\begin{versiona} ... \end{versiona} +\begin{versiona} + ... +\end{versiona} \end{verbatim} % with the opening and closing commands again on a line of their own. -\pagebreak[1] - -\LaTeX\ users note: for an included comment, the +Note: for an included comment, the \cmd{\begin} and \cmd{\end} lines act as if they don't exist. In particular, they don't imply grouping, so assignments \&c are not local. -\pagebreak[2] +Trick for short in/exclude macros (such as \verb+\maybe{this snippet}+): +% +\begin{verbatim} +\includecomment{cond} +\newcommand{\maybe}[1]{} +\begin{cond} +\renewcommand{\maybe}[1]{#1} +\end{cond} +\end{verbatim} +\section{Special comments} + +It is possible to make highly customized versions of the comment environment. Special comments are defined as % \begin{noverb} @@ -111,63 +115,131 @@ Special comments are defined as where the second and third arguments are executed before and after each comment block. You can use this for global formatting commands. + To keep definitions \&c local, you can include \cmd{\begingroup} in the `\meta{before commands}' and \cmd{\endgroup} in the `\meta{after commands}'. -ex: + +Example: % \begin{verbatim} \specialcomment{smalltt} {\begingroup\ttfamily\footnotesize}{\endgroup} \end{verbatim} % -You do \emph{not} have to do an additional -% +Special comments are automatically included. + +The comment environments use two auxiliary commands. You can get +nifty special effects by redefining them. + +\subsection{The cutfile} + +The commented text is written to an external file, the `cutfile'. Default definition: \begin{verbatim} -\includecomment{smalltt} + \def\CommentCutFile{comment.cut} \end{verbatim} -% -To remove `\env{smalltt}' blocks, give \verb+\excludecomment{smalltt}+ -after the definition. -Processing comments can apply processing to each line. -% -\begin{noverb} -\cmd{\processcomment}\marg{name}\marg{each-line commands}\marg{before commands}\marg{after commands} -\end{noverb} -% -By defining a control sequence -% +Included comments are processed like this: \begin{verbatim} -\def\Thiscomment##1{...} + \def\ProcessCutFile{\input{\CommentCutFile}\relax} +\end{verbatim} + and excluded files have +\begin{verbatim} + \def\ProcessCutFile{} +\end{verbatim} + +\begin{itemize} +\item By redefining the name of the cutfile, the value of the macro + \cmd{CommentCutFile}, it becomes possible to have nested comment environments. +\item If you are writing a textbook, you could have the answers to + exercises in your source, but write them to file rather than + formatting them: +\begin{verbatim} +\generalcomment{answer} + {\begingroup + \edef\tmp{\def\noexpand\CommentCutFile + {answers/\chapshortname-an\noexpand\arabic{excounter}.tex}}\tmp + \def\ProcessCutFile{}} + {\ifIncludeAnswers \begin{quote} + \leavevmode + \hbox{\kern-\unitindent + \textbf Solution to exercise \arabic{chapter}.\arabic{excounter}.\hspace{1em}}% + \ignorespaces\it + \input{\CommentCutFile} + \end{quote}\fi + \endgroup} +\end{verbatim} +\end{itemize} + +\subsection{Comment inclusion} + +The inclusion of the comment is done +by \cmd{\ProcessCutFile}, so you can redefine that: +\begin{verbatim} + \specialcomment + {mathexamplewithcode} + {\begingroup\def\ProcessCutFile{}} % arg1 + {\verbatiminput{\CommentCutFile} % arg2 + \endgroup + This gives: + \begin{equation} \input{\CommentCutFile} \end{equation} + } +\end{verbatim} +The idea here is to disable inclusion of the file, +but include it in the after commands, in display math. + +\subsection{Processing each line} + +You can also apply processing to each line. +By defining a control sequence +\begin{verbatim} + \def\Thiscomment##1{...} \end{verbatim} -% in the before commands the user can -specify what is to be done with each comment line. -BUG this does not work quite yet BUG +specify what is to be done with each comment line. If something +needs to be written to file, use \verb+\WriteCommentLine{the stuff}+ +Example: +\begin{verbatim} + \specialcomment + {underlinecomment} + {\def\ThisComment##1{\WriteCommentLine{\underline{##1}\par}} + \par} + {\par} +\end{verbatim} + +\subsection{More examples} -Trick for short in/exclude macros (such as \verb+\maybe{this snippet}+): -% \begin{verbatim} -\includecomment{cond} -\newcommand{\maybe}[1]{} -\begin{cond} -\renewcommand{\maybe}[1]{#1} -\end{cond} +\newcount\comlines +\specialcomment{countedcomment} + {\comlines=0\relax \def\ProcessCutFile{}% + \def\ThisComment##1{\global\advance\comlines1\relax}} + {**Comment: \number\comlines\ line(s) removed**} \end{verbatim} +\begin{verbatim} +\specialcomment + {underlinecomment} + {% + \def\ProcessCutFile{\input{\CommentCutFile}\relax} + \def\ThisComment##1{\WriteCommentLine{u: \underline{##1}\par}} + \par + } + {\par} +\end{verbatim} -\section{Basic approach of the implementation:} +\section{Unicode support} -to comment something out, scoop up every line in verbatim mode -as macro argument, then throw it away. -For inclusions, in \LaTeX\ the block is written out to -a file \cmd{\CommentCutFile} (default ``\texttt{comment.cut}''), which is -then included. -In plain \TeX\ (and other formats) both the opening and -closing comands are defined as noop. +Unicode support works if you use e\TeX, which is for instance the case +if you use pdflatex. You need the following lines: +\begin{verbatim} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\end{verbatim} +in your preamble. +\section{Change log} -\section{Changes in version 3.1} +\subsection{Changes in version 3.1} \begin{itemize} \item updated author's address @@ -188,14 +260,14 @@ closing comands are defined as noop. \end{itemize} -\section{Changes in 3.2} +\subsection{Changes in 3.2} \begin{itemize} \item \cmd{\specialcomment} brought up to date (thanks to Ivo Welch). \end{itemize} -\section{Changes in 3.3} +\subsection{Changes in 3.3} \begin{itemize} \item updated author's address again @@ -203,7 +275,7 @@ closing comands are defined as noop. \end{itemize} -\section{Changes in 3.4} +\subsection{Changes in 3.4} \begin{itemize} \item added GNU public license @@ -212,7 +284,7 @@ closing comands are defined as noop. \end{itemize} -\section{Changes in 3.5} +\subsection{Changes in 3.5} \begin{itemize} \item corrected typo in header. @@ -222,7 +294,7 @@ closing comands are defined as noop. \end{itemize} -\section{Changes in 3.6} +\subsection{Changes in 3.6} \begin{itemize} \item The `cut' file is now written more verbatim, using \cmd{\meaning}; @@ -232,11 +304,8 @@ closing comands are defined as noop. \end{itemize} -\section{Known bugs:} +\subsection{Changes in 3.8} -\begin{itemize} -\item \texttt{excludecomment} leads to one superfluous space -\item \texttt{processcomment} leads to a superfluous line break -\end{itemize} +T1 font encoding is now supported. See t1test.tex. \end{document} diff --git a/Master/texmf-dist/doc/latex/comment/comment_plain.tex b/Master/texmf-dist/doc/latex/comment/comment_plain.tex new file mode 100644 index 00000000000..9470a3e5a4b --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/comment_plain.tex @@ -0,0 +1,263 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Comment.sty version 3.5, August 1998 +% +% Purpose: +% selectively in/exclude pieces of text: the user can define new +% comment versions, and each is controlled separately. +% Special comments can be defined where the user specifies the +% action that is to be taken with each comment line. +% +% Author +% Victor Eijkhout +% Department of Computer Science +% University of Tennessee +% 107 Ayres Hall +% Knoxville TN 37996 +% USA +% +% victor@eijkhout.net +% +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 2 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% For a copy of the GNU General Public License, write to the +% Free Software Foundation, Inc., +% 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +% or find it on the net, for instance at +% http://www.gnu.org/copyleft/gpl.html +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This style can be used with plain TeX or LaTeX, and probably +% most other packages too. +% +% Usage: all text included between +% \comment ... \endcomment +% or \begin{comment} ... \end{comment} +% is discarded. +% +% The opening and closing commands should appear on a line +% of their own. No starting spaces, nothing after it. +% This environment should work with arbitrary amounts +% of comment, and the comment can be arbitrary text. +% +% Other `comment' environments are defined by +% and are selected/deselected with +% \includecomment{versiona} +% \excludecoment{versionb} +% +% These environments are used as +% \versiona ... \endversiona +% or \begin{versiona} ... \end{versiona} +% with the opening and closing commands again on a line of +% their own. +% +% LaTeX users note: for an included comment, the +% \begin and \end lines act as if they don't exist. +% In particular, they don't imply grouping, so assignments +% &c are not local. +% +% Special comments are defined as +% \specialcomment{name}{before commands}{after commands} +% where the second and third arguments are executed before +% and after each comment block. You can use this for global +% formatting commands. +% To keep definitions &c local, you can include \begingroup +% in the `before commands' and \endgroup in the `after commands'. +% ex: +% \specialcomment{smalltt} +% {\begingroup\ttfamily\footnotesize}{\endgroup} +% You do *not* have to do an additional +% \includecomment{smalltt} +% To remove 'smalltt' blocks, give \excludecomment{smalltt} +% after the definition. +% +% Processing comments can apply processing to each line. +% \processcomment{name}{each-line commands}% +% {before commands}{after commands} +% By defining a control sequence +% \def\Thiscomment##1{...} in the before commands the user can +% specify what is to be done with each comment line. +% BUG this does not work quite yet BUG +% +% Trick for short in/exclude macros (such as \maybe{this snippet}): +%\includecomment{cond} +%\newcommand{\maybe}[1]{} +%\begin{cond} +%\renewcommand{\maybe}[1]{#1} +%\end{cond} +% +% Basic approach of the implementation: +% to comment something out, scoop up every line in verbatim mode +% as macro argument, then throw it away. +% For inclusions, in LaTeX the block is written out to +% a file \CommentCutFile (default "comment.cut"), which is +% then included. +% In plain TeX (and other formats) both the opening and +% closing comands are defined as noop. +% +% Changes in version 3.1 +% - updated author's address +% - cleaned up some code +% - trailing contents on \begin{env} line is always discarded +% even if you've done \includecomment{env} +% - comments no longer define grouping!! you can even +% \includecomment{env} +% \begin{env} +% \begin{itemize} +% \end{env} +% Isn't that something ... +% - included comments are written to file and input again. +% Changes in 3.2 +% - \specialcomment brought up to date (thanks to Ivo Welch). +% Changes in 3.3 +% - updated author's address again +% - parametrised \CommentCutFile +% Changes in 3.4 +% - added GNU public license +% - added \processcomment, because Ivo's fix (above) brought an +% inconsistency to light. +% Changes in 3.5 +% - corrected typo in header. +% - changed author email +% - corrected \specialcomment yet again. +% - fixed excludecomment of an earlier defined environment. +% +% Known bugs: +% - excludecomment leads to one superfluous space +% - processcomment leads to a superfluous line break +% +\def\makeinnocent#1{\catcode`#1=12 } +\def\csarg#1#2{\expandafter#1\csname#2\endcsname} +\def\latexname{lplain}\def\latexename{LaTeX2e} +\newwrite\CommentStream +\def\CommentCutFile{comment.cut} + +\def\ProcessComment#1% start it all of + {\begingroup + \def\CurrentComment{#1}% + \let\do\makeinnocent \dospecials + \makeinnocent\^^L% and whatever other special cases + \endlinechar`\^^M \catcode`\^^M=12 \xComment} +%\def\ProcessCommentWithArg#1#2% to be used in \leveledcomment +% {\begingroup +% \def\CurrentComment{#1}% +% \let\do\makeinnocent \dospecials +% \makeinnocent\^^L% and whatever other special cases +% \endlinechar`\^^M \catcode`\^^M=12 \xComment} +{\catcode`\^^M=12 \endlinechar=-1 % + \gdef\xComment#1^^M{% + \expandafter\ProcessCommentLine} + \gdef\ProcessCommentLine#1^^M{\def\test{#1} + \csarg\ifx{End\CurrentComment Test}\test + \edef\next{\noexpand\EndOfComment{\CurrentComment}}% + \else \ThisComment{#1}\let\next\ProcessCommentLine + \fi \next} +} + +% 3.1 change: in LaTeX and LaTeX2e prevent grouping +\if 0% +\ifx\fmtname\latexename + 0% +\else \ifx\fmtname\latexname + 0% + \else + 1% +\fi \fi +%%%% +%%%% definitions for LaTeX +%%%% +\def\AfterIncludedComment + {\immediate\closeout\CommentStream + \input{\CommentCutFile}\relax + }% +\def\TossComment{\immediate\closeout\CommentStream} +\def\WriteCommentLine#1{\immediate\write\CommentStream{#1}} +\def\BeforeIncludedComment + {\immediate\openout\CommentStream=\CommentCutFile + \let\ThisComment\WriteCommentLine} +\def\includecomment + #1{\message{Include comment '#1'}% + \csarg\let{After#1Comment}\AfterIncludedComment + \csarg\def{#1}{\BeforeIncludedComment + \ProcessComment{#1}}% + \CommentEndDef{#1}} +\long\def\specialcomment + #1#2#3{\message{Special comment '#1'}% + % note: \AfterIncludedComment does \input, so #2 goes here! + \csarg\def{After#1Comment}{#2\AfterIncludedComment#3}% + \csarg\def{#1}{\BeforeIncludedComment\relax + \ProcessComment{#1}}% + \CommentEndDef{#1}} +\long\def\processcomment + #1#2#3#4{\message{Lines-Processing comment '#1'}% + \csarg\def{After#1Comment}{#3\AfterIncludedComment#4}% + \csarg\def{#1}{\BeforeIncludedComment#2\relax + \ProcessComment{#1}}% + \CommentEndDef{#1}} +\def\leveledcomment + #1#2{\message{Include comment '#1' up to level '#2'}% + %\csarg\newif{if#1IsStreamingComment} + %\csarg\newif{if#1IsLeveledComment} + %\csname #1IsLeveledCommenttrue\endcsname + \csarg\let{After#1Comment}\AfterIncludedComment + \csarg\def{#1}{\BeforeIncludedComment + \ProcessCommentWithArg{#1}}% + \CommentEndDef{#1}} +\else +%%%% +%%%%plain TeX and other formats +%%%% +\def\includecomment + #1{\message{Including comment '#1'}% + \csarg\def{#1}{}% + \csarg\def{end#1}{}} +\long\def\specialcomment + #1#2#3{\message{Special comment '#1'}% + \csarg\newif{if#1IsStreamingComment} + \csarg\def{#1}{\def\ThisComment{}\def\AfterComment{#3}#2% + \ProcessComment{#1}}% + \CommentEndDef{#1}} +\fi + +%%%% +%%%% general definition of skipped comment +%%%% +\def\excludecomment + #1{\message{Excluding comment '#1'}% + \csarg\def{#1}{\let\AfterComment\relax + \def\ThisComment####1{}\ProcessComment{#1}}% + \csarg\let{After#1Comment}\TossComment + \CommentEndDef{#1}} + +\if 0% +\ifx\fmtname\latexename + 0% +\else \ifx\fmtname\latexname + 0% + \else + 1% +\fi \fi +% latex & latex2e: +\def\EndOfComment#1{\endgroup\end{#1}% + \csname After#1Comment\endcsname} +\def\CommentEndDef#1{{\escapechar=-1\relax + \csarg\xdef{End#1Test}{\string\\end\string\{#1\string\}}% + }} +\else +% plain & other +\def\EndOfComment#1{\endgroup\AfterComment} +\def\CommentEndDef#1{{\escapechar=-1\relax + \csarg\xdef{End#1Test}{\string\\end#1}% + }} +\fi + +\excludecomment{comment} + +\endinput diff --git a/Master/texmf-dist/doc/latex/comment/t1test.pdf b/Master/texmf-dist/doc/latex/comment/t1test.pdf Binary files differnew file mode 100644 index 00000000000..ac188a8c110 --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/t1test.pdf diff --git a/Master/texmf-dist/doc/latex/comment/t1test.tex b/Master/texmf-dist/doc/latex/comment/t1test.tex new file mode 100644 index 00000000000..d06cef454ac --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/t1test.tex @@ -0,0 +1,24 @@ +\documentclass{article} + +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} + +\usepackage{comment} +\includecomment{mention} + +%% set-language-environment UTF-8 + +\begin{document} + +Yes: +\begin{mention} +Ð +\end{mention} +. + +No: +\begin{comment} +Ñ +\end{comment} +. +\end{document} diff --git a/Master/texmf-dist/doc/latex/comment/writeup.pdf b/Master/texmf-dist/doc/latex/comment/writeup.pdf Binary files differnew file mode 100644 index 00000000000..17cfd14f759 --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/writeup.pdf diff --git a/Master/texmf-dist/doc/latex/comment/writeup.tex b/Master/texmf-dist/doc/latex/comment/writeup.tex new file mode 100644 index 00000000000..0519d1f439f --- /dev/null +++ b/Master/texmf-dist/doc/latex/comment/writeup.tex @@ -0,0 +1,244 @@ +\documentclass[parskip=false, DIV=8, headings=normal, pagesize=auto]{scrartcl} + +\usepackage{fixltx2e} +\usepackage{etex} +\usepackage{xspace} +\usepackage{lmodern} +\usepackage[T1]{fontenc} +\usepackage{textcomp} +\usepackage{microtype} +\usepackage[unicode=true]{hyperref} + +\newenvironment*{noverb}{% + \flushleft + \vskip\parskip + \parskip=0pt\relax +}{% + \endflushleft +} + +\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} +\newcommand*{\pkg}[1]{\textsf{#1}} +\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} +\makeatletter +\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} +\makeatother +\newcommand*{\env}[1]{\texttt{#1}} +\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} +\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} + +\addtokomafont{title}{\rmfamily} + +\title{The \pkg{comment} package\thanks{This manual corresponds to + \pkg{comment}~v3.8 of July 2016.}} +% +\author{Victor Eijkhout\\\mail{victor@eijkhout.net}} \date{August 2016} + + +\begin{document} + +\maketitle + +\section{Purpose:} + +Selectively in/exclude pieces of text: the user can define new +comment versions, and each is controlled separately. +Special comments can be defined where the user specifies the +action that is to be taken with each comment line. + +Plain \TeX\ support has been phased out. + +As of 3.8 the package will increasingly use e\TeX\ features, for +instance to solve Unicode support issues. + +\section{Usage:} + +All text included between +% +\begin{verbatim} +\begin{comment} + ... +\end{comment} +\end{verbatim} +% +is discarded. + +The opening and closing commands should appear on a line +of their own. No starting spaces, nothing after it. +This environment should work with arbitrary amounts +of comment, and the comment can be arbitrary text. + +Other `\env{comment}' environments are defined by +and are selected/deselected with +% +\begin{verbatim} +\includecomment{versiona} +\excludecoment{versionb} +\end{verbatim} +% +These environments are used as +% +\begin{verbatim} +\versiona ... \endversiona +\end{verbatim} +% +or +% +\begin{verbatim} +\begin{versiona} ... \end{versiona} +\end{verbatim} +% +with the opening and closing commands again on a line of +their own. + +\pagebreak[1] + +\LaTeX\ users note: for an included comment, the +\cmd{\begin} and \cmd{\end} lines act as if they don't exist. +In particular, they don't imply grouping, so assignments +\&c are not local. + +\pagebreak[2] + +Special comments are defined as +% +\begin{noverb} +\cmd{\specialcomment}\marg{name}\marg{before commands}\marg{after commands} +\end{noverb} +% +where the second and third arguments are executed before +and after each comment block. You can use this for global +formatting commands. +To keep definitions \&c local, you can include \cmd{\begingroup} +in the `\meta{before commands}' and \cmd{\endgroup} in the `\meta{after commands}'. +ex: +% +\begin{verbatim} +\specialcomment{smalltt} + {\begingroup\ttfamily\footnotesize}{\endgroup} +\end{verbatim} +% +You do \emph{not} have to do an additional +% +\begin{verbatim} +\includecomment{smalltt} +\end{verbatim} +% +To remove `\env{smalltt}' blocks, give \verb+\excludecomment{smalltt}+ +after the definition. + +Processing comments can apply processing to each line. +% +\begin{noverb} +\cmd{\processcomment}\marg{name}\marg{each-line commands}\marg{before commands}\marg{after commands} +\end{noverb} +% +By defining a control sequence +% +\begin{verbatim} +\def\Thiscomment##1{...} +\end{verbatim} +% +in the before commands the user can +specify what is to be done with each comment line. +BUG this does not work quite yet BUG + +Trick for short in/exclude macros (such as \verb+\maybe{this snippet}+): +% +\begin{verbatim} +\includecomment{cond} +\newcommand{\maybe}[1]{} +\begin{cond} +\renewcommand{\maybe}[1]{#1} +\end{cond} +\end{verbatim} + + +\section{Basic approach of the implementation:} + +to comment something out, scoop up every line in verbatim mode +as macro argument, then throw it away. +For inclusions, in \LaTeX\ the block is written out to +a file \cmd{\CommentCutFile} (default ``\texttt{comment.cut}''), which is +then included. +In plain \TeX\ (and other formats) both the opening and +closing comands are defined as noop. + + +\section{Changes in version 3.1} + +\begin{itemize} +\item updated author's address +\item cleaned up some code +\item trailing contents on \cmd{\begin}\marg{env} line is always discarded + even if you've done \cmd{\includecomment}\marg{env} +\item comments no longer define grouping!! you can even + % +\begin{verbatim} +\includecomment{env} +\begin{env} +\begin{itemize} +\end{env} +\end{verbatim} + % + Isn't that something\ldots +\item included comments are written to file and input again. +\end{itemize} + + +\section{Changes in 3.2} + +\begin{itemize} +\item \cmd{\specialcomment} brought up to date (thanks to Ivo Welch). +\end{itemize} + + +\section{Changes in 3.3} + +\begin{itemize} +\item updated author's address again +\item parametrised \cmd{\CommentCutFile} +\end{itemize} + + +\section{Changes in 3.4} + +\begin{itemize} +\item added GNU public license +\item added \cmd{\processcomment}, because Ivo's fix (above) brought an + inconsistency to light. +\end{itemize} + + +\section{Changes in 3.5} + +\begin{itemize} +\item corrected typo in header. +\item changed author email +\item corrected \cmd{\specialcomment} yet again. +\item fixed excludecomment of an earlier defined environment. +\end{itemize} + + +\section{Changes in 3.6} + +\begin{itemize} +\item The `cut' file is now written more verbatim, using \cmd{\meaning}; + some people reported having trouble with ISO~latin~1, or \texttt{umlaute.sty}. +\item removed some \cmd{\newif} statements. + Has this suddenly become \cmd{\outer} again? +\end{itemize} + + +\section{Changes in 3.8} + +T1 font encoding is now supported. See t1test.tex. + +%% \section{Known bugs:} + +%% \begin{itemize} +%% \item \texttt{excludecomment} leads to one superfluous space +%% \item \texttt{processcomment} leads to a superfluous line break +%% \end{itemize} + +\end{document} |