Skip to content

Commit

Permalink
getting closer
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Nov 23, 2024
1 parent 8c3e49d commit 2cbe640
Show file tree
Hide file tree
Showing 7 changed files with 381 additions and 128 deletions.
16 changes: 15 additions & 1 deletion required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2024-11-23 Frank Mittelbach <[email protected]>

* latex-lab-block.dtx (subsubsection{Implementation of block templates \ldots}):
Use private storage bin for parindent and not \listparindent to decouple block
and list templates (tagging/762)

(subsubsection{Blockquote instances}):
Theorems use their own block-instance and not displayblock to allow for
customization (tagging/762)

* latex-lab-firstaid.dtx (subsection{ams classes and amsthm}):
Move the theorem link target later to not have to force hmode with \leavevmode.
Otherwise theorems get always an indentation.

2024-11-21 Ulrike Fischer <[email protected]>
* latex-lab-float.dtx: Correct socket declaration.

Expand All @@ -6,7 +20,7 @@

2024-10-25 Ulrike Fischer <[email protected]>
* latex-lab-math.dtx: reorganized luamml and mathml options
to support also structure elements and extended the documentation. Corrected
to support also structure elements and extended the documentation. Corrected
handling of alt-texts. Added examples for the various options.

2024-10-16 Ulrike Fischer <[email protected]>
Expand Down
16 changes: 11 additions & 5 deletions required/latex-lab/latex-lab-block.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1915,8 +1915,13 @@
%
% \begin{template}{block display}
%
% In contrast to the \LaTeXe{} implementation we do not directly
% use \cs{listparindent} here but a private register of the
% template. The reason is that block template instances are also
% used outside of lists.
% \changes{v0.8s}{2024/10/03}{Offer item-skip key also on block templates}
% \changes{v0.8w}{2024/11/23}{}
% \changes{v0.8w}{2024/11/23}{Use private storage bin for parindent
% and not \cs{listparindent} to decouple block and list templates (tagging/762)}
% \begin{macrocode}
\DeclareTemplateCode{block}{display}{1}
{
Expand Down Expand Up @@ -2020,8 +2025,8 @@
\skip_set_eq:NN \@outerparskip \parskip
\skip_set_eq:NN \parskip \parsep
% \end{macrocode}
%
% \changes{v0.8w}{2024/11/23}{}
% \changes{v0.8w}{2024/11/23}{Use private storage bin for parindent
% and not \cs{listparindent} to decouple block and list templates (tagging/762)}
% \begin{macrocode}
\dim_set_eq:NN \parindent \l_@@block_parindent_dim
\dim_add:Nn \linewidth { - \rightmargin - \leftmargin }
Expand Down Expand Up @@ -3103,7 +3108,8 @@
%

%
% \changes{v0.8w}{2024/11/23}{}
% \changes{v0.8w}{2024/11/23}{Theorems use their own block-instance
% and not displayblock to allow for customization (tagging/762)}
% \begin{macrocode}
\DeclareInstance{blockenv}{theorem}{display}
{
Expand Down Expand Up @@ -3367,7 +3373,7 @@
% Theorems do not support nesting, so we have only one to set up.
% The \LaTeX{} default reused the general value of \cs{parindent}
% and \cs{parskip} and, of course, they start at the outer margin.
% \changes{v0.8w}{2024/11/23}{}
% \changes{v0.8w}{2024/11/23}{Add block instance for theorems}
% \begin{macrocode}
\DeclareInstance{block}{theoremblock-0}{display}
{
Expand Down
49 changes: 26 additions & 23 deletions required/latex-lab/latex-lab-firstaid.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
\def\ltlabfirstaiddate{2024-10-16}
\def\ltlabfirstaidversion{0.85h}
\def\ltlabfirstaiddate{2024-11-23}
\def\ltlabfirstaidversion{0.85i}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
Expand Down Expand Up @@ -179,35 +179,38 @@
% While create the caption/label we disable para-tagging.
% \begin{macrocode}
\tagpdfparaOff
\mode_leave_vertical:
% \end{macrocode}
% The anchor for links. amsthm allows for unnumbered theorems so we have to test
% for an empty counter.
% \changes{v0.85h}{2024/10/16}{add test if counter is empty tagging/736}
% \begin{macrocode}
\tl_if_empty:NTF \l__block_thm_current_counter_tl
{\MakeLinkTarget[theorem]{}}
{\MakeLinkTarget{\l__block_thm_current_counter_tl}}
\group_begin:
\normalfont
\the\thm@headfont \thm@indent
\normalfont
\the\thm@headfont \thm@indent
% \end{macrocode}
% The anchor for links. It must be inserted when we have started hmode
% (which happens with \cs{thm@indent}). \pkg{amsthm} allows for unnumbered
% theorems so we have to test for an empty counter.
% \changes{v0.85h}{2024/10/16}{add test if counter is empty
% tagging/736}
% \changes{v0.85i}{2024/11/23}{Do not use \cs{leavevmode} but wait
% for hmode to add the link target}
% \begin{macrocode}
\tl_if_empty:NTF \l__block_thm_current_counter_tl
{\MakeLinkTarget[theorem]{}}
{\MakeLinkTarget{\l__block_thm_current_counter_tl}}
\@ifempty{##1}
{\let\thmname\@gobble}
{\let\thmname\@gobble}
% \end{macrocode}
% we insert the MC and the Lbl structure into \cs{thmname},
% \cs{thmnumber} and \cs{thmnote}. This will also work
% with new theorem style as long as they use these command.
% \begin{macrocode}
{\def\thmname####1{\tag_mc_begin:n {}####1\tag_mc_end:}}%
{\def\thmname####1{\tag_mc_begin:n {}####1\tag_mc_end:}}%
\@ifempty{##2}
{\let\thmnumber\@gobble}
{\def\thmnumber####1
{\tag_struct_begin:n{tag=Lbl}\tag_mc_begin:n {}
####1
\tag_mc_end:\tag_struct_end:}}%
{\let\thmnumber\@gobble}
{\def\thmnumber####1
{\tag_struct_begin:n{tag=Lbl}\tag_mc_begin:n {}
####1
\tag_mc_end:\tag_struct_end:}}%
\@ifempty{##3}
{\let\thmnote\@gobble}
{\def\thmnote####1{\tag_mc_begin:n{}####1\tag_mc_end:}}%
{\let\thmnote\@gobble}
{\def\thmnote####1{\tag_mc_begin:n{}####1\tag_mc_end:}}%
\tag_struct_begin:n{tag=Caption}
\thm@swap\swappedhead\thmhead{##1}{##2}{##3}%
\tag_mc_begin:n{}\the\thm@headpunct\tag_mc_end:
Expand All @@ -221,7 +224,7 @@
% be used if tagging is active!
% \begin{macrocode}
\tagpdfparaOn
\UseTaggingSocket{para/begin} %
\UseTaggingSocket{para/begin}
\ignorespaces}
% \end{macrocode}
% This redefines the standard styles for the theorem heads.
Expand Down
10 changes: 8 additions & 2 deletions required/latex-lab/testfiles-firstaid/test-amsart-733.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
% \newline = linebreak
{\thmnumber{#2 }\thmname{#1}\thmnote{: #3}}% Thm head spec



\theoremstyle{citing}
\newtheorem{theorem}{Theorem}

Expand All @@ -22,14 +24,18 @@

xxxx
\begin{theorem}
text
para 1 \\ para1

para 2 \\ para2
\end{theorem}
xxxx

xxxx

\begin{theorem}
text
para 1 \\ para1

para 2 \\ para2
\end{theorem}

xxxx
Expand Down
Loading

0 comments on commit 2cbe640

Please sign in to comment.