Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making the rotating package tagging compatible #1537

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions required/graphics/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ are not part of the distribution.
================================================================================
All changes above are only part of the development branch for the next release.
================================================================================
2024-11-01 Ulrike Fischer <[email protected]>

* rotating.dtx: Tagging support for sideways floats (tagging-project#751).
Added \leavevmode to sideways, turn etc (tagging-project#112).


#########################
# 2024-11-01 Release
Expand Down
21 changes: 19 additions & 2 deletions required/graphics/rotating.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
\ProvidesFile{rotating.dtx}%
%</dtx>
%<package>\ProvidesPackage{rotating}%
[2016/08/11 v2.16d
[2024/11/01 v2.16e
%<package> rotated objects in LaTeX%
%<*dtx>
rotating package source file%
Expand Down Expand Up @@ -257,8 +257,12 @@
% \section{Turning and rotation environments}
% \begin{macro}{sideways}
% Environment to turn the contents through 90 degrees.
% \changes{v2.16e}{2024/11/01}{add \cs{leavevmode} for tagging support}
% \cs{Grot@box} issues a \cs{leavevmode} but for tagging (when using lualatex)
% this is too late, it should happen before the box is set.
% \begin{macrocode}
\def\sideways{%
\leavevmode
\Grot@setangle{90}%
\setbox\z@\color@hbox\ignorespaces}
\def\endsideways{%
Expand All @@ -272,8 +276,10 @@
%
% \begin{macro}{turn}
% Rotate the contents of the environment, leaving the appropriate space
% \changes{v2.16e}{2024/11/01}{add \cs{leavevmode} for tagging support}
% \begin{macrocode}
\def\turn#1{%
\leavevmode
\Grot@setangle{#1}%
\setbox\z@\color@hbox\ignorespaces}
\def\endturn{%
Expand All @@ -286,8 +292,10 @@
% \end{macro}
% \begin{macro}{rotate}
% Rotate the contents of the environment, leaving \emph{no space}.
% \changes{v2.16e}{2024/11/01}{add \cs{leavevmode} for tagging support}
% \begin{macrocode}
\def\rotate#1{%
\leavevmode
\Grot@setangle{#1}%
\setbox\z@\color@hbox\ignorespaces}
\def\endrotate{%
Expand All @@ -301,8 +309,10 @@
% \end{macro}
% \begin{macro}{\turnbox}
% A macro version of the `rotate' environment.
% \changes{v2.16e}{2024/11/01}{add \cs{leavevmode} for tagging support}
% \begin{macrocode}
\def\turnbox#1#2{%
\leavevmode
\Grot@setangle{#1}%
% \end{macrocode}
% Note: grouping within the box makes \cs{color@hbox} unnecessary, I think.
Expand Down Expand Up @@ -350,9 +360,13 @@
% \end{macrocode}
% Set the float contents in
% a box of width \cs{textheight} instead of \cs{columnwidth}.
% \changes{v2.16e}{2024/11/01}{correct tagging of the minipage}
% \begin{macrocode}
\begin{lrbox}\rot@float@box
\SuspendTagging{\minipage}%
\begin{minipage}\textheight
\ResumeTagging{\minipage}%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can guess what happens here, but from the outside the suspensions look odd. I wonder if that case happens elsewhere too and should get some sort of an interface, or at least perhaps a sentence or two explaining what goes on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a sentence, but I have no idea for a better interface. One doesn't want the tagging from the minipage environment and imho this can only be done either by surrounding the minipage with such a code, or by defining a dedicated environment minipagewithouttagging.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the question to ask is under which circumstances do you not want minipage tagging? Because of it being inside an lrbox/mbox? What should happen if you have an lrbox with 2 minipages inside?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

point is use of lrbox is core LaTeX so the combination with minipage should work. without the need to disable and reanable tagging by the user

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not want the minipage tag (the Div) because I'm in a float and this minipage has no semantic meaning. I do not want the \tagmcend\tagstructend before the minipage (which normally closes a P-tag) and the reopening after the minipage as the minipage is in a lrbox and fills it up. Two minipages (without other material) should probably use a Div around them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

point is use of lrbox is core LaTeX so the combination with minipage should work. without the need to disable and reanable tagging by the user

Well the problem is that xxx minipage yyy in a lrbox needs different tagging to minipage alone. (At least with pdflatex which has to insert correctly nested MC-literals.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks OK to me modulo the discussion re minipage tagging when I'd defer to whatever @FrankMittelbach and @u-fischer decide.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, eventually a minipage inside an lrbox has to work as this is official std LaTeX usage and should not require any action by a user if that is used in a document. However, that isn't soemthing we need to solve now. But what we should do is making an issue for it in the tagging-project repo, so that it gets address at some point.

So with that I think this PR can be merged

\UseTaggingSocket{para/restore}%
}
% \end{macrocode}
% \end{macro}
Expand All @@ -372,7 +386,10 @@
% we need to use the a variant \cs{pageref} mechanism and our own
% specialised labels.
% \begin{macrocode}
\end{minipage}\end{lrbox}%
\par\SuspendTagging{\minipage}%
\end{minipage}%
\ResumeTagging{\minipage}%
\end{lrbox}%
\stepcounter{r@tfl@t}%
\rot@label{RF\ther@tfl@t}%
\rot@pageref{RF\ther@tfl@t}{\R@@page}%
Expand Down
Loading