On Tue, Sep 03, 2024 at 01:44:33AM +0200, Rudolf Adamkovič wrote: > Patrice Dumas <[email protected]> writes: > > I think using <pre> makes perfect sense semantically. LaTeX is source > code, just like SVG is. It just happens that MathJax may (or may not) > render it (soon enough). What is more, it is often beneficial to read > LaTeX code as formatted by its author, not re-formatted, which makes it > doubly-important to use <pre>. Virtually nobody presents SVG or LaTeX > code, for un-rendered consumption, that is as source code, on a single > line in a proportional fonts. Are these good arguments?
First, a minor point, even though the point that TeX code could be considered as code and not directly as math makes some sense, it is quite different from SVG in term of readability, in general even though TeX math is code in a way, it is much better in term of readability and in some case as good as it can be compared to 'ascii' math (for somewhat complex math). More importantly, this misses the point that in Texinfo the @displaymath or @math may not be LaTeX (nor TeX). We strongly recommend using TeX math code such that it renders correctly when processed by Texinfo TeX, but semantically it is math, not code. So, I still do not think that considering TeX as output by Texinfo is semantically code is the best. A <div> that contains math is better from a semantic point of view. That being said, in HTML, math is almost always TeX code, so, the presentation of math is TeX code, such that we want to present TeX code as well as possible, and we can consider that for that, <pre> has the merit to keep end of lines as they are in the original TeX for text based browsers. If we do that, we will need to use CSS to remove momospaced font and add emphasis, though, such that the presentaiton is correct in graphical browsers. > By the same line of reasoning, inline mathematics should use <code>, > because well, it literally is "code" that has not been rendered yet. I do not think that it would be a good idea, the @math TeX is, in general, quite readable, and is presented inline anyway, so there is no gain in term of presentation by using <code> and it is semantically inferior to emphasizing, in my opinion. -- Pat
