« first day (5086 days earlier)      last day (145 days later) » 

cfr
cfr
05:38
how can I figure out from a test log whether I've forgotten a \fi or to close a group? I can tell from the pre-normalised log, but if compilation fails with an incomplete \ifx, I can't figure out how to make a test which reliably fails.
(actually, I can't even make one which unreliably fails.)
@mickep 'The two first born' means something very different from 'the first two born'. :-)
@cfr Yes, thank you, indeed!
cfr
cfr
@mickep I'm sure it's helpful in discussing matrices ;).
06:08
@cfr In Swedish both sounds about right, that was why my colleague was not sure, I guess.
cfr
cfr
06:52
@mickep I find it very easy to believe the difference would be not at all obvious. just if you ever get a time machine and go back, remember that injudicious use of the first might start a war or get you beheaded or something.
or just stick to matrices.
or go far enough back they don't speak english.
or stay in sweden.
or just don't get a time machine.
07:23
@cfr Put a test at the end for the current if level (using the eTeX primitive) - we do the same for group levels
cfr
cfr
@JosephWright thanks. can I have a hint where i should look that up?
@cfr \TYPEOUT { The~current~conditional~level~is~\number\currentiflevel } or similar
07:41
@cfr Perhaps I should add to the core of l3build - I can see an argument for this
cfr
cfr
08:15
@JosephWright I meant the primitive ;).
@JosephWright ??
08:38
@cfr As in, we could check at the end of every run
@cfr texdoc etex
09:01
Suggestions for a better command name for github.com/josephwright/siunitx/issues/684? I don't like \hms, really, and \time is taken :)
@JosephWright that would quite useful imho if the log would typeout something if the result is different to zero.
09:38
@UlrikeFischer Indeed
09:49
Someone sent me this
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\mathtoolsset{mathic}
\usepackage[left=6.6cm, right=6.6cm]{geometry}
\begin{document}
%\showoutput
\textit{A connected graph~\(G\) on \(n\) vertices has no less than \(n-1\) edges.}
\par
\textit{A connected graph \(G\) on \(n\) vertices has no less than \(n-1\) edges.}
\end{document}
It looks like this
I'm trying to understand why the difference in breaking due to with or without ~.
I looked at \showoutput after the word graph and got
....\kern 0.76714
....\penalty 10000
....\glue 3.57774 plus 1.53333 minus 1.0222
....\mathon

....\kern 0.76714
....\penalty 92
....\glue 3.57774 plus 1.53333 minus 1.0222
....\mathon
So the kern and glues are the same, the penalties are not. Can those explain the diferences in line breaks?
Where does the penalty 92 come from?
@mickep not sure. Some 10 years ago we added some code to the mathic part of mathtools to fix an issues with preceeding ~\(...\) nullifying the italic correction. Not 100% sure if that is adding the 92. Probably need to output totally without mathic. I'll eat my lunch first
10:17
@mickep You're right, that 92 is a bit fishy.
@daleif But I do not understand why it has the result it has.
Clearly the first line is overful, so it is a "fail". But why that does not happen to the second one, I do not get.
@mickep It is down to the ~ and the code that \( executes when ~ was detected before it.
For reverence this is the relevant code, can be inserted before activating mathic
\MHInternalSyntaxOn
\def\MT_mathic_true: {
  \MH_if_boolean:nF {math_italic_corr}{
    \MH_set_boolean_T:n {math_italic_corr}
    \MH_if_boolean:nTF {robustify}{
      \MH_let:NwN \MT_mathic_redeffer: \DeclareRobustCommand
    }{
      \MH_let:NwN \MT_mathic_redeffer: \renewcommand
    }
    \MH_let:NwN \MT_begin_inlinemath: \(
    \MT_mathic_redeffer:*\({
      \relax\ifmmode\@badmath\else
      \ifhmode
        \MH_if_dim:w \fontdimen\@ne\font>\z@
          \MH_if_dim:w \lastskip>\z@
            \skip@\lastskip\unskip
@JosephWright or going full \datetime{2024-10-03 12:28:33}? (/me ducks) ;-)
 
2 hours later…
12:04
@daleif Did you solve it yet?
12:52
@mickep Haven't had time yet. I'm guessing the code some from the chat many years ago. Not sure if I understand the code. The penalty comes from \penalty\count@, but I do not know where the 92 comes from.
13:14
@daleif @mickep looks like a bug in mathtools
            \MH_if_num:w \lastpenalty>\z@
              \count@\lastpenalty\unpenalty
            \MH_fi:
            \@@italiccorr
            \MH_if_num:w \count@>\z@
\show \b            \showthe\count@
              \penalty\count@
You conditionally save the last penalty in \count@ but you unconditionally use it if it's greater than 0 so you pick up whatever random value it has at that point
92 is the character code of \ and gets set in \newif at the start of article.cls
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{article}
              [2024/02/08 v1.4n
 Standard LaTeX document class]
\newcommand\@ptsize{}
\newif\if@restonecol
@daleif ^^ @mickep I'm sure such leakage never happens in context....
@DavidCarlisle I knew something was wrong in that code, just not use to the count syntax.
What exactly is the correct solution here? Use a dedicated counter? Run \lastpenalty > 0 again (I haven't checked how \/ is implemented yet)
@daleif Dedicated counter
@daleif the problem isn't really using the scratch counter it is using the value when you haven't set it. Even an mtools-specific counter would be wrong here
@JosephWright does \/ set any penalties?
@DavidCarlisle Since it is a sratch cntr, counldn't we just set it to zero in the missing else case
@daleif also as etex is assumed it would be better to replace v which is the classic tex approximation to testing if the previous item is a penalty with \ifnum\lastnodetype=13
@daleif yes
@daleif no, but the \maybe@ic command taht adds italic correction in \textxx does
13:28
For now I just add the missing set to zero case and make a note that \ifnum\lastnodetype=13 is s better test and then leave that for the Expl3 conversion
\def \fix@penalty {%
  \ifnum \lastpenalty=\z@
    \@@italiccorr
  \else
    \count@ \lastpenalty
    \unpenalty
    \@@italiccorr
    \penalty \count@
  \fi
}
@daleif the kernel could use the same improvement ^^
@DavidCarlisle the lastnumtype?
@daleif yes latex2e.ltx is full of \ifnum\last[skip,penalty]=\z@ tests that would be better as \lastnodetype tests (at some small compatibility risk)
13:47
Marked as mathtools issue #62. I'll update the dtx latex, just wanted to write it down fresh in memory.
Should say "will update the dtx later"
 
1 hour later…
14:59
It is still a bit curious that the line break much later es influenced by the penalty before (or inside) the first formula.
15:11
@mickep after the ~ \count@ gets set to 10000 and that polutes the remaining cases just as the initial 92 did.
@DavidCarlisle Ouch, so somehow it gets set before the last formula? Or, it looked like what happened.
@mickep so you get nobreak penaly inserted before \(n\) and before \(n-1\)
@DavidCarlisle Ah, so, a nice trick not to have to type ~ at all places.
@mickep the code says "if there is no explicit penalty before inline math, insert a penalty with whatever number happens to be in \count@
@DavidCarlisle Oh, OK
15:15
@mickep much more efficient than using context
@DavidCarlisle Well, ConTeXt has nice mechanisms so that one does not have to write the ~ before short formulas.
@mickep sigh, clearly just copying latex again, it seems
@DavidCarlisle Yes, but honestly we did not know that you had this 92/10000 feature there :(
Otherwise we would of course had used the same trick.
yo'
yo'
Btw, Overleaf is looking for people to join the support team! LaTeX expertise welcome but not required. Let me know if you were interested or if you wanted some more details about the position! digitalscience.pinpointhq.com/postings/…
5
Oh, yet another unit question. Now with a \text answer. I guess they get what they deserve.
 
3 hours later…
cfr
cfr
17:58
@JosephWright that would definitely be useful - if it would check ifs and grouping. and it would have saved ctan processing my package twice. I think I really should have noticed. but I'm not confident I will, which is why I wanted to test. but I realise I will have to add the test for every package.
18:14
@cfr I'm look at it - probably next week
@mickep :)
cfr
cfr
@DavidCarlisle thanks.
@yo' possibly, but I doubt you would want me.
18:56
@JosephWright -- Maybe some shortening of "duration".
19:53
@barbarabeeton Oooh, that's quite good
@barbarabeeton \durn/\drn?
@daleif -- What's your default paper size, A4 or lettersize? I'm trying to replicate this with plain TeX, and may calculations don't produce a sensible result.
@JosephWright -- Oh, I rather like \durn, but it sounds like one is somewhat exasperated.
@JosephWright Gert suggests \tardis
6
20:58
@UlrikeFischer ooh
21:49
@barbarabeeton to replicate with plain, put \nobreak before every inline math

« first day (5086 days earlier)      last day (145 days later) »