summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/textpos/README26
-rw-r--r--Master/texmf-dist/doc/latex/textpos/VERSION-1.101
-rw-r--r--Master/texmf-dist/doc/latex/textpos/VERSION-1.9.11
-rw-r--r--Master/texmf-dist/doc/latex/textpos/examples/t1.tex24
-rw-r--r--Master/texmf-dist/doc/latex/textpos/examples/t11.tex90
-rw-r--r--Master/texmf-dist/doc/latex/textpos/niepraschk-eso-pic.pdfbin37258 -> 37246 bytes
-rw-r--r--Master/texmf-dist/doc/latex/textpos/textpos-example.tex8
-rw-r--r--Master/texmf-dist/doc/latex/textpos/textpos.html81
-rw-r--r--Master/texmf-dist/doc/latex/textpos/textpos.pdfbin262834 -> 278433 bytes
-rw-r--r--Master/texmf-dist/source/latex/textpos/textpos.drv19
-rw-r--r--Master/texmf-dist/source/latex/textpos/textpos.dtx353
-rw-r--r--Master/texmf-dist/tex/latex/textpos/textpos.sty139
12 files changed, 525 insertions, 217 deletions
diff --git a/Master/texmf-dist/doc/latex/textpos/README b/Master/texmf-dist/doc/latex/textpos/README
index 47e5085aadc..c5a09cef8a2 100644
--- a/Master/texmf-dist/doc/latex/textpos/README
+++ b/Master/texmf-dist/doc/latex/textpos/README
@@ -1,8 +1,7 @@
-
Textpos: absolute positioning of text on the LaTeX page
--------------------------------------------------------
+=======================================================
-Version 1.9.1, 2019 April 15
+Version 1.10, 2020 September 26
This package facilitates placing boxes at absolute positions on the
LaTeX page. There are several reasons why this might be useful, but
@@ -15,34 +14,33 @@ 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.
+Textpos has a canonical home page at <http://purl.org/nxg/dist/textpos>.
+The CTAN URL for Textpos is <https://ctan.org/pkg/textpos>.
+The source is hosted at [code.nxg.name](https://code.nxg.name/nxg/tex/textpos).
-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.
+For the change history, see textpos.html.
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>).
+Download or find the file `textpos.sty`. Install `textpos.sty` somewhere
+LaTeX will find it (see [the TeX FAQ](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>.
+[everyshi][everyshi]. You will need to download this package from CTAN first.
Licence
-------
-This software is copyright, 1999-2019, Norman Gray.
+This software is copyright, 1999-2020, 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
+<https://nxg.me.uk>
[lppl]: http://www.latex-project.org/lppl.txt
+[everyshi]: https://www.ctan.org/pkg/everyshi
diff --git a/Master/texmf-dist/doc/latex/textpos/VERSION-1.10 b/Master/texmf-dist/doc/latex/textpos/VERSION-1.10
new file mode 100644
index 00000000000..8414910cfad
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/textpos/VERSION-1.10
@@ -0,0 +1 @@
+textpos-1.10, released 2020 September 26
diff --git a/Master/texmf-dist/doc/latex/textpos/VERSION-1.9.1 b/Master/texmf-dist/doc/latex/textpos/VERSION-1.9.1
deleted file mode 100644
index 8c18834dd52..00000000000
--- a/Master/texmf-dist/doc/latex/textpos/VERSION-1.9.1
+++ /dev/null
@@ -1 +0,0 @@
-textpos-1.9.1, released 2019 April 15
diff --git a/Master/texmf-dist/doc/latex/textpos/examples/t1.tex b/Master/texmf-dist/doc/latex/textpos/examples/t1.tex
index 8cb8bfc45ff..9ec75f092d7 100644
--- a/Master/texmf-dist/doc/latex/textpos/examples/t1.tex
+++ b/Master/texmf-dist/doc/latex/textpos/examples/t1.tex
@@ -14,16 +14,7 @@
\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}
+\TPShowGrid{4}{4}
\begin{textblock}{3}(0,0)
\{3\}(0,0)
@@ -38,6 +29,19 @@
\{3\}[0.5,0.5](3,3)
\end{textblock}
+\begin{textblock}{1}[0,0](4,2)
+[0,0]
+\end{textblock}
+\begin{textblock}{1}[0,1](4,2)
+[0,1]
+\end{textblock}
+\begin{textblock}{1}[1,0](4,2)
+[1,0]
+\end{textblock}
+\begin{textblock}{1}[1,1](4,2)
+\hfill [1,1] % push this to the right of the box
+\end{textblock}
+
\begin{textblock}{2.5}(3,3)
\{2.5\}(3,3)
\end{textblock}
diff --git a/Master/texmf-dist/doc/latex/textpos/examples/t11.tex b/Master/texmf-dist/doc/latex/textpos/examples/t11.tex
new file mode 100644
index 00000000000..e07c3572b06
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/textpos/examples/t11.tex
@@ -0,0 +1,90 @@
+%%% Testing: textblock in horizontal mode
+%
+% In textpos up to 1.9.1, a textblock in horizontal mode, with the
+% [absolute] option, worked, in the sense of not failing, but produced
+% ugly spacing, because in generating a `\par` it messed up
+% inter-paragraph spacing. This had the result that the text either
+% side of the textblock appeared as separate paragraphs with no space
+% between them. The appearance in [relative] mode was OK, but with
+% the `\par` visible. This isn't a _bug_, since the documentation
+% didn't say anything other than that a `\par` is inserted at this
+% point, but it's not pretty.
+
+\documentclass{article}
+
+\parindent=0pt
+\baselineskip=12pt
+
+\usepackage[absolute]{textpos}
+\usepackage{color}
+
+\definecolor{Blue}{rgb}{0.9,0.9,1.0}
+\definecolor{Red}{rgb}{1.0,0.5,0.5}
+\textblockcolour{Blue}
+
+% Make the textblock contents, and size, stand out
+\def\content#1{\noindent
+ \textcolor{Red}{\hbox to 1em{%
+ \vrule height 9pt depth 3pt width 2pt %12 pt total
+ \hss
+ \vrule width 2pt }\relax
+ #1}}
+
+\begin{document}
+
+\TPoptions{absolute=false}
+
+Line 1. Line 1a. % no descenders on this line
+% The sentence space between these should be the same as between these
+% and 1bis
+\begin{textblock}{5}(0,0)
+\content{Relative, hmode}
+\end{textblock}
+Line \smash{1bis, preceded by sentence space}. % \smash, to ensure line has zero depth
+
+Line 2 should be the usual baseline from 1.
+
+\vskip 1cm
+
+Line 3.
+
+\begin{textblock}{5}(0,0)
+\content{Relative, vmode}
+\end{textblock}
+
+Line 4.
+
+Line 5 should be separated from line 4 by the same baseline as 4 from~3.
+
+Line 6. Line 6a.
+\begin{textblock*}{10cm}(0mm,0mm)
+\content{Relative, hmode, star.}
+\end{textblock*}
+Line \smash{6bis, preceded by sentence space.}
+
+Line 7. With second sentence.
+
+\begin{textblock*}{10cm}(0mm,0mm)
+\content{Relative, vmode, star.}
+\end{textblock*}
+
+Line 8 should be separated from 7 by the usual baseline.
+
+\newpage
+\TPoptions{absolute=true}
+
+Line 9. Line 9a.
+\begin{textblock}{5}(0,0)
+\content{Absolute 1}
+\end{textblock}
+Line 9bis, preceded by sentence space. % the smash doesn't matter in absolute mode
+
+Line 10.
+
+\begin{textblock*}{5cm}(0mm,10mm)
+\content{Absolute 2}
+\end{textblock*}
+
+Line 11 should be separated from 10 by the usual baseline.
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/textpos/niepraschk-eso-pic.pdf b/Master/texmf-dist/doc/latex/textpos/niepraschk-eso-pic.pdf
index 791fa57b849..64b976a71df 100644
--- a/Master/texmf-dist/doc/latex/textpos/niepraschk-eso-pic.pdf
+++ b/Master/texmf-dist/doc/latex/textpos/niepraschk-eso-pic.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/textpos/textpos-example.tex b/Master/texmf-dist/doc/latex/textpos/textpos-example.tex
index 2e8cb70547f..212238b5849 100644
--- a/Master/texmf-dist/doc/latex/textpos/textpos-example.tex
+++ b/Master/texmf-dist/doc/latex/textpos/textpos-example.tex
@@ -7,7 +7,7 @@
%% textpos.dtx (with options: `example')
%% Textpos: absolute positioning of text on the page
%%%% File: textpos.dtx
-%%%% Copyright 1999-2019, Norman Gray
+%%%% Copyright 1999-2020, Norman Gray
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -19,17 +19,17 @@
%%
%% This work has the LPPL maintenance status `maintained'.
%%
-%% The Current Maintainer of this work is Norman Gray <http://nxg.me.uk>
+%% The Current Maintainer of this work is Norman Gray <https://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.
+%% Author: Norman Gray, gray@nxg.name
%% 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
+%% Mercurial ident: c834991c867a (1.10+1), 2020-09-26 17:44 +0100
%%
\documentclass{article}
diff --git a/Master/texmf-dist/doc/latex/textpos/textpos.html b/Master/texmf-dist/doc/latex/textpos/textpos.html
index eec9629d6b5..9688d6417e5 100644
--- a/Master/texmf-dist/doc/latex/textpos/textpos.html
+++ b/Master/texmf-dist/doc/latex/textpos/textpos.html
@@ -1,26 +1,25 @@
-<?xml version="1.0"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head profile="http://dublincore.org/documents/dcq-html/">
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dcterms="http://purl.org/dc/terms/">
+<head>
<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"/>
+<meta property="dcterms:subject" content="latex, textpos, absolute positioning"/>
+
+<meta property="dcterms:date" content="2020-09-26"/>
+<link href="https://nxg.me.uk/norman" rev="author" rel="dcterms:creator"/>
+
</head>
<body>
-<h1>Textpos</h1>
+<h1 property="dcterms:title">Textpos</h1>
<div class="abstract">
-<p>Lay out text and graphics at arbitrary positions on the LaTeX page.</p>
+<p property="dcterms:description">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>
+<p class="distpage">The textpos home page is at
+<a href="http://purl.org/nxg/dist/textpos"><code>https://purl.org/nxg/dist/textpos</code></a>;
please quote this URL rather than the URL it resolves to.</p>
-<p>Version 1.9.1, 2019 April 15.</p>
+<p>Version 1.10, 2020 September 26.</p>
</div>
<p>This package facilitates placing boxes at absolute positions on the
@@ -49,14 +48,15 @@ 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>
+<p class="distpage">The source is held
+<a href="https://code.nxg.name/nxg/tex/textpos">online</a></p>
+
+
-<div class="distpage">
- <h2>Installation and further information</h2>
-</div>
+
+
+<h2 class="distpage">Installation and further information</h2>
<ol>
@@ -80,7 +80,40 @@ documentation.</li>
<h2>History</h2>
<dl>
-<dt><strong>1.9.1, 2019 April 15</strong></dt>
+<dt><strong>1.10, 2020 September 26</strong></dt>
+<dd>
+<ul>
+<li>Use the <em>ltshipout</em> package to place boxes in absolute mode.
+Therefore the package should now be compatible with LaTeX3.
+Many thanks to Ulrike Fischer for guidance on the changes which were required here.</li>
+<li>The code has moved from bitbucket.org to
+<a href="https://code.nxg.name/nxg/tex/textpos/">code.nxg.name</a>,
+since bitbucket have closed down support for Mercurial. The
+outstanding issues have been preserved, but have not (yet) been
+migrated to a new system, so may become inaccessible.</li>
+</ul>
+</dd>
+
+<dt>1.10b1, 2020 January 26</dt>
+<dd>
+<ul>
+<li>Add the <code>\TPShowGrid</code> macro.</li>
+<li>Become invisible in horizontal mode.
+<em>Note: this is a change in behaviour:</em>
+Before this the behaviour of the package in horizontal
+mode was deliberately somewhat underspecified (with an intended
+implication of ‘don't do this’), and the package, for want of anything
+more imaginative to do, simply threw in a paragraph break, which
+produced ugly spacing in some circumstances. As a result of
+<a href="https://tex.stackexchange.com/questions/525453/">user
+feedback</a>, from version 1.10 it seemed reasonable to try a little
+harder to be invisible in the horizontal case
+(see <a href="https://bitbucket.org/nxg/textpos/issues/16/">issue 16</a>).</li>
+<li>Various documentation improvements.</li>
+</ul>
+</dd>
+
+<dt>1.9.1, 2019 April 15</dt>
<dd>
<ul>
<li>Added the <code>\TPReferencePosition</code> command, to change the
@@ -246,8 +279,8 @@ make textpos compatible with the <code>calc</code> package</dd>
<div class="signature">
-<a href="http://nxg.me.uk">Norman Gray</a><br/>
-2019 April 15
+<a href="https://nxg.me.uk">Norman Gray</a><br/>
+2020 September 26
</div>
</body>
diff --git a/Master/texmf-dist/doc/latex/textpos/textpos.pdf b/Master/texmf-dist/doc/latex/textpos/textpos.pdf
index 88e65fbcea3..ea21daab343 100644
--- a/Master/texmf-dist/doc/latex/textpos/textpos.pdf
+++ b/Master/texmf-dist/doc/latex/textpos/textpos.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/textpos/textpos.drv b/Master/texmf-dist/source/latex/textpos/textpos.drv
index c77cc9eb131..331d0176495 100644
--- a/Master/texmf-dist/source/latex/textpos/textpos.drv
+++ b/Master/texmf-dist/source/latex/textpos/textpos.drv
@@ -7,7 +7,7 @@
%% textpos.dtx (with options: `driver')
%% Textpos: absolute positioning of text on the page
%%%% File: textpos.dtx
-%%%% Copyright 1999-2019, Norman Gray
+%%%% Copyright 1999-2020, Norman Gray
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -19,36 +19,37 @@
%%
%% This work has the LPPL maintenance status `maintained'.
%%
-%% The Current Maintainer of this work is Norman Gray <http://nxg.me.uk>
+%% The Current Maintainer of this work is Norman Gray <https://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.
+%% Author: Norman Gray, gray@nxg.name
%% 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
+%% Mercurial ident: c834991c867a (1.10+1), 2020-09-26 17:44 +0100
%%
\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.
+\author{Norman Gray\\(\texttt{https://nxg.me.uk})}
+\date{Version 1.10, 2020 September 26\footnote{Mercurial ident: c834991c867a (1.10+1), 2020-09-26 17:44 +0100.
+This software is copyright, 1999-2020 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\Lcount[1]{\textsl{\small#1}}
\newcommand\Lenv[1]{\texttt{\{#1\}}}
-\newcommand\pstyle[1]{\textsl {#1}}
+\newcommand\pstyle[1]{\textsf{#1}}
\makeatletter % make the ttfamily font less overbearingly large
\renewcommand\ttfamily{\not@math@alphabet\ttfamily\mathtt
\fontfamily\ttdefault
\fontsize{9}{\f@baselineskip}\selectfont}
\makeatother
+\def\LaTeXiie{\LaTeX$2\epsilon$}
\def\activemeta#1>{\meta{#1}}
{\catcode`\<=\active
\gdef\cmd{\begingroup
diff --git a/Master/texmf-dist/source/latex/textpos/textpos.dtx b/Master/texmf-dist/source/latex/textpos/textpos.dtx
index 7be07003894..7b43236da42 100644
--- a/Master/texmf-dist/source/latex/textpos/textpos.dtx
+++ b/Master/texmf-dist/source/latex/textpos/textpos.dtx
@@ -3,7 +3,7 @@
% anywhere on the LaTeX page. It's useful for posters.
%
%%%% File: textpos.dtx
-%%%% Copyright 1999-2019, Norman Gray
+%%%% Copyright 1999-2020, Norman Gray
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -15,41 +15,42 @@
%%
%% This work has the LPPL maintenance status `maintained'.
%%
-%% The Current Maintainer of this work is Norman Gray <http://nxg.me.uk>
+%% The Current Maintainer of this work is Norman Gray <https://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.
+%% Author: Norman Gray, gray@nxg.name
%% 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
+%% Mercurial ident: c834991c867a (1.10+1), 2020-09-26 17:44 +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}
+%<+package>\ProvidesPackage{textpos}[2020/09/26 v1.10]
+%<+package>\typeout{Package: textpos 2020/09/26 1.10, 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.
+\author{Norman Gray\\(\texttt{https://nxg.me.uk})}
+\date{Version 1.10, 2020 September 26\footnote{Mercurial ident: c834991c867a (1.10+1), 2020-09-26 17:44 +0100.
+This software is copyright, 1999-2020 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\Lcount[1]{\textsl{\small#1}}
\newcommand\Lenv[1]{\texttt{\{#1\}}}
-\newcommand\pstyle[1]{\textsl {#1}}
+\newcommand\pstyle[1]{\textsf{#1}}
\makeatletter % make the ttfamily font less overbearingly large
\renewcommand\ttfamily{\not@math@alphabet\ttfamily\mathtt
\fontfamily\ttdefault
\fontsize{9}{\f@baselineskip}\selectfont}
\makeatother
+\def\LaTeXiie{\LaTeX$2\epsilon$}
% Make command strings easier to write
\def\activemeta#1>{\meta{#1}}
{\catcode`\<=\active
@@ -114,15 +115,17 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% 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{}
+% \emph{If it is running in \LaTeXiie} (as opposed to the newer \LaTeX3),
+% this package requires the services of Martin Schr\"oder's package \pstyle{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
+% The source is held at \url{https://code.nxg.name/nxg/tex/textpos}.
+% \iffalse and there is an issues list there, for bug reports.\fi
+% 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
@@ -219,13 +222,21 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% 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!).
+% vertical mode. It can also be called in horizontal (ie, paragraph)
+% mode. In each case, it should be invisible, in the sense of having
+% no effect on the spacing of the paragraph text.\footnote{Note:
+% \emph{this is a change} in version
+% 1.10. Before then the behaviour of the package in horizontal
+% mode was deliberately somewhat underspecified (with an intended
+% implication of `don't do this'), and the package, for want of anything
+% more imaginative to do, simply threw in a paragraph break. As a
+% result of user feedback, from version 1.10 it seemed reasonable to try
+% a little harder to be invisible in the horizontal case.}
+% If called in horizontal mode (in \TeX\ terms), the relative-mode
+% `anchor point' is just below the box containing the current line (it
+% uses |\vadjust|, if that helps).
+% If you try to use the environment when in maths mode, the package
+% objects.
%
% \subsection{Package options}
% \label{packopts}
@@ -234,7 +245,14 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% \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.
+% fitting closely round the contents of each \Lenv{textblock} environment.
+% Note that this option is
+% intended to help locate boxes on the page when composing a document,
+% and the boxes are not intended to be decorative. However the
+% \Lenv{textblock} environment is compatible with (for example) the
+% \pstyle{tcolorbox} package, in the sense that you can
+% include a \Lenv{tcolorbox} environment within a \Lenv{textblock}
+% environment, with the expected effect\footnote{See also \url{https://tex.stackexchange.com/questions/34088/}.}.
% \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,
@@ -290,7 +308,8 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% \subsubsection{Setting up a positioning grid}
%
% \DescribeMacro{\TPGrid}
-% You will often wish to set up a grid on your page. Rather than
+% The dimensions |\TPHorizModule| and |\TPVertModule| implicitly
+% create a positioning grid on the 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
@@ -317,6 +336,16 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% leaving 40mm of a border on the right and left sides, and a 20mm
% border top and bottom.
%
+% \DescribeMacro{\TPShowGrid}
+% Note that this sets up a notional layout grid for the page or, put
+% another way, it sets the module units with respect to which the
+% |(<hpos>,<vpos>)| coordinates are interpreted, but it
+% does not actually draw a grid on the page. To display the grid, use
+% the |\TPShowGrid{<nhoriz>}{<nvert>}| macro. This has a starred
+% variant, which additionally shows the coordinates at each grid
+% point. You should do this near the beginning of your file.
+% For an alternative approach, see Sect.~\ref{s:interactions}.
+%
% \subsubsection{Box margin}
%
% \DescribeMacro{\TPMargin}
@@ -445,6 +474,9 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% the width and location arguments to the (unstarred) \Lenv{textblock}
% environment.
%
+% With the unstarred \Lenv{textblock} environment, however, you will generally be able to
+% use the |\fpeval| command of the `xfp' package.\footnote{https://ctan.org/pkg/xfp}
+%
% \subsection{Package parameters}
% \begin{raggedright}
% \begin{description}
@@ -454,7 +486,8 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% 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.
+% The default is one sixteenth of the paper width
+% (ie, as if set up with |\TPGrid{16}{16}|).
% \item[\texttt{\bslash TPVertModule}]
% \DescribeMacro{\TPVertModule}
% The length unit which is used for the vertical positioning and
@@ -719,10 +752,11 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
%
% 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
+% that it is easier to work out \Lenv{textblock} coordinates. I have
+% (finally, in 1.10) followed this suggestion, in the |\TPShowGrid| macro, but
+% another approach to doing this, which may have further useful
+% flexibility, is to use Rolf Niepraschk's
+% \texttt{eso-pic} package. 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
@@ -757,7 +791,40 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% \section{History}
% \iffalse @RELEASENOTES@ \fi
% \begin{description}
-% \item[\textbf{1.9.1, 2019 April 15}]\relax
+% \item[\textbf{1.10, 2020 September 26}]\relax
+%
+% \begin{itemize}
+% \item Use the \emph{ltshipout} package to place boxes in absolute mode.
+% Therefore the package should now be compatible with LaTeX3.
+% Many thanks to Ulrike Fischer for guidance on the changes which were required here.
+% \item The code has moved from bitbucket.org to
+% code.nxg.name\footnote{\url{https://code.nxg.name/nxg/tex/textpos/}},
+% since bitbucket have closed down support for Mercurial. The
+% outstanding issues have been preserved, but have not (yet) been
+% migrated to a new system, so may become inaccessible.
+% \end{itemize}
+%
+%
+% \item[1.10b1, 2020 January 26]\relax
+%
+% \begin{itemize}
+% \item Add the |\TPShowGrid| macro.
+% \item Become invisible in horizontal mode.
+% \emph{Note: this is a change in behaviour:}
+% Before this the behaviour of the package in horizontal
+% mode was deliberately somewhat underspecified (with an intended
+% implication of ‘don't do this’), and the package, for want of anything
+% more imaginative to do, simply threw in a paragraph break, which
+% produced ugly spacing in some circumstances. As a result of
+% user
+% feedback\footnote{\url{https://tex.stackexchange.com/questions/525453/}}, from version 1.10 it seemed reasonable to try a little
+% harder to be invisible in the horizontal case
+% (see issue 16\footnote{\url{https://bitbucket.org/nxg/textpos/issues/16/}}).
+% \item Various documentation improvements.
+% \end{itemize}
+%
+%
+% \item[1.9.1, 2019 April 15]\relax
%
% \begin{itemize}
% \item Added the |\TPReferencePosition| command, to change the
@@ -958,6 +1025,9 @@ The latest version of this license is at \texttt{http://www.latex-project.org/lp
% The text includes footnoted thanks to various people who have made
% (sometimes very detailed) suggestions for functionality.
%
+% Ulrike Fischer provided detailed guidance on the changes required to
+% make \pstyle{textpos} compatible with \LaTeX3.
+%
% Thanks are additionally due, for general bugreports and other suggestions, to
% Jozef Bednarcik,
% Richard G Daniel,
@@ -1084,13 +1154,33 @@ located at that point, rather than the top-left corner.
\ProcessOptions
% \end{macrocode}
%
+% \subsection{\LaTeX3/\LaTeXiie\ compatibility}
+%
+% This code aims to be compatible with both \LaTeXiie\ and \LaTeX3. This
+% means that it must use the \pstyle{everyshi} package in the \LaTeXiie\
+% case, and can use the corresponding built-in \LaTeX3 mechanism otherwise.
+% For documentation on the latter, see the `ltshipout' package documentation.
+%
+% There are a couple of places in where we must switch behaviour.
+% Conditionalise them with a single switch.
+% \begin{macrocode}
+\newif\ifTP@Liii
+\@ifl@t@r\fmtversion{2020/10/01}\TP@Liiitrue\TP@Liiifalse
+\PackageInfo{textpos}{choosing support for \ifTP@Liii LaTeX3\else LaTeX2e\fi}
+% \end{macrocode}
+%
% \subsection{Required Packages}
%
-% To manipulate |\box255|, this package needs the package
-% \texttt{everyshi}, which provides the command |\EveryShipout|.
+% To manipulate |\box255| when using \LaTeXiie,
+% this package needs the package
+% \pstyle{everyshi}, which provides the command |\EveryShipout|.
% \begin{macrocode}
-\ifTP@abspos
- \RequirePackage{everyshi}
+\ifTP@Liii
+ % avoid everyshi package
+\else
+ \ifTP@abspos
+ \RequirePackage{everyshi}
+ \fi
\fi
\RequirePackage{keyval}
% \end{macrocode}
@@ -1151,9 +1241,15 @@ located at that point, rather than the top-left corner.
% 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).
+% shipped out.\footnote{These additions contributed by Olaf Maibaum}
% \changes{v1.1}{1999/02/22}{Introduce holdbox, and absolute/relative modes}
%
+% Add a flag which is used to recall the vertical/horizontal mode in
+% which the textblock is prepared.
+% \begin{macrocode}
+\newif\ifTP@vmode
+% \end{macrocode}
+%
% Define the holdbox only in the `absolute positioning' mode.
% \begin{macrocode}
\ifTP@abspos
@@ -1166,9 +1262,8 @@ located at that point, rather than the top-left corner.
% 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).
+% this problem, but introduces others by interfering with vertical
+% spacing.\footnote{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
@@ -1274,6 +1369,39 @@ located at that point, rather than the top-left corner.
\def\showtextsize{\normalsize}
% \end{macrocode}
%
+% In order to make it easy to visualise the grid, the
+% |\TPShowGrid| macro displays it on the page. There's a starred
+% version, which shows the coordinates, and an unstarred version,
+% which doesn't.
+% \begin{macrocode}
+\def\TPShowGrid{\@ifstar{\@tempswatrue\@TPShowGrid}{\@tempswafalse\@TPShowGrid}}
+% \end{macrocode}
+% And the implementation
+% \begin{macrocode}
+\def\@TPShowGrid#1#2{
+ \begin{textblock}{#1}(0,0)
+ \lineskip=0pt % abut boxes directly
+ \setbox0=\hbox{(0)}%
+ \@tempdima=\TPVertModule
+ \advance\@tempdima -1.1\ht0
+ \@tempcnta=0
+ \hrule
+ \loop
+ \vbox to \TPVertModule{\noindent
+ \@tempcntb=0
+ \vrule
+ \loop
+ \hbox to \TPHorizModule{%
+ \if@tempswa\raise\@tempdima\hbox{(\the\@tempcntb,\the\@tempcnta)}\fi
+ \hfil \vrule height \TPVertModule}%
+ \advance\@tempcntb 1
+ \ifnum\@tempcntb<#1 \repeat
+ \vss \hrule}
+ \advance\@tempcnta 1
+ \ifnum\@tempcnta<#2 \repeat
+ \end{textblock}}
+% \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.
@@ -1412,22 +1540,10 @@ located at that point, rather than the top-left corner.
% \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
+ \TP@begintextblock
}
% \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,
@@ -1435,20 +1551,32 @@ located at that point, rather than the top-left corner.
% \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
+ \setlength{\@tempdima}{#1}%
+ \TP@begintextblock
}
\expandafter\let\csname textblock*\endcsname\TP@textblockstar
% \end{macrocode}
% \end{macro}
+% Common code for |textblock| and |textblock*|.
+% \begin{macrocode}
+\def\TP@begintextblock{%
+ \ifvmode
+ \TP@vmodetrue
+ \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. You cannot use it in maths mode.}
+ \else % in horizontal mode
+ \TP@vmodefalse
+ \@bsphack
+ \unskip
+ \fi
+ \fi
+ \@ifnextchar[{\TP@textblock}{\expandafter\TP@textblock\expandafter[\TP@referenceposition]}%] bracematch
+}
+% \end{macrocode}
%
% \begin{macro}{\TP@textblock}
% Command |\TP@textblock| saves all its arguments in a token list, for
@@ -1522,7 +1650,7 @@ located at that point, rather than the top-left corner.
\hskip\TP@absmargin\vbox\bgroup
\textwidth\hsize \columnwidth\hsize \linewidth\hsize
\fi
- }
+}
% \end{macrocode}
% \end{macro}
%
@@ -1546,12 +1674,6 @@ located at that point, rather than the top-left corner.
% |\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.
@@ -1572,26 +1694,11 @@ located at that point, rather than the top-left corner.
\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}
%
@@ -1625,8 +1732,8 @@ located at that point, rather than the top-left corner.
\@tempdima=#3\TPHorizModule
\@tempdimb=#4\TPVertModule
\else % absolute/starred endtextblock
- \setlength{\@tempdima}{#3}
- \setlength{\@tempdimb}{#4}
+ \setlength{\@tempdima}{#3}%
+ \setlength{\@tempdimb}{#4}%
\fi
% \end{macrocode}
% Next, we adjust them so that the position |(#1,#2)| is at this
@@ -1727,7 +1834,9 @@ located at that point, rather than the top-left corner.
% \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
+% absolute-position mode.
+%
+% If we are in absolute position mode, 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
@@ -1750,18 +1859,47 @@ located at that point, rather than the top-left corner.
% 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.
+% See the discussion of interline glue
+% (ie, |\baselineskip| and |\prevdepth|)
+% in Chapter~12 (p.~80) of the \TeX book.
% \begin{macrocode}
\else
- \box0
- \prevdepth=\TP@prevdepth
+ \ifTP@vmode
+ \@tempdima=\prevdepth
+ \prevdepth=-1000pt % = \nointerlineskip, supressing interline glue
+ \box0 % zero height+depth
+ \prevdepth=\@tempdima
+ \else
+ \vadjust{\box0}%
+ \@esphack
+ \fi
\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
+% Finally, and only if we are in the absolute-position mode,
+% set the textblockorigin to the (default) upper-left corner of the paper,
+% and organise the shipout mechanism to place the |\TP@holdbox| in a suitable place.
+%
+% There are two cases here, one when we are using \LaTeX3, and one
+% with \LaTeXiie.
+%
+% First, the \LaTeX3 case: use the `ltshipout' mechanism..
+% \begin{macrocode}
+\ifTP@abspos
+ \ifTP@Liii
+ \ifTP@overlay
+ \AddToHook{shipout/foreground}{%
+ \ifTP@displayholdbox\put(\strip@pt\dimexpr1in,-\strip@pt\dimexpr1in){\box\TP@holdbox}\fi}
+ \else
+ \AddToHook{shipout/background}{%
+ \ifTP@displayholdbox\put(\strip@pt\dimexpr1in,-\strip@pt\dimexpr1in){\box\TP@holdbox}\fi}
+ \fi
+% \end{macrocode}
+%
+% Second, the \LaTeXiie\ case: use the macros provided by the \pstyle{everyshi} package.
+% We set up the output routine with |\EveryShipout|, and . 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
@@ -1774,21 +1912,22 @@ located at that point, rather than the top-left corner.
% 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}%
+ \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
\fi
\textblockorigin{0pt}{0pt}%
\fi
diff --git a/Master/texmf-dist/tex/latex/textpos/textpos.sty b/Master/texmf-dist/tex/latex/textpos/textpos.sty
index ad216f0a4ab..6a3354e4e38 100644
--- a/Master/texmf-dist/tex/latex/textpos/textpos.sty
+++ b/Master/texmf-dist/tex/latex/textpos/textpos.sty
@@ -7,7 +7,7 @@
%% textpos.dtx (with options: `package')
%% Textpos: absolute positioning of text on the page
%%%% File: textpos.dtx
-%%%% Copyright 1999-2019, Norman Gray
+%%%% Copyright 1999-2020, Norman Gray
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -19,21 +19,21 @@
%%
%% This work has the LPPL maintenance status `maintained'.
%%
-%% The Current Maintainer of this work is Norman Gray <http://nxg.me.uk>
+%% The Current Maintainer of this work is Norman Gray <https://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.
+%% Author: Norman Gray, gray@nxg.name
%% 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
+%% Mercurial ident: c834991c867a (1.10+1), 2020-09-26 17:44 +0100
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{textpos}[2019/04/15 v1.9.1]
-\typeout{Package: textpos 2019/04/15 1.9.1, absolute positioning of text on the page}
+\ProvidesPackage{textpos}[2020/09/26 v1.10]
+\typeout{Package: textpos 2020/09/26 1.10, absolute positioning of text on the page}
\newif\ifTPshowboxes
\TPshowboxesfalse
@@ -56,8 +56,15 @@
\TP@displayholdboxtrue
\DeclareOption{discardcontent}{\TP@displayholdboxfalse}
\ProcessOptions
-\ifTP@abspos
- \RequirePackage{everyshi}
+\newif\ifTP@Liii
+\@ifl@t@r\fmtversion{2020/10/01}\TP@Liiitrue\TP@Liiifalse
+\PackageInfo{textpos}{choosing support for \ifTP@Liii LaTeX3\else LaTeX2e\fi}
+\ifTP@Liii
+ % avoid everyshi package
+\else
+ \ifTP@abspos
+ \RequirePackage{everyshi}
+ \fi
\fi
\RequirePackage{keyval}
\define@key{tp}{absolute}{\csname TP@abspos#1\endcsname}
@@ -80,6 +87,7 @@
{You can't use \protect\marginpar\space within a textblock}
{You're using textpos because you _don't_ want things to float around, yes?}}
\newbox\TP@textbox
+\newif\ifTP@vmode
\ifTP@abspos
\newbox\TP@holdbox % starts off void
\AtEndDocument{\ifTP@displayholdbox\ifvoid\TP@holdbox \else \hbox{}\fi\fi}
@@ -133,6 +141,29 @@
\newdimen\TPboxrulesize
\setlength{\TPboxrulesize}{0.4pt}
\def\showtextsize{\normalsize}
+\def\TPShowGrid{\@ifstar{\@tempswatrue\@TPShowGrid}{\@tempswafalse\@TPShowGrid}}
+\def\@TPShowGrid#1#2{
+ \begin{textblock}{#1}(0,0)
+ \lineskip=0pt % abut boxes directly
+ \setbox0=\hbox{(0)}%
+ \@tempdima=\TPVertModule
+ \advance\@tempdima -1.1\ht0
+ \@tempcnta=0
+ \hrule
+ \loop
+ \vbox to \TPVertModule{\noindent
+ \@tempcntb=0
+ \vrule
+ \loop
+ \hbox to \TPHorizModule{%
+ \if@tempswa\raise\@tempdima\hbox{(\the\@tempcntb,\the\@tempcnta)}\fi
+ \hfil \vrule height \TPVertModule}%
+ \advance\@tempcntb 1
+ \ifnum\@tempcntb<#1 \repeat
+ \vss \hrule}
+ \advance\@tempcnta 1
+ \ifnum\@tempcnta<#2 \repeat
+ \end{textblock}}
\ifTP@abspos
\newdimen\TP@ox
\newdimen\TP@oy
@@ -189,32 +220,30 @@
\def\TPReferencePosition#1{\def\TP@referenceposition{#1}}
\def\textblock#1{%
\@tempdima=#1\TPHorizModule
- \ifvmode\else
+ \TP@begintextblock
+}
+\def\TP@textblockstar#1{%
+ \setlength{\@tempdima}{#1}%
+ \TP@begintextblock
+}
+\expandafter\let\csname textblock*\endcsname\TP@textblockstar
+\def\TP@begintextblock{%
+ \ifvmode
+ \TP@vmodetrue
+ \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.}
+ vertical mode or horizontal mode. You cannot use it in maths mode.}
\else % in horizontal mode
- \par % force us back into vertical mode
+ \TP@vmodefalse
+ \@bsphack
+ \unskip
\fi
\fi
\@ifnextchar[{\TP@textblock}{\expandafter\TP@textblock\expandafter[\TP@referenceposition]}%] bracematch
}
-\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
\newtoks\TP@tbargs
\def\TP@textblock[#1,#2](#3,#4){%
\TP@tbargs={{#1}{#2}{#3}{#4}}%
@@ -242,10 +271,9 @@
\hskip\TP@absmargin\vbox\bgroup
\textwidth\hsize \columnwidth\hsize \linewidth\hsize
\fi
- }
+}
\def\endtextblock{\global\@tempswatrue\TP@commonendtextblock}
\@namedef{endtextblock*}{\global\@tempswafalse\TP@commonendtextblock}
-\newdimen\TP@prevdepth
\def\TP@commonendtextblock{%
\ifdim\TP@margin = 0pt
\relax
@@ -260,17 +288,15 @@
{\color{\TP@rulecolour}\hrule depth 0pt height \TPboxrulesize}%
\fi
\egroup % end of \TP@textbox
- \TP@prevdepth=\prevdepth
- \prevdepth=-1000pt % = \nointerlineskip
\expandafter\TP@endtextblock\the\TP@tbargs
- }
+}
\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}
+ \setlength{\@tempdima}{#3}%
+ \setlength{\@tempdimb}{#4}%
\fi
\ifdim\TP@margin < 0pt
\advance\@tempdima \TP@margin
@@ -346,25 +372,42 @@
\box0
}%
\else
- \box0
- \prevdepth=\TP@prevdepth
+ \ifTP@vmode
+ \@tempdima=\prevdepth
+ \prevdepth=-1000pt % = \nointerlineskip, supressing interline glue
+ \box0 % zero height+depth
+ \prevdepth=\@tempdima
+ \else
+ \vadjust{\box0}%
+ \@esphack
+ \fi
\fi
- }%
+}
\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}%
+ \ifTP@Liii
+ \ifTP@overlay
+ \AddToHook{shipout/foreground}{%
+ \ifTP@displayholdbox\put(\strip@pt\dimexpr1in,-\strip@pt\dimexpr1in){\box\TP@holdbox}\fi}
+ \else
+ \AddToHook{shipout/background}{%
+ \ifTP@displayholdbox\put(\strip@pt\dimexpr1in,-\strip@pt\dimexpr1in){\box\TP@holdbox}\fi}
+ \fi
\else
- \EveryShipout{\ifTP@displayholdbox
- \global\setbox\@cclv\vbox{%
- \unvbox\TP@holdbox
- \ifvbox\@cclv \unvbox\@cclv \else \box\@cclv \fi
- }%
- \fi}%
+ \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
\fi
\textblockorigin{0pt}{0pt}%
\fi