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

end-skip and related keys in block code are not functional #738

Open
u-fischer opened this issue Oct 17, 2024 · 4 comments
Open

end-skip and related keys in block code are not functional #738

u-fischer opened this issue Oct 17, 2024 · 4 comments
Labels
area: block environments bug Something isn't working in code we maintain (directly)

Comments

@u-fischer
Copy link
Member

Extracted from #733 . With the block code It is currently not possible to set the end-skip through a key

Note once this is resolved the latex-lab-firstaid code for amsthm should be adapted too.

\DocumentMetadata
  {
    testphase={block}
  }

\documentclass{article}
\begin{document}
xxxxx
\begin{enumerate}[end-skip=50pt]
\item blub
\end{enumerate}
xxxxx

xxxxx
\begin{enumerate}
\ExplSyntaxOn  \skip_set:Nn\l__block_topsepadd_skip{50pt} \ExplSyntaxOff
\item blub
\end{enumerate}
xxxxx


\end{document}

image

@mbertucci47
Copy link
Contributor

I know nothing of xtemplate but it looks like end-skip is setting \l__block_botsep_skip but this never gets used. Same for end-par-skip and \l__block_parbotsep_skip

@mbertucci47
Copy link
Contributor

The block begin code does three things I'm not sure about. They are comments below. (Again, I don't know what I'm talking about.)

\skip_set:Nn \l__block_topsepadd_skip { \topsep } % should \topsep be \l__block_botsep_skip instead?
    \mode_if_vertical:TF
      {
        \skip_add:Nn \l__block_topsepadd_skip { \partopsep } % should \partopsep be \l__block_parbotsep_skip instead?
        \__kernel_displayblock_beginpar_vmode:
      }
      {
        \__block_skip_remove_last: \__block_skip_remove_last:
        \__kernel_displayblock_beginpar_hmode:w \par
      }
    \legacy_if:nTF { @inlabel }
      {
        \legacy_if_set_true:n { @noparitem }
        \legacy_if_set_true:n { @noparlist }
      }
      {
        \legacy_if:nT { @newlist } { \@noitemerr }
        \legacy_if_set_false:n { @noparlist }
        \skip_set_eq:NN \l__block_effective_top_skip \l__block_topsepadd_skip % why this?
      }

If the first two changes are made but not the third, then Ulrike's example has 50pt space above and below. If the third commented line is commented out, then the output looks correct, but I'm sure there's a reason for that line.

@FrankMittelbach
Copy link
Member

I know nothing of xtemplate but it looks like end-skip is setting \l__block_botsep_skip but this never gets used. Same for end-par-skip and \l__block_parbotsep_skip

LaTeX2e lists which have been the starting point for coding that template, do not offer any customisation for the skip at the end. I started at some point to intoroduce that (hence the keys) but then realized that setting the defaults right so that everything works well as before and also gives customization possibilities needs more coding then I had time to do back then, so I left it unfinished (I think itsays so somewhere). It gets a little tricky if you have nested lists etc.

@mbertucci47
Copy link
Contributor

mbertucci47 commented Oct 17, 2024

Also, is it intentional that there's no error or warning when an unknown key is used? The names are easy to mix up.

\begin{enumerate}[blublub]
\item blub
\end{enumerate}

does not error.

@FrankMittelbach FrankMittelbach added bug Something isn't working in code we maintain (directly) area: block environments labels Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: block environments bug Something isn't working in code we maintain (directly)
Projects
None yet
Development

No branches or pull requests

3 participants