all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* SymPy from inside Emacs
@ 2022-05-13  7:34 Andreas Röhler
  2022-05-13  7:47 ` Eli Zaretskii
  2022-05-13 12:10 ` Daniel Fleischer
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Röhler @ 2022-05-13  7:34 UTC (permalink / raw)
  To: help-gnu-emacs

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

Hi,

the Python module SymPy displays math formulas. Running in a 
bash-terminal at Xubuntu that works nicely.
 From Emacs however, the spaces in the upper line are wider than the 
chars below.

See attached sympy.png.

That way, displaying the exponents goes wrong. See the "5" at EOL in 
upper line belong to last char "y" in line below. Whilst the 
column-numbers are correct, i.e. respective.

Any help?

Thanks,
Andreas


[-- Attachment #2: sympy.png --]
[-- Type: image/png, Size: 163471 bytes --]

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

* Re: SymPy from inside Emacs
  2022-05-13  7:34 SymPy from inside Emacs Andreas Röhler
@ 2022-05-13  7:47 ` Eli Zaretskii
  2022-05-13  8:01   ` Andreas Röhler
  2022-05-13 10:39   ` Andreas Röhler
  2022-05-13 12:10 ` Daniel Fleischer
  1 sibling, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2022-05-13  7:47 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 13 May 2022 09:34:14 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 
> the Python module SymPy displays math formulas. Running in a 
> bash-terminal at Xubuntu that works nicely.
>  From Emacs however, the spaces in the upper line are wider than the 
> chars below.
> 
> See attached sympy.png.

I think that's because the · character (or something similar) used to
depict the multiplication comes from another font, one that is not
fixed-pitch and/or whose width is different from that of the default
font.  The spaces are not the cause of this, they come from the
default font and are always of the same width.



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

* Re: SymPy from inside Emacs
  2022-05-13  7:47 ` Eli Zaretskii
@ 2022-05-13  8:01   ` Andreas Röhler
  2022-05-13 10:38     ` Eli Zaretskii
  2022-05-13 10:39   ` Andreas Röhler
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2022-05-13  8:01 UTC (permalink / raw)
  To: help-gnu-emacs


Am 13.05.22 um 09:47 schrieb Eli Zaretskii:
>> Date: Fri, 13 May 2022 09:34:14 +0200
>> From: Andreas Röhler<andreas.roehler@easy-emacs.de>
>>
>> the Python module SymPy displays math formulas. Running in a
>> bash-terminal at Xubuntu that works nicely.
>>   From Emacs however, the spaces in the upper line are wider than the
>> chars below.
>>
>> See attached sympy.png.
> I think that's because the · character (or something similar) used to
> depict the multiplication comes from another font, one that is not
> fixed-pitch and/or whose width is different from that of the default
> font.  The spaces are not the cause of this, they come from the
> default font and are always of the same width.
>
Font was       ftcrhb:-1ASC-Liberation Mono-regular-normal-normal-*-...


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

* Re: SymPy from inside Emacs
  2022-05-13  8:01   ` Andreas Röhler
@ 2022-05-13 10:38     ` Eli Zaretskii
  2022-05-13 10:42       ` Andreas Röhler
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2022-05-13 10:38 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 13 May 2022 10:01:22 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 
> > I think that's because the · character (or something similar) used to
> > depict the multiplication comes from another font, one that is not
> > fixed-pitch and/or whose width is different from that of the default
> > font.  The spaces are not the cause of this, they come from the
> > default font and are always of the same width.
> >
> Font was       ftcrhb:-1ASC-Liberation Mono-regular-normal-normal-*-...

For that single character or for the regular buffer text? or for both?

My point is that if the default font doesn't support the
"multiplication" character, you cannot expect the lines to align in
Emacs.



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

* Re: SymPy from inside Emacs
  2022-05-13  7:47 ` Eli Zaretskii
  2022-05-13  8:01   ` Andreas Röhler
@ 2022-05-13 10:39   ` Andreas Röhler
  2022-05-13 14:18     ` Leo Butler
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2022-05-13 10:39 UTC (permalink / raw)
  To: help-gnu-emacs


Am 13.05.22 um 09:47 schrieb Eli Zaretskii:
>> Date: Fri, 13 May 2022 09:34:14 +0200
>> From: Andreas Röhler<andreas.roehler@easy-emacs.de>
>>
>> the Python module SymPy displays math formulas. Running in a
>> bash-terminal at Xubuntu that works nicely.
>>   From Emacs however, the spaces in the upper line are wider than the
>> chars below.
>>
>> See attached sympy.png.
> I think that's because the · character (or something similar) used to
> depict the multiplication comes from another font, one that is not
> fixed-pitch and/or whose width is different from that of the default
> font.  The spaces are not the cause of this, they come from the
> default font and are always of the same width.
>
Okay, thanks, solved it by installing a truly monospaced font.


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

* Re: SymPy from inside Emacs
  2022-05-13 10:38     ` Eli Zaretskii
@ 2022-05-13 10:42       ` Andreas Röhler
  2022-05-13 10:46         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2022-05-13 10:42 UTC (permalink / raw)
  To: help-gnu-emacs


Am 13.05.22 um 12:38 schrieb Eli Zaretskii:
>> Date: Fri, 13 May 2022 10:01:22 +0200
>> From: Andreas Röhler<andreas.roehler@easy-emacs.de>
>>
>>> I think that's because the · character (or something similar) used to
>>> depict the multiplication comes from another font, one that is not
>>> fixed-pitch and/or whose width is different from that of the default
>>> font.  The spaces are not the cause of this, they come from the
>>> default font and are always of the same width.
>>>
>> Font was       ftcrhb:-1ASC-Liberation Mono-regular-normal-normal-*-...
> For that single character or for the regular buffer text? or for both?


For all. Emacs started like "emacs --debug-init --font 'Liberation Mono-14"

>
> My point is that if the default font doesn't support the
> "multiplication" character, you cannot expect the lines to align in
> Emacs.
>


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

* Re: SymPy from inside Emacs
  2022-05-13 10:42       ` Andreas Röhler
@ 2022-05-13 10:46         ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2022-05-13 10:46 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 13 May 2022 12:42:20 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 
> >> Font was       ftcrhb:-1ASC-Liberation Mono-regular-normal-normal-*-...
> > For that single character or for the regular buffer text? or for both?
> 
> 
> For all. Emacs started like "emacs --debug-init --font 'Liberation Mono-14"

Then I guess that font is not really monospaced.  I see you've solved
this by using a different font.



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

* Re: SymPy from inside Emacs
  2022-05-13  7:34 SymPy from inside Emacs Andreas Röhler
  2022-05-13  7:47 ` Eli Zaretskii
@ 2022-05-13 12:10 ` Daniel Fleischer
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Fleischer @ 2022-05-13 12:10 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs

Andreas Röhler [2022-05-13 Fri 09:34] wrote:

> the Python module SymPy displays math formulas. Running in a bash-terminal at Xubuntu that works nicely.
> From Emacs however, the spaces in the upper line are wider than the chars below.

Maybe you'll be interested in

https://github.com/astoff/comint-mime

It works nicely. 

-- 

Daniel Fleischer



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

* Re: SymPy from inside Emacs
  2022-05-13 10:39   ` Andreas Röhler
@ 2022-05-13 14:18     ` Leo Butler
  2022-05-15  8:17       ` Andreas Röhler
  0 siblings, 1 reply; 10+ messages in thread
From: Leo Butler @ 2022-05-13 14:18 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs@gnu.org

On Fri, May 13 2022, Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:

> Am 13.05.22 um 09:47 schrieb Eli Zaretskii:
>>> Date: Fri, 13 May 2022 09:34:14 +0200
>>> From: Andreas Röhler<andreas.roehler@easy-emacs.de>
>>>
>>> the Python module SymPy displays math formulas. Running in a
>>> bash-terminal at Xubuntu that works nicely.
>>>   From Emacs however, the spaces in the upper line are wider than the
>>> chars below.
>>>
>>> See attached sympy.png.
>> I think that's because the · character (or something similar) used to
>> depict the multiplication comes from another font, one that is not
>> fixed-pitch and/or whose width is different from that of the default
>> font.  The spaces are not the cause of this, they come from the
>> default font and are always of the same width.
>>
> Okay, thanks, solved it by installing a truly monospaced font.

Andreas, an alternative solution would be to define a filter function
that filters the sympy output before insertion into the comint buffer.
You could replace the offending characters with better behaved ones
without changing font.

C-h f comint-preoutput-filter-functions

Leo

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

* Re: SymPy from inside Emacs
  2022-05-13 14:18     ` Leo Butler
@ 2022-05-15  8:17       ` Andreas Röhler
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Röhler @ 2022-05-15  8:17 UTC (permalink / raw)
  To: Leo Butler; +Cc: help-gnu-emacs@gnu.org


Am 13.05.22 um 16:18 schrieb Leo Butler:
> On Fri, May 13 2022, Andreas Röhler<andreas.roehler@easy-emacs.de>  wrote:
>
>> Am 13.05.22 um 09:47 schrieb Eli Zaretskii:
>>>> Date: Fri, 13 May 2022 09:34:14 +0200
>>>> From: Andreas Röhler<andreas.roehler@easy-emacs.de>
>>>>
>>>> the Python module SymPy displays math formulas. Running in a
>>>> bash-terminal at Xubuntu that works nicely.
>>>>    From Emacs however, the spaces in the upper line are wider than the
>>>> chars below.
>>>>
>>>> See attached sympy.png.
>>> I think that's because the · character (or something similar) used to
>>> depict the multiplication comes from another font, one that is not
>>> fixed-pitch and/or whose width is different from that of the default
>>> font.  The spaces are not the cause of this, they come from the
>>> default font and are always of the same width.
>>>
>> Okay, thanks, solved it by installing a truly monospaced font.
> Andreas, an alternative solution would be to define a filter function
> that filters the sympy output before insertion into the comint buffer.
> You could replace the offending characters with better behaved ones
> without changing font.
>
> C-h f comint-preoutput-filter-functions
>
> Leo


Thanks for the hint.

Andreas


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

end of thread, other threads:[~2022-05-15  8:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-13  7:34 SymPy from inside Emacs Andreas Röhler
2022-05-13  7:47 ` Eli Zaretskii
2022-05-13  8:01   ` Andreas Röhler
2022-05-13 10:38     ` Eli Zaretskii
2022-05-13 10:42       ` Andreas Röhler
2022-05-13 10:46         ` Eli Zaretskii
2022-05-13 10:39   ` Andreas Röhler
2022-05-13 14:18     ` Leo Butler
2022-05-15  8:17       ` Andreas Röhler
2022-05-13 12:10 ` Daniel Fleischer

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.