From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/carlisle/README.txt | 98 +++++++++++ macros/latex/contrib/carlisle/dotlessj.sty | 106 ++++++++++++ macros/latex/contrib/carlisle/ltxtable.pdf | Bin 0 -> 70947 bytes macros/latex/contrib/carlisle/ltxtable.tex | 230 ++++++++++++++++++++++++++ macros/latex/contrib/carlisle/mylatex.ltx | 211 ++++++++++++++++++++++++ macros/latex/contrib/carlisle/plain.sty | 251 +++++++++++++++++++++++++++++ macros/latex/contrib/carlisle/remreset.sty | 47 ++++++ macros/latex/contrib/carlisle/scalefnt.sty | 44 +++++ macros/latex/contrib/carlisle/slashed.sty | 171 ++++++++++++++++++++ 9 files changed, 1158 insertions(+) create mode 100644 macros/latex/contrib/carlisle/README.txt create mode 100644 macros/latex/contrib/carlisle/dotlessj.sty create mode 100644 macros/latex/contrib/carlisle/ltxtable.pdf create mode 100644 macros/latex/contrib/carlisle/ltxtable.tex create mode 100644 macros/latex/contrib/carlisle/mylatex.ltx create mode 100644 macros/latex/contrib/carlisle/plain.sty create mode 100644 macros/latex/contrib/carlisle/remreset.sty create mode 100644 macros/latex/contrib/carlisle/scalefnt.sty create mode 100644 macros/latex/contrib/carlisle/slashed.sty (limited to 'macros/latex/contrib/carlisle') diff --git a/macros/latex/contrib/carlisle/README.txt b/macros/latex/contrib/carlisle/README.txt new file mode 100644 index 0000000000..7f4822ffb0 --- /dev/null +++ b/macros/latex/contrib/carlisle/README.txt @@ -0,0 +1,98 @@ + +CTAN:macros/latex/contrib/supported/carlisle + +This directory contains various packages that are not related to +each other except by the fact that they have the same author. + + All the files in this directory, and the LaTeX packages + that can be extracted from the source files in ths directory + may be redistributed and/or modified under the terms + of the LaTeX Project Public License Distributed from CTAN + archives in directory macros/latex/base/lppl.txt; either + version 1 of the License, or (at your option) any later version. + +David Carlisle https://github.com/davidcarlisle/dpctex + +2018-04-01 + + +Currently the directory contains the following. + +mylatex.ltx + This file provides a method of making a special format tailored to + one document, with all the class and packages, and other preamble + material pre-loaded. This can save quite a lot of time on some + systems. See the comments in the file. + +dotlessj.sty + If you are using a font set without a dotless j (\j and \jmath) then + this package will fake one. It requires the LaTeX color package. + It does not require any explicit PostScript support. + +plain.sty + Typeset plain TeX markup in LaTeX documents. + Within \begin{plain} ... \end{plain} most plain TeX constructs work + including commands such as \over which might have been disabled by + other LaTeX packages such as amsmath. + +scalefnt.sty + \scalefont{2} selects the current font in twice the current size. + \scalefont{.75} reduces the current font size by three quarters. + +slashed.sty + Commands for the `Feynman slashed character' notation. + +ltxtable.tex +ltxtable.pdf + This generates and documents the package ltxtable.sty. A merger of + longtable and tabularx packages from the Standard LaTeX tools + collection. This produces multipage tables in which the column + widths are automatically calculated to achieve a specified total + table width. + +remreset.sty + \@removefromreset: a companion to the standard \@addtoreset command + allows counters to be removed from the reset list of a controlling + counter. For example, a class file based on book class may say + \@removefromreset{footnote}{chapter} + so that footnotes are no longer reset every chapter (the book class + default). + This file is obsolete with LaTeX releases from 2018 onwards as the + command is defined in the format. + + +Packages that were formally in this collection. + + +nopageno.sty + This file has now moved: see macros/latex/contrib/nopageno + +blkarray.sty + This file has now moved: see macros/latex/contrib/blkarray + +typehtml.dtx +typehtml.ins + These files have moved: see macros/latex/contrib/typehtml + +comma.sty + These files have moved: see macros/latex/contrib/comma + +colortbl.dtx +colortbl.ins + These files have moved: see macros/latex/contrib/colortbl + +textcase.dtx +textcase.ins + These files have moved: see macros/latex/contrib/textcase + +fix2col.dtx +fix2col.ins + These files have moved: see macros/latex/contrib/fix2col + +pspicture.ins +pspicture.dtx + These files have now moved: see macros/latex/contrib/pspicture + +tabulary.dtx +tabulary.ins + These files have now moved: see macros/latex/contrib/tabulary diff --git a/macros/latex/contrib/carlisle/dotlessj.sty b/macros/latex/contrib/carlisle/dotlessj.sty new file mode 100644 index 0000000000..c91512fb55 --- /dev/null +++ b/macros/latex/contrib/carlisle/dotlessj.sty @@ -0,0 +1,106 @@ + +% dotlessj package +%%%%%%%%%%%%%%%%% +% dotless j (\j) for them that wants one. + +% Copyright 1997 1998 David Carlisle +% +% This file may be distributed under the terms of the LPPL. +% See 00readme.txt for details. +% +% David Carlisle david@dcarlisle.demon.co.uk + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{dotlessj}[1998/12/09 v0.03 dotless j package (DPC)] + +% 1997/09/10 v0.01 posted to c.t.t +% 1997/09/11 v0.02 added \jmath support +% 1998/12/09 v0.03 added \v\j for Christoph Eyrich + +\RequirePackage{color} + +% use a coloured rule rather than clipping as it is more portable +% eg the Y&Y dviwindo previewer, and the OzTeX previewer support +% colour package (and dviwindo can print on colour to non PS devices +% such as ink jet printers). +% Disadvantages of using colour are: +% a) it shows up if the background is not white. +% b) You have to arrange that the accent is printed after the colour. +% (Easy to arrange for text accents with LaTeX's +% \DeclareTextCompositeCommand, but a bit more dangerous for math +% accents.) +\def\j@internal{% + \setbox\tw@\hbox{\copy\z@ + \kern-.8\wd\z@ + {\color{white}% + \vrule \@height1.1\ht\z@ \@depth -1.1\ht4 \@width \wd\z@}% + \kern-.2\wd\z@}% + \ht\tw@\ht4 } + +% + +% The \jmath definition, set up to be passed to \mathpalette +\def\jmath@#1#2{% + {\m@th\sbox\z@{$#1j$}\sbox4{$#1\imath$}% + \j@internal + \box\tw@}}% + +% The \jmathaccent definition, set up to be passed to \mathpalette +\def\jmath@x#1#2{% + {\m@th\sbox\z@{$#1j$}\sbox4{$#1\imath$}% + \j@internal + \copy\tw@\kern-\wd\tw@#2{\kern\wd\tw@}}}% + +\DeclareRobustCommand\jmathaccent[1]{{\mathpalette\jmath@x{#1}}} + + +\DeclareRobustCommand\jaccent[1]{% + {\leavevmode\sbox\z@{j}% + \hb@xt@\wd\z@{\hss\clap\j\clap{#1{}}\hss}}}% + +% centered version of \rlap \llap. +\def\clap#1{\hb@xt@\z@{\hss#1\hss}}% + + +% If \jmath is passed to a math accent, need to intercept it and +% instead pass the accent to \jmathaccent. + +\let\j@mathaccent\mathaccent + +\def\mathaccent{\afterassignment\j@mathacc@\count@} + +\def\j@mathacc@#1#2{% + \ifx\jmath#2% + \jmathaccent{\j@mathaccent\count@}% + \else +% #1 should be \relax, but put it back, just in case. + \j@mathaccent\count@#1{#2}% + \fi} + + +% delay everything as \j and friends get defined by encoding files +% read in by, eg fontenc package. + +\AtBeginDocument{% +% +\DeclareRobustCommand\j{% + {\sbox\z@{j}\sbox4{\i}% + \j@internal + \leavevmode\box\tw@}}% +% +\DeclareRobustCommand\jmath{{\mathpalette\jmath@\relax}}% +% +% Could do this for all known encodings, but just do it +% for the default encoding at begin document, to avoid wasting +% too much space. +\DeclareTextCompositeCommand\'{\encodingdefault}{\j}{\jaccent\'}% +\DeclareTextCompositeCommand\`{\encodingdefault}{\j}{\jaccent\`}% +\DeclareTextCompositeCommand\"{\encodingdefault}{\j}{\jaccent\"}% +\DeclareTextCompositeCommand\^{\encodingdefault}{\j}{\jaccent\^}% +\DeclareTextCompositeCommand\~{\encodingdefault}{\j}{\jaccent\~}% +\DeclareTextCompositeCommand\.{\encodingdefault}{\j}{j}% +\DeclareTextCompositeCommand\={\encodingdefault}{\j}{\jaccent\=}% +\DeclareTextCompositeCommand\v{\encodingdefault}{\j}{\jaccent\v}} + + + diff --git a/macros/latex/contrib/carlisle/ltxtable.pdf b/macros/latex/contrib/carlisle/ltxtable.pdf new file mode 100644 index 0000000000..70d868afbb Binary files /dev/null and b/macros/latex/contrib/carlisle/ltxtable.pdf differ diff --git a/macros/latex/contrib/carlisle/ltxtable.tex b/macros/latex/contrib/carlisle/ltxtable.tex new file mode 100644 index 0000000000..ea5ba2f195 --- /dev/null +++ b/macros/latex/contrib/carlisle/ltxtable.tex @@ -0,0 +1,230 @@ +% +%% User documentation and source for ltxtable package +%% (C) 1995 David Carlisle +% +%% This file may be distributed under the terms of the LPPL. +%% See 00readme.txt for details. +% +% Save this file as ltxtable.tex, then +% latex ltxtable +% +% This will write the ltxtable.sty package file on to your system +% and produce some rather terse typeset documentation. +% +\begin{filecontents}{ltx1.tex} +\begin{longtable}{|cXX|} +the & head& line\endhead +the & foot& line\endfoot +a&b&b\\ +\multicolumn{2}{c}{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}&c\\ +a&b&b b b b b b b b b b b b b b b b b b b b b b b b b b \\ +a a& b b& c c\\ +a a& b b& + c c c c c c c c c c c c c c c c c c c c c c c c c c c c c cc cc\\ +a a aaaa& b b& c ccccc\\ +\end{longtable} +\end{filecontents} + +\begin{filecontents}{ltxtable.sty} +% +%% ltxtable package (C) 1995 David Carlisle +%% +%% This file may be distributed under the terms of the LPPL. +%% See 00readme.txt for details. +% +% User documentation is in the file ltxtable.tex +% +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ltxtable} + [1995/12/11 v0.2 longtable/tabularx merge (DPC)] +% \end{macrocode} +% +% May as get these in, going to need them... +% \begin{macrocode} +\RequirePackage{tabularx,longtable} +% \end{macrocode} +% +% \begin{macrocode} +\def\LTXtable#1#2{% +\begingroup +\TX@target#1\relax +\expandafter\TX@newcol\expandafter{\tabularxcolumn{\TX@col@width}}% + \def\@elt##1{\global\value{##1}\the\value{##1}\relax}% + \edef\TX@ckpt{\cl@@ckpt}% + \let\@elt\relax + \TX@old@table=\maxdimen + \TX@col@width=\TX@target + \global\TX@cols=\@ne + \TX@typeout@ + {\@spaces Table Width\@spaces Column Width\@spaces X Columns}% +% \end{macrocode} +% Need to modify |\TX@trial| so that |longtable| functions are +% Subverted to do the measuring that |tabularx| normally does. +% Also during the trial runs each `chunk' is not unboxed so it just +% gets thrown away when the next chunk starts. +% \begin{macrocode} +\def\TX@trial##1{% + \setbox\@tempboxa=\hbox{% +% \end{macrocode} +% |\multicolum| A sad tale, For now just stop |longtable| messing with +% it, so that |tabularx| can mess with it. +% \begin{macrocode} +\let\LTmulticolumn\multicolumn +% \end{macrocode} +% +% \begin{macrocode} +\def\endlongtable{% + \LT@echunk +\global\setbox\@ne\hbox{\unhbox\@ne}% + \kern\wd\@ne + \LT@get@widths% + \endgroup}% +% \end{macrocode} +% +% \begin{macrocode} +\def\LT@ntabularcr{% + \ifnum0=`{}\fi + \LT@echunk + \LT@get@widths + \LT@bchunk}% +% \end{macrocode} +% +% \begin{macrocode} +\def\LT@argtabularcr[####1]{% + \ifnum0=`{}\fi + \ifdim ####1>\z@ + \unskip\@xargarraycr{####1}\else \@yargarraycr{####1}\fi + \LT@echunk + \LT@get@widths + \LT@bchunk}% +% \end{macrocode} +% +% \begin{macrocode} +% Any extra commands. This is used on the first run to count the number +% of {\ttfamily X} columns. +% \begin{macrocode} + ##1\relax +% \end{macrocode} +% Added at v1.05: dissable "\write"s during a trial run. This trick is +% from the \TeX{}Book. +% \begin{macrocode} + \let\immediate=\relax\def\write####1####{{\afterassignment}\toks@=}% +% \end{macrocode} +% Turn off warnings (see appendix D). Also prevent them being turned +% back on by setting the parameter names to be registers. +% \begin{macrocode} + \hbadness=\@M\hfuzz=\maxdimen + \let\hbadness=\@tempcnta\let\hfuzz=\@tempdima +% \end{macrocode} +% Make the table, and finish the hbox. +% Since v1.06, "\toks@" contains the preamble specification, +% and possible optional argument, as well as the table body. +% Well it does in |tabularx|, here the body is in an external file so +% just input it. +% \begin{macrocode} + \input{#2}\unskip}% +% \end{macrocode} +% Since v1.05 reset all \LaTeX\ counters, by executing "\TX@ckpt". +% \begin{macrocode} +\TX@ckpt +% \end{macrocode} +% Print some statistics. +% Added "\TX@align" in v1.05, to line up the columns. +% \begin{macrocode} + \TX@typeout@{\@spaces + \expandafter\TX@align + \the\wd\@tempboxa\space\space\space\space\space\@@ + \expandafter\TX@align + \the\TX@col@width\space\space\space\space\space\@@ + \@spaces\the\TX@cols}}% +% \end{macrocode} +% \end{macro} + \TX@trial{\def\NC@rewrite@X{% + \global\advance\TX@cols\@ne\NC@find p{\TX@col@width}}}% +\let\LT@make@row\LT@blank@row + \loop + \TX@arith + \ifTX@ + \TX@trial{}% + \repeat +% \end{macrocode} +% On the last run, may as well run with |\setlongtables|. +% \begin{macrocode} +\let\LT@make@row\relax +\input{#2}% +\endgroup} +% \end{macrocode} + + +\end{filecontents} + +\documentclass{article} +\setlength{\textheight}{5in} +\usepackage{ltxtable} + +\tracingtabularx +\begin{document} + +\title{ltxtable: longtable meets tabularx} +\author{David Carlisle} +\date{1995/12/11} +\maketitle + +Since \texttt{tabularx} was put on the archives in 1992 or so I have +had a constant stream of email messages asking for a merged +\texttt{tabularx}/\texttt{longtable} package. + +Well here it is! (First draft, anyway.) + +Rules of the game: + +\begin{itemize} +\item Put the \texttt{longtable} environment using \texttt{tabularx} + style \texttt{X} column specifiers in a file \emph{file} on its + own. (You can use the \texttt{filecontents} environment to include + it back into the main document file, if you wish.) +\item If you want to input the file at some point, using the + \texttt{X} columns to force the table width to be \emph{width} wide, + go \verb|\LTXtable{|\emph{width}\verb|}{|\emph{file}\verb|}|. +\item \verb|\multicolumn|: If you read the \texttt{tabularx} and + \texttt{longtable} docs you will find that both packages have a lot + of fun with this command. In order to keep my sanity, for this + merger I disable \texttt{longtable}'s version of \verb|\multicolumn|. + This means that the column widths calculated are not always the same + (not as good as) the widths that would be calculated by an + equivalent \texttt{tabularx} environment. Perhaps one day I will do + something about this. Perhaps. +\end{itemize} + +\clearpage + +\centering + + +A 300pt rule, just so can see the required width. + +\mbox{\vrule width 300pt height 1pt} + +First a tabularx + + +\begingroup +\renewenvironment{longtable}{\noindent\tabularx{300pt}}{\endtabularx} +\def\endhead{\\}\def\endfoot{\rlap{ !!!}\\} +\input{ltx1} +\endgroup + + +Then a longtable + + + +\LTXtable{300pt}{ltx1} + +\end{document} + +1995/11/07 v0.1 first release +1995/12/11 v0.2 (Petr Sojka) Typos fixed so the package works! + (Initial release *always* read the same table file, + ignoring the argument...) diff --git a/macros/latex/contrib/carlisle/mylatex.ltx b/macros/latex/contrib/carlisle/mylatex.ltx new file mode 100644 index 0000000000..d1ea1ea233 --- /dev/null +++ b/macros/latex/contrib/carlisle/mylatex.ltx @@ -0,0 +1,211 @@ +%%% +%%% mylatex.ltx +%%%%%%%%%%%%%%% +%%% +%%% Use this file to make a format based on the preamble of any LaTeX +%%% file +%%% +%%% There are no restrictions on the distribution or modification of +%%% this file, except that other people should not attempt to alter +%%% the master copy on the ctan archives. +%%% +%%% Making the format +%%%%%%%%%%%%%%%%%%%%% +%%% +%%% Given a LaTeX file `abc.tex', use initex as follows: +%%% +%%% initex &latex mylatex.ltx abc (Generic TeX) +%%% initex \&latex mylatex.ltx abc (unix and other TeX's) +%%% tex /i &latex mylatex.ltx abc (emtex) +%%% +%%% If you are on a Mac or using some shell that makes it inconvenient +%%% to use a command line such as the above examples then you may +%%% make a file `mylatex.tex' with the single line +%%% \input mylatex.ltx abc +%%% and then pass the file mylatex.tex to your (ini)tex shell to produce +%%% the format, ie something equivalent to initex &latex mylatex.tex. +%%% +%%% If you are using OzTeX, see the separate instructions below. +%%% +%%% This should make a format file mylatex.fmt which you can then use +%%% as follows +%%% +%%% Using the new format +%%%%%%%%%%%%%%%%%%%%%%%% +%%% +%%% tex &mylatex abc (generic TeX) +%%% virtex \&mylatex abc (Unix TeX) +%%% +%%% This will process your document, abc.tex, just as LaTeX does, but +%%% quicker as the contents of the preamble will be stored in the +%%% format file and will not need to be run each time. +%%% +%%% If (vir)tex fails to find your mylatex.fmt then it is not searching +%%% in the current directory, either modify your TEXFORMATS path (or +%%% equivalent) to search `.' or (on unix/dos) use ./ as in: +%%% virtex \&./mylatex abc +%%% +%%% Making and using the format with OzTeX +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% +%%% Given a LaTeX file `abc.tex', do this: select `TeX...' from OzTeX's +%%% TeX menu, and go to the folder containing the file `abc.tex' as if you +%%% were selecting the file `abc.tex'. Then hit the Cancel button - this +%%% procedure sets OzTeX's working folder to the one containing abc.tex. +%%% Next, select iniTeX from the TeX menu, and type: +%%% +%%% &latex mylatex.ltx abc +%%% +%%% This should make a format file mylatex.fmt which you can save in the +%%% same folder as the file you're working on. +%%% +%%% To use the new format, put this at the very start of the very first +%%% line of your document: +%%% +%%% %&mylatex +%%% +%%% Further Notes +%%%%%%%%%%%%%%%%% +%%% +%%% The file abc.tex must contain a line *just* with +%%% \begin{document} +%%% Everything up to (but not including) the \begin{document} will +%%% be saved in the format and not executed in subsequent runs. +%%% +%%% If you are modifying the document (or working on a similar document) +%%% you may wish to add new commands to your document preamble. +%%% The `mylatex' format normally skips the whole preamble (believing +%%% it to be pre-loaded) and so such new commands do not take effect. +%%% You could re-make the format, preloading the new preamble, but that +%%% might be inconvenient to do every time, and so an alternative scheme +%%% has been introduced. +%%% If the preamble contains a comment mylatex (ie a line just +%%% containing a % white space and the word mylatex) then the mylatex +%%% format will start reading the preable at that point so any new +%%% commands can be placed after such a comment and they will be +%%% executed. +%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% David Carlisle +%%% 1994/09/27 +%%% +%%% Modified 1994/10/21 after comments by +%%% Volker Kunert +%%% Modified 1996/01/26 To fix printout of preloaded files (which +%%% hasnt worked since December 94 release, and to fix +%%% incompatibility with \makeindex command. +%%% Modified 1997/10/04 To generalise the \makeindex support to work +%%% with any (well most:-) \openout uses in the preamble. +%%% Modified 1997/10/09 Most? Ross Moore pointed out I just broke +%%% changebar, so further tinkering. Also useful discussions +%%% with Ross lead to the following changes. +%%% Added `mylatex' comment feature. +%%% Added some font preloading. +%%% Modified 1998/01/21 Jean-Francois Mertens pointed out that comments +%%% before the first TeX command were broken by the previous +%%% version. In particular %&mylatex special comments which +%%% would be picked up by some TeX versions to automatically +%%% select the format. +%%% Modified 1998/10/14 Rowland McDonnell added notes on how to use +%%% mylatex.ltx with OzTeX +%%% Modified 1999/01/04 Rowland McDonnell corrected notes on how to +%%% use mylatex.ltx with OzTeX. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\makeatletter + +% Save the original definitions. +\let\MYLATEXdocument\document +\let\MYLATEXopenout\openout + +% The version of \document to use on the initex run. +% Just preloads some fonts, puts back \document and \openout, +% sets up the banner to display the file list of files preloaded, +% then sets up some special catcodes so the preamble will be +% skipped on normal runs with the new format. +\def\document{\endgroup +% Force some font preloading. + {\setbox\z@\hbox{% + $$% math (not bold, some setups don't have \boldmath) + \normalfont% normal + {\ifx\large\@undefined\else\large\fi % large and footnote + \ifx\footnotesize\@undefined\else\footnotesize\fi}% + {\bfseries\itshape}% bold and bold italic + {\itshape}% italic + \ttfamily% monospace + \sffamily% sans serif + }}% + \let\document\MYLATEXdocument + \let\openout\MYLATEXopenout + \makeatother + \everyjob\expandafter{\the\everyjob + \begingroup + \listfiles + \expandafter\MYLATEXcustomised\@dofilelist + \endgroup}% + \@addtofilelist{.}% + \catcode`\\=13\relax% + \catcode`\#=12\relax% + \catcode`\ =9\relax% + \dump} + + +% In principle \openout stream= filename need not be space terminated, +% and need not be immediate, but this covers \makeindex \makeglossary +% and index package's \newindex which are all the cases of \openout +% that occur before \begin{document} that I could see. +% Thanks to Ross Moore for pointing out \AtBeginDocument is too late +% eg changebar package *closes* the stream in \AtBeginDocument, so need +% to make sure it is opened before that. Make a special purpose hook. +% +\def\openout#1 {% + \g@addto@macro\MYLATEXopens{\immediate\openout#1 }} +\let\MYLATEXopens\@empty + +% Templates for ending the `preamble skipping process'. +\def\MYLATEXbegin{\begin{document}} +\def\MYLATEXcomment{mylatex} + +% Banner for \everyjob. +\def\MYLATEXcustomised#1#2#3\typeout#4{% + \typeout{CUSTOMISED FORMAT. Preloaded files:^^J% + \@spaces\@spaces.}#3} + +% While the preamble is being skipped, the EOL is active +% and defined to grab each line and inspect it looking +% for \begin{document} or mylatex lines. +% The special catcodes required are not enabled until after the +% first TeX command in the file, so as to avoid problems with +% the special processing that TeX does on the first line, choosing +% the format, or the file name etc. +{\catcode`\^^M=\active% + \catcode`\/=0 % + /catcode`\\=13 % + /gdef\{/catcode`/\=0 /catcode`/^^M=13 /catcode`/%=9 ^^M}% + /long/gdef^^M#1^^M{% + /def/MYLATEXline{#1}% +% If hit a comment `mylatex' then do as if you'd hit \begin{document} +% except don't run the real \document as a \begin{document} will be +% coming up later in the file at the end of the preamble. + /ifx/MYLATEXline/MYLATEXcomment% + /let/MYLATEXbegin/relax% + /let/MYLATEXline/relax% + /fi% +% If hit \begin{document} put things back as they should be, run the +% hook with any save \openouts then do the original \document code. + /ifx/MYLATEXline/MYLATEXbegin% + /catcode`/^^M=5/relax% + /let^^M/par% + /catcode`/#=6/relax% + /catcode`/%=14/relax% + /catcode`/ =10/relax% + /expandafter/MYLATEXopens/expandafter/MYLATEXbegin% + /else% +% Otherwise grab the next line to look at. + /expandafter^^M% + /fi}}% + +% Trick lookahead to allow mylatex.ltx and the document filename to be +% given on the same command line. (initex &latex mylatex.ltx abc.tex) +\expandafter\input\endinput% + diff --git a/macros/latex/contrib/carlisle/plain.sty b/macros/latex/contrib/carlisle/plain.sty new file mode 100644 index 0000000000..aa12bffaa2 --- /dev/null +++ b/macros/latex/contrib/carlisle/plain.sty @@ -0,0 +1,251 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% plain.sty +% %%%%%%%%% +% +% Copyright 1990 David Carlisle +% +% This file may be distributed under the terms of the LPPL. +% See 00readme.txt for details. + +% Defines a new environment plain, in which plain TeX files should be +% LaTeX'able. +% Defines \magnification and \bye to be no-op. +% Re-enables some plain commands (\line, \eqalign ...) +% Fakes some other plain commands (\footnote, \topinsert, ... ) +% Keeps LaTeX's font definitions, and output routine. +% +% Example use: +% \begin{plain} +% \input{Somebodys_nasty_plain_file.tex} +% \end{plain} +% +% You do not have to \input the plain commands, they can be entered +% directly inside the plain environment. +% +% \begin{plain} +% $$ \eqalign{1+2&=2+1\cr&=3}$$ +% \end{plain} + +% Note that this style file is designed to make plain TeX files do +% something sensible inside LaTeX. The page breaks, widths of lines, +% fonts used etc may not be the same as obtained from plain TeX. + +% If you want exactly the same result from LaTeX as plain TeX use: (!!) +% latex \&plain Somebodys_nasty_plain_file.tex + +% David Carlisle +% carlisle@cs.man.ac.uk +% 1990/11/14 + +% All of the code is from (l)plain.tex except a few definitions +% which are marked with the comment: +%DPC +% and one set of three commands marked with the comment +%RF (at DPC's request) +% +% one place where extraneous \par token, and two places where +% extraneous spaces appeared corrected RF 2001/09/14 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 1990/11/14 initial version +% 1994-5 Robin Fairbairns kindly fixed up a few things +% 1996/04/22 Add support for plain TeX commands and primitives hit +% by AMS packages. + +%DPC +% Just to get started... +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{plain}[1996/04/22 Plain TeX emulation (DPC)] + +%DPC +\let\latex@end=\end + +%DPC +% First a few \new's +\newif\ifus@@latex +\newif\if@cr@latex +\newbox\tabs@latex +\newbox\tabsyet@latex +\newbox\tabsdone@latex + +%DPC +% AMS packages might squash these, so ... +\ifx\@@over\@undefined + \let\@@over\over +\fi +\ifx\@@atop\@undefined + \let\@@atop\atop +\fi +\ifx\@@above\@undefined + \let\@@above\above +\fi +\ifx\@@overwithdelims\@undefined + \let\@@overwithdelims\overwithdelims +\fi +\ifx\@@atopwithdelims\@undefined + \let\@@atopwithdelims\atopwithdelims +\fi +\ifx\@@abovewithdelims\@undefined + \let\@@abovewithdelims\abovewithdelims +\fi + +%DPC +% The plain environment: +\def\plain{% +% +%DPC +% put the \ifs and registers back +\let\ifus@\ifus@@latex +\let\if@cr\if@cr@latex +\let\tabs\tabs@latex +\let\tabsyet\tabsyet@latex +\let\tabsdone\tabsdone@latex +% +\let\centering=\@centering +% +% \line changed to \@@line because LaTeX redefines \line +\let\line\@@line +% <-- this comment marker inserted by RF 2001-09-14 +% LaTeX has its own tabbing environment, so PLAIN's is disabled. +\def\cleartabs{\global\setbox\tabsyet\null \setbox\tabs\null}% +\def\settabs{\setbox\tabs\null \futurelet\next\sett@b}% +\let\+=\relax % in case this file is being read in twice +\def\sett@b{\ifx\next\+\let\next\relax + \def\next{\afterassignment\s@tt@b\let\next}% + \else\let\next\s@tcols\fi\next}% +\def\s@tt@b{\let\next\relax\us@false\m@ketabbox}% +\def\tabalign{\us@true\m@ketabbox}% non-\outer version of \+ +\outer\def\+{\tabalign}% +\def\s@tcols##1\columns{\count@##1 \dimen@\hsize + \loop\ifnum\count@>\z@ \@nother \repeat}% +\def\@nother{\dimen@ii\dimen@ \divide\dimen@ii\count@ + \setbox\tabs\hbox{\hbox to\dimen@ii{}\unhbox\tabs}% + \advance\dimen@-\dimen@ii \advance\count@\m@ne}% +% +\def\m@ketabbox{\begingroup + \global\setbox\tabsyet\copy\tabs + \global\setbox\tabsdone\null + \def\cr{\@crtrue\crcr\egroup\egroup + \ifus@\unvbox\z@\lastbox\fi\endgroup + \setbox\tabs\hbox{\unhbox\tabsyet\unhbox\tabsdone}}% + \setbox\z@\vbox\bgroup\@crfalse + \ialign\bgroup&\t@bbox####\t@bb@x\crcr}% +% +\def\t@bbox{\setbox\z@\hbox\bgroup}% +\def\t@bb@x{\if@cr\egroup % now \box\z@ holds the column + \else\hss\egroup \global\setbox\tabsyet\hbox{\unhbox\tabsyet + \global\setbox\@ne\lastbox}% now \box\@ne holds its size + \ifvoid\@ne\global\setbox\@ne\hbox to\wd\z@{}% + \else\setbox\z@\hbox to\wd\@ne{\unhbox\z@}\fi + \global\setbox\tabsdone\hbox{\box\@ne\unhbox\tabsdone}\fi + \box\z@}% +% +% LaTeX has its own sectioning macros +\outer\def\beginsection##1\par{\filbreak\bigskip + \message{##1}\leftline{\bf##1}\nobreak\smallskip\vskip-\parskip + \noindent}% +% +% LaTeX change: \bye is eliminated. +%DPC +% \bye made a no-op +\let\bye\relax +% +%DPC +% fake \supereject +\let\supereject\clearpage +% +%DPC +% \end made no-op unless it is followed by { +\def\end{\@ifnextchar \bgroup\latex@end\relax}% +% +% LaTeX change: \eqalign eliminated, since it is replaced by the +% eqnarray environment. +\def\eqalign##1{\null\,\vcenter{\openup\jot\m@th + \ialign{\strut\hfil$\displaystyle{####}$&$\displaystyle{{}####}$\hfil + \crcr##1\crcr}}\,}% +% +% LaTeX: The following \eqalign type macros are eliminated, since +% they are replaced by the eqnarray environment. +\def\eqalignno##1{\displ@y \tabskip\centering + \halign to\displaywidth{% + \hfil$\@lign\displaystyle{####}$\tabskip\z@skip + &$\@lign\displaystyle{{}####}$\hfil\tabskip\centering + &\llap{$\@lign####$}\tabskip\z@skip\crcr + ##1\crcr}}% +\def\leqalignno##1{\displ@y \tabskip\centering + \halign to\displaywidth{% + \hfil$\@lign\displaystyle{####}$\tabskip\z@skip + &$\@lign\displaystyle{{}####}$\hfil\tabskip\centering + &\kern-\displaywidth\rlap{$\@lign####$}\tabskip\displaywidth\crcr + ##1\crcr}}% +% +%DPC +% Fake plain's \nopagenumers +\def\nopagenumbers{\pagestyle{empty}}% +% +\def\advancepageno{\ifnum\pageno<\z@ \global\advance\pageno\m@ne + \else\global\advance\pageno\@ne \fi}% increase |pageno| +% +\countdef\pageno\z@ +% +%DPC +% Fake plain's \footnote with internal LaTeX commands +\def\footnote##1{\def\@thefnmark{##1}\@footnotemark\@footnotetext}% +% +%DPC +% Re-instate the primitive \underline +%(LaTeX's version generates errors in some valid (plain) contexts) +\let\underline\@@underline +% +%DPC +% Re-instate plain's \item +\def\item{\par\hang\textindent}% +\def\itemitem{\par\indent \hangindent2\parindent \textindent}% +% +%DPC +% Fake plain's \[top|mid|page]insert with LaTeX's figure environment. +\def\topinsert{\begin{figure}[!tp]}% +\def\midinsert{\begin{figure}[!htp]}% +\def\pageinsert{\begin{figure}[p]}% +\def\endinsert{\end{figure}}% +% +% \magnification doesn't work in LaTeX +% +%DPC +% Make \magnification just gobble the next +\def\magnification{\count@}% +% +%RF (at DPC's request) +% \proclaim \hang and \textindent from plain.tex (since they're now no +% longer part of 2e kernel, but only compatibility) +\def\proclaim ##1. ##2\par{\medbreak + \noindent{\bf##1.\enspace}{\sl##2\par}% + \ifdim\lastskip<\medskipamount \removelastskip\penalty55\medskip\fi}% +% +\def\hang{\hangindent\parindent}% +% +\def\textindent##1{\indent\llap{##1\enspace}\ignorespaces}% +% +% +%DPC +% Repair AMS `damage' +\let\over\@@over +\let\atop\@@atop +\let\above\@@above +\let\overwithdelims\@@overwithdelims +\let\atopwithdelims\@@atopwithdelims +\let\abovewithdelims\@@abovewithdelims +% +\def\cases##1{\left\{\,\vcenter{\normalbaselines\m@th + \ialign{$####\hfil$&\quad####\hfil\crcr##1\crcr}}\right.}% +\def\matrix##1{\null\,\vcenter{\normalbaselines\m@th + \ialign{\hfil$####$\hfil&&\quad\hfil$####$\hfil\crcr + \mathstrut\crcr\noalign{\kern-\baselineskip}% + ##1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}% +\def\pmatrix##1{\left(\matrix{##1}\right)}% +% +%DPC +%end of \def\plain +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/macros/latex/contrib/carlisle/remreset.sty b/macros/latex/contrib/carlisle/remreset.sty new file mode 100644 index 0000000000..0d987ec185 --- /dev/null +++ b/macros/latex/contrib/carlisle/remreset.sty @@ -0,0 +1,47 @@ + +% remreset package +%%%%%%%%%%%%%%%%%% + +% Copyright 1997, 2018 David carlisle +% This file may be distributed under the terms of the LPPL. +% See README.txt for details. + +% 2018/04/01 David Carlisle +% 1997/09/28 David Carlisle + +% LaTeX includes a command \@addtoreset that is used to declare that +% a counter should be reset every time a second counter is incremented. + +% For example the book class has a line +% \@addtoreset{footnote}{chapter} +% So that the footnote counter is reset each chapter. + +% If you wish to base a new class on book, but without this counter +% being reset, then standard LaTeX gives no simple mechanism to do +% this. + +% This package defines |\@removefromreset| which just undoes the effect +% of \@addtoreset. So for example a class file may be defined by + +% \LoadClass{book} +% \@removefromreset{footnote}{chapter} + +% 2018: package obsoleted as the command is defined in the LaTeX format. + +\@ifundefined{@removefromreset}{% +\def\@removefromreset#1#2{{% + \expandafter\let\csname c@#1\endcsname\@removefromreset + \def\@elt##1{% + \expandafter\ifx\csname c@##1\endcsname\@removefromreset + \else + \noexpand\@elt{##1}% + \fi}% + \expandafter\xdef\csname cl@#2\endcsname{% + \csname cl@#2\endcsname}}}% +}{% +\PackageWarningNoLine{remreset} + {The remreset package is obsolete:\MessageBreak + \noexpand\@removefomresset is defined}% +} + + diff --git a/macros/latex/contrib/carlisle/scalefnt.sty b/macros/latex/contrib/carlisle/scalefnt.sty new file mode 100644 index 0000000000..4ab5d3e5a5 --- /dev/null +++ b/macros/latex/contrib/carlisle/scalefnt.sty @@ -0,0 +1,44 @@ + +% scalefnt package +%%%%%%%%%%%%%%%%%% + +% Copyright 1997 David carlisle +% This file may be distributed under the terms of the LPPL. +% See 00readme.txt for details. + +% 1997/09/28 David Carlisle + +% This package defines a command \scalefont. After \scalefont{.75} then +% the current font and baselineskip will be scaled to 75% of their +% original size. Any scale factor may be specified. + +% If you are using traditional fd files based on bitmap font sizes, +% LaTeX's font system will round the requested font size to the nearest +% available size. If you are using scalable fonts, such as the psnfss +% or type1cm packages, then the requested font size will be used exactly. + +% Almost all of the code here is in fact dealing with scaling the stretch +% components of \baselineskip. This is a bit odd as 99% of documents +% have a rigid \baselineskip, however the technique may be useful in +% some contexts, and is left here as an example. + +\DeclareRobustCommand\scalefont[1]{% + \dimen@\z@ + \dimen@ii\z@ + \afterassignment\@scalefont + \@tempdima\the\baselineskip\relax\relax\relax\relax\relax + \skip@#1\@tempdima\@plus#1\dimen@\@minus#1\dimen@ii + \dimen@\f@size\p@ + \dimen@#1\dimen@ + \fontsize\dimen@\skip@\selectfont} + +\def\@scalefont#1#2#3#4#5{% + \if#1p% + \afterassignment\@scalefont\dimen@#5% + \else + \if#1m% + \dimen@ii + \fi + \fi} + + diff --git a/macros/latex/contrib/carlisle/slashed.sty b/macros/latex/contrib/carlisle/slashed.sty new file mode 100644 index 0000000000..9c39b591bb --- /dev/null +++ b/macros/latex/contrib/carlisle/slashed.sty @@ -0,0 +1,171 @@ +%% slashed.sty: Produce the `Feynman slashed character' notation +%% beloved of High Energy Physicists. +%% +%% This is a standard LaTeX package, but as many physicists perversely +%% use use a plain TeX rather than a format designed for document +%% production, it runs under plain as well. +%% (Just say \input slashed.sty in that case +%% rather than \usepackage{slashed}). + +%% This began life as me commenting in comp.text.tex +%% on some code posted by Ben Bullock, which was originally written by +%% Mike Wade. +%% In the ensuing newsgroup thread, P? Parker, Axel Thimm +%% and Maurizio Loreti and others made helpful comments +%% +%% David Carlisle +%% +%% Copyright 1997 David carlisle +%% This file may be distributed under the terms of the LPPL. +%% See 00readme.txt for details. + +\ifx\ProvidesPackage\undefined + \catcode`\@=11 +\else +\ProvidesPackage{slashed} + [1997/01/16 v0.01 Feynman Slashed Character Notation (DPC)] +\fi + + +%% Usage \slashed{p} \slashed{D} etc. + +%% As \slashed may not put the / quite where you want, you can +%% customise it for certain arguments. After +%% +%% \declareslashed{}{/}{.1}{0}{D} +%% +%% Then any later use of \slashed{D} will have the / moved +%% to the right of centre by 0.1 of the width of `D'. +%% +%% The arguments to \declareslashed are: +%% +%% #1 A command to apply to the constructed character (for instance +%% \mathbin to re-make it into a binary relation). (It seems that +%% For the intended use as the Feynman notation it will only +%% ever be applied to `ordinary' symbols, and so #1 will be empty +%% but someone might find use for it. +%% +%% #2 The symbol to overprint. Normally / but you can try \not or | +%% (or \big/ or whatever) to get different effects. +%% +%% #3 The overprinted symbol is moved to the right by this fraction +%% of the width of the symbol #5. +%% +%% #4 The overprinted symbol is moved up by this fraction +%% of the width of the symbol #5. +%% (Note width not height, so #3 and #4 use the same units) +%% +%% #5 The symbol to which these customisations applies. + + +%% The basic guts of the macro just measures the specified character +%% and a / and arranges to put the centre of the / over the centre +%% of the character. (This, barring some TeX quibbles, was what the +%% orignally posted macro did.) + +%% The first refinement is to call the macro via \mathpalette so +%% that it works correctly in subscripts, fractions etc. + +%% Remaining problems. + +%% The macro puts the middle of the slash through the +%% middle of the symbol, where `middle' is defined as the centre of the +%% bounding rectangles. However the eye doesn't necessarily work that +%% way, for instance $\sla D$ looks to have the slash too far to the +%% left to me. It is virtually impossible to do such micro positioning +%% automatically as it depends on the shape of the letters and the +%% personal judgement of the viewer, and \TeX\ does not have either of +%% these pieces of information. However one could do something like +%% the following which allows you to predefine offsets for certain +%% letters. The offsets are done relative to the size of the symbol +%% so they work OK in superscrips (or within the scope of a La\TeX\ +%% size change). + +%% Some characters just don't work with /. The computer modern math +%% italic f and / have about the same slope and whatever you do it +%% just looks horrible. So allow the use of an alternative character +%% (eg \not, which has a slightly different slope). + +% #1 normally / +% #2 right shift +% #3 up shift +% #4 \displaystyle etc (added by \mathpalette) +% #5 symbol. +\def\sla@#1#2#3#4#5{{% + \setbox\z@\hbox{$\m@th#4#5$}% + \setbox\tw@\hbox{$\m@th#4#1$}% + \dimen4\wd\ifdim\wd\z@<\wd\tw@\tw@\else\z@\fi + \dimen@\ht\tw@ + \advance\dimen@-\dp\tw@ + \advance\dimen@-\ht\z@ + \advance\dimen@\dp\z@ + \divide\dimen@\tw@ + \advance\dimen@-#3\ht\tw@ + \advance\dimen@-#3\dp\tw@ + \dimen@ii#2\wd\z@ + \raise-\dimen@\hbox to\dimen4{% + \hss\kern\dimen@ii\box\tw@\kern-\dimen@ii\hss}% + \llap{\hbox to\dimen4{\hss\box\z@\hss}}}} + +% Use offsets of 0 unless a command has been pre-defined +% with different offsets for this symbol. +\def\slashed#1{% + \expandafter\ifx\csname sla@\string#1\endcsname\relax + {\mathpalette{\sla@/00}{#1}}% + \else + \csname sla@\string#1\endcsname + \fi} + +% #1 normally empty, can be \mathop etc +% #2 normally / +% #3 right shift +% #4 up shift +% #5 symbol +\def\declareslashed#1#2#3#4#5{% + \expandafter\def\csname sla@\string#5\endcsname{% + #1{\mathpalette{\sla@{#2}{#3}{#4}}{#5}}}} + +\catcode`\@=12 + +%% Now some fine tuning, if you are not using Computer Modern +%% This is almost certainly wrong. You may think some of these are +%% wrong anyway. + + +\declareslashed{}{/}{.08}{0}{D} +\declareslashed{}{/}{.1}{0}{A} +\declareslashed{}{/}{0}{-.05}{k} +\declareslashed{}{/}{.1}{0}{\partial} +\declareslashed{}{\not}{-.6}{0}{f} + +\endinput + +================================================================ +% test file (plain TeX) +\input slashed.sty + + +$ +\slashed{D} \slashed{p} \slashed{k} \slashed{r} \slashed{A} + \slashed{f} +\slashed{U} \slashed{\partial} +$ + +\bye + +================================================================ +% and same again as LaTeX + +\documentclass{article} +\usepackage{slashed} + +\begin{document} + +$ +\slashed{D} \slashed{p} \slashed{k} \slashed{r} \slashed{A} + \slashed{f} +\slashed{U} \slashed{\partial} +$ +\end{document} + + -- cgit v1.2.3