« first day (4413 days earlier)      last day (505 days later) » 

7:00 AM
\documentclass{article}
\usepackage{etoolbox}
\usepackage{tikz}
\makeatletter
\let\mathdollar=$%$
\newif\if@mathchoice
\protected\long\def\wlog@math#1{%
  \ifmeasuring@
  \else
    \if@mathchoice
    \else
      \wlog{MATH: \detokenize{#1}}%
    \fi
  \fi
}
\begingroup
  \catcode`\$=\active
  \protected\gdef ${%$
    \@ifnextchar$%$
      {\grabdisplaymath}
      {\grabinlinemath}%
  }
  \protected\gdef\grabinlinemath#1${%$
    \wlog@math{#1}%
    \mathdollar #1\mathdollar
  }
  \protected\gdef\grabdisplaymath$#1$${%$
@DavidCarlisle, @UlrikeFischer ^^^ Better with \mathchoice
 
 
2 hours later…
8:57 AM
@DavidCarlisle, @UlrikeFischer github.com/pgf-tikz/pgf/pull/1221
@DavidCarlisle, @UlrikeFischer The route via \everymath looks quite a bit more complicated
 
9:41 AM
@JosephWright the tikz code errors now if one change the catcode back?
\catcode`\$=3
\begin{tikzpicture}
\draw (0,0)-- ($(1,0)+(1,1)$);
\end{tikzpicture}
gives ! Package PGF Math Error: Unknown operator $' or $(' (in '$(1').
 
@UlrikeFischer Well yes, back with 'don't change catcode mid-document'
@UlrikeFischer The parser in TikZ needs to look for an explicit $, and it's all set up on a token basis: it would need more work to handle both cases
 
@JosephWright but it also errors if I define some command \testtikz in the preamble with this content. So what happens with all the pictures in libraries using dollars with catcode 3?
 
@UlrikeFischer There really shouldn't be many dollars in TikZ sources ...
@UlrikeFischer I am planning to work through all of the TikZ sources and see if I can adjust so that they work without forcing the catcode of $, but that will take a while as there are still all the RCS-based headers, etc.
 
@JosephWright well I would say there are around 20 package loading the calc library (including a few beamer styles) and e.g. in circuitikz one finds ` \draw (0,{2-\i/2}) let \p1 = ($(T-#1-subckt@reference)-(T-#1-\anchor)$) in`
 
@UlrikeFischer I know that the current demo is just that :)
@UlrikeFischer If we agree on the catcode plan, I will sort this: one for the team list?
 
10:05 AM
@JosephWright yes. I really wonder what is the best plan here. We are using $ in the format too, e.g. \ensuremath doesn't grab the math because of this. What breaks if $ is active from the start and no only at begin document?
 
@DavidCarlisle Should I replace $ with something else in the package?
 
@UlrikeFischer My plan for today is to explore the alternative approach using \everymath: I made a start over breakfast but got stuck with a few issues. Lunchtime ...
 
@AlexG Probably not, although I didn't check what the active character was doing there just a global swep over texlive looking for $
 
@UlrikeFischer amsmath at present, but I also need to explore this
@UlrikeFischer Note that e.g. TikZ explicitly forces catcode-3, so making active in the format is not a guarantee of applying to all packages
 
@JosephWright yes, that could be a problem. I bet most of the oberdiek packages have something here too.
 
10:11 AM
@JosephWright \mathstyle might be the best that can be done in a reasonably compatible way but it is still pretty weird, wrong (or at least not useful) value after an ungrouped \mathchoice or in \over not guarded with \Ustack
 
@DavidCarlisle @MarcelKrüger pointed out we'd need \Ustack, and I think the idea would be to make the exposed \mathchoice into a macro, hiding the primitive
 
@JosephWright but would you force grouping or allow the current slightly weird behaviour that \scriptstyle escapes a \mathchoice?
 
@DavidCarlisle I was thinking of issuing an error and refusing to do anything ;) \mathchoice is after all not in Lamport's book
@DavidCarlisle Seriously: I was thinking of using \mathstyle to make the typesetting choice, doing one thing and not using the primitive at all
@DavidCarlisle All that is required is that a control sequence called \mathchoice absorbs four arguments and typseets the correct one for the current math style
@UlrikeFischer At the moment, I'm still feeling active-$ is better than \everymath
 
@JosephWright my main worry (which is independant of the method used for grabbing) are people hiding the "end math" in some commands.
 
10:29 AM
@UlrikeFischer That also occurs to me
@UlrikeFischer The only other way is the math list approach, but that would mean Lua-only and at that point the entire plan would be very different
 
Hi everybody
Just a curiosity: is there a way to link a part of a LaTeX document into another LaTeX document?
Specifically, I should link terms from a dictionary into documentation.
Are there any packages that allow me to do something like this, or is it unrealistic?
 
@LukeTheWolf use the xr-hyper package + hyperref.
 
@UlrikeFischer Thx!
 
@LukeTheWolf if you know the names of the target destinations, then hyperref is enough.
 
@UlrikeFischer I'll try that! Just to be sure, with "names" you mean the "entries" of my dictionary?
 
10:41 AM
@LukeTheWolf no, assuming that you used hyperref in your dictionary, there will be anchors in the PDF which you can use in external links. The names are often guessable, e.g. chapter.1 or section.1.2. or page.23
 
@UlrikeFischer Ahn ok ok got it! Thanks a lot again!
 
11:37 AM
LaTeX does not inform if files read in via \@starttoc do not exist at the time they are to be read in, but are created at the end of the LaTeX run, after the aux file has been read in for the second time, so that they exist in the next LaTeX run.
With new LaTeX, could the \@starttoc command be patched so that in case the file to be input does not exist a directive is added to the hook "enddocument/info" to check whether the that file exists and if so to issue a message that a previously non-existent auxiliary file has been created in the meantime and that the document should be recompiled to take that auxiliary file into account?
Or has this already been done and I didn't notice due to using rarther old LaTeX2e <2020-10-01> patch level 4 with L3 programming layer <2021-02-18>?
 
@UlrichDiez I get a No file test-utf8.toc. message.
 
Reading a grant proposal in Comic Sans
3
 
12:07 PM
@JosephWright Haha, provoking.
 
12:18 PM
@UlrikeFischer I get such a message, too, but I don't get a message that the file has been created in the meantime and that LaTeX should be re-run for taking that into account.
 
@UlrichDiez most "re-run" scripts look for that messge as a need to re-run so an extra message at the end wouldn't necessarily help
 
@UlrichDiez You seem to want something like logreq but built in to the kernel?
 
@JosephWright Not necessarily into the kernel. I think I can implement such a thing on my own as well. Actually I would like to know if I overlook aspects due to which the idea/concept is flawed in any case.
 
@UlrichDiez Like I said, look at logreq
 
@UlrichDiez you could use \usepackage[starttoc]{rerunfilecheck}
 
12:31 PM
@UlrikeFischer @Joseph Wright, @Ulrike Fischer: Thanks for these pointers. So what I had n mind is already implemented, thus no need for me to reinvent the wheel... ;-)
 
1:06 PM
A completely different question: When posting blocks of code on TeX-LaTeX StackExchange - what is the recommended maximum number of characters per line? (In usenet, [de.]comp.text.tex, I try to stick to the 72 character limit...)
 
1:19 PM
@UlrichDiez I try to avoid the need for horizontal scrolling in the resulting pre/div (using the maximum width of my browser window, however). This would be around 90, I think.
Not easy to test. The pre preview is wider than the resulting box in the posted answer. It should be 89, but it probably also depends on the char width of different fonts used by different operating systems. So ... 72 is a good rule-of-thumb, I'd say
 
1:41 PM
@UlrichDiez well shorter lines are better, but the optimum is around 30 on my mobile, and 86 on my PC and something between both on my small laptop, so you can't really win.
 
@UlrikeFischer @JosephWright I humbly admit I lost you here, so that my comment could be just babble, but if you want me to check things, I'll do it (circuitikz has subcircuits, which must be declared in the preamble and then instantiated in the body, which do us $ quite heavily)...
 
@Rmano Nothing for you to do at present: we are working out longer-term ideas and what does and doesn't work currently
 
@JosephWright ok, nice to know, thanks!
 
@Rmano do you have testfiles for circuitikz?
 
@UlrikeFischer Unfortunately, no. I normally just run the manual.
It's on my todo-list for when I'll have time (lots of it).
 
2:01 PM
@JosephWright does babel really need to do that?, seems odd to add weirdness to the format just for babel to test if it is there
 
@DavidCarlisle Long-term I'd rather not, but as a hotfix ...
@DavidCarlisle ALternative is to force \bbl@cased, but that requires a babel patch of \MakeUppercase, etc.
 
@JasperHabicht I wonder: What kind of displays can you assume nowadays for people who a) look at the code in the browser? b) copy-paste the code and look at it on their system? | For a while it was usus to assume vga 80x25, i.e. 80 characters per line and 25 screen lines.
 
@JosephWright babel could add it as a hotter fix
 
From the width one subtracted something, so that people could indent when quoting, and so that displaying programs had space for a frame and maybe a scroll bar... But things are changing all the time.
 
@DavidCarlisle I can restore the older approach to using \@uclclist instead
 
2:04 PM
@JosephWright which is same really. Perhaps just add a comment referencing babel at that point?
 
@DavidCarlisle Sure
@DavidCarlisle Sure
@DavidCarlisle I'm mindful that a proper fix might relate to our workshop, but will be long-term
 
@UlrichDiez As Ulrike said, it is difficult to say. Some people use mobile devices with much smaller screens to look at code (e.g. on TeX.SX). However, I would argue that people will hardly use TeX.SX on a mobile to copy and paste code to compile it somewhere. So, I would assume that most people who code use a monitor with1920 x 1080 pixels (at least when they code)
Then again, long lines are hard to read (which also holds for code) which is probably why the main part of the websites of the SE network is quite narrow. Also, maybe the window where the code is displayed is only one part of the screen, the rest being directories, menus, console windows etc ...
In general, I would argue that readability of code is more or less similar to the readability of other things you read. As for the length of lines, they may be a bit longer than with body text, since it is probably easier in code (which has indentation and maybe also syntax highlighting) to find the begin of the next line than it is for body text. To sum up my monologue: Sticking to around 80 chars per line as maximum is probably still valid.
 
2:22 PM
> which is probably why the main part of the websites of the SE network is quite narrow.
@JasperHabicht ^^^ You are very optimistic. I would say it is narrow to leave enough room for the advertisement in the right sidebar :)
 
@samcarter_xmas_is_coming Sure, this is another way to take it ... =) But my point was: text lines that span from one side of the browser window to the other are very hard to read.
 
@JasperHabicht I agree :)
 
 
2 hours later…
4:52 PM
@JasperHabicht Anyway, it seems that the size of the central column is limited to something around 780 pixel, even with a QHD display ;-| --- so it seems that there is a point in which you'll have a scrollbar, no matter the display...
 
@Rmano Yes this is true. I am not saying that I approve of this layout. I was just arguing (because Ulrich asked about the typical monitor sizes) that the optimal length of text (be it code or not) probably does not depend on the width of the screen that much.
 
I got into a fight with 1, 3, 5, 7 and 9. The odds were against me.
2
 
@Rmano But you are right: the layout looks a bit strange when the window is very wide and one wonders what the space is for. If I design a website, I typically increase the font size for wide layouts to avoid lines with too many chars in it
 
@PauloCereda did you see the impossible to answer question example in the meta post on new mailbox?
 
@JasperHabicht Indeed, I agree that too long a line is difficult to read, but one with a horizontal scrollbar is even worse. It would be nice to have the option to expand it if someone is not kind enough to wrap at 80...
 
5:03 PM
@Rmano As for the scrollbar: right, this is if you enter more than 89 chars for code (at least on Win 10 which uses Consolas at 13px).
True, this would be a nice option!
 

« first day (4413 days earlier)      last day (505 days later) »