|
From: | Jacob Bachmeyer |
Subject: | Re: behavior of @math with HTML output |
Date: | Fri, 14 Oct 2022 21:27:22 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 SeaMonkey/1.1.17 Mnenhy/0.7.6.0 |
Vincent Lefevre wrote:
On 2022-10-14 11:30:33 +0200, Patrice Dumas wrote:On Fri, Oct 14, 2022 at 12:40:08AM +0200, Vincent Lefevre wrote:On 2022-10-13 21:15:57 +0200, Patrice Dumas wrote: All of them are buggy: * Concerning t4h, @math{@var{base} \le 16}, yields "@varbase ≤ 16 ,", so @var doesn't work (while it is needed to ensure exactly the same typography/code as outside @math, e.g. <var>base</var>) and there is a spurious space before the comma.In my experience, t4h is the one that tries harder to use characters for simple math and often succeeds. Images are still used when it becomes too complex. It is probably the best for your use. As you have noticed, however, t4h only knows about TeX, not Texinfo. It is actually said in the manual that @math should not contain Texinfo commands, in line with the 'recent' better handling of TeX/LaTeX: "In general, the contents of @math or @displaymath should be plain TeX only, with no interspersed Texinfo commands."I assumed that this was for commands that exist in plain TeX, which is not the case of @var.
Since "var" actually is a TeX macro (Texinfo works by adjusting TeX's configuration to make @ introduce commands, like backslash does in plain TeX), would the correct syntax be "@math{\var{base} \le 16}" for the example above?
In the upcoming version, there is a converter to LaTeX, which allowed to add the customization variable CONVERT_TO_LATEX_IN_MATH. You could use that in conjunction with HTML_MATH t4h to have Texinfo @-commands produce TeX/LaTeX math in @math. However, it won't do what you want in term of formatting, as, if I recall well, @var is a no-op in conversion to LaTeX in math mode, as math mode is already slanted.Well, math mode normally uses italics, not slanted, but perhaps this is changed by t4h (or Texinfo). There is another issue: math mode disables kerning (because a sequence of letters typically means that this is a product), unless some command is used to specify that this is actually text. Not a major issue, but incorrect typography can be disturbing.
TeX has an \ifmmode conditional that is true in math mode; @var/\var and other marking macros could be adjusted to mark their arguments appropriately when invoked in math mode. Are there other macros that would be appropriate in @math? At first glance, @var seems unique here.
-- Jacob
[Prev in Thread] | Current Thread | [Next in Thread] |