Omit passages optionally under L A TEX. Uwe Lück 2005/04/28

Similar documents
The svn package. Richard Lewis 25th September 2007

Documentation for xcomment.sty

Version v2.01, 2000/06/29

The pagenote package

The afterpage package

The newunicodechar package

A New Implementation of L A TEX s verbatim and verbatim* Environments.

qstest.sty QuinScape Unit Test Package version

The jvlisting package

Martin Scharrer Version v /09/19

The cybercic package

The showkeys package

The showkeys package

M. R. C. van Dongen. ucc. LaTEX and Friends. Commands and Environments. Marc van Dongen

A Document Class and a Package for handling multi-files projects

A New Implementation of L A TEX s verbatim and verbatim* Environments.

The filecontents package

mylatexformat Use mylatexformat to make a format based on the preamble of any LaTeX file 2011/02/12 version 3.4

Typesetting ancient Greek using Ibycus-encoded fonts with the Babel system

A couple of things involving environments

The keyval package. David Carlisle 2014/10/28

The lstautogobble Package

The mathstyle package. Morten Høgholm 2008/08/13 v0.86

Manuel Pégourié-Gonnard v1.2a 2012/01/23

qstest, a L A TEX package for unit tests

The hanging package. Contents. 1 Introduction

The mcaption package

footnotehyper Abstract footnotehyper footnotehyper footnotehyper 1 License

Designing BIBTEX Styles

Filtering TEX(t) Files by TEX

TUGboat, Volume 0 (2001), No. 0 preliminary draft, 19 Jun :06 1

The lips LaTeX package Chicago Manual text ellipses (Frankenstein s lips)

The verbatimbox Package

The asciilist package

The xargs package. Manuel Pégourié-Gonnard v1.1 (2008/03/22) 1 Introduction 1. 2 Usage 1

The bibunits Package

Introduction to L A TEX for MCS-236

{cprotect.sty} \verbatim in \macro arguments

The svn-prov package

Sending Answers to Exercises (or Proofs of Theorems) to appendices

The alphalph package

The count1to package

The chemcompounds package

The trace package. Frank Mittelbach 2014/10/28

The twoopt package. Definitions with two optional arguments. 1999/04/12, v1.3. Heiko Oberdiek 1

The totpages package

The manyfoot package

volumes.sty: Support for Printing of only parts of a LaTeX document, with complete indices etc.

The EverySel package

Trees in TEX David Eppstein; February 6, 1985

The cjwoutl Package. Contents. Introduction. Colin J. Wynne 1996/04/26. 1 Making an Outline Outline Labels Cross References...

The hypbmsec package

The threadcol package

The gloss Package. Jose Luis Díiaz Javier Bezos. October 10, 1999

1. The Joy of TEX. Check out this example!

The optparams package

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

Manual for uoftexam.sty by Martin J. Osborne Version 1.8, October 2017

The mathstyle package

The xtheorem package

The BeamerSubFrame Package Reordering frames in the PDF file without reordering the source

mfirstuc.sty v2.06: uppercasing first letter

The nbaseprt package

The widetable package

QUIZ Friends class Y;

altfont: Using alternative fonts

beginlatex /12/ : page #199

252 TUGboat, Volume 39 (2018), No. 3

The tabularx package

fnlineno.sty Numbering Footnote Lines

The reflectgraphics package

Word-to-L A TEX specification

The textcase package

The tensor package for L A TEX2e

The showexpl package

Termcal.sty printing a class calendar

The bitset package. Heiko Oberdiek <heiko.oberdiek at googl .com> 2016/05/16 v1.2

S2P. Eetex executable changes

The tabularx package

Fancy paragraph designs with the fancypar package

32 TUGboat, Volume 36 (2015), No. 1

The footbib package. Eric Domenjoud 2007/02/20. 1 General overview 1. 3 Known and potential problems 7

Jonathan Zachhuber Michael Fü erer Version v., / /

Production of solution sheets in L A TEX 2ε

The xparse package Document command parser

FiNK the L A TEX2ε File Name Keeper

The calc package Infix notation arithmetic in L A TEX

L A TEX Class Holiday Inn Fisherman s Wharf San Francisco, CA July Cheryl Ponchin Sue DeMerritt

Creating More Than One Index Using splitidx And SplitIndex

The fltpoint package

The lips LaTeX package Chicago Manual text ellipses (Frankenstein s lips)

HOW TO TYPESET THESES. Using iiscthesis style for LAT E X

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators

The EverySel package

The supertabular environment

1. The Joy of TEX. Check out this example!

CONTEXT. Missing (For Generic Use) group: CONTEXT Support Macros. version: date: 1997 July 25. author: Hans Hagen

MakeIndex: An Index Processor For LaT E X

The graphicx package

Macros. 194 TUGboat, Volume 25 (2004), No. 2

Transcription:

The versions package Omit passages optionally under L A TEX Uwe Lück 2005/04/28 1 Legal matters: Released under the terms of the L A TEX Project Public License (ftp://ctan.tug.org/ tex-archive/macros/latex/base/lppl.txt version 1.3a; essentially: Free to use, copy, distribute [sell] and change, but, if changed, the name must be changed; no warranty). For copyright see above. This file has the LPPL maintenance status author-maintained. The Current Maintainer of this file is Uwe Lück. 2 Short description: Varies Stephen Bellantoni s version.sty in optionally omitting environments, defining (among others) \includeversion and \excludeversion as well as a comment environment. (For comparison to version.sty, see Section Improvements below.) So multiple versions of a document may be printed from one source file. Cf. packages comment (very similar functions and more, see comparison below), verbatim, optional (on CTAN). Needs L A TEX, even should work with L A TEX2.09 (please tell me if not). 3 Usage: 3.1 User commands: In the document part of your source file, put into environments \begin{ version } code \end{ version } passages code (or other code) to be omitted optionally. version may be any string consisting of character tokens (see TEXbook, p. 40: \csname ), and the document may contain environments with several names of this kind (VERSIONa, VERSIONb, etc.). Preceding \excludeversion{ version }, \includeversion{ version }, This manual corresponds to versions.sty v0.55, dated 2005/04/28. http://contact-ednotes.sty.de.vu 1

\markversion{ version } (in the preamble or even later on) control how these environments behave. \excludeversion{ version } version environments just not processed (ignored, i. e.); \includeversion{ version } version environments processed as if \begin{ version } and \end{ version } just were not present, however they form groups like \begin{relax} code \end{relax} or \begingroup code \endgroup. \markversion{ version } version environments processed, resulting text may be marked in printout for comparison of variants of your document, e. g. By default, these three commands send a message to screen, and \markversion{ version } results in printed marks indicating start, \end, and version. Cf. subsection Customize below. A warning is sent to screen if version has been defined earlier (by L A TEX, e. g.). (A version environment must not overlap with other environments, of course, must be balanced with respect to \if...\fi, and must not contain \outer macros. In L A TEX the only \outer macro is ^^L ascii form feed.) TODO: ( comment.sty and comment environment from verbatim.sty are superior concerning \outer macros. On request, I could equip my \processifversion with that \outer feature.) However, \begin{ version }... \end{ version } breaks inside macro arguments, e.g. of \footnote (it is even fragile). So there is \processifversion{ version }{ code } working analogously (grouping as well), depending on \excludeversion etc. (it is even robust). ( optional.sty works similarly.) A pre-installed instance of version is comment, which is ignored by default. So you may put rather long comments as code in \begin{comment} code \end{comment}. (This feature serves compatibility with Stephen Bellantoni s version.sty.) Note that alternative packages comment and verbatim define \comment as well. 3.2 Options: \usepackage[tracing]{versions} causes (i) checking package commands for undefinedness, (ii) messages on screen indicating line numbers of single excluded environments ( Ignore version, lines xx to yy ] ). If final line number and closing bracket don t appear on screen, the environment presumably contains (implicit) \fi or \if... not matching each other within that environment. This package option needs L A TEX 2ε and TEX version greater equal 3.0. (No change of \processifversion.) \usepackage[nogroup]{versions} provides a user command \includeversionnogroup{ version } working like \includeversion{ version }, but included version will form no grouping. 3.3 Customize: To change messages from \excludeversion, \includeversion, \markversion, or to change printed marks resulting from \markversion, take some of the following lines 2

into your file, remove left hand comment marks ( % ), and change the definition. (Must perhaps be enclosed in \makeatletter... \makeatother or \catcode \@=12... \catcode \@=11.) \renewcommand\versionmessage[2]{\typeout{*** #1 #2. ***}} \renewcommand\beginmarkversion{\@vs@sffbox{\@currenvir$>$}} \renewcommand\endmarkversion{\@vs@sffbox{$<$\@currenvir}} (For L A TEX 2ε, replace \renewcommand by \renewcommand*.) (1) \versionmessage is the style of screen reports from \excludeversion etc. Any redefinition must use two arguments. The first is the version name ( version ), the second is one out of excluded, included, included with marks. (2) \beginmarkversion and \endmarkversion is the style of marks surrounding environments version after \markversion{ version }. Any redefinition must use no argument. \@currenvir is version. \@Vs@sffbox{ code } as in package definition typesets argument CODE as \textsf{ code } and puts into an \fbox. 3.4 General warnings: (For legal warnings see top of file, for errors and requirements see Short description, option tracing and user commands above.) This package uses \includeversion and \excludeversion and thus cannot be used at the same time as Stephen Bellantoni s version.sty. Please send bug reports and other comments to above e-mail address! 4 Comparison with Viktor Eijkhout s comment.sty : Comment even works under plain TEX as well as L A TEX, present package under L A TEX only. \specialcomment in comment supports special surroundings this is missing here (but could easily be supplied on request). Included environments never form groups in comment, here user may choose whether they form groups or not, at least for simple including (not with marks). comment includes by writing on and reading from disk, present package needs no writing on disk. Unlike the present package, comment skips even \outer macros, \if... s and \fi s. (So comment is better for real comments. Concerning \outer, this feature is important for plain TEX, while under L A TEX the only \outer macro usually is ^^L.) Comment sometimes produces wrong spaces and discovers \end{comment} only if nothing else is in the input line. 3

5 Improvements vis-a-vis Stephen Bellantoni s version.sty : \processifversion added for excluding text inside arguments of, e. g., \footnote (where excluding environment would break). \processifversion is even robust. \@Esphack instead of \@esphack at \end of excluded environment; needed for properly processing input space symbols there. \begin and \end of included environment may appear in separate lines without doubling spaces (\@bsphack and \@esphack used). Screen messages sent by \includeversion and \excludeversion. Large passages don t fill main memory when excluded. ( s in versions means safe!) Optional tracing of excluded environments added. Option of including without grouping. Original \gdef and \csname #1END@NOTE\endcsname in \excludeversion were superfluous. 6 Version history: v0.1 2003/09/29 Very first; sent to Donald, Victor, Christian, Volker. v0.2 2003/09/30 \@sv@iffalse replacing \csname iffalse\fi; \@sv@ex: \@Esphack in group, extra \ignorespaces. v0.3 2003/10/01 Documentation: added warnings about \if... \fi and \outer thanks to Victor Eijkhout; sent it to him. v0.31 2003/10/03 Documentation: added that comment.sty and verbatim.sty are superior in the respect discussed above; also added comparison with comment.sty. v0.4 2003/10/06 Documentation: Replaced stupid proposal of \aftergroup for including (needs stack!); retreated offer of partially enable skipping \outer/\if.../\fi. (\process... typically comes too late to change category codes.) \xdef \gdef for \@sv@ex. Then changed all @sv into @Vs. Documentation: Referred to TEXbook for character tokens in version names. Removed \@Vs@sphgobble from \@Vs@iprocess (leave spacing to user); now robust without \Declare... Then phgobble phnoop. Added option nogroup. Added \normalfont in \@Vs@sffbox. Sent to Victor E. 2005/10/05; minor changes in documentation afterwards. 4

v0.5 2003/10/10 \@vs@iprocess \@vs@iprocess; \long\def\@vs@iprocess. Sent to CTAN. v0.51 2003/10/15 Documentation: added comment drawback: \end{document} works in own line only. v0.52 2004/05/24 One makro macro. v0.53 2004/08/19 Named LPPL v1.3, added maintenance status. v0.54 2005/01/10 http://www.contact.uwe.lueck.de.vu, LPPL v1.3a. v0.55 2005/04/28 http://contact-ednotes.sty.de.vu; \global\@ignorefalse. 5