From 8587c5fd37c754373f57eb096dbef9e21e9264ca Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 15 Nov 2010 00:35:10 +0000 Subject: varwidth doc (14nov10) git-svn-id: svn://tug.org/texlive/trunk@20442 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/varwidth/miscdoc.sty | 115 +++++++++++++++++++++ .../texmf-dist/doc/latex/varwidth/varwidth-doc.pdf | Bin 0 -> 191378 bytes .../texmf-dist/doc/latex/varwidth/varwidth-doc.tex | 55 ++++++++++ Master/tlpkg/libexec/ctan2tds | 1 + 4 files changed, 171 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/varwidth/miscdoc.sty create mode 100644 Master/texmf-dist/doc/latex/varwidth/varwidth-doc.pdf create mode 100644 Master/texmf-dist/doc/latex/varwidth/varwidth-doc.tex diff --git a/Master/texmf-dist/doc/latex/varwidth/miscdoc.sty b/Master/texmf-dist/doc/latex/varwidth/miscdoc.sty new file mode 100644 index 00000000000..da1f2a5fdba --- /dev/null +++ b/Master/texmf-dist/doc/latex/varwidth/miscdoc.sty @@ -0,0 +1,115 @@ +\ProvidesPackage{miscdoc}[2010/01/20 v1.2 documentation macros misc latex pkgs] + +% miscdoc.sty +% Copyright 2010 Robin Fairbairns +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Robin Fairbairns. +% +% This work consists of the file miscdoc.sty (only) + +\setcounter{errorcontextlines}{1274} + +% The package arose from a small exercise to document packages whose +% previous documentation consisted solely of comments in the package files. +% The macros here defined are lifted from the author's faq.sty +% (written for the UK TeX FAQ, CTAN:help/uk-tex-faq) or are inspired +% by others' work (credited where the author is known) ... except +% where they came as a flash of inspiration while actually writing the +% documentation. + +% this option suggested by Heiko Oberdiek, 2010-01-29 +\DeclareOption{hyper}{% + \AtEndOfPackage{% + \RequirePackage[pdfusetitle]{hyperref} + \RequirePackage{bookmark} + \bookmarksetup{numbered,open,openlevel=1} + } +} +\ProcessOptions\relax + +% note: T1 encoding assumed +\usepackage{lmodern} +\usepackage[T1]{fontenc} +\usepackage{booktabs} + +% from faq.sty +\newcommand\cs[1]{\texttt{\char`\\#1}} +\let\csx\cs +\def\bsbs{\cs{\char`\\}} + +% \cmdinvoke\cs +% \cs typeset as above +% may consist of optional or mandatory arguments; +% +% the `arguments' are simply typesett \texttt, as yet -- if something +% fancier is needed, there's a bunch of code needs rewriting here... +\DeclareRobustCommand\cmdinvoke{\@ifstar + {\let\@tempa\emph\@scmdinvoke}% + {\let\@tempa\relax\@scmdinvoke}% +} +\def\@scmdinvoke#1{\texttt{\symbol{92}#1}% + \futurelet\@let@token\@cmdinvoke +} +\def\@cmdinvoke{\ifx\@let@token\bgroup + \let\@tempb\@cmdinvoke@lbrace + \else + \ifx\@let@token[% ] + \let\@tempb\@cmdinvoke@lbrack + \else + \ifx\@let@token(% ) + \let\@tempb\@cmdinvoke@lparen + \else + \let\@tempb\@empty + \fi + \fi + \fi + \@tempb +} +\def\@cmdinvoke@lbrace#1{\penalty0\hskip0pt\relax + \texttt{\symbol{123}\@tempa{#1}\symbol{125}}% + \futurelet\@let@token\@cmdinvoke +} +\def\@cmdinvoke@lbrack[#1]{\penalty-150\hskip0pt\relax + \texttt{[\@tempa{#1}]}% + \futurelet\@let@token\@cmdinvoke +} +\def\@cmdinvoke@lparen(#1){\penalty-150\hskip0pt\relax + \texttt{(\@tempa{#1})}% + \futurelet\@let@token\@cmdinvoke +} +% and extension -- versions that take a single extra (delimiter) +% argument, such as \delcmdinvoke{lscrunge}( ... awful syntax, but... +\DeclareRobustCommand\delcmdinvoke{\@ifstar + {\let\@tempa\emph\@sdelcmdinvoke}% + {\let\@tempa\relax\@sdelcmdinvoke}% +} +\def\@sdelcmdinvoke#1#2{\texttt{\symbol{92}#1#2}% + \futurelet\@let@token\@cmdinvoke +} + +% sui generis +\newcommand\newitem{\par\addvspace{1ex}\noindent} + +% inspired by doc.sty in latex distribution +\newcommand\meta[1]{\ensuremath{\langle}\emph{#1}\ensuremath{\rangle}} + +% meaningful names, as in faq.sty +\newcommand\environment[1]{\texttt{#1}} +\newcommand\pkgoption[1]{\texttt{#1}} +\newcommand\extension[1]{\texttt{.#1}} +\newcommand\Package[1]{\textsf{#1}} +\def\option{\@ifnextchar[\@optionb\@option}% ] +\def\@optionb[#1]{{\normalfont\ttfamily[#1]}} +\def\@option#1{\texttt{#1}} + +\let\FontName\textsf \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.pdf b/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.pdf new file mode 100644 index 00000000000..1d78e61d4cd Binary files /dev/null and b/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.tex b/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.tex new file mode 100644 index 00000000000..8d1e78b44af --- /dev/null +++ b/Master/texmf-dist/doc/latex/varwidth/varwidth-doc.tex @@ -0,0 +1,55 @@ +\documentclass[a4paper]{article} +\usepackage[a4paper]{geometry} +\usepackage{miscdoc,varwidth,multicol} +\newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}} + +\newsavebox{\varbox} + +\begin{document} +\title{The \Package{varwidth} package (version 0.92)} +\author{Donald Arseneau\thanks{Documentation put together by Robin Fairbairns}} +\maketitle + +\section{The \environment{varwidth} environment} + +The package defines a \environment{varwidth} environment (based on +\environment{minipage}) which is an +analogue of \environment{minipage}, but whose resulting width is the +natural width of its contents. A trivial example: +\begin{center} + \begin{minipage}[t]{1in} + \cmdinvoke{begin}{varwidth}[1in]\\ + \null\quad\texttt{Trivia}\\ + \cmdinvoke{end}{varwidth} + \end{minipage}% + \quad and\quad + \begin{minipage}[t]{1in} + \cmdinvoke{begin}{minipage}[1in]\\ + \null\quad\texttt{Trivia}\\ + \cmdinvoke{end}{minpage} + \end{minipage} +\end{center} +produce +\begin{center} + \begin{lrbox}\varbox + \begin{varwidth}{1in} + Trivia + \end{varwidth} + \end{lrbox} + \fbox{\usebox{\varbox}}% + \quad and\quad + \begin{lrbox}\varbox + \begin{minipage}{1in} + Trivia + \end{minipage} + \end{lrbox} + \fbox{\usebox{\varbox}}% +\end{center} +(the output placed in an \cs{fbox} to emphasise the effect). + +\section{The \cs{narrowragged} command} + +The command works like \cs{raggedright}, but produces generally +narrowe lines in paragraphs, with more text in the last line (the +lines have more-equal lengths). +\end{document} diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 6fa1b842cc1..7a5cdec3856 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1073,6 +1073,7 @@ $standardtex='\.(.bx|cfg|sty|clo|ldf|cls|def|fd|cmap|4ht)$'; 'url', '^[^m].*\.sty', # not miscdoc.sty 'variations', '^variations\.tex|' . $standardtex, # not docvariations.tex 'varisize', '\.tex', + 'varwidth', '^..[^s].*\.sty', # not miscdoc.sty 'vaucanson-g', '\.(def|tex)|' . $standardtex, 'vertex', 'vertex\.tex|' . $standardtex, 'vhistory', '\.sty', # not hyperref.cfg -- cgit v1.2.3