[latex3-commits] [git/LaTeX3-latex3-latex2e] gh249: fix for #249 (98d4898a)

Frank Mittelbach frank.mittelbach at latex-project.org
Thu Apr 9 10:37:54 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh249
Link       : https://github.com/latex3/latex2e/commit/98d4898ac9fb48cade5ceb963d73f18b23df9047

>---------------------------------------------------------------

commit 98d4898ac9fb48cade5ceb963d73f18b23df9047
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Apr 9 10:37:54 2020 +0200

    fix for #249


>---------------------------------------------------------------

98d4898ac9fb48cade5ceb963d73f18b23df9047
 base/changes.txt                                   |  6 ++
 base/doc/ltnews32.tex                              | 11 ++++
 base/ltfloat.dtx                                   | 66 +++++++++++++++++++---
 base/testfiles/github-0249.lvt                     | 14 +++++
 .../sx459285.tlg => base/testfiles/github-0249.tlg |  4 +-
 base/testfiles/tlb-latexrelease-003.luatex.tlg     | 10 ++++
 base/testfiles/tlb-latexrelease-003.tlg            | 10 ++++
 base/testfiles/tlb-latexrelease-003.xetex.tlg      | 10 ++++
 base/testfiles/tlb-rollback-004.luatex.tlg         |  5 ++
 base/testfiles/tlb-rollback-004.tlg                |  5 ++
 base/testfiles/tlb-rollback-004.xetex.tlg          |  5 ++
 11 files changed, 136 insertions(+), 10 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index ea96e3b1..8381bfba 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -1,3 +1,9 @@
+2020-04-09  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltfloat.dtx (subsection{Footnotes}):
+	Set non-zero baselineskip inside \textsuperscript and \textsubscript
+	so that link boxes drawn by hyperref have a sensible height (gh/249)
+
 2020-04-07  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltclass.dtx (section{Implementation}):
diff --git a/base/doc/ltnews32.tex b/base/doc/ltnews32.tex
index 3eec5fd0..448bb597 100644
--- a/base/doc/ltnews32.tex
+++ b/base/doc/ltnews32.tex
@@ -203,6 +203,17 @@ $2^{16}$, and this limitation has now been lifted.
 \githubissue{124}
 
 
+\subsection{Set a non-zero \cs{baselineskip} in text scripts}
+
+As \cs{textsuperscript} and \cs{textsubscript} usually contain only a
+few characters on a single line the \cs{baselineskip} was set to
+zero. However, \pkg{hyperref} uses that value to determine the height
+of a link box which consequently came out far too small. This has
+been adjusted.
+%
+\githubissue{249}
+
+
 \subsection{Spacing issues when using \cs{linethickness}}
 
 In some circumstances the use of \cs{linethickness} introduced a
diff --git a/base/ltfloat.dtx b/base/ltfloat.dtx
index 23c3f464..dee9a101 100644
--- a/base/ltfloat.dtx
+++ b/base/ltfloat.dtx
@@ -31,7 +31,7 @@
 %
 %<*driver>
 % \fi
-\ProvidesFile{ltfloat.dtx}[2015/02/21 v1.2c LaTeX Kernel (Floats)]
+\ProvidesFile{ltfloat.dtx}[2020/04/09 v1.2d LaTeX Kernel (Floats)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltfloat.dtx}
@@ -1327,13 +1327,36 @@
 %   always start with a font selection command, to activate the font
 %   size switch.
 %    \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>                 {\@textsuperscript}{superscript baseline}%
 \def\@textsuperscript#1{%
-  {\m at th\ensuremath{^{\mbox{\fontsize\sf at size\z@#1}}}}}
+  {\m at th\ensuremath{^{\mbox{\fontsize\sf at size\sf at size#1}}}}}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\@textsuperscript}{superscript baseline}%
+%<latexrelease>
+%<latexrelease>\def\@textsuperscript#1{%
+%<latexrelease>  {\m at th\ensuremath{^{\mbox{\fontsize\sf at size\z@#1}}}}}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
 %    \end{macrocode}
 %  \end{macro}
 %
+%
+%
+%
+%
+%
+%
 %  \begin{macro}{\textsubscript}
 % \changes{v1.2a}{2014/12/30}{Command added (latexrelease)}
+% \changes{v1.2d}{2020/04/09}{Set non-zero baseline (gh/249)}
 %    \begin{macrocode}
 %</2ekernel>
 %<latexrelease>\IncludeInRelease{2015/01/01}%
@@ -1345,27 +1368,54 @@
 \DeclareRobustCommand*\textsubscript[1]{%
   \@textsubscript{\selectfont#1}}%
 %    \end{macrocode}
+%
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\textsubscript}{\textsubscript}%
+%<latexrelease>\let\textsubscript\@undefined
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+%    \end{macrocode}
 %  \end{macro}
 %
+%
+%
+%
 %  \begin{macro}{\@textsubscript}
 % \changes{v1.2a}{2014/12/30}{Command added (latexrelease)}
-%
+% \changes{v1.2d}{2020/04/09}{Set non-zero baseline (gh/249)}
 %    \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>                 {\@textsubscript}{subscript baseline}%
 \def\@textsubscript#1{%
-  {\m at th\ensuremath{_{\mbox{\fontsize\sf at size\z@#1}}}}}
+  {\m at th\ensuremath{_{\mbox{\fontsize\sf at size\sf at size#1}}}}}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2015/01/01}%
+%<latexrelease>                 {\@textsubscript}{subscript baseline}%
+%<latexrelease>
+%<latexrelease>\def\@textsubscript#1{%
+%<latexrelease>  {\m at th\ensuremath{_{\mbox{\fontsize\sf at size\z@#1}}}}}
 %    \end{macrocode}
-%  \end{macro}
 %
 %    \begin{macrocode}
-%</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{0000/00/00}%
-%<latexrelease>                 {\textsubscript}{\textsubscript}%
-%<latexrelease>\let\textsubscript\@undefined
+%<latexrelease>                 {\@textsubscript}{subscript baseline}%
 %<latexrelease>\let\@textsubscript\@undefined
 %<latexrelease>\EndIncludeInRelease
 %<*2ekernel>
 %    \end{macrocode}
+%  \end{macro}
+%
+%
 %
 % \begin{macro}{\footnotesep}
 %    \begin{macrocode}
diff --git a/base/testfiles/github-0249.lvt b/base/testfiles/github-0249.lvt
new file mode 100644
index 00000000..2731ec17
--- /dev/null
+++ b/base/testfiles/github-0249.lvt
@@ -0,0 +1,14 @@
+\documentclass[11pt]{article}
+
+\input{test2e}
+
+\begin{document}
+
+\START
+
+\textsuperscript{\typeout{superscript baseline=\the\baselineskip}}
+
+\textsubscript{\typeout{subscript baseline=\the\baselineskip}}
+
+
+\END
diff --git a/required/tools/testfiles/sx459285.tlg b/base/testfiles/github-0249.tlg
similarity index 88%
copy from required/tools/testfiles/sx459285.tlg
copy to base/testfiles/github-0249.tlg
index a1d101b4..5cc2e7b5 100644
--- a/required/tools/testfiles/sx459285.tlg
+++ b/base/testfiles/github-0249.tlg
@@ -6,5 +6,5 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 (Font)              <8> on input line ....
 LaTeX Font Info:    External font `cmex10' loaded for size
 (Font)              <6> on input line ....
-[1
-] (sx459285.aux)
+superscript baseline=8.0pt
+subscript baseline=8.0pt
diff --git a/base/testfiles/tlb-latexrelease-003.luatex.tlg b/base/testfiles/tlb-latexrelease-003.luatex.tlg
index e482b5f3..4179d1f3 100644
--- a/base/testfiles/tlb-latexrelease-003.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-003.luatex.tlg
@@ -97,8 +97,13 @@ Skipping: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Skipping: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Skipping: [....-..-..] \textsubscript  on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
 Skipping: [....-..-..] Make commands robust on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 Skipping: [....-..-..] Extended float list on input line ....
@@ -406,8 +411,13 @@ Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
 Already applied: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
+Already applied: [....-..-..] subscript baseline on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \markboth on input line ....
 LaTeX Info: Redefining \markright on input line ....
diff --git a/base/testfiles/tlb-latexrelease-003.tlg b/base/testfiles/tlb-latexrelease-003.tlg
index 121fbaf0..a5c67c84 100644
--- a/base/testfiles/tlb-latexrelease-003.tlg
+++ b/base/testfiles/tlb-latexrelease-003.tlg
@@ -95,8 +95,13 @@ Skipping: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Skipping: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Skipping: [....-..-..] \textsubscript  on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
 Skipping: [....-..-..] Make commands robust on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 Skipping: [....-..-..] Extended float list on input line ....
@@ -398,8 +403,13 @@ Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
 Already applied: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
+Already applied: [....-..-..] subscript baseline on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \markboth on input line ....
 LaTeX Info: Redefining \markright on input line ....
diff --git a/base/testfiles/tlb-latexrelease-003.xetex.tlg b/base/testfiles/tlb-latexrelease-003.xetex.tlg
index 033206dc..c09d4ec3 100644
--- a/base/testfiles/tlb-latexrelease-003.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-003.xetex.tlg
@@ -95,8 +95,13 @@ Skipping: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Skipping: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Skipping: [....-..-..] \textsubscript  on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
 Skipping: [....-..-..] Make commands robust on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 Skipping: [....-..-..] Extended float list on input line ....
@@ -407,8 +412,13 @@ Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
 Already applied: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
+Already applied: [....-..-..] subscript baseline on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \markboth on input line ....
 LaTeX Info: Redefining \markright on input line ....
diff --git a/base/testfiles/tlb-rollback-004.luatex.tlg b/base/testfiles/tlb-rollback-004.luatex.tlg
index 3c864239..13cef122 100644
--- a/base/testfiles/tlb-rollback-004.luatex.tlg
+++ b/base/testfiles/tlb-rollback-004.luatex.tlg
@@ -153,9 +153,14 @@ Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
 LaTeX Info: Redefining \textsubscript on input line ....
 Already applied: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
+Already applied: [....-..-..] subscript baseline on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \markboth on input line ....
 LaTeX Info: Redefining \markright on input line ....
diff --git a/base/testfiles/tlb-rollback-004.tlg b/base/testfiles/tlb-rollback-004.tlg
index fc1a8434..195b2246 100644
--- a/base/testfiles/tlb-rollback-004.tlg
+++ b/base/testfiles/tlb-rollback-004.tlg
@@ -151,9 +151,14 @@ Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
 LaTeX Info: Redefining \textsubscript on input line ....
 Already applied: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
+Already applied: [....-..-..] subscript baseline on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \markboth on input line ....
 LaTeX Info: Redefining \markright on input line ....
diff --git a/base/testfiles/tlb-rollback-004.xetex.tlg b/base/testfiles/tlb-rollback-004.xetex.tlg
index 18c7a028..3252d576 100644
--- a/base/testfiles/tlb-rollback-004.xetex.tlg
+++ b/base/testfiles/tlb-rollback-004.xetex.tlg
@@ -151,9 +151,14 @@ Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
 Applying: [....-..-..] float order in 2-column on input line ....
 Already applied: [....-..-..] float order in 2-column on input line ....
+Skipping: [....-..-..] superscript baseline on input line ....
+Applying: [....-..-..] superscript baseline on input line ....
 Applying: [....-..-..] \textsubscript  on input line ....
 LaTeX Info: Redefining \textsubscript on input line ....
 Already applied: [....-..-..] \textsubscript  on input line ....
+Skipping: [....-..-..] subscript baseline on input line ....
+Applying: [....-..-..] subscript baseline on input line ....
+Already applied: [....-..-..] subscript baseline on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
 LaTeX Info: Redefining \markboth on input line ....
 LaTeX Info: Redefining \markright on input line ....





More information about the latex3-commits mailing list.