Closed mbertucci47 closed 6 days ago
I think that is a bug in the ltproperties. Unlike the standard \label
properties are not written if \if@filesw
is false as there is an additional test and so the tagging code can not write the needed labels. It works fine if I remove the additional test:
\ExplSyntaxOn\makeatletter
\cs_set_protected:Npn \__property_record:nn #1#2
{
%\legacy_if:nT { @filesw }
% {
\protected@write \@auxout {}
{
\token_to_str:N \new@label@record
{#1}
{ \clist_map_function:nN {#2} \__property_record_value:n }
}
%}
}
\ExplSyntaxOff
\DocumentMetadata
{
lang=en-US,
pdfversion=2.0,
pdfstandard=ua-2,
testphase={phase-III,math,table,title,firstaid}
}
\documentclass{article}
\usepackage{scrwfile}
\TOCclone[Summary Contents]{toc}{stoc}
%\usepackage{hyperref}
\addtocontents{stoc}{\protect\value{tocdepth}=1}
\begin{document}
\tableofcontents
\section{A section}
\subsection{A subsection}
\listofstoc
\end{document}
I would suggest to remove that test. Does that sounds ok @josephwright @FrankMittelbach ?
@u-fischer But the whole point of @filesw
is to avoid writing anything to the secondary files ...
@josephwright if you use \@fileswfalse
in the preamble then both \label
and \RecordProperties
do not write. But if you set the boolean only locally, then \label
still works:
\documentclass{article}
%\makeatletter \@fileswfalse \makeatother
\begin{document}
\section{abc}
{\makeatletter \@fileswfalse \makeatother
\label{blub}\RecordProperties{bla}{page}}
\end{document}
So the behaviour is inconsequent.
I would suggest to remove that test. Does that sounds ok @josephwright @FrankMittelbach ?
yes that sounds ok to me (despite Joseph's missgivings :-))
The normal LaTeX interface consists of three parts: the switch \if@filesw
, \nofiles
and a redefinition of \protected@write
if \nofiles
is used.
So for normal LaTeX behavior the test around \protected@write
is pointless as that command is silenced by \nofiles
, thus the outer test can go.
In the package Markus uses the fact that the switch turns of opening and closing aux files for writing, but without \nowfiles
the \protected@write
still "writes" which is necessary for his approach, ie writing of auxiliary files is not stopped but changed by the package and @filesw
is kind of misused.
My suggestion to people is using this package here is to switch to morewrites
as as that can handle arbitrary many additional file streams and just 3 more and does not depend on altered latex internals. It might be a bit slower though (not tested) but it works well.
The scrwfile package redefines
\@starttoc
in a way that breaks tagging. The examplewarns
and the tags for the TOC are empty. Note the
\TOCclone
and\listofstoc
are not necessary to show the issue.