all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Scaling of image produced for math in Info in the Emacs Info reader
@ 2025-01-11 22:00 Patrice Dumas
  2025-01-12  8:23 ` Ihor Radchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Patrice Dumas @ 2025-01-11 22:00 UTC (permalink / raw)
  To: emacs-devel

Hello,

In the development version of GNU Texinfo, we have added a new
functionality, a conversion of math commands to images.  This was a
request from Rahguzar for the Emacs Info reader:
https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html

It was implemented recently in texi2any/makeinfo:
https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html

However, the images are not scaled correctly, they should be scaled
according to the user font size in Emacs.  We discussed about this
issue, and came to the conclusion that with the image generated from
math commands in Info file there should be some information on the image
size and that the Emacs Info viewer should be modified to take advantage
of this information to rescale the images.  We discussed about the
information that could be added to Info in those mails:
https://lists.gnu.org/archive/html/bug-texinfo/2025-01/msg00005.html
https://lists.gnu.org/archive/html/bug-texinfo/2025-01/msg00048.html

Eli Zaretskii suggested that we start a discussion on emacs-devel on
those subjects, so here it is.  Any feedback on the overall issue, on
what we should provide in Info, anybody interested in doing the change
in the Emacs Info reader?

PS: please keep me in CC, I am not subscribed.

-- 
Pat



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-11 22:00 Scaling of image produced for math in Info in the Emacs Info reader Patrice Dumas
@ 2025-01-12  8:23 ` Ihor Radchenko
  2025-01-12 13:12   ` Patrice Dumas
  2025-01-28 19:48 ` Björn Bidar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: Ihor Radchenko @ 2025-01-12  8:23 UTC (permalink / raw)
  To: Patrice Dumas, karthikchikmagalur, orgmode; +Cc: emacs-devel

Patrice Dumas <pertusus@free.fr> writes:

> In the development version of GNU Texinfo, we have added a new
> functionality, a conversion of math commands to images.  This was a
> request from Rahguzar for the Emacs Info reader:
> https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html
>
> It was implemented recently in texi2any/makeinfo:
> https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html
>
> However, the images are not scaled correctly, they should be scaled
> according to the user font size in Emacs....

Karthik and Timothy have managed to solved similar issues when
implementing LaTeX previews for Org mode.

Demo: https://www.youtube.com/watch?v=n-AfvuV-bYo

AFAIK, Karthik (CCed) have been working on generalizing the preview
system to work in arbitrary major modes (not just Org mode). Maybe it
can be reused for Info reader.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-12  8:23 ` Ihor Radchenko
@ 2025-01-12 13:12   ` Patrice Dumas
  0 siblings, 0 replies; 18+ messages in thread
From: Patrice Dumas @ 2025-01-12 13:12 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: karthikchikmagalur, orgmode, emacs-devel

On Sun, Jan 12, 2025 at 08:23:46AM +0000, Ihor Radchenko wrote:
> Patrice Dumas <pertusus@free.fr> writes:
> 
> > In the development version of GNU Texinfo, we have added a new
> > functionality, a conversion of math commands to images.  This was a
> > request from Rahguzar for the Emacs Info reader:
> > https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html
> >
> > It was implemented recently in texi2any/makeinfo:
> > https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html
> >
> > However, the images are not scaled correctly, they should be scaled
> > according to the user font size in Emacs....
> 
> Karthik and Timothy have managed to solved similar issues when
> implementing LaTeX previews for Org mode.
> 
> Demo: https://www.youtube.com/watch?v=n-AfvuV-bYo

Thanks.  The scaling part is indeed relevant, the idea would be to do
the same in the Info viewer, with images aligned with the text and
resized when zooming in and out.  The need we have is, however, much
less involved than in the video, as we already have the images
generated, what remains to do is to give information for scale when the
images are generated, and scale them in Emacs Info viewer.

(As a side note, previews for Texinfo editing could be much more similar
to the video setup).

-- 
Pat



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-11 22:00 Scaling of image produced for math in Info in the Emacs Info reader Patrice Dumas
  2025-01-12  8:23 ` Ihor Radchenko
@ 2025-01-28 19:48 ` Björn Bidar
       [not found] ` <8734h290u9.fsf@>
  2025-01-31  1:44 ` Scaling of image produced for math in Info in the Emacs Info reader, " James Thomas
  3 siblings, 0 replies; 18+ messages in thread
From: Björn Bidar @ 2025-01-28 19:48 UTC (permalink / raw)
  To: Patrice Dumas; +Cc: emacs-devel


Out of curiosity would it be possible to render math in UTF-8 instead?
That would avoid any scaling issues, especially when the font size
changes.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
       [not found] ` <8734h290u9.fsf@>
@ 2025-01-28 20:00   ` Eli Zaretskii
  2025-01-30  7:19     ` Björn Bidar
       [not found]     ` <87bjvo7orf.fsf@>
  0 siblings, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2025-01-28 20:00 UTC (permalink / raw)
  To: Björn Bidar; +Cc: pertusus, emacs-devel

> From: Björn Bidar <bjorn.bidar@thaodan.de>
> Cc: emacs-devel@gnu.org
> Date: Tue, 28 Jan 2025 21:48:14 +0200
> 
> 
> Out of curiosity would it be possible to render math in UTF-8 instead?
> That would avoid any scaling issues, especially when the font size
> changes.

UTF-8 is an encoding, so how can one render with it?

If you mean the Unicode characters from the symbols and mathematical
alphanumerics blocks, then does that really work for arbitrary
formulas?  The Unicode Standard has only a finite (somewhat small) set
of mathematical symbols, they are not enough to cover every possible
formula one might need?

Or do you mean something else?



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-28 20:00   ` Eli Zaretskii
@ 2025-01-30  7:19     ` Björn Bidar
       [not found]     ` <87bjvo7orf.fsf@>
  1 sibling, 0 replies; 18+ messages in thread
From: Björn Bidar @ 2025-01-30  7:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: pertusus, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Björn Bidar <bjorn.bidar@thaodan.de>
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 28 Jan 2025 21:48:14 +0200
>> 
>> 
>> Out of curiosity would it be possible to render math in UTF-8 instead?
>> That would avoid any scaling issues, especially when the font size
>> changes.
>
> UTF-8 is an encoding, so how can one render with it?

Sorry I should have said UTF-8 (mathematical) characters. 

> If you mean the Unicode characters from the symbols and mathematical
> alphanumerics blocks, then does that really work for arbitrary
> formulas?  The Unicode Standard has only a finite (somewhat small) set
> of mathematical symbols, they are not enough to cover every possible
> formula one might need?

I don't exactly but one way to try look into this is how does LaTeX do
it when rendering  mathematical formulas to PDF. Not sure if rendering
is the right here but I hope you get the point.

One example for rendering mathematical formulas in UTF-8 characters can
be seen in the PDF linked on this site:
https://www.cmor-faculty.rice.edu/~heinken/mh_links.html

List of (La)TeX Greek characters, Mathematical Symbols
https://www.cmor-faculty.rice.edu/~heinken/latex/symbols.pdf

Section 10 shows a Latex mathematical completely made of characters.




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
       [not found]     ` <87bjvo7orf.fsf@>
@ 2025-01-30  7:34       ` tomas
  2025-01-30  8:03       ` Eli Zaretskii
  2025-01-30  8:06       ` pertusus
  2 siblings, 0 replies; 18+ messages in thread
From: tomas @ 2025-01-30  7:34 UTC (permalink / raw)
  To: Björn Bidar; +Cc: Eli Zaretskii, pertusus, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

On Thu, Jan 30, 2025 at 09:19:00AM +0200, Björn Bidar wrote:

[...]

> Sorry I should have said UTF-8 (mathematical) characters. 

... Unicode (mathematical) characters.

Sorry to be fastidious :)

Confusion here is actually harmful.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
       [not found]     ` <87bjvo7orf.fsf@>
  2025-01-30  7:34       ` tomas
@ 2025-01-30  8:03       ` Eli Zaretskii
  2025-01-31  5:06         ` Björn Bidar
       [not found]         ` <878qqr4lnq.fsf@>
  2025-01-30  8:06       ` pertusus
  2 siblings, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2025-01-30  8:03 UTC (permalink / raw)
  To: Björn Bidar; +Cc: pertusus, emacs-devel

> From: Björn Bidar <bjorn.bidar@thaodan.de>
> Cc: pertusus@free.fr,  emacs-devel@gnu.org
> Date: Thu, 30 Jan 2025 09:19:00 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > If you mean the Unicode characters from the symbols and mathematical
> > alphanumerics blocks, then does that really work for arbitrary
> > formulas?  The Unicode Standard has only a finite (somewhat small) set
> > of mathematical symbols, they are not enough to cover every possible
> > formula one might need?
> 
> I don't exactly but one way to try look into this is how does LaTeX do
> it when rendering  mathematical formulas to PDF. Not sure if rendering
> is the right here but I hope you get the point.
> 
> One example for rendering mathematical formulas in UTF-8 characters can
> be seen in the PDF linked on this site:
> https://www.cmor-faculty.rice.edu/~heinken/mh_links.html
> 
> List of (La)TeX Greek characters, Mathematical Symbols
> https://www.cmor-faculty.rice.edu/~heinken/latex/symbols.pdf
> 
> Section 10 shows a Latex mathematical completely made of characters.

LaTeX doesn't just use Unicode codepoints to display math, it uses 2D
layout to place various font glyphs around and above/below others.
Since makeinfo produces what is basically a text file, it would need
to include some non-trivial formatting control sequences to tell Emacs
how to render these character glyphs to show them on screen.  So just
using the corresponding codepoints does not solve the problem, because
Emacs will then show the corresponding glyphs linearly, one after the
other.

We could perhaps use character composition and HarfBuzz shaping to
produce the desired effect from a sequence of codepoints, but that
would mean only certain fonts are suitable for displaying Info manuals
with math (assuming there are such fonts out there, I don't know if
that's true), and makeinfo will need to know about those fonts and
their shaping capabilities when it generates Info files.  I'm not sure
this is a reasonable design.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
       [not found]     ` <87bjvo7orf.fsf@>
  2025-01-30  7:34       ` tomas
  2025-01-30  8:03       ` Eli Zaretskii
@ 2025-01-30  8:06       ` pertusus
  2 siblings, 0 replies; 18+ messages in thread
From: pertusus @ 2025-01-30  8:06 UTC (permalink / raw)
  To: Björn Bidar; +Cc: Eli Zaretskii, emacs-devel

On Thu, Jan 30, 2025 at 09:19:00AM +0200, Björn Bidar wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> List of (La)TeX Greek characters, Mathematical Symbols
> https://www.cmor-faculty.rice.edu/~heinken/latex/symbols.pdf
> 
> Section 10 shows a Latex mathematical completely made of characters.

A PDF document is made of individual characters and curves/lines, but it
does not mean that it is possible to render it as lines of characters,
as for subscripts and superscripts, fractions and long bars it becomes
difficult to get something good when constrained by lines.  tex4ht tries
to use characters (and <sub>/<sup>) when rendering HTML, but falls back
to images for complex math.

If I recall well, symbolic calculus software often tries to have
representations using chracters on lines only, it is not that bad, but
not as good as specifically placed symbols.

-- 
Pat



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader, Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-11 22:00 Scaling of image produced for math in Info in the Emacs Info reader Patrice Dumas
                   ` (2 preceding siblings ...)
       [not found] ` <8734h290u9.fsf@>
@ 2025-01-31  1:44 ` James Thomas
  2025-02-03 19:24   ` Patrice Dumas
  3 siblings, 1 reply; 18+ messages in thread
From: James Thomas @ 2025-01-31  1:44 UTC (permalink / raw)
  To: Patrice Dumas; +Cc: Ihor Radchenko, emacs-devel

Patrice Dumas <pertusus@free.fr> writes:

> Hello,
>
> In the development version of GNU Texinfo, we have added a new
> functionality, a conversion of math commands to images.  This was a
> request from Rahguzar for the Emacs Info reader:
> https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html
>
> It was implemented recently in texi2any/makeinfo:
> https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html
>
> However, the images are not scaled correctly, they should be scaled
> according to the user font size in Emacs.  We discussed about this
> issue, and came to the conclusion that with the image generated from
> math commands in Info file there should be some information on the image
> size and that the Emacs Info viewer should be modified to take advantage
> of this information to rescale the images.

Are you aware of 'image-scaling-factor'?

Ihor Radchenko writes:

> AFAIK, Karthik (CCed) have been working on generalizing the preview
> system to work in arbitrary major modes (not just Org mode). Maybe it
> can be reused for Info reader.

IMO the above would be useful alternative, and/as some may not need
this.

--



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-30  8:03       ` Eli Zaretskii
@ 2025-01-31  5:06         ` Björn Bidar
       [not found]         ` <878qqr4lnq.fsf@>
  1 sibling, 0 replies; 18+ messages in thread
From: Björn Bidar @ 2025-01-31  5:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: pertusus, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> We could perhaps use character composition and HarfBuzz shaping to
> produce the desired effect from a sequence of codepoints, but that
> would mean only certain fonts are suitable for displaying Info manuals
> with math (assuming there are such fonts out there, I don't know if
> that's true), and makeinfo will need to know about those fonts and
> their shaping capabilities when it generates Info files.  I'm not sure
> this is a reasonable design.

Should this already happen composing HTML or LaTeX output? It possible
to render mathematical formulas in a similar way than in PDF's with
HTML.
"All" that's missing is include the information that PDF's and the HTML
output already should get for this.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
       [not found]         ` <878qqr4lnq.fsf@>
@ 2025-01-31  7:38           ` Eli Zaretskii
  2025-01-31 20:58             ` chad
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2025-01-31  7:38 UTC (permalink / raw)
  To: Björn Bidar; +Cc: pertusus, emacs-devel

> From: Björn Bidar <bjorn.bidar@thaodan.de>
> Cc: pertusus@free.fr,  emacs-devel@gnu.org
> Date: Fri, 31 Jan 2025 07:06:33 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > We could perhaps use character composition and HarfBuzz shaping to
> > produce the desired effect from a sequence of codepoints, but that
> > would mean only certain fonts are suitable for displaying Info manuals
> > with math (assuming there are such fonts out there, I don't know if
> > that's true), and makeinfo will need to know about those fonts and
> > their shaping capabilities when it generates Info files.  I'm not sure
> > this is a reasonable design.
> 
> Should this already happen composing HTML or LaTeX output? It possible
> to render mathematical formulas in a similar way than in PDF's with
> HTML.
> "All" that's missing is include the information that PDF's and the HTML
> output already should get for this.

How's that possible?  Info files are plain-text files with some
special-purpose control sequences.  Plain-text means it's just a
sequence of Unicode codepoints.  How can a plain-text file express
layout produced by LaTeX?



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-31  7:38           ` Eli Zaretskii
@ 2025-01-31 20:58             ` chad
  0 siblings, 0 replies; 18+ messages in thread
From: chad @ 2025-01-31 20:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Björn Bidar, pertusus, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

On Fri, Jan 31, 2025 at 2:39 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Björn Bidar <bjorn.bidar@thaodan.de>
> > [...]
> > Should this already happen composing HTML or LaTeX output? It possible
> > to render mathematical formulas in a similar way than in PDF's with
> > HTML.
> > "All" that's missing is include the information that PDF's and the HTML
> > output already should get for this.
>
> How's that possible?  Info files are plain-text files with some
> special-purpose control sequences.  Plain-text means it's just a
> sequence of Unicode codepoints.  How can a plain-text file express
> layout produced by LaTeX?
>

It's not really practical in HTML, either; that's the entire point of
MathJax
(a "javascript display engine" library that recreates a subset of TeX for
CSS + SVG or web-fonts). MathJax is used by systems like AsciiMath for
this purpose, but is anything but lightweight, and the usual expectation is
that you're either calling out to a web service, or running node locally.

I hope that helps,
~Chad

[-- Attachment #2: Type: text/html, Size: 1631 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader, Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-01-31  1:44 ` Scaling of image produced for math in Info in the Emacs Info reader, " James Thomas
@ 2025-02-03 19:24   ` Patrice Dumas
  2025-02-04  0:20     ` James Thomas
  0 siblings, 1 reply; 18+ messages in thread
From: Patrice Dumas @ 2025-02-03 19:24 UTC (permalink / raw)
  To: James Thomas; +Cc: Ihor Radchenko, emacs-devel

On Fri, Jan 31, 2025 at 07:14:26AM +0530, James Thomas wrote:
> Patrice Dumas <pertusus@free.fr> writes:
> 
> > Hello,
> >
> > In the development version of GNU Texinfo, we have added a new
> > functionality, a conversion of math commands to images.  This was a
> > request from Rahguzar for the Emacs Info reader:
> > https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html
> >
> > It was implemented recently in texi2any/makeinfo:
> > https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html
> >
> > However, the images are not scaled correctly, they should be scaled
> > according to the user font size in Emacs.  We discussed about this
> > issue, and came to the conclusion that with the image generated from
> > math commands in Info file there should be some information on the image
> > size and that the Emacs Info viewer should be modified to take advantage
> > of this information to rescale the images.
> 
> Are you aware of 'image-scaling-factor'?

Yes, we are, Eli pointed us to that information:
https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00069.html

But I do not have any idea on how to use that information in practice...

-- 
Pat



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader, Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-02-03 19:24   ` Patrice Dumas
@ 2025-02-04  0:20     ` James Thomas
  2025-02-04 12:31       ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: James Thomas @ 2025-02-04  0:20 UTC (permalink / raw)
  To: Patrice Dumas; +Cc: emacs-devel

Patrice Dumas writes:

> On Fri, Jan 31, 2025 at 07:14:26AM +0530, James Thomas wrote:
>> Patrice Dumas writes:
>>
>> > Hello,
>> >
>> > In the development version of GNU Texinfo, we have added a new
>> > functionality, a conversion of math commands to images.  This was a
>> > request from Rahguzar for the Emacs Info reader:
>> > https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html
>> >
>> > It was implemented recently in texi2any/makeinfo:
>> > https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html
>> >
>> > However, the images are not scaled correctly, they should be scaled
>> > according to the user font size in Emacs.  We discussed about this
>> > issue, and came to the conclusion that with the image generated from
>> > math commands in Info file there should be some information on the image
>> > size and that the Emacs Info viewer should be modified to take advantage
>> > of this information to rescale the images.
>>
>> Are you aware of 'image-scaling-factor'?
>
> Yes, we are, Eli pointed us to that information:
> https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00069.html
>
> But I do not have any idea on how to use that information in practice...

For e.g (setq-local image-scaling-factor 0.5) works in an Info buffer as
well. I think if there's a scale for any normal images included in the
file, the only thing to decide is the relative scale of formula images.

--



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader, Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-02-04  0:20     ` James Thomas
@ 2025-02-04 12:31       ` Eli Zaretskii
  2025-02-06  8:28         ` James Thomas
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2025-02-04 12:31 UTC (permalink / raw)
  To: James Thomas; +Cc: pertusus, emacs-devel

> From: James Thomas <jimjoe@gmx.net>
> Cc: emacs-devel@gnu.org
> Date: Tue, 04 Feb 2025 05:50:47 +0530
> 
> Patrice Dumas writes:
> 
> > On Fri, Jan 31, 2025 at 07:14:26AM +0530, James Thomas wrote:
> >> Patrice Dumas writes:
> >>
> >> > Hello,
> >> >
> >> > In the development version of GNU Texinfo, we have added a new
> >> > functionality, a conversion of math commands to images.  This was a
> >> > request from Rahguzar for the Emacs Info reader:
> >> > https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html
> >> >
> >> > It was implemented recently in texi2any/makeinfo:
> >> > https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html
> >> >
> >> > However, the images are not scaled correctly, they should be scaled
> >> > according to the user font size in Emacs.  We discussed about this
> >> > issue, and came to the conclusion that with the image generated from
> >> > math commands in Info file there should be some information on the image
> >> > size and that the Emacs Info viewer should be modified to take advantage
> >> > of this information to rescale the images.
> >>
> >> Are you aware of 'image-scaling-factor'?
> >
> > Yes, we are, Eli pointed us to that information:
> > https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00069.html
> >
> > But I do not have any idea on how to use that information in practice...
> 
> For e.g (setq-local image-scaling-factor 0.5) works in an Info buffer as
> well. I think if there's a scale for any normal images included in the
> file, the only thing to decide is the relative scale of formula images.

I think my idea at the time was to use scale factor of 1.0, which will
have the effect of scaling the image so it has the same height as the
font used to display the Info manual.  So the idea was to have in the
Info file some special control sequence which will tell Emacs to apply
the scale factor of 1.0 to the image.  (Of course, if it is known that
an image needs to be, say, twice larger than the text, the scale
factor could be 2.0 instead, and in general could be part of that
control sequence.)

Does this make sense?



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader, Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-02-04 12:31       ` Eli Zaretskii
@ 2025-02-06  8:28         ` James Thomas
  2025-02-06 10:04           ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: James Thomas @ 2025-02-06  8:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: pertusus, emacs-devel

Eli Zaretskii writes:

>> From: James Thomas
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 04 Feb 2025 05:50:47 +0530
>>
>> Patrice Dumas writes:
>>
>> > On Fri, Jan 31, 2025 at 07:14:26AM +0530, James Thomas wrote:
>> >> Patrice Dumas writes:
>> >>
>> >> > Hello,
>> >> >
>> >> > In the development version of GNU Texinfo, we have added a new
>> >> > functionality, a conversion of math commands to images.  This was a
>> >> > request from Rahguzar for the Emacs Info reader:
>> >> > https://lists.gnu.org/archive/html/help-texinfo/2024-08/msg00001.html
>> >> >
>> >> > It was implemented recently in texi2any/makeinfo:
>> >> > https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html
>> >> >
>> >> > However, the images are not scaled correctly, they should be scaled
>> >> > according to the user font size in Emacs.  We discussed about this
>> >> > issue, and came to the conclusion that with the image generated from
>> >> > math commands in Info file there should be some information on the image
>> >> > size and that the Emacs Info viewer should be modified to take advantage
>> >> > of this information to rescale the images.
>> >>
>> >> Are you aware of 'image-scaling-factor'?
>> >
>> > Yes, we are, Eli pointed us to that information:
>> > https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00069.html
>> >
>> > But I do not have any idea on how to use that information in practice...
>>
>> For e.g (setq-local image-scaling-factor 0.5) works in an Info buffer as
>> well. I think if there's a scale for any normal images included in the
>> file, the only thing to decide is the relative scale of formula images.
>
> I think my idea at the time was to use scale factor of 1.0, which will
> have the effect of scaling the image so it has the same height as the
> font used to display the Info manual.  So the idea was to have in the
> Info file some special control sequence which will tell Emacs to apply
> the scale factor of 1.0 to the image.  (Of course, if it is known that
> an image needs to be, say, twice larger than the text, the scale
> factor could be 2.0 instead, and in general could be part of that
> control sequence.)
>
> Does this make sense?

It does, but I was actually going for something simpler; during
Texinfo's generation: That it ought to create an image sized using the
system font in the build machine, by default. Any other scaling would be
up to us Emacs devs.

Since all images may be scaled at generation time itself, I thought,
there was no further need to complicate. The ideal arrangement is anyway
the formula itself being there and on-the-fly generation ala org.

--



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Scaling of image produced for math in Info in the Emacs Info reader, Re: Scaling of image produced for math in Info in the Emacs Info reader
  2025-02-06  8:28         ` James Thomas
@ 2025-02-06 10:04           ` Eli Zaretskii
  0 siblings, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2025-02-06 10:04 UTC (permalink / raw)
  To: James Thomas; +Cc: pertusus, emacs-devel

> From: James Thomas <jimjoe@gmx.net>
> Cc: pertusus@free.fr,  emacs-devel@gnu.org
> Date: Thu, 06 Feb 2025 13:58:59 +0530
> 
> Eli Zaretskii writes:
> 
> > I think my idea at the time was to use scale factor of 1.0, which will
> > have the effect of scaling the image so it has the same height as the
> > font used to display the Info manual.  So the idea was to have in the
> > Info file some special control sequence which will tell Emacs to apply
> > the scale factor of 1.0 to the image.  (Of course, if it is known that
> > an image needs to be, say, twice larger than the text, the scale
> > factor could be 2.0 instead, and in general could be part of that
> > control sequence.)
> >
> > Does this make sense?
> 
> It does, but I was actually going for something simpler; during
> Texinfo's generation: That it ought to create an image sized using the
> system font in the build machine, by default. Any other scaling would be
> up to us Emacs devs.

Is this really practical? how can Texinfo know what font is used by
default in Emacs?

The purpose of using the scale factor of 1.0 (more generally, any
float value) is to automatically adjust the image to any font Emacs
will use.

> Since all images may be scaled at generation time itself, I thought,
> there was no further need to complicate.

I think what I say above contradicts this assumption?

> The ideal arrangement is anyway the formula itself being there and
> on-the-fly generation ala org.

I don't follow: what do you mean by "on-the-fly generation"? is that
relevant to Texinfo manuals?



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-02-06 10:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-11 22:00 Scaling of image produced for math in Info in the Emacs Info reader Patrice Dumas
2025-01-12  8:23 ` Ihor Radchenko
2025-01-12 13:12   ` Patrice Dumas
2025-01-28 19:48 ` Björn Bidar
     [not found] ` <8734h290u9.fsf@>
2025-01-28 20:00   ` Eli Zaretskii
2025-01-30  7:19     ` Björn Bidar
     [not found]     ` <87bjvo7orf.fsf@>
2025-01-30  7:34       ` tomas
2025-01-30  8:03       ` Eli Zaretskii
2025-01-31  5:06         ` Björn Bidar
     [not found]         ` <878qqr4lnq.fsf@>
2025-01-31  7:38           ` Eli Zaretskii
2025-01-31 20:58             ` chad
2025-01-30  8:06       ` pertusus
2025-01-31  1:44 ` Scaling of image produced for math in Info in the Emacs Info reader, " James Thomas
2025-02-03 19:24   ` Patrice Dumas
2025-02-04  0:20     ` James Thomas
2025-02-04 12:31       ` Eli Zaretskii
2025-02-06  8:28         ` James Thomas
2025-02-06 10:04           ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.