summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/textpos
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/textpos
Initial commit
Diffstat (limited to 'macros/latex/contrib/textpos')
-rw-r--r--macros/latex/contrib/textpos/LICENCE416
-rw-r--r--macros/latex/contrib/textpos/README48
-rw-r--r--macros/latex/contrib/textpos/VERSION-1.9.11
-rw-r--r--macros/latex/contrib/textpos/examples/README.examples11
-rw-r--r--macros/latex/contrib/textpos/examples/t1.tex66
-rw-r--r--macros/latex/contrib/textpos/examples/t10.tex46
-rw-r--r--macros/latex/contrib/textpos/examples/t2.tex43
-rw-r--r--macros/latex/contrib/textpos/examples/t3.tex44
-rw-r--r--macros/latex/contrib/textpos/examples/t4.tex73
-rw-r--r--macros/latex/contrib/textpos/examples/t5.tex66
-rw-r--r--macros/latex/contrib/textpos/examples/t6.tex103
-rw-r--r--macros/latex/contrib/textpos/examples/t7.tex25
-rw-r--r--macros/latex/contrib/textpos/examples/t8.tex57
-rw-r--r--macros/latex/contrib/textpos/examples/t9.tex67
-rw-r--r--macros/latex/contrib/textpos/niepraschk-eso-pic.pdfbin0 -> 37258 bytes
-rw-r--r--macros/latex/contrib/textpos/niepraschk-eso-pic.tex87
-rw-r--r--macros/latex/contrib/textpos/textpos.dtx1803
-rw-r--r--macros/latex/contrib/textpos/textpos.html254
-rw-r--r--macros/latex/contrib/textpos/textpos.ins15
-rw-r--r--macros/latex/contrib/textpos/textpos.pdfbin0 -> 262834 bytes
20 files changed, 3225 insertions, 0 deletions
diff --git a/macros/latex/contrib/textpos/LICENCE b/macros/latex/contrib/textpos/LICENCE
new file mode 100644
index 0000000000..2244313901
--- /dev/null
+++ b/macros/latex/contrib/textpos/LICENCE
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % 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 M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
diff --git a/macros/latex/contrib/textpos/README b/macros/latex/contrib/textpos/README
new file mode 100644
index 0000000000..47e5085aad
--- /dev/null
+++ b/macros/latex/contrib/textpos/README
@@ -0,0 +1,48 @@
+
+Textpos: absolute positioning of text on the LaTeX page
+-------------------------------------------------------
+
+Version 1.9.1, 2019 April 15
+
+This package facilitates placing boxes at absolute positions on the
+LaTeX page. There are several reasons why this might be useful, but
+the main one (or at least my motivating one) is to help produce a
+large-format conference poster.
+
+This package provides a single environment, plus a starred variant,
+which contains the text (or graphics, or table, or whatever) which is
+to be placed on the page, and which specifies where it is to be
+placed. The environment is accompanied by various configuration
+commands.
+
+For the change history, see textpos.html.
+
+The canonical CTAN URL for Textpos is <https://ctan.org/pkg/textpos>.
+Textpos has a home page at <http://purl.org/nxg/dist/textpos>.
+The source is hosted at bitbucket: <https://bitbucket.org/nxg/textpos>,
+and there is an issues list there, for bug reports.
+
+
+Installation
+------------
+
+Download or find the file textpos.sty. Install textpos.sty somewhere
+LaTeX will find it (see <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=inst-wlcf>).
+
+This package requires the services of Martin Schroeder's package
+everyshi. You will need to download this package from CTAN first. See
+<https://www.ctan.org/pkg/everyshi>.
+
+Licence
+-------
+
+This software is copyright, 1999-2019, Norman Gray.
+It is released under the terms of the [LaTeX Project Public License][lppl],
+which is included in the file LICENCE.
+
+
+
+Norman Gray
+http://nxg.me.uk
+
+[lppl]: http://www.latex-project.org/lppl.txt
diff --git a/macros/latex/contrib/textpos/VERSION-1.9.1 b/macros/latex/contrib/textpos/VERSION-1.9.1
new file mode 100644
index 0000000000..8c18834dd5
--- /dev/null
+++ b/macros/latex/contrib/textpos/VERSION-1.9.1
@@ -0,0 +1 @@
+textpos-1.9.1, released 2019 April 15
diff --git a/macros/latex/contrib/textpos/examples/README.examples b/macros/latex/contrib/textpos/examples/README.examples
new file mode 100644
index 0000000000..16b23fb697
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/README.examples
@@ -0,0 +1,11 @@
+The t?.tex files in this directory are intended as regression tests,
+rather than strictly as examples. They nonetheless serve to illustrate
+some of what textpos can do.
+
+Not all of them actually work, as regression tests, right now, but
+this is because when comparing binary formats such as .dvi files,
+it's not always completely obvious what counts as a significant
+change. Any comments and suggestions would be welcome.
+
+Norman
+2006 September 2
diff --git a/macros/latex/contrib/textpos/examples/t1.tex b/macros/latex/contrib/textpos/examples/t1.tex
new file mode 100644
index 0000000000..8cb8bfc45f
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t1.tex
@@ -0,0 +1,66 @@
+%%% Testing:basic functionality
+\documentclass{article}
+
+\usepackage[absolute,showboxes]{textpos}
+
+\setlength{\TPHorizModule}{30mm}
+\setlength{\TPVertModule}{\TPHorizModule}
+\textblockorigin{10mm}{10mm} % start everything near the top-left corner
+
+\setlength{\parindent}{0pt}
+\pagestyle{empty}
+
+\textblockcolour{red} % should have no effect, since {color} not loaded
+
+\begin{document}
+
+\begin{textblock}{4}(0,0)
+ % make a grid on the page
+ \lineskip=0pt % abut boxes directly
+ \setbox1=\hbox to \TPHorizModule{\hfill \vrule height \TPVertModule}
+ \setbox0=\vbox to \TPVertModule{\noindent\copy1\copy1 \copy1 \vss\hrule}
+ \copy0
+ \copy0
+ \copy0
+ \copy0
+\end{textblock}
+
+\begin{textblock}{3}(0,0)
+\{3\}(0,0)
+\end{textblock}
+
+\begin{textblock}{2}(2,1)
+\textblocklabel{block two}
+\{2\}(2,1)
+\end{textblock}
+
+\begin{textblock}{3}[0.5,0.5](3,3)
+\{3\}[0.5,0.5](3,3)
+\end{textblock}
+
+\begin{textblock}{2.5}(3,3)
+\{2.5\}(3,3)
+\end{textblock}
+
+\begin{textblock}{3.5}(1.5,1.5)
+\{3.5\}(1.5,1.5)
+\end{textblock}
+
+\begin{textblock*}{5cm}(25mm,50mm)
+\{5cm\}(25mm,50mm)
+\end{textblock*}
+
+\begin{textblock*}{284.52756pt}[0.5,0.5](50.0mm,2.5cm)
+\{284.52756pt\}[0.5,0.5](50.0mm,2.5cm)
+\end{textblock*}
+
+\TPReferencePosition{0.5,0.5}
+\begin{textblock}{1}(2,4)
+\{1\}(2,4)\hfil\break (refpos [0.5,0.5])
+\end{textblock}
+
+% The following is for testing the _experimental_ (in v1.9) discardcontent=true mode
+% \TPoptions{discardcontent=true}
+% Here is content
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/examples/t10.tex b/macros/latex/contrib/textpos/examples/t10.tex
new file mode 100644
index 0000000000..3c8677353d
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t10.tex
@@ -0,0 +1,46 @@
+%%% Testing:interactions between (x,y)-positioning and \TPMargin
+% See https://bitbucket.org/nxg/textpos/issues/3/
+% Thanks to Richard Schreiber for the report and initial test code.
+
+\documentclass{minimal}
+\usepackage[top=0mm,bottom=0mm,left=0mm,right=0mm,a5paper]{geometry}
+\usepackage{color}
+\usepackage[absolute,showboxes]{textpos}
+
+\parindent0mm
+\begin{document}
+
+\textblockrulecolour{magenta}
+\TPGrid[0mm,0mm]{6}{9}%
+\TPMargin{5mm}%
+
+\null\vskip 4cm
+\noindent \hrule width 2\TPHorizModule
+\smallskip
+\hbox to 2\TPHorizModule{$\leftarrow$\hfil two units wide\hfil $\rightarrow$}
+
+\begin{textblock}{2}(0,0)
+ This box is top-left.
+ The top and left margin lines touch the edge of the page.
+\end{textblock}
+
+\begin{textblock}{2}[0,1](0,9)
+ This box should sit at the bottom left.
+ The box should be two units wide, and the text correspondingly narrower.
+ The bottom and left margin lines should touch the edge of the page.
+\end{textblock}
+
+\TPMargin*{5mm}
+\begin{textblock}{2}[1,0](6,0)
+ This box should sit at the top right of the page, and the text
+ should be two units wide. The top and right margin lines should be
+ off the page.
+\end{textblock}
+
+\TPMargin{0mm}%
+\begin{textblock}{2}[1,1](6,9)
+ This box sits at the bottom right edge.
+ The text and box are two units wide.
+ The bottom and right margin lines touch the edge of the page.
+\end{textblock}
+\end{document}
diff --git a/macros/latex/contrib/textpos/examples/t2.tex b/macros/latex/contrib/textpos/examples/t2.tex
new file mode 100644
index 0000000000..be52319c5a
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t2.tex
@@ -0,0 +1,43 @@
+%%% Testing:interaction with calc
+\documentclass{article}
+
+\usepackage[absolute,showboxes]{textpos}
+\usepackage{calc,ifthen}
+
+\setlength\TPHorizModule{1mm}
+\setlength\TPVertModule{\TPHorizModule}
+\newcounter{MYCOUNT}
+
+\setlength\parindent{0pt}\pagestyle{empty}
+
+\begin{document}
+
+% Set origin to 10mm,10mm
+\textblockorigin{56.9055pt-10mm}{0pt+1cm}
+% Box at (10mm,10mm)
+\begin{textblock*}{25mm*2}(10mm,10mm)
+\{25mm*2\}(10mm,10mm)
+\end{textblock*}
+% Box at (15mm,15mm)
+\begin{textblock*}{10mm+14cm}(3\TPHorizModule*5,10\TPVertModule+5mm)
+\verb^{10mm+14cm}(3\TPHorizModule*5,10\TPVertModule+5mm)^
+\end{textblock*}
+
+
+\whiledo{\value{MYCOUNT} < 5}%
+{
+ \textblockorigin{0mm + 20mm * \value{MYCOUNT}}{55mm * \value{MYCOUNT}}
+ \begin{textblock}{100}(10,10)%
+ \begin{minipage}[b][50mm][t]{\linewidth}
+ Text \hfill Text \par \vfill Text \hfill Text\par
+ \end{minipage}
+ \end{textblock}%
+ \stepcounter{MYCOUNT}
+}
+
+\def\tick#1{\vrule height 0pt depth #1pt}
+\def\\{\hbox to 1cm{\hfil\tick4\hfil\tick8}}
+\vbox{\hrule\hbox{\tick8\\\\\\\\\\\\\\\\\\\\}}
+
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/examples/t3.tex b/macros/latex/contrib/textpos/examples/t3.tex
new file mode 100644
index 0000000000..1768033b74
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t3.tex
@@ -0,0 +1,44 @@
+%From Wybo@Servalys.Nl Fri Jun 28 14:28:41 2002
+%From: Wybo Dekker <Wybo@Servalys.Nl>
+%To: Norman@Astro.Gla.Ac.Uk
+%Date: Mon, 24 Jun 2002 23:38:46 +0200 (Cest)
+%Subject: Textpos
+
+%Dear Norman,
+
+%Whn I Tried This:
+
+\documentclass{article}
+\RequirePackage[absolute]{textpos} % revision 1.4
+\usepackage{graphicx,fancybox}
+\begin{document}
+
+%\begin{Landscape*}{\pdfpagewidth}{\pdfpageheight}{\rotatebox{-90}}
+\begin{Landscape*}{\hsize}{\vsize}{\rotatebox{-90}}
+test
+\end{Landscape*}
+\end{document}
+
+%I got:
+%
+%! Incompatible list can't be unboxed.
+%\@EveryShipout@Hook ...\TP@holdbox \unvbox \@cclv
+% }\global \setbox
+% \TP@holdb...
+%<*> \end{Landscape*}
+%
+%Hans Hagen suggested to replace the \unvbox with
+%
+%\ifvbox\@cclv\unvbox\else\box\fi
+%
+%and that worked. Should that perhaps be a fix?
+%
+%--
+%Best regards, Wybo Dekker
+%
+%---Servalys Analytical Chemistry Services---
+%Wybo Dekker wybo@servalys.nl
+%Deilsedijk 60 www.servalys.nl
+%4158 CH Deil tel +31-345-652164
+%The Netherlands fax +31-345-652383
+
diff --git a/macros/latex/contrib/textpos/examples/t4.tex b/macros/latex/contrib/textpos/examples/t4.tex
new file mode 100644
index 0000000000..fa712d1eb8
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t4.tex
@@ -0,0 +1,73 @@
+%%% Testing:colours
+\documentclass{article}
+
+\newif\ifdebug
+\debugfalse
+
+%\usepackage[absolute,showboxes]{textpos}
+\ifdebug
+\usepackage[showboxes]{textpos}
+\else
+\usepackage{textpos}
+\fi
+
+\def\t#1#2{\ifdebug #2\else #1\fi}
+
+\usepackage{color}
+
+\setlength{\TPHorizModule}{30mm}
+\setlength{\TPVertModule}{\TPHorizModule}
+%\textblockorigin{10mm}{10mm} % start everything near the top-left corner
+
+\setlength{\parindent}{0pt}
+\pagestyle{empty}
+
+\def\bigstrut{\hrule height 2ex depth 2ex width 0pt }
+
+\begin{document}
+
+\definecolor{Pink}{rgb}{1.0,0.8,0.8}
+\definecolor{Blue}{rgb}{0.8,0.8,1.0}
+\definecolor{Yellow}{rgb}{0.8,0.8,0.0}
+
+\textcolor{Blue}{\t{a1}{Hello}}
+{\color{Yellow} \t{a2}{There}}
+
+\textblockcolour{Pink}
+
+\begin{textblock}{3}(0,0)
+\t{b}{\{3\}(0,0) Pink}
+\end{textblock}
+
+\begin{textblock}{2}(2,1)
+\textblocklabel{block two}
+\textblockcolour{Blue}
+\t{c}{\{2\}(2,1) Blue}
+\end{textblock}
+
+\begin{textblock}{3}[0.5,0.5](3,3)
+\bigstrut
+\t{d}{\{3\}[0.5,0.5](3,3)
+ \textcolor{Yellow}{\t{e}{Yellow}}
+ \t{d2}{on Pink}}
+\end{textblock}
+
+\begin{textblock}{2.5}(3,3)
+\tekstblokkulur{}
+\t{f}{\{2.5\}(3,3)}
+\textcolor{Yellow}{\t{g}{No colour}}
+\end{textblock}
+
+\begin{textblock}{3.5}(1.5,1.5)
+\t{h}{\{3.5\}(1.5,1.5) Pink}
+\end{textblock}
+
+%\begin{textblock*}{5cm}(25mm,50mm)
+%\{5cm\}(25mm,50mm)
+%\end{textblock*}
+
+%\begin{textblock*}{284.52756pt}[0.5,0.5](50.0mm,2.5cm)
+%\{284.52756pt\}[0.5,0.5](50.0mm,2.5cm)
+%\end{textblock*}
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/examples/t5.tex b/macros/latex/contrib/textpos/examples/t5.tex
new file mode 100644
index 0000000000..37a181c87d
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t5.tex
@@ -0,0 +1,66 @@
+%%% Testing:spacing
+\documentclass{article}
+
+\usepackage{textpos}
+%\usepackage[showboxes]{textpos}
+
+\hoffset=0pt
+\voffset=0pt
+\oddsidemargin=0pt
+\topmargin=0pt
+\headheight=0pt
+\headsep=0pt
+
+\setlength{\TPHorizModule}{50pt}
+\setlength{\TPVertModule}{\TPHorizModule}
+
+\pagestyle{empty}
+
+\begin{document}
+
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{30pt}
+\setlength{\baselineskip}{20pt}
+
+% Make sure that all text appears precisely where it ought to. The
+% above dimensions mean that text appears in round-number locations.
+%
+% The \showbox puts detailed calculations in the log file
+%
+% Output of 'dvireport -F -up t5.dvi':
+% c 97[a] 0,20pt
+% c 121[y] 4.72223,20pt
+% c 98[b] 0,28.8889pt
+% c 121[y] 5.27777,28.8889pt
+% c 99[c] 50,76.25pt
+% c 100[d] 0,70pt
+% c 121[y] 5.55556,70pt
+%
+% The most important thing is that `a' and `d' are 50pt
+% apart, \parskip+\baselineskip
+%
+% This test may not currently be working (2005 August 30). There's an
+% extra 30pt (\parskip) appearing before the by and cy in their boxes,
+% which clearly isn't present in the t5.correct.dvi. Ought it to be
+% there? Have I done something (when?) which has caused this to
+% spuriously appear?
+
+
+\showboxdepth=8
+\showboxbreadth=8
+
+\noindent ay
+\vrule height 20pt depth 0pt width 0pt % strut -- makes base of this
+ % line 20pt from top
+\begin{textblock}{3}(0,0)
+\noindent by
+\end{textblock}
+\begin{textblock}{2}(1,1)
+\noindent cy
+\end{textblock}
+\noindent
+dy
+
+%\showlists % put detailed diagnostics into log file
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/examples/t6.tex b/macros/latex/contrib/textpos/examples/t6.tex
new file mode 100644
index 0000000000..5c479987b6
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t6.tex
@@ -0,0 +1,103 @@
+%%% Testing:colours, borders and margins
+\documentclass{article}
+
+\usepackage{textpos}
+\usepackage{color}
+
+\setlength{\TPHorizModule}{20pt}
+\setlength{\TPVertModule}\TPHorizModule
+
+\setlength\parindent{0pt}
+\pagestyle{empty}
+
+\begin{document}
+
+\definecolor{Blue}{rgb}{0.8,0.8,1.0}
+\definecolor{Borders}{rgb}{0.8,1.0,0.8}
+
+\begin{textblock}{4}(0,0)
+ \textblockcolour{Blue}
+ Blue
+\end{textblock}
+
+\begin{textblock}{12}(4,-1)
+ \hrule width 12\TPHorizModule
+ \vbox to 0pt{\hbox{12 units}\vss}
+ \vskip1\TPVertModule
+ \hrule width 8\TPHorizModule
+ \vbox to 0pt{\hbox{8 units}\vss}
+ \vskip1\TPVertModule
+ \hrule width 4\TPHorizModule
+ \vbox to 0pt{\hbox{4 units}\vss}
+ \vskip1\TPVertModule
+ \hrule width 2\TPHorizModule
+ \vbox to 0pt{\hbox{2 units}\vss}
+ \vskip1\TPVertModule
+ \hrule width 1\TPHorizModule
+\end{textblock}
+
+\begin{textblock}{12}(4,4)
+ This text is inside a box with a blue background. The text is flush
+ with the edge of the box, and the whole thing is twelve units wide.
+
+ There's a second paragraph in here.
+ \begin{itemize}
+ \item Here is a list item. It should be appropriately narrower than
+ the text around it, and specifically not abut the border.
+ \item Here is a second item.
+ \end{itemize}
+\end{textblock}
+
+\TPshowboxestrue
+\textblockrulecolour{red}
+\setlength\TPboxrulesize{0.25\TPHorizModule}
+
+\TPMargin{1\TPHorizModule}
+
+\begin{textblock}{4}(0,7)
+ \textblockcolour{Blue}
+ Blue
+\end{textblock}
+
+\begin{textblock}{12}(4,11)
+ This text is also inside a box with a blue background. However,
+ this time, there's a red border and a margin. The box as a whole is
+ twelve units wide, and the text is correspondingly narrower.
+ \begin{itemize}
+ \item Here is a list item. It should be appropriately narrower than
+ the text around it, and specifically not abut the border.
+ \item Here is a second item.
+ \end{itemize}
+\end{textblock}
+
+\TPMargin*{1\TPHorizModule}
+
+\begin{textblock}{4}(0,19)
+ \textblockcolour{Blue}
+ Blue
+\end{textblock}
+\tekstblokroolkulur{Borders}
+
+\begin{textblock}{12}(4,21)
+ Finally, here is some text on a blue background with an
+ unattractive green border. This time, the text is twelve units wide,
+ and the box, and its border, is consequently wider than that.
+ \begin{itemize}
+ \item Here is a list item. It should be appropriately narrower than
+ the text around it, and specifically not abut the border.
+ \item Here is a second item.
+ \end{itemize}
+ Here's some final text, and a quotation:
+ \begin{quotation}
+ \noindent
+ You shall see them on a beautiful quarto page, where a neat rivulet
+ of text shall meander through a meadow of
+ margin.
+ \hfil\penalty50\hskip2em\hbox{}\nobreak\hfil
+ \emph{--- Sheridan, The School for Scandal}\parfillskip=0pt
+ \end{quotation}
+\end{textblock}
+
+
+\end{document}
+
diff --git a/macros/latex/contrib/textpos/examples/t7.tex b/macros/latex/contrib/textpos/examples/t7.tex
new file mode 100644
index 0000000000..6deceeff77
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t7.tex
@@ -0,0 +1,25 @@
+\documentclass{article}
+
+%\usepackage[showboxes]{textpos}
+\usepackage[absolute,showboxes]{textpos}
+
+\setlength{\TPHorizModule}{100pt}
+\TPVertModule=\TPHorizModule
+
+\begin{document}
+
+ \begin{textblock}{2}(1,1)
+ Here is some text
+ \end{textblock}
+
+ \begin{textblock}{2}(2,2)
+ More text
+ \end{textblock}
+
+\null\newpage
+
+\begin{textblock}{2}(1.5,1.5)
+ Text on a new page
+\end{textblock}
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/examples/t8.tex b/macros/latex/contrib/textpos/examples/t8.tex
new file mode 100644
index 0000000000..aa0d74e5d3
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t8.tex
@@ -0,0 +1,57 @@
+%%% Testing: floats
+
+\documentclass{article}
+
+\usepackage[showboxes]{textpos}
+\setlength{\parindent}{0pt}
+
+\begin{document}
+
+\listoffigures
+
+Here is some text.
+\marginpar{\dots with a marginal note}
+
+\begin{figure}
+Hello, this is a normal figure
+\caption[short normal 1]{\label{normal1}long normal 1}
+\end{figure}
+
+\begin{textblock}{5}(0,5)
+In this document we have figures~\ref{figa} and~\ref{figb}.
+\end{textblock}
+
+\tracingcommands=2 \tracingmacros=2
+\begin{textblock}{5}(1,6)
+ Here is a figure.
+ \begin{figure}
+ Text
+ \caption[short textblock caption]{This is the first textblock figure (with short)}
+ \label{figa}
+ \end{figure}
+\end{textblock}
+\tracingcommands=0 \tracingmacros=0
+
+\begin{textblock}{5}(2,7)
+ Here is another figure.%error: \marginpar{\dots and a marginpar in block}
+ % perhaps the following ought to be OK
+ %\begin{minipage}{4cm} Hello minipage\marginpar{ping!}\end{minipage}
+ \begin{figure}
+ More text
+ \caption{\label{figb}This is the second textblock figure (no short)}
+ \end{figure}
+\end{textblock}
+
+\begin{textblock}{5}(3,8)
+ We can still refer to figures~\ref{figb} and~\ref{figa}.
+\end{textblock}
+
+Here is text, just before the outer figure.
+\begin{figure}
+\hrule
+This is another normal figure
+\hrule
+\caption[short normal 2]{\label{figc}This is the final figure, with short}
+\end{figure}
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/examples/t9.tex b/macros/latex/contrib/textpos/examples/t9.tex
new file mode 100644
index 0000000000..b86cf38892
--- /dev/null
+++ b/macros/latex/contrib/textpos/examples/t9.tex
@@ -0,0 +1,67 @@
+%%% Testing: switching between absolute and relative mode
+
+\documentclass{article}
+
+\usepackage[absolute,showboxes]{textpos}
+\setlength{\parindent}{0pt}
+\TPHorizModule=1cm
+\TPVertModule=1cm
+
+\begin{document}
+
+Here is some text, which appears in the body of the page.
+\begin{textblock}{5}(0,0)
+This text is at (0,0), and should appear at the very top-left corner.
+\end{textblock}
+
+Here is more text, which also appears in the body.
+\begin{textblock}{5}(1,1)
+This text is at (1,1), and should appear near the top-left corner, 1cm
+in and down.
+\end{textblock}
+
+\newpage
+\TPoptions{ absolute=false,
+ showboxes = false}
+
+Here is some text, which appears in the body of page two.
+\begin{textblock}{5}(0,0)
+This text is at (0,0), and appears at the top-left of the text block,
+just under `Here is some text'.
+It should not have a box around it.
+\end{textblock}
+
+\vskip4cm
+Here is more text, which also appears in the body of p.2.
+\begin{textblock}{5}(1,1)
+This text is at (1,1), and also appears in the text block 1cm along
+and down from the `Here is more text', and without a surrounding box.
+\end{textblock}
+
+\TPoptions{absolute=true, showboxes=true, showtext=false}
+
+\vskip4cm
+Text. The corresponding text block should appear only as a box, with
+no text inside it. It appears in the top-left corner of the page.
+\begin{textblock}{5}(0,0)
+This text should not appear (just the box, positioned 2cm along and
+down from `Text.'
+\end{textblock}
+
+\TPoptions{absolute=false, showboxes=true, showtext=true}
+
+\vskip4cm
+Text 2.
+\begin{textblock}{5}(6,0)
+This text should appear surrounded by a box, level with, but along from, `Text 2'.
+\end{textblock}
+
+\newpage
+\TPoptions{absolute=true}
+
+Page 3.
+\begin{textblock}{5}(0,0)
+This text appears at the extreme top-left of page three.
+\end{textblock}
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/niepraschk-eso-pic.pdf b/macros/latex/contrib/textpos/niepraschk-eso-pic.pdf
new file mode 100644
index 0000000000..791fa57b84
--- /dev/null
+++ b/macros/latex/contrib/textpos/niepraschk-eso-pic.pdf
Binary files differ
diff --git a/macros/latex/contrib/textpos/niepraschk-eso-pic.tex b/macros/latex/contrib/textpos/niepraschk-eso-pic.tex
new file mode 100644
index 0000000000..10be9ec8af
--- /dev/null
+++ b/macros/latex/contrib/textpos/niepraschk-eso-pic.tex
@@ -0,0 +1,87 @@
+
+% Rolf Niepraschk, nieprasck@ptb.de, 2002-11-24
+% A funny demo for `textpos' with a backgroundgrid from `eso-pic'.
+\documentclass[a4paper,draft]{article}
+
+%\usepackage[absolute,showboxes]{textpos}
+\usepackage[absolute]{textpos}
+\usepackage[colorgrid,texcoord]{eso-pic}[2002/11/16]
+\usepackage{calc}
+
+\newcommand\StartX{25mm} \newcommand\StartY{40mm}
+\newcommand\Wi{160mm} \newcommand\Wii{40mm} \newcommand\Wiii{60mm}
+\newcommand\Hi{20mm} \newcommand\Hii{100mm}
+
+\pagestyle{empty}
+
+\begin{document}
+
+\textblockorigin{0cm}{0cm}
+
+\begin{textblock*}{\Wi}(\StartX,\StartY)%
+ \noindent\colorbox[rgb]{0,0,1}{%
+ \begin{minipage}[c][\Hi - 2\fboxsep][c]{\linewidth - 2\fboxsep}%
+ \centering\Huge\textbf{FOO}%
+ \end{minipage}}%
+\end{textblock*}
+
+\begin{textblock*}{\Wii}(\StartX,\StartY + 20mm)%
+ \noindent\colorbox[rgb]{0,1,0}{%
+ \begin{minipage}[c][\Hii - 2\fboxsep][c]{\linewidth - 2\fboxsep}%
+ \centering\Huge\textbf{BAR}%
+ \end{minipage}}%
+\end{textblock*}
+
+\begin{textblock*}{\Wii}(\StartX + \Wi - \Wii,\StartY + 20mm)%
+ \noindent\colorbox[rgb]{1,1,0}{%
+ \begin{minipage}[c][\Hii - 2\fboxsep][c]{\linewidth - 2\fboxsep}%
+ \centering\Huge\textbf{BAR}%
+ \end{minipage}}%
+\end{textblock*}
+
+\begin{textblock*}{\Wi}(\StartX,\Wi)%
+ \noindent\colorbox[rgb]{1,0,1}{%
+ \begin{minipage}[c][\Hi - 2\fboxsep][c]{\linewidth - 2\fboxsep}%
+ \centering\Huge\textbf{FOO}%
+ \end{minipage}}%
+\end{textblock*}
+
+\begin{textblock*}{\Wiii}(75mm,70mm)%
+ \setlength\fboxrule{2pt}%
+ \noindent\fbox{%
+ \begin{minipage}{\linewidth - 2\fboxsep - 2\fboxrule}%
+ \Large\itshape
+ Text Text Text Text Text
+ Text Text Text Text Text
+ Text Text Text Text Text
+ Text Text Text Text Text
+ Text Text Text Text Text
+ Text Text Text Text Text
+ Text Text Text Text Text
+ \end{minipage}}%
+\end{textblock*}
+
+\begin{textblock*}{\Wiii}(75mm,130mm)%
+ \setlength\fboxrule{2pt}%
+ \noindent\fbox{%
+ \begin{minipage}[c][\Hi - 2\fboxsep - 2\fboxrule]%
+ {\linewidth - 2\fboxsep - 2\fboxrule}%
+ \centering\Huge\textbf{\LaTeX}
+ \end{minipage}}%
+\end{textblock*}
+
+\begin{textblock*}{\Wi}(\StartX,\StartY + 160mm)%
+ \noindent\colorbox[rgb]{0,1,1}{%
+ \begin{minipage}[c][\Hi - 2\fboxsep][c]{\linewidth - 2\fboxsep}%
+ \centering\Huge\textbf{FOOBAR}%
+ \end{minipage}}%
+\end{textblock*}
+
+\begin{textblock*}{\Wi}(\StartX,\StartY + 200mm)%
+ \noindent\colorbox[rgb]{1,0,0}{%
+ \begin{minipage}[c][\Hi - 2\fboxsep][c]{\linewidth - 2\fboxsep}%
+ \centering\Huge\textbf{BAZ}%
+ \end{minipage}}%
+\end{textblock*}
+
+\end{document}
diff --git a/macros/latex/contrib/textpos/textpos.dtx b/macros/latex/contrib/textpos/textpos.dtx
new file mode 100644
index 0000000000..7be0700389
--- /dev/null
+++ b/macros/latex/contrib/textpos/textpos.dtx
@@ -0,0 +1,1803 @@
+% \iffalse
+% This is textpos.dtx, which allows you to place text (and graphics)
+% anywhere on the LaTeX page. It's useful for posters.
+%
+%%%% File: textpos.dtx
+%%%% Copyright 1999-2019, Norman Gray
+%%
+%% 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 Norman Gray <http://nxg.me.uk>
+%%
+%% This work consists of the files textpos.dtx and textpos.ins,
+%% and the derived file textpos.sty.
+%%
+%% Author: Norman Gray, norman@astro.gla.ac.uk.
+%% Department of Physics and Astronomy, University of Glasgow, UK
+%%
+%% See the file LICENCE for a copy of the LPPL.
+%%
+%% Mercurial ident: 09ee0efc21ac (1.9.1+0), 2019-04-15 22:14 +0100
+%%
+%<+package>\NeedsTeXFormat{LaTeX2e}
+%<+package>\ProvidesPackage{textpos}[2019/04/15 v1.9.1]
+%<+package>\typeout{Package: textpos 2019/04/15 1.9.1, absolute positioning of text on the page}
+%
+%<*driver>
+\documentclass{ltxdoc}
+\title{Textpos: absolute positioning of text on the page}
+\author{Norman Gray\\(\texttt{http://nxg.me.uk})}
+\date{Version 1.9.1, 2019 April 15\footnote{Mercurial ident: 09ee0efc21ac (1.9.1+0), 2019-04-15 22:14 +0100.
+This software is copyright, 1999-2019 Norman Gray.
+It is released under the terms of the LaTeX Project Public License,
+either version 1.3 of this licence or (at your option) any later version.
+The latest version of this license is at \texttt{http://www.latex-project.org/lppl.txt}.}}
+\newcommand\Lopt[1]{\textsf {\small [#1]}}
+\newcommand\file[1]{\texttt {#1}}
+\newcommand\Lcount[1]{\textsl {\small#1}}
+\newcommand\Lenv[1]{\texttt{\{#1\}}}
+\newcommand\pstyle[1]{\textsl {#1}}
+\makeatletter % make the ttfamily font less overbearingly large
+\renewcommand\ttfamily{\not@math@alphabet\ttfamily\mathtt
+ \fontfamily\ttdefault
+ \fontsize{9}{\f@baselineskip}\selectfont}
+\makeatother
+% Make command strings easier to write
+\def\activemeta#1>{\meta{#1}}
+{\catcode`\<=\active
+ \gdef\cmd{\begingroup
+ \catcode`\\=12 \catcode`\{=12 \catcode`\}=12
+ \catcode`\<=\active \let<\activemeta
+ \catcode`\|=12
+ \docmd}}
+\def\docmd|#1|{\texttt{#1}\endgroup}
+%% \url macro (url.sty does this better)
+\def\setpathdots{\discretionary{.}{}{.}}
+\def\setpathslash{\discretionary{/}{}{/}}
+{\catcode`\.=\active
+ \catcode`\/=\active
+ \gdef\pathcats{%
+ \catcode`\%=12 \catcode`\~=12
+ \catcode`\.=\active \let.\setpathdots
+ \catcode`\/=\active \let/\setpathslash
+ \catcode`\#=12 \catcode`\_=12}%
+ }
+\def\setpath#1{\ttfamily\small <\nobreak #1\nobreak>\endgroup}
+\def\url{\begingroup\pathcats\setpath}
+%\RecordChanges
+%\OnlyDescription
+\begin{document}
+\maketitle
+\tableofcontents
+%% \bigskip
+%% \hrule
+%% \bigskip
+\newpage
+\DocInput{textpos.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+%
+%
+%
+% \changes{v1.0a}{1998/04/29}{Robin Fairbairns pointed out and adjusted errors in the documentation}
+% \changes{v1.0b}{1998/04/30}{Reorganised documentation -- properly this time}
+% \changes{v1.1b}{1999/03/05}{Added note to the effect that everyshi can be found at CTAN}
+% \changes{v1.1c}{1999/03/09}{Corrected checksum (again!)}
+% \changes{v1.1d}{1999/06/06}{Clarified copyright and licence status}
+% \changes{v1.3?}{2003/06/??}{Finally removed bloody useless checksum and character table}
+%
+%
+% \noindent
+% This package facilitates placing boxes at absolute positions on the
+% \LaTeX\ page. There are several reasons why this might be useful, but
+% the reason which originally motivated this package is to help produce a
+% large-format conference poster. However the facility is also useful
+% for filling in forms or other special purpose layout.
+%
+% This package provides a single environment, which contains the text
+% (or graphics, or table, or whatever) which is to be placed on the
+% page, and which specifies where it is to be placed.
+%
+% The package tries not to get in the way. That is, you should be
+% able to use most of the apparatus of \LaTeX\ in your poster, such as
+% section headings, citations, graphics inclusion, and so on. Please
+% let me know if you experience problems in this respect.
+%
+% This package requires the services of Martin Schr\"oder's package
+% \texttt{everyshi}. If this is not already part of your \TeX{}
+% installation, you will need to download this package from CTAN. See
+% \url{https://www.ctan.org/pkg/everyshi}.
+%
+% The canonical CTAN URL for Textpos is \url{https://ctan.org/pkg/textpos}.
+% Textpos has a home page at \url{http://purl.org/nxg/dist/textpos}.
+% The source is held at bitbucket: \url{https://bitbucket.org/nxg/textpos},
+% and there is an issues list there, for bug reports. Code
+% contributions or fixes are welcome, but note that I feel that
+% Textpos is pretty mature now, and I'm reluctant to extend its
+% functionality beyond its natural boundaries, so it would be wise to
+% chat to me about any new features before spending a lot of time
+% drafting them in code.
+%
+% An article describing Textpos appeared in TUGboat in 2002:
+% Norman Gray, `Absolute Positioning with
+% Textpos', TUGboat \textbf{23} (3/4), pp341--4, 2002, available at
+% \url{http://www.tug.org/TUGboat/tb23-3-4/tb75gray.pdf}.
+%
+% \section{Description}
+%
+% Load the package as usual, with
+% \begin{quote}
+% \cmd|\usepackage<package-options>{textpos}|
+% \end{quote}
+% The \meta{package-options} are as described in section~\ref{packopts}.
+%
+% The environment is used as follows
+% \DescribeEnv{textblock}
+% \begin{quote}\begin{raggedright}
+% \cmd|\begin{textblock}{<hsize>}(<hpos>,<vpos>)|\\
+% text...\\
+% |\end{textblock}|
+% \end{raggedright}
+% \end{quote}
+% The \meta{hsize} and \meta{hpos} arguments are given in units of a
+% module |\TPHorizModule|, and \meta{vpos} is given in units of a
+% module |\TPVertModule|. You set these using
+% the command
+% \cmd|\setlength{\TPHorizModule}{<dimen>}|,
+% and similarly for |\TPVertModule|.
+% The arguments may be any dimension, and you may use the modules as
+% units elsewhere in your document if you wish to, for example in
+% \texttt{\bslash makebox[2\bslash TPHorizModule]\{gnus\}}. The text in the
+% environment will be set in a
+% box \meta{hsize} modules wide, and placed on the page with its
+% upper left corner at the position (\textit{hpos,vpos}). As is
+% natural in \TeX, the \meta{vpos} parameter indicates distance
+% \emph{down} from the `anchor point' (see below).
+%
+% The \Lenv{textblock} parameters \meta{hsize},
+% \meta{hpos} and \meta{vpos} are \emph{multiples or fractions of the horizontal
+% and vertical modules}, as appropriate. If you want or need to give
+% explicit sizes here, see the \Lenv{textblock*} environment below.
+%
+% Notice that the positioning arguments for the \Lenv{textblock}
+% command -- the coordinates \cmd|...(<hpos>,<vpos>)| -- are in
+% \emph{round} brackets,\marginpar{Round brackets!}
+% not curly ones. This is in imitation of the \texttt{picture}
+% environment, and whether or not this is sensible, it's not going to
+% change now.
+%
+% This package works in two modes, relative and absolute.
+% \marginpar{relative \& absolute mode}
+% In the first one, the default, the block-positioning parameters in the
+% \Lenv{textblock} envirionment are taken to be relative to an `anchor
+% point' which is the current position on the page, that is, the place
+% where (the bottom left of) a character would appear if it were typed
+% at this point. This will be appropriate if you are
+% laying out text within a \texttt{figure} environment or the like.
+% In this mode, you will typically give several \Lenv{textblock}
+% environments one after the other, so that they are all relative to
+% the same point.
+%
+% If, however, your entire
+% document is to be laid out piece by piece (which is the case in the
+% canonical use of the package, to lay out a poster), then you might
+% want to be more sure of where the origin is. In this case, you make
+% the package work in its absolute mode, by invoking it with
+% the \Lopt{absolute} option: |\usepackage[absolute]{textpos}|.
+% In this mode, all the block-positioning parameters are given
+% relative to a single origin on the page. By default, this `anchor point' is the
+% top-left corner of the page, but you may change it with the
+% command \cmd|\textblockorigin{<hpos>}{<vpos>}|.
+% Here \meta{hpos} and \meta{vpos} are dimensions such as `10mm',
+% relative to the top-left corner of the paper. You may use this
+% command only if the package was invoked with the \Lopt{absolute}
+% option.
+%
+% See also section~\ref{packopts} for how to alternate
+% between modes, see section~\ref{absolute-newpage} for notes on the
+% interaction with the |\newpage| command, and see
+% section~\ref{s:absrelmode} for some subtleties about choosing which
+% mode to use.
+%
+% The textblocks are placed on the page\marginpar{layers} in the order in which they
+% appear in the file. This means that later textblocks will be placed
+% on top of earlier ones, which may matter if one or other contains,
+% for example, a block of opaque colour (I believe this to be true in
+% practice for all output mechanisms, though I doubt it's guaranteed
+% in principle). This order was unspecified before textpos 1.7e; it
+% was changed, and specified, in that version.
+%
+% The \Lenv{textblock} environment will most often be used in
+% vertical mode. If it is called in horizontal (ie, paragraph) mode,
+% however, it will silently create a paragraph break by inserting a
+% |\par| command before the environment; it remains in vertical mode
+% after the environment is finished. It should have no further
+% effects on spacing, and if you find that it does, that's a bug. If
+% you try to use the environment when in maths mode, the package
+% objects (as it should!).
+%
+% \subsection{Package options}
+% \label{packopts}
+%
+% There are several package options:
+% \begin{description}
+% \item[\Lopt{showboxes}]When you are laying things out, it can be
+% useful to have the boxes drawn in for you. This option draws a box
+% fitting closely round the set text.
+% \item[\Lopt{noshowtext}]This suppresses the display of the text in
+% each block (so it's not really usable without the \Lopt{showboxes}
+% option). The resulting box will be the correct size, but empty,
+% unless the |\textblocklabel| command has been given. This
+% can be useful when you are previewing a document.
+% \item[\Lopt{absolute}]If this is present, then the positions on the
+% \Lenv{textblock} environment are taken to be absolute positions on
+% the page. There is also a \Lopt{relative} option, which is the default.
+% See above for more detail.
+% \item[\Lopt{overlay}]When using the absolute-position mode, the
+% textblocks are placed under any other text on the page. This is
+% normally what you want, but if you have page contents, and they have
+% something
+% which \emph{obscures} the textblocks (for example, a block of opaque
+% colour), then the positioned textboxes disappear. In this case,
+% specify the option \Lopt{overlay}, to request that the positioned
+% blocks of text overlay any other page contents, rather
+% than being overlaid.
+% \item[\Lopt{verbose}, \Lopt{quiet}]The package writes a few messages
+% to the output, describing its calculations. These are potentially
+% irritating, so you can turn them off with the \Lopt{quiet} option or
+% on with the \Lopt{verbose} option. The default is currently
+% \Lopt{verbose}, but this might change in future.
+% \end{description}
+%
+% \subsection{Changing options on the fly}
+% \label{s:changing-options}
+%
+% \begin{macro}{\TPoptions}
+% Each of the options mentioned in the previous section can be changed within the body of the text,
+% using the command |\TPoptions| with a comma-separated list of
+% keywords
+% \textit{$\langle$keyword$\rangle$}\texttt{=true} or
+% \textit{$\langle$keyword$\rangle$}\texttt{=false}.
+% The recognised keywords are `absolute', `overlay', `verbose',
+% `showboxes' and `showtext'. Thus the command
+% \begin{quote}
+% |\TPoptions{absolute=false , showboxes = true }|
+% \end{quote}
+% will switch off \Lopt{absolute} mode, and switch on \Lopt{showboxes}
+% mode. As this example illustrates, you can include whitespace in
+% the specification; the arguments \emph{must} be either \texttt{true}
+% or \texttt{false}, or else bad things will happen.
+%
+% You can switch between absolute and relative mode within a page. If
+% a document is to use absolute mode \emph{anywhere} within it,
+% however, it must be \emph{started} in absolute mode, with the
+% \Lopt{absolute} option to the |\usepackage| command.
+% \end{macro}
+%
+% \subsection{Configuration commands, and variants}
+%
+% \subsubsection{Setting up a positioning grid}
+%
+% \DescribeMacro{\TPGrid}
+% You will often wish to set up a grid on your page. Rather than
+% calculate and specify the two modules explicitly, you can set up the
+% grid with a command
+% \cmd|\TPGrid{<nhoriz>}{<nvert>}|, which sets
+% |\TPHorizModule| to be \meta{paper
+% width}/\meta{nhoriz}, and |\TPVertModule| to be
+% \meta{paper height}/\meta{nvert}. This takes an optional pair of
+% dimension arguments, which specify a coordinate, as follows.
+% \begin{quote}\begin{raggedright}
+% \cmd|\TPGrid[<x>,<y>]{<nhoriz>}{<nvert>}|
+% \end{raggedright}\end{quote}
+% If these are present, then the modules are set
+% up to leave a border of the given size around the grid. That is,
+% |\TPHorizModule| is set to be (\meta{paper
+% width}${}-{}2$\meta{x})/\meta{nhoriz}, and similarly for
+% |\TPVertModule|. Further, if the package was given
+% the \Lopt{absolute} option, then the text origin is set to be
+% (\meta{x},\meta{y}) through a call to |\textblockorigin|
+% (see below). For example, the declaration
+% \begin{quote}\begin{raggedright}
+% \cmd|\TPGrid[40mm,20mm]{10}{5}|
+% \end{raggedright}\end{quote}
+% would choose \cmd|\TPHorizModule| and \cmd|\TPVertModule| so as to
+% give a grid of 10~intervals across and 5~intervals down, after
+% leaving 40mm of a border on the right and left sides, and a 20mm
+% border top and bottom.
+%
+% \subsubsection{Box margin}
+%
+% \DescribeMacro{\TPMargin}
+% By default, the box that is positioned by the
+% \Lenv{textblock} environment is a tight fit to the block of text
+% (or other material) inside it. This looks rather odd when you also
+% use the |\textblockcolour| macro described below, or specify a larger
+% than default |\TPboxrulesize|, in order to get a noticeable border
+% round a piece of text. In those cases, you will want to request a
+% non-zero margin around your text. If you give the command
+% \begin{quote}
+% |\TPMargin{|\meta{size}|}|
+% \end{quote}
+% then the block of text inside the textblock will be decreased in
+% width, enough to give the specified margin on each side. That is,
+% the \meta{hsize} of the textblock, and thus the coloured block (or
+% the edge of the displayed border), remains the same, but the text
+% width inside it decreases. The parameter \meta{size} may be any
+% non-negative dimension, and may as usual be in units of
+% |\TPHorizModule| or |\TPVertModule|. The default behaviour is
+% recovered by giving a \meta{size} of \texttt{0pt}.
+%
+% \DescribeMacro{\TPMargin*}
+% There is a starred variant of this command,
+% |\TPMargin*{|\meta{size}|}|, where the argument must again be
+% non-negative. In this case, the text block inside the box is set
+% with the \meta{hsize} specified in the \Lenv{textblock}
+% environment, but the coloured block is increased in size, such that
+% there is again a margin of the specified size around the text block.
+%
+% \subsubsection{Choosing the textblock reference point}
+%
+% You may give an optional argument to the \Lenv{textblock}
+% environment, specifying which point in the box
+% is to be placed at the specified point:
+% \begin{quote}
+% \begin{raggedright}
+% \cmd|\begin{textblock}{<hsize>}[<ho>,<vo>](<hpos>,<vpos>)|\\
+% text...\\
+% |\end{textblock}|
+% \end{raggedright}
+% \end{quote}
+% The coordinates \meta{ho} and \meta{vo} are fractions of the
+% width and height of the text box, respectively, and state that the
+% box is to be placed so that the reference
+% point (\meta{ho},\meta{vo}) within the box is to be placed at the point
+% (\meta{hpos},\meta{vpos}) on the page. The default specification is
+% [0,0], indicating the top left of the box; the argument [0,1] (for
+% example) would specify the bottom left, and [0.5,0.5] the middle.
+%
+% If the margin is non zero, then the position identified by
+% [\meta{ho},\meta{vo}] is slightly subtle:
+% \begin{itemize}
+% \item if the margin was specified with |\TPMargin|, then these
+% coordinates are relative to the box \emph{including} the margin;
+% \item if the margin was specified with |\TPMargin*|, then the
+% coordinates are relative to the contents of the \Lenv{textblock},
+% \emph{excluding} the margin.
+% \end{itemize}
+% For example, in the default case where the positioning argument is
+% [0,0], |\TPMargin| will cause the top-left of the surrounding box to
+% be at position (\meta{hpos},\meta{vpos}) (and the text to be
+% narrower), but |\TPMargin*| will cause the top left of the enclosed
+% text to be at (\meta{hpos},\meta{vpos}) (and the enclosing box to be
+% wider).
+%
+% Note: This behaviour was somewhat underspecified in versions of
+% textpos before v1.8, and in consequence inconsistently implemented.
+% The rationalisation in this version \emph{may} change documents which relied on
+% the previous behaviour.
+%
+% \begin{macro}{\TPReferencePosition}
+% As noted, the default reference position is |[0,0]|. This can be overridden
+% using the |\TPReferencePosition| command, which takes as argument
+% the reference position argument to be used for subsequent boxes.
+% Thus |\TPReferencePosition{0.5,0.5}| (note no square brackets) would
+% cause subsequent boxes to be centred on their
+% location\footnote{Thanks to an anonymous textpos user for the suggestion
+% here, which was added in v1.9
+% -- I was surprised that this functionality hadn't been present for years.}.
+% \end{macro}
+%
+% \subsubsection{Specifying textblocks with absolute sizes}
+% \label{s:textblock-absolute}
+%
+% \DescribeEnv{textblock*}
+% There is an alternative, starred, form of the \Lenv{textblock}
+% environment. In the argument to the \Lenv{textblock*} environment, the
+% block width, and the block position (but \emph{not} the
+% specification of the block reference point) are given as absolute
+% dimensions, rather than as numbers in units of the horizontal and
+% vertical modules. Thus
+% \begin{quote}
+% \begin{raggedright}
+% \cmd|\begin{textblock*}{<hsize>}[<ho>,<vo>](<hpos>,<vpos>)|\\
+% text...\\
+% \cmd|\end{textblock*}|
+% \end{raggedright}
+% \end{quote}
+% produces a textblock of the given size, where this time \meta{hsize},
+% \meta{hpos} and \meta{vpos} are absolute dimensions, but \meta{ho}
+% and \meta{vo} are still pure-number offsets (that is, fractions of the
+% width and height of the textblock), as above.
+%
+% Each \Lenv{textblock} environment takes up zero space on the page (which
+% means, by the way, that it cannot detect that it's overprinting or
+% being overprinted), so you can (and typically will) use several of
+% the environments in a row to scatter text all over the page.
+%
+% The package is compatible with the \pstyle{calc} package, so that
+% you may use calc-style expressions when specifying lengths. Thus
+% \begin{quote}
+% \begin{raggedright}
+% |\usepackage{calc}|\\
+% |\textblockorigin{56.9055pt-10mm}{0pt+1cm}|\\
+% |\begin{textblock*}{10mm+14cm}(0.3cm*5,10\TPVertModule+5mm)|\\
+% text\dots\\
+% |\end{textblock*}|\\
+% \end{raggedright}
+% \end{quote}
+% Note that you can only use calc-style expressions where you would
+% specify a length with units, such as the width and location
+% arguments of \Lenv{textblock*} or the arguments to |\textblockorigin|
+% -- you can't use them when specifying a
+% length in units of the horizontal and vertical modules, such as in
+% the width and location arguments to the (unstarred) \Lenv{textblock}
+% environment.
+%
+% \subsection{Package parameters}
+% \begin{raggedright}
+% \begin{description}
+% \item[\texttt{\bslash TPHorizModule}]
+% \DescribeMacro{\TPHorizModule}
+% The length unit which is used for the horizontal positioning and
+% size parameters of the \Lenv{textblock} environment. Set it using
+% the command \cmd|\setlength{\TPHorizModule}{<dimen>}| (or indeed
+% |\addtolength|).
+% The default is one sixteenth of the paper width.
+% \item[\texttt{\bslash TPVertModule}]
+% \DescribeMacro{\TPVertModule}
+% The length unit which is used for the vertical positioning and
+% size parameters of the \Lenv{textblock} environment. Set it using
+% the command \cmd|\setlength{\TPVertModule}{<dimen>}| (or |\addtolength|).
+% The default is one sixteenth of the paper height.
+% \item[\texttt{\bslash TPshowboxestrue} and \texttt{\bslash TPshowboxesfalse}]
+% You can control whether text blocks have the rule around them by
+% using the |\TPshowboxestrue| and |\TPshowboxesfalse| commands. The
+% \Lopt{showboxes} option simply sets the initial value of this switch.
+% \item[\texttt{\bslash TPboxrulesize}]
+% \DescribeMacro{\TPboxrulesize}
+% When you use the \Lopt{showboxes} option,
+% the lines drawn are of this width. If this too small to show up
+% when you are previewing your document, or if you simply like bold
+% frames and wish to make them a feature of your poster's design, you
+% may adjust the size using |\setlength| or |\addtolength|. The
+% default is 0.4pt. See also the |\textblockrulecolour| command.
+% Note that the \Lopt{showboxes} option is mostly conceived of as an
+% aid to layout, and so the options for customising these rules are
+% rather limited. If you wish more extensively customised boxes, then
+% you would probably be best using a package which provides specific
+% support for that, going beyond what could be usefully added to
+% textpos.\footnote{A StackOverflow discussion at
+% \url{https://tex.stackexchange.com/questions/34088/} suggests
+% packages TikZ, mdframed or tcolorbox.}
+% \item[\texttt{\bslash textblocklabel}]
+% \DescribeMacro{\textblocklabel}
+% This may be used within any \Lenv{textblock}
+% environment. It is ignored, unless the \Lopt{noshowtext} option has
+% been specified, when it will be used to label the textblock it is
+% inside. Use: |\textblocklabel{Identifying text}|.
+% \item[\texttt{\bslash showtextsize}]
+% \DescribeMacro{\showtextsize}
+% When |\textblocklabel| is being
+% shown, the text appears in size |\showtextsize|, which is
+% defined by default to be |\normalsize|. If this is too
+% small, you may adjust it using |\newcommand{\showtextsize}{\large}|, or
+% whatever size you prefer.
+% \item[\texttt{\bslash textblockorigin}]
+% \DescribeMacro{\textblockorigin}
+% Sets the position of the top-left of the
+% printable area. See above.
+% \end{description}
+% \end{raggedright}
+%
+% \DescribeMacro{\textblockcolour}
+% The text blocks can be coloured in. If you load the \pstyle{color}
+% package, then the commands of that package, |\textcolor|,
+% |\pagecolor| and the like, should work as usual. The
+% \pstyle{textpos} package adds a new command,
+% |\textblockcolour|. If you give the command
+% \begin{quote}
+% |\textblockcolour{|\meta{colour}|}|
+% \end{quote}
+% all text blocks following will have their background filled with the
+% specified colour, which must be one of the standard colours or have
+% been declared in a
+% |\definecolor| declaration in the document preamble. This colour
+% may be overridden for individual text blocks by giving this command
+% within the \Lenv{textblock} environment. If you wish a block not to
+% have any background colour, you can suppress it, again for one block
+% at a time, with the command |\textblockcolour{}| inside the
+% \Lenv{textblock} environment.
+%
+% \DescribeMacro{\textblockrulecolour}
+% You can similarly change the colour of the borders around the text
+% block. If you give the command
+% \begin{quote}
+% |\textblockrulecolour{|\meta{colour}|}|
+% \end{quote}
+% then following text blocks will have their border in the given
+% colour, which must again be either one of the standard ones of
+% declared in the document preamble.
+%
+% \DescribeMacro{\textblockcolor}
+% For the benefit of those who observe Mr.\ Noah Webster's spelling
+% reforms, |\textblockcolor| is defined as a synonym for
+% |\textblockcolour|, but those who would condemn such anaemic half measures
+% \DescribeMacro{\tekstblokkulur}
+% can use |\tekstblokkulur| instead.
+% \DescribeMacro{\textblockrulecolor}
+% \DescribeMacro{\tekstblokroolkulur}
+% There are also the corresponding spelling-reform variants of
+% |\textblockrulecolour|.
+%
+% \subsection{Figure and table environments}
+%
+% \pstyle{Textpos} changes
+% the behaviour of any \Lenv{figure} and \Lenv{table} environments
+% \emph{within} instances of the \Lenv{textblock} environment, in such
+% a way that the figure or table contents do not float away from the
+% \Lenv{textblock} environment. For the same reason, |\marginpar| is
+% forbidden within a textblock. It makes no change, however, outside
+% the environment, where figures float as normal, and you are still
+% able to use \pstyle{textblock} within figures, as described above.
+% Within a \Lenv{textblock}, these environments do nothing
+% beyond accepting the usual |\caption| command, which behaves
+% correctly with respect to caption numbering and |\label| commands
+% (it also respects |\@makecaption|, so you can tinker with that if
+% you like that sort of thing). There's no real need to use either
+% the \Lenv{figure} or \Lenv{table} environments within a textblock --
+% you don't require them to allow |\includegraphics| or \Lenv{tabular}
+% to work, for example -- but many people automatically use them to
+% surround graphics or tables, and also expect to use these
+% environments to number figures and tables within \Lenv{textblock}
+% environments; they are therefore here on a principle of least
+% surprise.
+%
+% The support here is admittedly simple, and it is known to fail in
+% the case where there are \Lenv{figure} (or \Lenv{table})
+% environments both inside and outside \Lenv{textblock}s on the same
+% page (the LoF is ordered incorrectly in this case, due to the
+% different times that the various environments write to the
+% \texttt{.lof} file). I don't have immediate plans to fix this: the
+% situation is surely sufficiently rare as not to justify the
+% (potentially fragile) complication of the fix -- if you disagree,
+% let me know.
+%
+% Since both \LaTeX's floats mechanism (that is, \Lenv{figure} and
+% \Lenv{table}) and the \Lopt{absolute} mode are designed to move
+% content around, we can't expect them to play together nicely. With
+% \Lopt{absolute} mode on, the contents of a \Lenv{textblock} inside a
+% floating \Lenv{figure} probably isn't going to end up where you
+% expect it to. The only case I can think of where this would
+% inconvenience you, is if you wanted some absolutely-positioned
+% material to appear on the `next' page. You might at first try to use
+% a |\begin{figure}[p]| -- that won't work, but the following will, if
+% you first load the \pstyle{afterpage} package:
+% \begin{verbatim}
+% \afterpage{%
+% \newpage%
+% \begin{textblock*}{297mm}(0mm,0mm)%
+% \includegraphics{picture.png}% a full-page picture?
+% \end{textblock*}%
+% \null%
+% \newpage}
+% \end{verbatim}
+% This inserts a complete page, with some graphic on it, immediately
+% after the end of the current page\footnote{Thanks to Matthias Gloede for
+% this technique.}.
+%
+% \section{Notes}
+% \subsection{Suggestions: Producing large-format posters}
+%
+% If you are producing a large-format poster, such as A0 size, you
+% might want to use Gerlinde Kettl and Matthias Weiser's \cmd|a0poster|
+% class, which painlessly deals with the miscellaneous hassles of
+% printing to a large-format postscript printer.
+%
+% I have a collection of suggestions for producing such posters at
+% \url{http://purl.org/nxg/note/posters}.
+%
+% The text on a large poster will typically use a very large font. It
+% can be a hassle to create (or have dvips create) these fonts, and
+% they take up a good deal of space on your disk. You might want to
+% investigate the BlueSky/AMS fonts (available at CTAN), which are
+% postscript versions of the Computer Modern fonts, and which can
+% therefore be scaled arbitrarily.
+%
+% \subsection{Absolute mode and $\backslash$newpage}
+% \label{absolute-newpage}
+%
+% You can sometimes get rather puzzling behaviour when you use
+% |\newpage| in absolute mode.
+%
+% When using the \Lopt{absolute} option, you will often
+% have all of the text on your page inside \Lenv{textblock}
+% environments. In this case, \TeX\ does not believe that you have
+% anything on the page at all, and so if you give a |\newpage| command
+% to start a second sheet (perhaps you have a particularly generous
+% poster space allocation at your conference, or you are filling out a
+% form), \TeX\ thinks it is redundant, and ignores it, so that all
+% your \Lenv{textblock} environments end up on just one page. To work
+% round this, use |\null\newpage| instead: the |\null| (which produces
+% a zero-width box) is enough to persuade
+% \TeX\ to respect the page-break.
+%
+% This happens for the same reason that, also quite surprisingly, two
+% |\newline| commands in a row do not produce a blank page.
+%
+% \subsection{Absolute or relative mode?}
+% \label{s:absrelmode}
+%
+% The \Lopt{absolute} mode appears to be the obvious mode to choose:
+% the positions it specifies are independent of margins, spacing and
+% other offsets, and so easier to think with. Because of the way
+% \Lopt{absolute} mode is implemented, however, it has some
+% interactions which may make \Lopt{relative} mode better in some
+% cases.
+%
+% \Lopt{absolute} mode works by inserting a \TeX\ box into a page at
+% almost the last moment before the page is finalised for output (at
+% |\shipout| time, if you're a \TeX\ afficionado). This is normally
+% robust, and in many ways it is an attractively simple solution, but
+% it may interact badly with other packages which
+% manipulate this `shipout' box, or packages which juggle or inspect
+% boxes at or just before this late stage. In particular, the Prosper
+% package manipulates the page just before this stage,
+% the Color package inserts material using |\shipout|.
+%
+% Similarly the TikZ package\marginpar{textpos \& TikZ}
+% (or at least its `externalize' support) examines the page at
+% a time which means it fails to spot the absolute-mode textpos
+% material. In the TikZ case, you can try using the
+% option |\TPoptions{discardcontent=true}| which,
+% in Textpos absolute mode, discards the contents of all
+% |{textblock}| boxes, in a way which should make it compatible with
+% TikZ. This option is \emph{experimental} in Textpos v1.9, and may
+% change or disappear in future versions -- the author would be
+% particular interested to get feedback regarding this
+% option.\footnote{My understanding of the problem here is derived from an excellent Stackoverflow answer
+% by `JLDiaz' \url{http://tex.stackexchange.com/a/66853}, a Textpos
+% bugreport by Michael H\"upkes, and a discussion on the PGF bugparade
+% \url{https://github.com/pgf-tikz/pgf/issues/393}.}
+%
+% These are discussed in a little more detail below, but in each of
+% these cases, using textpos in \Lopt{relative} mode will evade the
+% problem. This solution will work in the cases where the
+% \Lenv{textblock} environment is at a more-or-less predictable
+% location on the page.
+%
+% Textpos and Prosper\marginpar{textpos \& prosper} squabble because
+% Textpos in absolute mode places its text onto the page \emph{after}
+% Prosper has rotated the page from portrait to landscape format, so
+% that the \Lenv{textblock} contents end up at the correct position on
+% the portrait page, but the wrong position on the landscape
+% page\footnote{Thanks to Erik Van Eynde for the initial discussion of this.}.
+% Since Prosper slides start at a consistent point, however, you can fairly happily use Textpos in
+% relative mode as long as the \Lenv{textblock} environment is the
+% first thing on the slide.
+%
+% There's a similar unfortunate interaction with the \texttt{color}
+% package\marginpar{textpos \& color}. That package's |\pagecolor|
+% command, when used with
+% \texttt{pdflatex}, causes textpos absolute mode to behave
+% strangely\footnote{See the \texttt{comp.text.tex} thread `Colour in
+% a0 poster' starting 2007 April 3}. A fix may appear here in time, but
+% for the present, there are three workarounds. The first is to place
+% the |\pagecolor{...}| command before |\begin{document}|, which
+% causes the redefinitions of |\shipout| to happen in a working
+% order. If this is impossible for some reason, then (as with the
+% Prosper workaround above) you can use textpos in relative
+% mode: if the textblocks are the first printable material on the
+% page, then they're anchored at a fixed position, and you should be
+% able to use textblocks and |\pagecolor| with \texttt{pdflatex}
+% much as normal. The final possibility is to use \texttt{latex},
+% \texttt{dvips} and \texttt{ps2pdf} to produce PDF, since the
+% dvips driver happens not to have this problem\footnote{Thanks to Joris Vankerschaver
+% for the initial report, and to Heiko Oberdiek for one of the
+% workarounds}.
+%
+% \subsection{Other interactions}
+% \label{s:interactions}
+%
+% The Beamer package's\marginpar{textpos \& beamer}
+% background frame overlays the textpos material, unless the
+% \Lopt{overlay} option is used to tell textpos to delay it.
+% Therefore, you should use the \Lopt{overlay,absolute}
+% options with Beamer.\footnote{Thanks to Marius Arenz for
+% the explanation here.}
+%
+% Gabriel Zachmann suggested having Textpos put a grid on the
+% page\marginpar{page grid}, so
+% that it is easier to work out \Lenv{textblock} coordinates. I may
+% yet do this, but it may not be necessary, since Rolf Niepraschk's
+% \texttt{eso-pic} package can help you create this grid yourself.
+% There is a vivid example of using Textpos along with Rolf's
+% \texttt{eso-pic} package and the \texttt{calc} package on the
+% Textpos web pages, at
+% \url{http://purl.org/nxg/dist/textpos}, and an example of how to
+% create a grid with TikZ at \url{http://tex.stackexchange.com/a/85088/96}.
+%
+% Finally, Robert Wenner reported a problem when using Textpos along
+% with the \texttt{texdraw} package\marginpar{textpos \& texdraw}, with
+% |\move(0,0)| apparently
+% making a difference when it should be a no-op. I haven't worked out
+% what's going on here, and further reports of this, ideally with a
+% minimal example, would be most welcome.
+%
+% \subsection{Troubleshooting}
+%
+% \begin{description}
+% \item[Switching to absolute mode with \texttt{$\backslash$TPoptions} doesn't work]
+% In order for the \Lopt{absolute} mode to work anywhere, the document
+% has to be \emph{started} in absolute mode (see Sect.~\ref{s:changing-options}).
+% This is a hard-to-avoid limitation of the way that this mode is implemented.
+%
+% \item[Error: `Missing number, treated as zero']
+% If you give absolute values (that is, values with units) to the
+% \Lenv{textblock} environment, then you will be confronted with the
+% rather opaque error `Missing number, treated as zero'. Remember
+% that the \Lenv{textblock} environment requires relative sizes, and
+% the \Lenv{textblock*} environment requires sizes with units; see
+% Sect.~\ref{s:textblock-absolute}. You get a similar error message
+% if you give relative sizes to the \Lenv{textblock*} environment.
+%
+% \end{description}
+%
+% \section{History}
+% \iffalse @RELEASENOTES@ \fi
+% \begin{description}
+% \item[\textbf{1.9.1, 2019 April 15}]\relax
+%
+% \begin{itemize}
+% \item Added the |\TPReferencePosition| command, to change the
+% default reference position away from |[0,0]|.
+% \item Added the \emph{experimental}
+% |\TPoptions{discardcontent=true}| option, to improve
+% compatibility with TikZ
+% (see issue 6 in the repository\footnote{\url{https://bitbucket.org/nxg/textpos/issues/6/}}).
+% Note: \emph{This option may change or disappear in future versions}, and the author would be
+% particular interested to get feedback regarding it.
+% \item Documentation: added discussion of the implementation difference
+% between relative and absolute mode, and when one is preferable to the other.
+% \item Documentation: note that the showboxes option is intended only as
+% a basic aid to layout.
+% \item (Version 1.9 was partially released, but it contained an
+% attribution error which could be most easily fixed by a minor version bump).
+% \end{itemize}
+%
+%
+% \item[1.8, 2016 June 5]\relax
+% \begin{itemize}
+% \item Added the |\TPoptions| command, to switch modes on and
+% off within the document. Various documentation tweaks.
+% \item The behaviour of |\TPMargin| and
+% |\TPMargin*| were somewhat underspecified in versions of
+% Textpos before v1.8, and in consequence inconsistently implemented.
+% This has now been rationalised, but the change \emph{may} change
+% documents which relied on the previous behaviour.
+% Thanks to Richard Schreiber for the detailed bug report.
+% \item In this release, I switched to more conventional dotted-integer, n.m.r,
+% version numbers, from the LaTeX-style model with intermediate releases denoted by letters.
+% \end{itemize}
+%
+% \item[1.7j, 2014 January 3]\relax
+% Re-released under the LPPL.
+%
+% \item[1.7i, 2012 November 10]\relax
+% Bugfix: further change to the way the {color} package is loaded
+% (fixes issue 2); now finally fixed?
+%
+% \item[1.7h, 2012 June 1]\relax
+% Bugfix: further change to the way the {color} package is loaded.
+% Some documentation tweaks.
+% Pointers to bitbucket repository.
+%
+% \item[1.7g, 2010 September 30]\relax
+% Bugfix: change the way we handle the {color} package not being
+% loaded – replacement |\color| command is now robust.
+% Thanks to Joseph Wright for the bugreport.
+% Also adjusted documentation of reference points.
+%
+% \item[1.7f, 2009 May 28]\relax
+% The change in behaviour introduced in v1.7e is now documented (it
+% was unspecified before, and 1.7e didn't commit itself one way or the
+% other).
+%
+% \item[1.7e, 2009 March 29]\relax
+% Daniel Richard G noted that the order in which textblock contents
+% was laid down on the page was counter-intuitive, since one would
+% expect that later environments go 'on top of' earlier ones. This
+% order was unspecified before this version, but I've changed this,
+% satisfying a principle of least surprise (later ones now go 'on
+% top').
+%
+% \item[1.7d, 2007 March 30]\relax
+% Axel Sommerfeldt suggested a further alternative approach, even more
+% lightweight, and I incorporated a version of that.
+%
+% \item[1.7c, 2007 March 29]\relax
+% Giovanni Radilla reported a problem with captions, which meant that the
+% captions weren't appearing properly in the list of figures. Dan
+% Luecking and Axel Sommerfeldt analysed the problem precisely, and the
+% latter provided code which I've incorporated in this fix.
+%
+% \item[1.7b, 2007 March 21]\relax
+% Robert Whittaker reported a problem with |\TPmargin|,
+% which meant that lists and quotations (and other things which
+% manipulated |\leftskip| and |\rightskip|) were
+% not decreasing in size when you set |\TPmargin| non-zero.
+% Fixed.
+%
+% \item[1.7a, 2006 September 2]\relax
+% Version 1.7 created an inadvertant dependency on the
+% |{color}| package. Now, if you do not load that package,
+% |\textblockrulecolour| will have no effect, rather than
+% failing. Textpos will give you a warning in this case, reminding you
+% to load the |{color}| package.
+%
+% \item[\textbf{1.7, 2006 August 24}]\relax
+% Added the |\textblockrulecolour| and
+% |\TPshowboxes{true,false}| commands, to further control the
+% display of the rules around the text blocks.
+%
+% \item[1.6b, 2006 August 10]\relax
+% Minor documentation fixes
+%
+% \item[1.6a, 2005 October 13]\relax
+% The overriding of the figure and table environments now also works
+% when there is no previous environment to override.
+%
+% \item[\textbf{1.6, 2005 August 30}]\relax
+% Made |{calc}|-style dimensions to the
+% |{textblock*}| argument work again (so \emph{that's} what
+% regression tests are for...). Override the |figure| and
+% |table| environments within |textblock|
+% environments, to avoid their surprising and undesirable interaction
+% with |textblock|.
+%
+% \item[1.5b, 2005 June 13]\relax
+% The 1.5 release broke the textblock environment's optional
+% argument, controlling the position of the reference point within the
+% block. Fixed.
+%
+% \item[1.5a, 2005 March 26]\relax
+% Documentation fixes: added a section on the
+% interaction between absolute mode and LaTeX's |\newpage|
+% command.
+%
+% \item[\textbf{1.5, 2005 March 23}]\relax
+% Implement |\TPMargin| command, which causes a margin
+% to appear round the blocks of text within textblock
+% environments. This makes it easy to use blocks of colour which
+% are larger than the block of text by a decent margin, or to put a
+% border round textblocks by setting a suitably-sized margin and using
+% the |showboxes| package option.
+%
+% \item[\textbf{1.4, 2003 September 7}]\relax
+% Changes in the handling of vertical spacing; inconsistent in some
+% circumstances before. Slight (consequent) change to the algorithm
+% which ensures that material is output in absolute mode even when the
+% page is otherwise empty. See README for details. Version 1.3a will
+% remain available for some time in case these fixes break things.
+%
+% \item[1.3a, 2003 June 24]\relax
+% Added the |\textblockcolour| command, to set
+% the background colour of text blocks
+%
+% \item[\textbf{1.3, 2003 June 24}]\relax
+% (there was a release 1.3, but it was broken, and immediately
+% replaced by 1.3a)
+%
+% \item[1.2b, 2002 July 1]\relax
+% Works around a bug present in at least one package,
+% which leaves box255 holding an hbox at the wrong moment
+%
+% \item[1.2a, 2002 April 28]\relax
+% Version 1.2 had an error, which caused a confusing error
+% if you gave any fractional part in the arguments to the
+% |{textblock}| environment. This was fixed in version 1.2a,
+% which adds a |{textblock*}| environment (fully compatible
+% with |calc|), and does not attempt to support calc-style
+% expressions in the parameters to the unstarred
+% |{textblock}| environment.
+%
+% \item[\textbf{1.2, 2002 April 21}]\relax
+% Rolf Niepraschk |niepraschk@ptb.de| provided code to
+% make textpos compatible with the |calc| package
+%
+% \item[Version 1.1]\relax
+% Released in 1999
+%
+% \end{description}
+%
+% \section{Credits}
+%
+% Olaf Maibaum, \texttt{Olaf.Maibaum@informatik.uni-oldenburg.de},
+% made an elegant improvement to an earlier version of this package,
+% by producing the code which I've incorporated here as the `absolute
+% mode' (I'd had something like this before, but it was \emph{very}
+% kludgy).
+%
+% Bjoern Pedersen, \texttt{bjoern@poseidon.org.chemie.tu-muenchen.de},
+% made the excellent suggestion that the horizontal and vertical
+% modules should be independent, and provided code to implement this.
+%
+% Rolf Niepraschk, \texttt{niepraschk@ptb.de}, provided the code changes
+% which made textpos compatible with the \pstyle{calc} package.
+%
+% Wybo Dekker, \texttt{wybo@servalys.nl}, reported a problem when
+% box~255 was (erroneously) not a vbox, and passed on a fix from Hans
+% Hagen.
+%
+% Jenny Maresh and Matthias Jerg independently suggested that it would
+% be useful to specify a margin around the block of text in a
+% \Lenv{textblock} environment. That resulted in the |\TPMargin|
+% command (after an unconscionably long gestation period). Rusen Lu
+% suggested that one should be able to specify the colours of the box
+% borders, and that it would be useful to turn the bordering feature
+% on and off within the file.
+%
+% Axel Sommerfeldt provided elegant code to fix incorrect
+% behaviour of |\caption| within the \Lenv{figure} environment.
+%
+% Section~\ref{s:interactions}, above, lists numerous people who have
+% provided problem reports about the interactions between Textpos and
+% other packages, and provided suggestions for workarounds and fixes.
+%
+% The text includes footnoted thanks to various people who have made
+% (sometimes very detailed) suggestions for functionality.
+%
+% Thanks are additionally due, for general bugreports and other suggestions, to
+% Jozef Bednarcik,
+% Richard G Daniel,
+% Wolfgang Fleischer,
+% Greg Petriccione,
+% Giovanni Radilla,
+% Richard Schreiber,
+% Brian Stephanik,
+% Robert Whittaker,
+% Joseph Wright,
+% and Joachim Wuttke,
+%
+% If you've reported a bug or made a suggestion and I haven't credited
+% you here, please do accept my apologies, and please let me know.
+%
+% \section{Example}
+%
+% Here is a short example file.
+% \begin{macrocode}
+%<*example>
+\documentclass{article}
+
+\usepackage[absolute]{textpos}
+
+\setlength{\TPHorizModule}{30mm}
+\setlength{\TPVertModule}{\TPHorizModule}
+\textblockorigin{10mm}{10mm} % start everything near the top-left corner
+\setlength{\parindent}{0pt}
+
+\begin{document}
+
+\begin{textblock}{3}(0,0)
+This block is 3 modules wide, and is placed with its top left corner
+at the `origin' on the page. Note that the length of the block is not
+specified in the arguments -- the box will be as long as necessary to
+accomodate the text inside it. You need to examine the output of the
+text to adjust the positioning of the blocks on the page.
+\end{textblock}
+
+\begin{textblock}{2}(2,1)
+\textblocklabel{block two}
+Here is another, slightly narrower, block, at position (2,1) on the page.
+\end{textblock}
+
+\begin{textblock}{3}[0.5,0.5](2,3)
+This block is at position (2,3), but because the optional argument
+[0.5,0.5] has been given, it is the centre of the block which is
+located at that point, rather than the top-left corner.
+\end{textblock}
+
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{}
+
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+%
+% \subsection{Options}
+%
+% Allow the user to switch on display of boxes round the text.
+% \begin{macrocode}
+\newif\ifTPshowboxes
+\TPshowboxesfalse
+\DeclareOption{showboxes}{\TPshowboxestrue}
+% \end{macrocode}
+% \dots and switch off printing of text.
+% \begin{macrocode}
+\newif\ifTP@showtext
+\TP@showtexttrue
+\DeclareOption{noshowtext}{\TP@showtextfalse}
+% \end{macrocode}
+%
+% The user may declare that the positions given to the |\textblock|
+% environment are to be absolute on the page, rather than relative to
+% the current position. Relative mode is, and will remain, the
+% default, so the \Lopt{relative} option is redundant, but is here for symmetry.
+% \begin{macrocode}
+\newif\ifTP@abspos
+\TP@absposfalse
+\DeclareOption{absolute}{\TP@abspostrue}
+\DeclareOption{relative}{\TP@absposfalse}
+% \end{macrocode}
+%
+% When using the absolute-position mode, the holdbox is placed into
+% box~255 in front of the previous contents of box~255. This is
+% normally what you want, but if the page contents have something
+% which \emph{obscures} the hold box (for example, a block of opaque
+% colour), then the positioned textboxes disappear. In this case,
+% allow the user to specify that the holdbox is to be placed
+% \emph{after} the contents of box~255, so that it overlays it rather
+% than being overlayed.
+% \changes{v1.1c}{1999/03/22}{Added overlay option}
+% \begin{macrocode}
+\newif\ifTP@overlay
+\TP@overlayfalse
+\DeclareOption{overlay}{\TP@overlaytrue}
+% \end{macrocode}
+%
+% The package can produce some messages reporting on its progress.
+% Allow these to be turned off and on explicitly. The default is
+% (currently) on.
+% \changes{v1.2}{2002/04/21}{Added verbose and quiet options}
+% \begin{macrocode}
+\newif\ifTP@chatter
+\TP@chattertrue
+\DeclareOption{quiet}{\TP@chatterfalse}
+\DeclareOption{verbose}{\TP@chattertrue}
+% \end{macrocode}
+%
+% Define a switch to suppress holdbox processing (see |\TP@holdbox| below).
+% \begin{macrocode}
+\newif\ifTP@displayholdbox
+ \TP@displayholdboxtrue
+\DeclareOption{discardcontent}{\TP@displayholdboxfalse}
+% \end{macrocode}
+%
+% That's it. Now process the options and get on with it.
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+%
+% \subsection{Required Packages}
+%
+% To manipulate |\box255|, this package needs the package
+% \texttt{everyshi}, which provides the command |\EveryShipout|.
+% \begin{macrocode}
+\ifTP@abspos
+ \RequirePackage{everyshi}
+\fi
+\RequirePackage{keyval}
+% \end{macrocode}
+%
+% \subsection{Changing options within the text}
+%
+% Define a |\TPoptions| macro which supports constructions like |\TPoptions{verbose=true}|.
+% \begin{macrocode}
+\define@key{tp}{absolute}{\csname TP@abspos#1\endcsname}
+\define@key{tp}{overlay}{\csname TP@overlay#1\endcsname}
+\define@key{tp}{verbose}{\csname TP@chatter#1\endcsname}
+\define@key{tp}{showboxes}{\csname TPshowboxes#1\endcsname}
+\define@key{tp}{showtext}{\csname TP@showtext#1\endcsname}
+\define@key{tp}{discardcontent}{\csname @tempswa#1\endcsname
+ \if@tempswa\TP@displayholdboxfalse\else\TP@displayholdboxtrue\fi}
+\def\TPoptions{\setkeys{tp}}
+% \end{macrocode}
+%
+% \subsection{Other initialisation}
+%
+% Handle floats. The following definition of |\TP@xfloat| will be
+% used to redefine |\@xfloat| within textblocks. It has the same
+% `interface' as |\@xfloat| -- and in particular, it sets |\@captype|,
+% so that |\caption| will still work -- except that it ignores any
+% placement specifiers, and doesn't put anything into the |\@currbox|.
+% Thus nothing will actually float from here, and thus float out of the
+% textblock.
+%
+% We have to open a box, and set |\@floatpenalty|, because
+% |\end@float| expects to close a box; and we don't want to redefine
+% |\end@float| because that would required us to redefine
+% |\end@dblfloat| as well. Redefine |\@xympar| to throw an error:
+% this means that |\marginpar| is forbidden inside textblocks. Hmm,
+% it also means that it's forbidden even within a minipage -- is that
+% a bad thing?
+% \changes{1.6a}{2005/10/13}{remove superfluous definitions of thefigure}
+% \changes{1.7c}{2007/03/29}{fix caption handling -- code from Axel Sommerfeldt}
+% \changes{1.7d}{2007/03/30}{further figure fixes, building on more Axel suggestions}
+% \begin{macrocode}
+\def\TP@xfloat#1[#2]{
+ \par\def\@captype{#1}%
+ \@floatpenalty\z@
+ \color@vbox
+ \normalcolor
+ \vbox\bgroup
+}
+\def\TP@xympar{
+ \PackageError{textpos}
+ {You can't use \protect\marginpar\space within a textblock}
+ {You're using textpos because you _don't_ want things to float around, yes?}}
+% \end{macrocode}
+%
+% \subsection{The box handling starts here}
+% The text we set will be put into the box |\TP@textbox|.
+% \begin{macrocode}
+\newbox\TP@textbox
+% \end{macrocode}
+% When the package is invoked in `absolute' mode, the contents of
+% |\TP@textbox| are not shipped out immediately, but instead put into the box
+% |\TP@holdbox|, which holds the boxes until the page as a whole is
+% shipped out (these additions contributed by Olaf Maibaum).
+% \changes{v1.1}{1999/02/22}{Introduce holdbox, and absolute/relative modes}
+%
+% Define the holdbox only in the `absolute positioning' mode.
+% \begin{macrocode}
+\ifTP@abspos
+ \newbox\TP@holdbox % starts off void
+% \end{macrocode}
+%
+% \TeX\ does not call the output routine if there is nothing on the
+% page. To deal with this situation, add code to the end-document
+% hook to add a zero-size hbox on the page if |\TP@holdbox| is
+% non-empty; the page is no longer empty, so the output routine must
+% be called at some point. The alternative is to add such an hbox at
+% the end of every textblock, when in absolute mode. That solves
+% this problem, but introduces others by interfering with vertical spacing.
+% (thanks to Bjoern Pedersen for diagnosing this in an old version
+% of textpos).
+% \begin{macrocode}
+ \AtEndDocument{\ifTP@displayholdbox\ifvoid\TP@holdbox \else \hbox{}\fi\fi}
+\fi
+% \end{macrocode}
+% All the dimensions (except the optional argument of the textblock
+% environment) are in terms of the modules |\TPHorizModule| and
+% |\TPVertModule|.
+% \changes{v1.1}{1999/02/22}{Distinguish horizontal and vertical modules}
+% \begin{macrocode}
+\newdimen\TPHorizModule
+\newdimen\TPVertModule
+% \end{macrocode}
+%
+% \begin{macro}{\TPMargin}
+% Macro |\TPMargin| specifies the amount of space left between the
+% box, as positioned by the \texttt{textblock}, and the enclosed
+% text. The argument is a dimension, which may as usual be given in
+% units of |\TP*Module|. We signal this to the rest of this package
+% by making |\TP@margin| positive (we demand that the argument is
+% positive). The companion dimension |\TP@absmargin| is just the
+% absolute value of |\TP@margin|, for convenience.
+% \begin{macrocode}
+\newdimen\TP@margin
+\TP@margin=0pt
+\newdimen\TP@absmargin
+\TP@absmargin=0pt
+\newcommand{\TPMargin}{%
+ \@ifstar\TPMargin@outer\TPMargin@inner
+}
+\newcommand{\TPMargin@inner}[1]{%
+ \TP@margin=#1\relax
+ \ifdim\TP@margin < 0pt
+ \PackageError{textpos}
+ {\protect\TPMargin\space must have a positive argument}
+ {\protect\TPMargin\space must have a positive argument}
+ \fi
+ \TP@absmargin=\TP@margin
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TPMargin*}
+% Partnered to this, the |\TPMargin*| command also specifies a margin
+% between the text and its enclosing box, but this time the
+% \emph{text} is at the position specified by the \texttt{textblock},
+% and the box, delimited either by a line or by a panel of colour,
+% extends outside this position by an amount specified in the argument
+% to this macro. We signal this to the rest of this package by making
+% the margin negative.
+% \begin{macrocode}
+\newcommand\TPMargin@outer[1]{%
+ \TP@margin=-#1\relax
+ \ifdim\TP@margin > 0pt
+ \PackageError{textpos}
+ {\protect\TPMargin*\space must have a positive argument}
+ {\protect\TPMargin*\space must have a positive argument}
+ \fi
+ \TP@absmargin=-\TP@margin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TPGrid}
+% Rather than declare the modules to be specific sizes, they can be
+% declared to be proportions of the paper size. The command
+% |\TPGrid{16}{10}| would declare the horizontal module to be a
+% sixteenth of the paper size, and the vertical one to be a tenth of
+% the paper height. Set the textblockorigin if the optional arguments
+% were provided.
+% \changes{v1.1c}{1999/03/09}{Add optional argument to TPGrid}
+% \begin{macrocode}
+\def\TPGrid{%
+ \@ifnextchar[{\@tempswatrue\TP@Grid}{\@tempswafalse\TP@Grid[0pt,0pt]}}
+\def\TP@Grid[#1,#2]#3#4{
+ \setlength{\@tempdima}{#1}
+ \multiply\@tempdima by 2
+ \TPHorizModule=\paperwidth
+ \advance\TPHorizModule by -\@tempdima
+ \divide\TPHorizModule by #3
+ \setlength{\@tempdima}{#2}
+ \multiply\@tempdima by 2
+ \TPVertModule=\paperheight
+ \advance\TPVertModule by -\@tempdima
+ \divide\TPVertModule by #4
+ \ifTP@chatter
+ \typeout{Grid set #3 x #4 = \the\TPHorizModule\space x \the\TPVertModule}%
+ \fi
+ \ifTP@abspos\if@tempswa \textblockorigin{#1}{#2}\fi\fi
+}
+% \end{macrocode}
+% \end{macro}
+% And use this to initialise initialise the modules to a suitable
+% default -- one sixteenth of the paper width and height.
+% \begin{macrocode}
+\TPGrid{16}{16}
+% \end{macrocode}
+%
+% The rules round the boxes are of width |\TPboxrulesize|, and the
+% label text within them is |\normalsize|. For the colour, see
+% |\textblockrulecolour|.
+% \begin{macrocode}
+\newdimen\TPboxrulesize
+\setlength{\TPboxrulesize}{0.4pt}
+\def\showtextsize{\normalsize}
+% \end{macrocode}
+%
+% \begin{macro}{\textblockorigin}
+% If we're producing a single page of text, it can be convenient to
+% set an origin. This command may only be used in absolute mode.
+%
+% First, we need two dimensions, to hold the position of the origin.
+% These are relative to the top-left corner of the page, so we need to
+% shift them by (1in,1in) to make them relative to the \TeX\ origin.
+% \begin{macrocode}
+\ifTP@abspos
+ \newdimen\TP@ox
+ \newdimen\TP@oy
+\fi
+% \end{macrocode}
+% The |\textblockorigin| command sets the origin of the page. It may
+% only be called if the package was loaded with the \Lopt{absolute}
+% option, so output an error message if that's not the case.
+% \begin{macrocode}
+\def\textblockorigin#1#2{%
+ \ifTP@abspos
+ \TP@ox=-1in \addtolength\TP@ox{#1}
+ \TP@oy=-1in \addtolength\TP@oy{#2}
+ \ifTP@chatter\typeout{TextBlockOrigin set to #1 x #2}\fi
+ \else
+ \PackageError{textpos}
+ {The \protect\textblockorigin\space command\MessageBreak
+ may only be used if the package was given\MessageBreak
+ the`absolute' option when it was invoked}
+ {If you want to use the \protect\textblockorigin\space command, then
+ \MessageBreak
+ invoke the package with the syntax\MessageBreak
+ \protect\usepackage[absolute]{textpos}}
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textblocklabel}
+% When we're only displaying rules boxes, instead of the text contents
+% of the blocks, it's useful to be able to identify which block is
+% which. The contents of |\textblocklabel| are ignored except when
+% the \Lopt{noshowtext} option has been used.
+% \begin{macrocode}
+\def\textblocklabel#1{\gdef\TP@textblocklabel{#1}}
+% (should I use \@bsphack...\@esphack for this?)
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textblockcolour}
+% \changes{v1.3}{2003/06/25}{Add textblockcolour}
+% \changes{v1.3a}{2003/06/25}{Fix textblockcolour so it works when {color} not loaded}
+% \begin{macrocode}
+\def\textblockcolour#1{%
+ \@ifundefined{color}%
+ {\PackageWarning{textpos}{command textblockcolour used,\MessageBreak
+ but {color} package not loaded.\MessageBreak
+ Colour changes ignored.}}
+ {\gdef\TP@blockcolour{#1}
+ \ifx\TP@defaultblockcolour\@undefined
+ \gdef\TP@defaultblockcolour{#1}
+ \fi
+ }}
+\def\TP@blockcolour{} % safe initial default
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textblockcolor}
+% Add a synonym for those who follow Webster's half-hearted spelling reforms.
+% \begin{macrocode}
+\let\textblockcolor\textblockcolour
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tekstblokkulur}
+% \dots and one for the hard-core reformers, too.
+% \begin{macrocode}
+\let\tekstblokkulur\textblockcolour
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textblockrulecolour}
+% We select the colour of the box rules using |\color| (since v1.7).
+% However we don't want to depend on the `color' package, so if we're
+% showing box rules, and so would be selecting box colours, then give
+% a warning but do not fail. Note the faking of that package's
+% commands below.
+% \changes{v1.7}{2006/08/24}{Add textblockrulecolour}
+% \begin{macrocode}
+\def\textblockrulecolour#1{%
+ \@ifundefined{color}%
+ {\PackageWarning{textpos}{command textblockrulecolour used,\MessageBreak
+ but {color} package not loaded.\MessageBreak
+ Colour changes ignored.}}
+ {\gdef\TP@rulecolour{#1}}}
+\def\TP@rulecolour{black}
+% \end{macrocode}
+% Plus spelling-reform variants:
+% \begin{macrocode}
+\let\textblockrulecolor\textblockrulecolour
+\let\tekstblokroolkulur\textblockrulecolour
+% \end{macrocode}
+% \end{macro}
+%
+% We don't want to create a dependency on the \pstyle{color} package,
+% so we shouldn't fail if that package isn't loaded. Don't check that
+% here, since the document, or another package, may load the color
+% package later. Instead, define a command which will create dummy
+% no-op definitions for the package commands we use, and invoke this
+% just before we invoke any of the color package's commands (see above
+% for usage).
+% \begin{macrocode}
+\gdef\TP@color[#1]#2{}
+\def\TP@checkdummycolorpackage{%
+ \@ifundefined{color}%
+ {\globaldefs=1
+ \DeclareRobustCommand\color[2][]{}%
+ \def\color@block##1##2##3{}%
+ \globaldefs=0 }{}%
+ \global\let\TP@checkdummycolorpackage\relax % don't come here again
+}
+% \end{macrocode}
+%
+% Default the reference position, and support the command to override it.
+% \begin{macrocode}
+\def\TP@referenceposition{0,0}
+\def\TPReferencePosition#1{\def\TP@referenceposition{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\textblock}
+% Now define the start of the textblock environment. Read the first
+% argument, and save it for the moment as |\@tempdima|. If we are
+% not in vertical mode, then issue a |\par| to make us so. The
+% environment is documented to create this paragraph break in this
+% case, so we don't neet to warn the user about this.
+% Then call |\TP@textblock| to read the remaining arguments and start
+% off the |\vbox| the body text will be set in.
+% \changes{v1.1}{1999/02/22}{Add par here, to put us back into vertical mode}
+% \changes{v1.4}{2003/09/05}{Remove warning about par}
+% \begin{macrocode}
+\def\textblock#1{%
+ \@tempdima=#1\TPHorizModule
+ \ifvmode\else
+ \ifmmode
+ \PackageError{textpos}
+ {You cannot use textblock in maths mode}
+ {You may use the textblock environment only in \MessageBreak
+ vertical mode or horizontal mode (when it triggers a\MessageBreak
+ new paragraph). You cannot use it in maths mode.}
+ \else % in horizontal mode
+ \par % force us back into vertical mode
+ \fi
+ \fi
+ \@ifnextchar[{\TP@textblock}{\expandafter\TP@textblock\expandafter[\TP@referenceposition]}%] bracematch
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textblock*}
+% |\begin{textblock*}| is a variant of |\begin{textblock}| which takes
+% absolute values for its arguments. It uses |\setlength| throughout,
+% and is therefore compatible with the \pstyle{calc} package.
+% \changes{1.2a}{2002/04/28}{Added textblock* env}
+% \begin{macrocode}
+\def\TP@textblockstar#1{%
+ \setlength{\@tempdima}{#1}
+ \ifvmode\else
+ \PackageWarning{textpos}{environment textblock* not in vertical mode.
+ \MessageBreak
+ Environment textblock* should not have any text\MessageBreak
+ or printable material appearing before it.\MessageBreak
+ Alignment may work out wrongly.}%
+ \par % force us back into vertical mode
+ \fi
+ \@ifnextchar[{\TP@textblock}{\expandafter\TP@textblock\expandafter[\TP@referenceposition]}%] bracematch
+}
+\expandafter\let\csname textblock*\endcsname\TP@textblockstar
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TP@textblock}
+% Command |\TP@textblock| saves all its arguments in a token list, for
+% use in |\TP@endtextblock| later, then it starts a vbox. Arguments~1
+% and~2 are the coordinates of the reference point, as proportions of
+% the box's horizontal and vertical size, and arguments~3 and~4 are
+% the position of the box in units of the horizontal and vertical modules.
+% \begin{macrocode}
+\newtoks\TP@tbargs
+\def\TP@textblock[#1,#2](#3,#4){%
+ \TP@tbargs={{#1}{#2}{#3}{#4}}%
+% \end{macrocode}
+%
+% Now (re)define |\@xfloat| and |\@xympar| to be the stub ones defined
+% above. Do this in all cases, even those where the |\figure|
+% environment is not defined: if there's no figure environment, this
+% will end up otiose rather than wrong, plus this will cope with the
+% rather peculiar case where there are some floats defined
+% \emph{other} than |\figure|.
+% \begin{macrocode}
+ \let\@xfloat\TP@xfloat
+ \let\@xympar\TP@xympar
+% \end{macrocode}
+%
+% Start the |\TP@textbox|, which contains the contents of the textblock.
+% Below, let the `textblock' refer to the block of text inside this
+% box, and `specwidth' the width provided as argument to the
+% \Lenv{textblock} environment.
+% \begin{macrocode}
+ \setbox\TP@textbox=\vbox\bgroup
+% \end{macrocode}
+% If we're showing boxes, then draw a rule here
+% \begin{macrocode}
+ \ifTPshowboxes
+ \TP@checkdummycolorpackage
+ {\color{\TP@rulecolour}\hrule height0pt depth \TPboxrulesize }%
+ \vskip-\TPboxrulesize
+ \fi
+% \end{macrocode}
+% Cases:
+% \begin{itemize}
+% \item When |\TP@margin| is zero, then `specwidth', the width of the
+% `textblock', and the actual width of |\TP@textbox|, are all equal.
+% \item When |\TP@margin| is positive, then `specwidth' is the width
+% of |\TP@textbox|, and the `textblock' is narrower (and shorter) than
+% this by a margin |\TP@margin| all round (|\hsize| is `specwidth'
+% minus 2|\TP@margin|).
+% \item When |\TP@margin| is negative, then `specwidth' is the width
+% of the `textblock' (|\hsize| is `specwidth'), and |\TP@textbox| is
+% wider than this by minus |\TP@margin|.
+% \end{itemize}
+% Here, when |\TP@margin| is non-zero, we set the `textblock' inside a
+% box of appropriate |\hsize|, and put that inside the |\TP@textbox|,
+% spaced appropriately (this seems more robust than using
+% left- and rightskip, which some environment redefine).
+% \changes{v1.7b}{2007/03/21}{Fixed lists inside boxes with non-zero margins}
+% \begin{macrocode}
+ \ifdim\TP@margin = 0pt
+ \hsize=\@tempdima
+ \textwidth\hsize \columnwidth\hsize \linewidth\hsize
+ \else
+ \vskip\TP@absmargin
+ \@tempdimb=\@tempdima % \@tempdimb is outer box width
+ \hsize=\@tempdima % \hsize is inner box width
+ \ifdim\TP@margin < 0pt
+ \advance\@tempdimb by 2\TP@absmargin % bigger box
+ \else
+ \advance\hsize by -2\TP@absmargin % narrower content
+ \fi
+ \hbox to \@tempdimb\bgroup
+ \hskip\TP@absmargin\vbox\bgroup
+ \textwidth\hsize \columnwidth\hsize \linewidth\hsize
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endtextblock}
+% \begin{macro}{\endtextblock*}
+% We have two slight variants of the end-block code, depending on
+% whether we're in a |{textblock}| or a |{textblock*}| environment.
+% The |\if@tempswa| set here is tested below, in |\TP@endtextblock|.
+% \changes{1.2a}{2002/04/28}{Added commonendtextblock, and starred variant}
+% \begin{macrocode}
+\def\endtextblock{\global\@tempswatrue\TP@commonendtextblock}
+\@namedef{endtextblock*}{\global\@tempswafalse\TP@commonendtextblock}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\TP@commonendtextblock}
+% At the end of the environment, draw the matching horizontal rule
+% (if we're showing boxes),
+% and finish off the vbox begun in |\TP@textblock|. Then call
+% |\TP@endtextblock| with the arguments we saved in the token register
+% in |\TP@tbargs|.
+%
+% To manipulate the spacing around textblocks, we want to save the
+% |\prevdepth| quantity in |\TP@prevdepth|.
+% \begin{macrocode}
+\newdimen\TP@prevdepth
+% \end{macrocode}
+%
+% Now we can handle the end of the textblock. When |\TP@margin| is
+% non-zero, include a final skip which is the size of the absolute
+% value of this margin.
+% \begin{macrocode}
+\def\TP@commonendtextblock{%
+ \ifdim\TP@margin = 0pt
+ \relax
+ \else
+ \egroup % end of inner vbox
+ \hskip\TP@absmargin % (just \hfil would work here, too)
+ \egroup % end of inner hbox
+ \vskip\TP@absmargin
+ \fi
+ \ifTPshowboxes
+ \vskip-\TPboxrulesize
+ {\color{\TP@rulecolour}\hrule depth 0pt height \TPboxrulesize}%
+ \fi
+ \egroup % end of \TP@textbox
+% \end{macrocode}
+%
+% Control vertical spacing: we need to avoid causing the
+% insertion of more space in the case where this \texttt{textblock} is
+% between paragraphs of text. Save the |\prevdepth|, then set it to
+% $-1000pt$, suppressing interline glue; then add the zero-size vbox;
+% then restore |\prevdepth| to what it was before. See the discussion
+% of interline glue (ie, |\baselineskip| and |\prevdepth|) in
+% Chapter~12 (p.~80) of the \TeX book (thanks to Peter M\"unster
+% \texttt{<peter@univ-rennes1.fr>} for spotting that I'd got this
+% wrong in the previous version).
+% \changes{v1.1e}{2001/04/29}{Replace randomly-placed nointerline skip with prevdepth acrobatics, to avoid spacing misfeatures}
+% \changes{v1.4}{2003/09/05}{Improve prevdepth calculations, adding TP@prevdepth}
+% \begin{macrocode}
+ \TP@prevdepth=\prevdepth
+ \prevdepth=-1000pt % = \nointerlineskip
+% \end{macrocode}
+% Finally, call |\TP@endtextblock| to do the work of putting the text
+% on the page, directly or indirectly.
+% \begin{macrocode}
+ \expandafter\TP@endtextblock\the\TP@tbargs
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TP@endtextblock}
+% This is where most of the calculations are. Set temporary dimensions
+% a and b to be the coordinates (again, in units of the modules), and
+% then adjust them by subtracting the position of the `reference point'
+% given by parameters~1 and~2. These dimensions are pure numbers,
+% fractions of the width and height, respectively, of the text block.
+% Parameters~3 and~4 indicate where the reference point will be
+% positioned. In the unstarred case (|\if@tempswa| true), these are
+% pure numbers, indicating dimensions in units of the |\TPHorizModule|
+% and |\TPVertModule| respectively; in the starred case (|\if@tempswa|
+% false), they're dimensions.
+%
+% Position the box |\TP@textbox|, which was build up between
+% |\TP@textblock| and |\endtextblock|, at (x,y)=|(#3,#4)|.
+% The point that is so positioned is at |(#1\wd,#2\ht)| of
+% |\TP@textbox|, so that |(#1,#2)| =(0,0) means top left.
+%
+% If we're in the absolute-position mode, then we need to make further
+% adjustments to these dimensions.
+%
+% Below, |\@tempdima| and |\@tempdimb| are the $x$- and
+% $y$-coordinates of the framebox.
+% \changes{v1.5b}{2005/06/13}{Fixed control of reference point, broken in 1.5}
+% First, we set these coordinates to be |(#3,#4)|.
+% \begin{macrocode}
+\def\TP@endtextblock#1#2#3#4{%
+ \if@tempswa % modular/unstarred endtextblock
+ \@tempdima=#3\TPHorizModule
+ \@tempdimb=#4\TPVertModule
+ \else % absolute/starred endtextblock
+ \setlength{\@tempdima}{#3}
+ \setlength{\@tempdimb}{#4}
+ \fi
+% \end{macrocode}
+% Next, we adjust them so that the position |(#1,#2)| is at this
+% coordinate. The |\TP@textbox| is the box including the lines
+% \emph{and} margin.
+%
+% Case 1: |\TP@margin| is negative: the `textblock' is `specwidth'
+% wide, and box |\TP@textbox| is wider and deeper than
+% the `specwidth', by |\TP@margin| all round; we want the position
+% |(#1,#2)| to be fractions of the textblock size, not |\TP@textbox|
+% \begin{macrocode}
+ \ifdim\TP@margin < 0pt
+ \advance\@tempdima \TP@margin
+ \advance\@tempdimb \TP@margin
+ \@tempdimc=\wd\TP@textbox
+ \advance\@tempdimc 2\TP@margin % now \@tempdimc is width of textblock
+ \multiply\@tempdimc #1
+ \advance\@tempdima -\@tempdimc
+ \@tempdimc=\ht\TP@textbox
+ \advance\@tempdimc 2\TP@margin % now \@tempdimc is height of textblock
+ \multiply\@tempdimc #2
+ \advance\@tempdimb -\@tempdimc
+% \end{macrocode}
+% Case 2: |\TP@margin| is positive or zero: the |\TP@textbox| is
+% `specwidth' in width; the text inside the box is
+% narrower than this width; the coordinates |(#1,#2)| are
+% fractions of |\TP@textbox| size (ie, `specwidth').
+% \begin{macrocode}
+ \else
+ \@tempdimc=#1\wd\TP@textbox
+ \advance\@tempdima -\@tempdimc
+ \@tempdimc=#2\ht\TP@textbox
+ \advance\@tempdimb -\@tempdimc
+ \fi
+% \end{macrocode}
+% FInally, shift the origin if we're in absolute-positioning mode.
+% \begin{macrocode}
+ \ifTP@abspos
+ \advance\@tempdima by \TP@ox
+ \advance\@tempdimb by \TP@oy
+ \fi
+% \end{macrocode}
+% Then create an hbox inside a vbox, both of size 0pt, in each case
+% with the contents prefixed by a skip of the appropriate size, and
+% suffixed by |\hss| or |\vss| respectively. Put the result into the
+% temporary box~0
+% \changes{v1.3}{2003/06/25}{Add colouring of textblocks}
+% \begin{macrocode}
+ \setbox0=\vbox to 0pt{\vskip\@tempdimb
+ \hbox to 0pt{\hskip\@tempdima
+ \ifx\TP@blockcolour\@empty \else
+ {\TP@checkdummycolorpackage
+ \color{\TP@blockcolour}%
+ \color@block{\wd\TP@textbox}{\ht\TP@textbox}{\dp\TP@textbox}%
+ }%
+ \fi
+ \ifx\TP@defaultblockcolour\@undefined \else
+ \global\let\TP@blockcolour\TP@defaultblockcolour
+ \fi
+ \ifTPshowboxes
+ {\color{\TP@rulecolour}\vrule width \TPboxrulesize}%
+ \hskip -\TPboxrulesize
+ \fi
+ \ifTP@showtext
+ \box\TP@textbox
+ \else
+ \vbox to\ht\TP@textbox{%
+ \ifTPshowboxes
+ {\color{\TP@rulecolour}\hrule depth 0pt height \TPboxrulesize \vskip-\TPboxrulesize}%
+ \fi
+ \vskip\smallskipamount
+ \hbox to\wd\TP@textbox{%
+ \ifx\TP@textblocklabel\undefined
+ \hbox{}%
+ \else
+ \hskip\smallskipamount
+ \fbox{\showtextsize \TP@textblocklabel}%
+ \global\let\TP@textblocklabel\undefined
+ \fi
+ \hss
+ }%
+ \vss
+ \ifTPshowboxes
+ \vskip -\TPboxrulesize
+ {\color{\TP@rulecolour}\hrule depth 0pt height \TPboxrulesize}%
+ \fi
+ }%
+ \fi
+ \ifTPshowboxes
+ \hskip -\TPboxrulesize
+ {\color{\TP@rulecolour}\vrule width \TPboxrulesize}%
+ \fi
+ \hss}%
+ \vss
+ }% end of box0
+% \end{macrocode}
+%
+% \subsection{Sending the boxes to the output}
+%
+% Now switch behaviour depending on whether or not we're in the
+% absolute-position mode. If we are, then add the newly-constructed
+% box 0 to (the end of) the holdbox. The order matters in some
+% (many?, all?) circumstances, since this way means that later
+% textblock environments go `on top of' earlier ones, which is
+% generally more intuitive. I \emph{think} this would be true for all
+% drivers. Does this have some interaction with the \Lopt{overlay}
+% option, and if so, should it be coupled to that? I haven't
+% documented this one way or the other, and I think that ambiguity is
+% probably useful.
+% \begin{macrocode}
+ \ifTP@abspos
+ \global\setbox\TP@holdbox\vbox{%
+ \unvbox\TP@holdbox
+ \box0
+ }%
+% \end{macrocode}
+% Else, place the box on the page immediately, and restore the value
+% of the quantity |\prevdepth| to what it was before we started
+% accumulating material for the textblock. This will mean (a) that
+% we can list several textblock environments one after another, and have them
+% all offset from the same point, and (b) that we are invisible with
+% respect to any |\parskip| or |\baselineskip| calculations that were
+% relevant at the time we started the textblock.
+% \begin{macrocode}
+ \else
+ \box0
+ \prevdepth=\TP@prevdepth
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% Finally, and only if we are in the absolute-position mode, set up
+% the output routine with |\EveryShipout|, and set the textblockorigin
+% to the (default) upper-left corner of the paper. Respect the
+% \Lopt{overlay} option by putting the |\TP@holdbox| contents
+% \emph{after} the |\@cclv| contents, putting the latter into a size-0
+% box (could this cause a problem with spacing? I don't think so, at
+% this stage).
+%
+% Box 255 should be either a vbox or void (see \TeX Book pp.~125
+% or~253), but if it is an hbox, because some package has misbehaved,
+% then we ought to try not to simply collapse. Work round this by
+% testing explicitly whether box~255 is a vbox or not.
+% If |\ifTP@displayholdbox| is false, then both of these should be no-ops.
+% \changes{v1.2b}{2002/07/01}{Defend against box 255 not being a vbox}
+% \begin{macrocode}
+\ifTP@abspos
+ \ifTP@overlay
+ \EveryShipout{\ifTP@displayholdbox
+ \global\setbox\@cclv\vbox{%
+ \vbox to 0pt{\ifvbox\@cclv \unvbox\@cclv \else \box\@cclv \fi \vss}%
+ \unvbox\TP@holdbox % TP@holdbox is now void
+ }%
+ \fi}%
+ \else
+ \EveryShipout{\ifTP@displayholdbox
+ \global\setbox\@cclv\vbox{%
+ \unvbox\TP@holdbox
+ \ifvbox\@cclv \unvbox\@cclv \else \box\@cclv \fi
+ }%
+ \fi}%
+ \fi
+ \textblockorigin{0pt}{0pt}%
+\fi
+% \end{macrocode}
+% Done!
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/textpos/textpos.html b/macros/latex/contrib/textpos/textpos.html
new file mode 100644
index 0000000000..eec9629d6b
--- /dev/null
+++ b/macros/latex/contrib/textpos/textpos.html
@@ -0,0 +1,254 @@
+<?xml version="1.0"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head profile="http://dublincore.org/documents/dcq-html/">
+<title>Textpos</title>
+<meta name="DC.subject" content="latex, textpos, absolute positioning"/>
+<meta name="DC.title" content="Textpos"/>
+<meta name="DC.date" content="2019-04-15"/>
+<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"/>
+<link href="https://nxg.me.uk/norman" rev="author"/>
+<link type="text/css" rel="stylesheet" href="style.css"/>
+</head>
+
+<body>
+<h1>Textpos</h1>
+<div class="abstract">
+<p>Lay out text and graphics at arbitrary positions on the LaTeX page.</p>
+
+<p>
+
+<span class="distpage">The textpos home page is at
+<a href="http://purl.org/nxg/dist/textpos"><code>http://purl.org/nxg/dist/textpos</code></a>;</span>
+please quote this URL rather than the URL it resolves to.</p>
+<p>Version 1.9.1, 2019 April 15.</p>
+</div>
+
+<p>This package facilitates placing boxes at absolute positions on the
+LaTeX page. There are several reasons why this might be useful, but
+the main one (or at least my motivating one) is to help produce a
+large-format conference poster. Other applications include placing
+material within, say, figures. Textpos is also discussed in the <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=abspos">TeX FAQ
+entry on absolute positioning</a>.</p>
+
+<p>This package provides a single environment, which contains the text
+(or graphics, or table, or whatever) which is to be placed on the
+page, and which specifies where it is to be placed. The environment
+is accompanied by various configuration commands. See the <a href="textpos.pdf">manual (pdf)</a>.</p>
+
+<p>An article describing Textpos appeared in TUGboat in 2002:
+<a href="http://www.tug.org/TUGboat/tb23-3-4/tb75gray.pdf">Norman Gray, <em>Absolute Positioning with Textpos</em>,
+TUGboat <strong>23</strong> (3/4), pp341–4, 2002.</a></p>
+
+<p>I have a collection of general advice about <a href="http://purl.org/nxg/note/posters">creating
+conference posters with LaTeX</a>.</p>
+
+<p>Rolf Niepraschk provided me with a wonderful demo
+(<a href="niepraschk-eso-pic.tex">tex</a>,
+<a href="niepraschk-eso-pic.pdf">pdf</a>)
+of using Textpos along with his <code>eso-pic</code> package,
+and the <code>calc</code> package, to produce a grid which can help lay out
+material on the page.</p>
+
+<p>The source is held at
+<a href="https://bitbucket.org/nxg/textpos">bitbucket</a>,
+and there is an issues list there, for bug reports.</p>
+
+
+<div class="distpage">
+ <h2>Installation and further information</h2>
+</div>
+
+<ol>
+
+
+
+<li>Run LaTeX on the file <code>textpos.ins</code> – this will
+unpack the style file <code>textpos.sty</code> amongst other files.
+Place this somewhere where TeX can find it.</li>
+
+<li>Run LaTeX on the file <code>textpos.dtx</code> to obtain the
+documentation.</li>
+</ol>
+
+<p class="distpage">The <code>textpos</code> home page is at <a href="http://purl.org/nxg/dist/textpos"><code>http://purl.org/nxg/dist/textpos</code></a>, and there may be more up-to-date versions available there.</p>
+
+<p><code>Textpos</code> is also available on CTAN:
+<a href="https://www.ctan.org/pkg/textpos">macros/latex/contrib/textpos/</a></p>
+
+
+
+<h2>History</h2>
+
+<dl>
+<dt><strong>1.9.1, 2019 April 15</strong></dt>
+<dd>
+<ul>
+<li>Added the <code>\TPReferencePosition</code> command, to change the
+default reference position away from <code>[0,0]</code>.</li>
+<li>Added the <em>experimental</em>
+<code>\TPoptions{discardcontent=true}</code> option, to improve
+compatibility with TikZ
+(see <a href="https://bitbucket.org/nxg/textpos/issues/6/">issue 6 in the repository</a>).
+Note: <em>This option may change or disappear in future versions</em>, and the author would be
+particular interested to get feedback regarding it.</li>
+<li>Documentation: added discussion of the implementation difference
+between relative and absolute mode, and when one is preferable to the other.</li>
+<li>Documentation: note that the showboxes option is intended only as
+a basic aid to layout.</li>
+<li>(Version 1.9 was partially released, but it contained an
+attribution error which could be most easily fixed by a minor version bump).</li>
+</ul>
+</dd>
+
+<dt>1.8, 2016 June 5</dt>
+<dd><ul>
+<li>Added the <code>\TPoptions</code> command, to switch modes on and
+off within the document. Various documentation tweaks.</li>
+<li>The behaviour of <code>\TPMargin</code> and
+<code>\TPMargin*</code> were somewhat underspecified in versions of
+Textpos before v1.8, and in consequence inconsistently implemented.
+This has now been rationalised, but the change <em>may</em> change
+documents which relied on the previous behaviour.
+Thanks to Richard Schreiber for the detailed bug report.</li>
+<li>In this release, I switched to more conventional dotted-integer, n.m.r,
+version numbers, from the LaTeX-style model with intermediate releases denoted by letters.</li>
+</ul></dd>
+
+<dt>1.7j, 2014 January 3</dt>
+<dd>Re-released under the LPPL.</dd>
+
+<dt>1.7i, 2012 November 10</dt>
+<dd>Bugfix: further change to the way the {color} package is loaded
+(fixes issue 2); now finally fixed?</dd>
+
+<dt>1.7h, 2012 June 1</dt>
+<dd>Bugfix: further change to the way the {color} package is loaded.
+Some documentation tweaks.
+Pointers to bitbucket repository.</dd>
+
+<dt>1.7g, 2010 September 30</dt>
+<dd>Bugfix: change the way we handle the {color} package not being
+loaded – replacement <code>\color</code> command is now robust.
+Thanks to Joseph Wright for the bugreport.
+Also adjusted documentation of reference points.</dd>
+
+<dt>1.7f, 2009 May 28</dt>
+<dd>The change in behaviour introduced in v1.7e is now documented (it
+was unspecified before, and 1.7e didn't commit itself one way or the
+other).</dd>
+
+<dt>1.7e, 2009 March 29</dt>
+<dd>Daniel Richard G noted that the order in which textblock contents
+was laid down on the page was counter-intuitive, since one would
+expect that later environments go 'on top of' earlier ones. This
+order was unspecified before this version, but I've changed this,
+satisfying a principle of least surprise (later ones now go 'on
+top').</dd>
+
+<dt>1.7d, 2007 March 30</dt>
+<dd>Axel Sommerfeldt suggested a further alternative approach, even more
+lightweight, and I incorporated a version of that.</dd>
+
+<dt>1.7c, 2007 March 29</dt>
+<dd>Giovanni Radilla reported a problem with captions, which meant that the
+captions weren't appearing properly in the list of figures. Dan
+Luecking and Axel Sommerfeldt analysed the problem precisely, and the
+latter provided code which I've incorporated in this fix.</dd>
+
+<dt>1.7b, 2007 March 21</dt>
+<dd>Robert Whittaker reported a problem with <code>\TPmargin</code>,
+which meant that lists and quotations (and other things which
+manipulated <code>\leftskip</code> and <code>\rightskip</code>) were
+not decreasing in size when you set <code>\TPmargin</code> non-zero.
+Fixed.</dd>
+
+<dt>1.7a, 2006 September 2</dt>
+<dd>Version 1.7 created an inadvertant dependency on the
+<code>{color}</code> package. Now, if you do not load that package,
+<code>\textblockrulecolour</code> will have no effect, rather than
+failing. Textpos will give you a warning in this case, reminding you
+to load the <code>{color}</code> package.</dd>
+
+<dt><strong>1.7, 2006 August 24</strong></dt>
+<dd>Added the <code>\textblockrulecolour</code> and
+<code>\TPshowboxes{true,false}</code> commands, to further control the
+display of the rules around the text blocks.</dd>
+
+<dt>1.6b, 2006 August 10</dt>
+<dd>Minor documentation fixes</dd>
+
+<dt>1.6a, 2005 October 13</dt>
+<dd>The overriding of the figure and table environments now also works
+when there is no previous environment to override.</dd>
+
+<dt><strong>1.6, 2005 August 30</strong></dt>
+<dd>Made <code>{calc}</code>-style dimensions to the
+<code>{textblock*}</code> argument work again (so <em>that's</em> what
+regression tests are for...). Override the <code>figure</code> and
+<code>table</code> environments within <code>textblock</code>
+environments, to avoid their surprising and undesirable interaction
+with <code>textblock</code>.</dd>
+
+<dt>1.5b, 2005 June 13</dt>
+<dd>The 1.5 release broke the textblock environment's optional
+argument, controlling the position of the reference point within the
+block. Fixed.</dd>
+
+<dt>1.5a, 2005 March 26</dt>
+<dd>Documentation fixes: added a section on the
+interaction between absolute mode and LaTeX's <code>\newpage</code>
+command.</dd>
+
+<dt><strong>1.5, 2005 March 23</strong></dt>
+<dd>Implement <code>\TPMargin</code> command, which causes a margin
+to appear round the blocks of text within textblock
+environments. This makes it easy to use blocks of colour which
+are larger than the block of text by a decent margin, or to put a
+border round textblocks by setting a suitably-sized margin and using
+the <code>showboxes</code> package option.</dd>
+
+<dt><strong>1.4, 2003 September 7</strong></dt>
+<dd>Changes in the handling of vertical spacing; inconsistent in some
+circumstances before. Slight (consequent) change to the algorithm
+which ensures that material is output in absolute mode even when the
+page is otherwise empty. See README for details. Version 1.3a will
+remain available for some time in case these fixes break things.</dd>
+
+<dt>1.3a, 2003 June 24</dt>
+<dd>Added the <code>\textblockcolour</code> command, to set
+the background colour of text blocks</dd>
+
+<dt><strong>1.3, 2003 June 24</strong></dt>
+<dd>(there was a release 1.3, but it was broken, and immediately
+replaced by 1.3a)</dd>
+
+<dt>1.2b, 2002 July 1</dt>
+<dd>Works around a bug present in at least one package,
+which leaves box255 holding an hbox at the wrong moment</dd>
+
+<dt>1.2a, 2002 April 28</dt>
+<dd>Version 1.2 had an error, which caused a confusing error
+if you gave any fractional part in the arguments to the
+<code>{textblock}</code> environment. This was fixed in version 1.2a,
+which adds a <code>{textblock*}</code> environment (fully compatible
+with <code>calc</code>), and does not attempt to support calc-style
+expressions in the parameters to the unstarred
+<code>{textblock}</code> environment.</dd>
+
+<dt><strong>1.2, 2002 April 21</strong></dt>
+<dd>Rolf Niepraschk <code>niepraschk@ptb.de</code> provided code to
+make textpos compatible with the <code>calc</code> package</dd>
+
+<dt>Version 1.1</dt>
+<dd>Released in 1999</dd>
+
+</dl>
+
+
+<div class="signature">
+<a href="http://nxg.me.uk">Norman Gray</a><br/>
+2019 April 15
+</div>
+
+</body>
+</html>
diff --git a/macros/latex/contrib/textpos/textpos.ins b/macros/latex/contrib/textpos/textpos.ins
new file mode 100644
index 0000000000..3934773993
--- /dev/null
+++ b/macros/latex/contrib/textpos/textpos.ins
@@ -0,0 +1,15 @@
+\input docstrip
+\preamble
+ Textpos: absolute positioning of text on the page
+\endpreamble
+\keepsilent
+\askforoverwritefalse
+
+\generate{\file{textpos.drv}{\from{textpos.dtx}{driver}}
+ \file{textpos.sty}{\from{textpos.dtx}{package}}
+ \file{textpos-example.tex}{\from{textpos.dtx}{example}}
+ }
+
+\endbatchfile
+
+%% $Id$
diff --git a/macros/latex/contrib/textpos/textpos.pdf b/macros/latex/contrib/textpos/textpos.pdf
new file mode 100644
index 0000000000..88e65fbcea
--- /dev/null
+++ b/macros/latex/contrib/textpos/textpos.pdf
Binary files differ