help-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add "Up:" to Texinfo navigation bar?


From: Rudolf Adamkovič
Subject: Re: How to add "Up:" to Texinfo navigation bar?
Date: Tue, 03 Sep 2024 01:44:33 +0200

Patrice Dumas <pertusus@free.fr> writes:

> What would you have expected?  My feeling is that adding a
> MATHJAX_CONFIGURATION variable with default:
>   options: {
>     skipHtmlTags: {'[-]': ['pre']},
>     ignoreHtmlClass: 'tex2jax_ignore',
>     processHtmlClass: 'tex2jax_process'
>   }, 
> set if MATHJAX_CONFIGURATION is undef could work.  Do you have another
> proposition?

That would be helpful.  It would allow me, for example, to load the
physics extension, which is something I need.

> For no-JavaScript browsers with CSS support, a possibility could be to
> add CSS with --css-include, with something like:
>
>   div.displaymath {white-space: pre;}
>
> (I tested with Firefox with and without JavaScript).  If you want to
> propose something like that as the default, I think that it should be
> discussed on the bug-texinfo list.
>
> Even if the output could be better in text browsers (which, in general,
> do not support CSS, so the above CSS use is not possible), my view is that
> using a <div> is better from both a formatting and a semantic point of
> view than using <pre>.  I could change my mind, but that would require
> some good arguments.

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?

(Speaking as a user, every time MathJax does not load in my Texinfo
instance, which happens from time to time for unrelated reasons, it
makes all non-trivial mathematics unusable.)

> Also, currently this would break MathJax, as pre is excluded from
> MathJax elements, and this would probably require using some CSS to
> avoid the monospaced font.

MathJax documentation gives this as their example:

 :: skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre',
 :: 'code', 'annotation', 'annotation-xml']
 ::
 :: This array lists the names of the tags whose contents should not be
 :: processed by MathJaX (other than to look for ignore/process classes as
 :: listed below). You can add to (or remove from) this list to prevent
 :: MathJax from processing mathematics in specific contexts. E.g.,
 ::
 :: skipHtmlTags: {'[-]': ['code', 'pre'], '[+]': ['li']}
 ::
 :: would remove 'code' and 'pre' tags from the list, while adding 'li'
 :: tags to the list.

 https://docs.mathjax.org/en/latest/options/document.html

> To me, if you really want a <pre> for displaymath, the best is to
> redefine the displaymath conversion command function.

By the same line of reasoning, inline mathematics should use <code>,
because well, it literally is "code" that has not been rendered yet.

> It happens to be a relatively small and simple default function.

That, and `MATHJAX_CONFIGURATION' to enable <pre>.  Of course, I can
hack something together privately, but for the sake of Texinfo users, it
would be probably better to fix this upstream, in my opinion.

Rudy
-- 
"Mathematics takes us still further from what is human into the region
of absolute necessity, to which not only the actual world, but every
possible world, must conform."  --- Bertrand Russell, 1902

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]