summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/makebox
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/makebox
Initial commit
Diffstat (limited to 'macros/latex/contrib/makebox')
-rw-r--r--macros/latex/contrib/makebox/ChangeLog2
-rw-r--r--macros/latex/contrib/makebox/Makefile96
-rw-r--r--macros/latex/contrib/makebox/README46
-rw-r--r--macros/latex/contrib/makebox/getversion.tex7
-rw-r--r--macros/latex/contrib/makebox/makebox.dtx139
-rw-r--r--macros/latex/contrib/makebox/makebox.ins25
-rw-r--r--macros/latex/contrib/makebox/makebox.pdfbin0 -> 281990 bytes
-rw-r--r--macros/latex/contrib/makebox/makebox.xml29
-rw-r--r--macros/latex/contrib/makebox/testmakebox.tex25
9 files changed, 369 insertions, 0 deletions
diff --git a/macros/latex/contrib/makebox/ChangeLog b/macros/latex/contrib/makebox/ChangeLog
new file mode 100644
index 0000000000..78164ce850
--- /dev/null
+++ b/macros/latex/contrib/makebox/ChangeLog
@@ -0,0 +1,2 @@
+2004/07/31 v0.1 Harald Harders (h.harders@tu-bs.de)
+ - Initial version.
diff --git a/macros/latex/contrib/makebox/Makefile b/macros/latex/contrib/makebox/Makefile
new file mode 100644
index 0000000000..fe96cb5169
--- /dev/null
+++ b/macros/latex/contrib/makebox/Makefile
@@ -0,0 +1,96 @@
+
+SRCDIR=makebox
+INSTALLDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/tex/latex/makebox
+DOCDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/doc/latex/makebox
+VERSION=`latex getversion | grep '^VERSION' | sed 's/^VERSION \\(.*\\)\\.\\(.*\\)/\\1_\\2/'`
+
+
+.SUFFIXES: .sty .ins .dtx .dvi .ps .pdf
+
+.ins.sty:
+ latex $<
+
+.dtx.pdf:
+ pdflatex $<
+ pdflatex $<
+ makeindex -s gind.ist $(*D)/$(*F)
+ makeindex -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo
+ pdflatex $<
+
+.dvi.ps:
+ dvips -o $(*D)/$(*F).ps $(*D)/$(*F)
+
+
+all: makebox makebox.pdf testmakebox.dvi output
+
+testmakebox.dvi: testmakebox.tex makebox.sty
+ latex testmakebox
+
+
+makebox: makebox.sty
+
+
+
+clean:
+ @-rm -f makebox.glo makebox.gls makebox.idx makebox.ilg
+ @-rm -f makebox.ind makebox.aux makebox.log makebox.toc
+ @-rm -f testmakebox.log testmakebox.aux
+ @-rm -f *~
+
+distclean: clean
+ @-rm -f makebox.sty makebox.pdf
+ @-rm -f testmakebox.dvi
+
+tar: all clean
+ echo Generate makebox-$(VERSION).tar.gz
+ -rm -f makebox-$(VERSION).tar.gz
+ tar czCf .. makebox-$(VERSION).tar.gz \
+ $(SRCDIR)/README \
+ $(SRCDIR)/ChangeLog \
+ $(SRCDIR)/Makefile \
+ $(SRCDIR)/makebox.dtx \
+ $(SRCDIR)/makebox.ins \
+ $(SRCDIR)/makebox.pdf \
+ $(SRCDIR)/testmakebox.tex \
+ $(SRCDIR)/getversion.tex \
+ $(SRCDIR)/makebox.xml
+ rm -f getversion.log
+
+texlive: all clean
+ rm -rf texmf
+ mkdir -p texmf/tex/latex/makebox
+ mkdir -p texmf/doc/latex/makebox
+ mkdir -p texmf/source/latex/makebox
+ cp makebox.sty texmf/tex/latex/makebox
+ cp makebox.dtx makebox.ins makebox.xml texmf/source/latex/makebox
+ cp Makefile texmf/source/latex/makebox
+ cp testmakebox.tex README makebox.pdf texmf/doc/latex/makebox
+
+zip: all clean
+ -@rm -f makebox-$(VERSION).zip
+ mkdirhier tex/latex/makebox
+ mkdirhier doc/latex/makebox
+ mkdirhier source/latex/makebox
+ mv makebox.sty tex/latex/makebox
+ cp makebox.dtx makebox.ins makebox.xml source/latex/makebox
+ cp Makefile source/latex/makebox
+ cp testmakebox.tex README ChangeLog makebox.pdf doc/latex/makebox
+ zip -r makebox-$(VERSION).zip tex doc source
+ rm -r tex/ doc/ source/
+ rm -f getversion.log
+
+install: all
+ if [ ! -d $(INSTALLDIR) ]; then mkdirhier $(INSTALLDIR); fi
+ if [ ! -d $(DOCDIR) ]; then mkdirhier $(DOCDIR); fi
+ @rm -f $(INSTALLDIR)/* $(DOCDIR)/*
+ install -m644 makebox.sty $(INSTALLDIR)
+ install -m644 makebox.pdf $(DOCDIR)
+ texhash
+
+output:
+ @echo "Please copy makebox.sty to a directory"
+ @echo "in the LaTeX search path"
+
+
+makebox.sty: makebox.ins makebox.dtx
+
diff --git a/macros/latex/contrib/makebox/README b/macros/latex/contrib/makebox/README
new file mode 100644
index 0000000000..b07e4f35de
--- /dev/null
+++ b/macros/latex/contrib/makebox/README
@@ -0,0 +1,46 @@
+makebox.sty
+===========
+
+Define a \makebox* command that does the same as a \makebox command
+while the width is given by a sample text instead of an explicit length
+measure.
+
+
+Copyright 2000--2004 Harald Harders
+
+This program can 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 any later version.
+
+
+
+Installation:
+
+automatic: - run make
+ - run make install
+ or
+ - run make
+ - copy makebox.sty to a place where LaTeX can find it
+ - run texhash or the corresponding command of your distribution
+
+by hand: - execute latex on makebox.ins
+ - copy makebox.sty to a place LaTeX can find it
+ - run texhash or the corresponding command of your distribution
+ If you also want to re-compile the documentation which should not
+ be necessary do the following items, too:
+ - execute:
+ pdflatex makebox.dtx
+ pdflatex makebox.dtx
+ makeindex -s gglo.ist -o makebox.gls makebox.glo
+ makeindex -s gind.ist makebox
+ pdflatex makebox.dtx
+ - copy makebox.pdf to the documentation tree of your
+ TeX implementation
+ - run texhash or the corresponding command of your distribution,
+ again
+
+
+2004/07/31
+Harald Harders
+h.harders@tu-bs.de
diff --git a/macros/latex/contrib/makebox/getversion.tex b/macros/latex/contrib/makebox/getversion.tex
new file mode 100644
index 0000000000..e8c57a3cbe
--- /dev/null
+++ b/macros/latex/contrib/makebox/getversion.tex
@@ -0,0 +1,7 @@
+\documentclass[english]{ltxdoc}
+\nofiles
+\usepackage{makebox}
+\GetFileInfo{makebox.sty}
+\typeout{VERSION \fileversion}
+\begin{document}
+\end{document}
diff --git a/macros/latex/contrib/makebox/makebox.dtx b/macros/latex/contrib/makebox/makebox.dtx
new file mode 100644
index 0000000000..2c6de06016
--- /dev/null
+++ b/macros/latex/contrib/makebox/makebox.dtx
@@ -0,0 +1,139 @@
+% \iffalse meta comment
+% File: makebox.dtx Copyright (C) 1999 Harald Harders
+% \fi
+%
+% \iffalse
+%
+%<*driver>
+\documentclass{ltxdoc}
+\IfFileExists{makebox.sty}{\usepackage{makebox}
+ \let\makeboxSTYfound\active}{\GenericWarning{makebox.dtx}{Package
+ file makebox.sty not found (Documentation will be messed up!^^J^^A
+ Generate makebox.sty by (La)TeXing makebox.ins, process
+ makebox.dtx again)^^J}\stop}
+\usepackage[T1]{fontenc}
+\usepackage{longtable}
+\usepackage{graphicx}
+\usepackage{url}
+\GetFileInfo{makebox.sty}
+\title{The \texttt{makebox} package\thanks{This file has version
+ \fileversion\ last revised \filedate.}}
+\author{Harald Harders\\\texttt{h.harders@tu-bs.de}}
+\date{File Date \filedate, Printed \today}
+\newlength{\tempdima}%
+\makeatletter
+\renewenvironment{table}[1][]{%
+ \@float{table}[#1]%
+ \centering%
+ \setlength{\tempdima}{\abovecaptionskip}%
+ \setlength{\abovecaptionskip}{\belowcaptionskip}%
+ \setlength{\belowcaptionskip}{\tempdima}%
+ }{%
+\end@float
+}
+\makeatother
+\EnableCrossrefs
+\CodelineIndex
+\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter}
+\DoNotIndex{\setcounter,\space,\ifx,\else,\fi}
+\CodelineNumbered
+\RecordChanges
+\CheckSum{18}
+\begin{document}
+ \DocInput{makebox.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \maketitle
+% \begin{abstract}
+% \noindent
+% This package defines a \cs{makebox*} command that allows to give the
+% width for the \cs{makebox} command by a sample text instead of a
+% measure.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section*{Copyright}
+% Copyright 2004 Harald Harders.
+%
+% This program can 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 any later version.
+%
+% \section{Using this package}
+%
+% Sometimes you want to put a text into a box that has the same width
+% as another text.
+% Normally, you have to use \cs{settowidth} to set a length to the
+% width of the reference text and use \cs{makebox} afterwards.
+%\DescribeMacro{\makebox*}%
+%With this package, you can use the \cs{makebox*} command for that.
+% The width of the box is then given by a mandatory first argument
+% (instead of the optional first argument of the \cs{makebox}
+% command).
+% The following arguments are identically to the normal \cs{makebox}
+% command.
+%
+% For example,
+%\begin{verbatim}
+%--longer reference text--\\*
+%--\makebox*{longer reference text}{short text}--\\*
+%--\makebox*{longer reference text}[r]{short text}--\\*
+%--\makebox*{longer reference text}[r]{even longer text than the reference}--\end{verbatim}
+% leads to\\
+%--longer reference text--\\*
+%--\makebox*{longer reference text}{short text}--\\*
+%--\makebox*{longer reference text}[r]{short text}--\\*
+%--\makebox*{longer reference text}{even longer text than the reference}--
+%
+%
+% \StopEventually{\PrintChanges \PrintIndex}
+%
+%
+% \section{The implementation}
+% \iffalse
+%<*package>
+% \fi
+% \changes{1.04}{2003/11/09}{Avoide usage of \cs{textversion} etc.}%
+% Heading of the package:
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{makebox}
+ [2004/07/31 v0.1 extend makebox command]
+% \end{macrocode}
+% \begin{macro}{\makebox*}
+% Save the original \cs{makebox} command since it has to be redefined.
+% \begin{macrocode}
+\newcommand*\hh@orig@makebox{}
+\let\hh@orig@makebox\makebox
+% \end{macrocode}
+% Redefine \cs{makebox}.
+% If using normally call the original command.
+% If using with a star, get the width of the box by a text and call
+% \cs{hh@makebox} for doing so.
+% \begin{macrocode}
+\renewcommand*\makebox{%
+ \@ifnextchar*%
+ {\hh@makebox}{\hh@orig@makebox}%
+}
+% \end{macrocode}
+% The \cs{hh@makebox} is defined with two mandatory arguments since
+% the star is the first argument and ignored.
+% First, the width of the reference text is stored in the length
+% \cs{@tempdima}.
+% Then, the original \cs{makebox} command ist called to typeset the
+% box.
+% \begin{macrocode}
+\newcommand*\hh@makebox[2]{%
+ \settowidth\@tempdima{#2}%
+ \hh@orig@makebox[\@tempdima]%
+}
+% \end{macrocode}
+% \end{macro}
+% \iffalse
+%</package>
+% \fi
+% \Finale
diff --git a/macros/latex/contrib/makebox/makebox.ins b/macros/latex/contrib/makebox/makebox.ins
new file mode 100644
index 0000000000..145e458e6d
--- /dev/null
+++ b/macros/latex/contrib/makebox/makebox.ins
@@ -0,0 +1,25 @@
+\input docstrip.tex
+\preamble
+
+ makebox package
+
+ Copyright 2004 Harald Harders
+
+ This program can 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 any later version.
+
+ h.harders@tu-bs.de
+
+\endpreamble
+
+\askforoverwritefalse
+
+% Files
+%%%%%%%%%%%%%%%%%%%%%%
+\generate{%
+ \file{makebox.sty}{\from{makebox.dtx}{package}}%
+}%
+
+\endbatchfile
diff --git a/macros/latex/contrib/makebox/makebox.pdf b/macros/latex/contrib/makebox/makebox.pdf
new file mode 100644
index 0000000000..6ec9eb77c6
--- /dev/null
+++ b/macros/latex/contrib/makebox/makebox.pdf
Binary files differ
diff --git a/macros/latex/contrib/makebox/makebox.xml b/macros/latex/contrib/makebox/makebox.xml
new file mode 100644
index 0000000000..40e4538793
--- /dev/null
+++ b/macros/latex/contrib/makebox/makebox.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!DOCTYPE entry SYSTEM "../catalogue.dtd">
+<entry id="makebox"
+ datestamp="2004/07/31"
+ modifier="h.harders@tu-bs.de">
+ <about>
+ <name>makebox</name>
+ <caption>makebox* command with width from a sample text.</caption>
+ <author>
+ <name>Harald Harders</name>
+ <email>h.harders@tu-bs.de</email>
+ </author>
+ <license type="lppl"/>
+ <version>
+ <number>0.1</number>
+ </version>
+ </about>
+ <description>
+ <abstract>
+Define a \makebox* command that does the same as a \makebox command
+while the width is given by a sample text instead of an explicit length
+measure.
+ </abstract>
+ </description>
+ <distribution>
+ <texlive>latex3</texlive>
+ <ctan>macros/latex/contrib/makebox</ctan>
+ </distribution>
+</entry>
diff --git a/macros/latex/contrib/makebox/testmakebox.tex b/macros/latex/contrib/makebox/testmakebox.tex
new file mode 100644
index 0000000000..0e61830c55
--- /dev/null
+++ b/macros/latex/contrib/makebox/testmakebox.tex
@@ -0,0 +1,25 @@
+\documentclass{minimal}
+\usepackage[T1]{fontenc}
+\usepackage{makebox}
+\unitlength1mm
+\begin{document}
+|asdf|
+
+|\makebox[20mm][l]{asdf}|
+
+|\makebox[20mm][r]{asdf}|
+
+|\makebox[20mm][c]{asdf}|
+
+|asdfasdf|
+
+|\makebox*{asdfasdf}[l]{asdf}|
+
+|\makebox*{asdfasdf}{asdf}|
+
+|\makebox*{asdfasdf}[r]{asdf}|
+
+
+|\makebox(20,3)[r]{asdf}|
+
+\end{document}