Re: [sage-support] generate latex from symbolic expression without \;

56 views
Skip to first unread message

David Loeffler

unread,
Apr 9, 2013, 5:53:13 AM4/9/13
to sage-s...@googlegroups.com
+1. I don't like this behaviour and I've never understood why it's the
default. (Why on earth does Sage insist on overriding LaTeX's very
carefully tuned spacing settings? Do we think we know more about
typography than TeX's designers?)

David

On 9 April 2013 09:55, shersonb <caret...@gmail.com> wrote:
> As it stands, latex(2*x) will return:
>
> 2 \, x
>
> and thus leaves a space between the 2 and the x when compiled. This does not look very good, IMO. Is there an option some where that I can set so that this behavior is avoided, so that the above will return "2 x" instead?
>
> ~Brian
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

Dan Drake

unread,
Apr 9, 2013, 12:24:55 PM4/9/13
to sage-s...@googlegroups.com
On Tue, 09 Apr 2013 at 01:55AM -0700, shersonb wrote:
> As it stands, latex(2*x) will return:
>
> 2 \, x
>
> and thus leaves a space between the 2 and the x when compiled. This
> does not look very good, IMO. Is there an option some where that I can
> set so that this behavior is avoided, so that the above will return "2
> x" instead?

I would also like to remove those hard-coded spaces. It makes SageTeX
much less pleasant, since the output looks weird.

Dan

--
--- Dan Drake
----- http://math.pugetsound.edu/~ddrake
-------
signature.asc
Message has been deleted

Stephen Nuchia

unread,
Jun 13, 2013, 10:54:50 AM6/13/13
to sage-s...@googlegroups.com
I think the reason for it is probably because Sage variables are so often words rather than letters  When using LaTeX directly on formulas involving typical programming variable names one has to override the "carefully tuned spacing" in just this way.

A patch to leave out the space when both sides of a product are numeric literals, single-letter variables or have non-default (user defined) latex forms would be a nice little project for somebody.


On Tuesday, April 9, 2013 3:55:29 AM UTC-5, shersonb wrote:
As it stands, latex(2*x) will return:

2 \, x

and thus leaves a space between the 2 and the x when compiled. This does not look very good, IMO. Is there an option some where that I can set so that this behavior is avoided, so that the above will return "2 x" instead?

~Brian

Emmanuel Charpentier

unread,
Jun 24, 2013, 2:36:58 PM6/24/13
to sage-s...@googlegroups.com


Le jeudi 13 juin 2013 16:54:50 UTC+2, Stephen Nuchia a écrit :
I think the reason for it is probably because Sage variables are so often words rather than letters  When using LaTeX directly on formulas involving typical programming variable names one has to override the "carefully tuned spacing" in just this way.

A patch to leave out the space when both sides of a product are numeric literals,

Yikes ! In this case I'd keep the spacing (or add \cdot) ! I want some form of visual distinction between twelve times thirty-four and one thousand two hundreds thirty-four accessible *also* to presbytic and hypermetropic people. Unless you want to reinforce the canard pretending that an acceptable mathematician is a young (or myopic) mathematician...
 
single-letter variables

Disputable but acceptable
 
or have non-default (user defined) latex forms

OK.
 
would be a nice little project for somebody.

On Tuesday, April 9, 2013 3:55:29 AM UTC-5, shersonb wrote:
As it stands, latex(2*x) will return:

2 \, x

and thus leaves a space between the 2 and the x when compiled. This does not look very good, IMO. Is there an option some where that I can set so that this behavior is avoided, so that the above will return "2 x" instead?

Shouldn't that be 2{}x instead ? Just asking...

                                                                                         Emmanuel Charpentier
 

~Brian

Burcin Erocal

unread,
Jun 24, 2013, 2:59:55 PM6/24/13
to sage-s...@googlegroups.com
On Mon, 24 Jun 2013 11:36:58 -0700 (PDT)
Emmanuel Charpentier <emanuel.c...@gmail.com> wrote:

>
>
> Le jeudi 13 juin 2013 16:54:50 UTC+2, Stephen Nuchia a écrit :
> >
> > I think the reason for it is probably because Sage variables are so
> > often words rather than letters When using LaTeX directly on
> > formulas involving typical programming variable names one has to
> > override the "carefully tuned spacing" in just this way.
> >
> > A patch to leave out the space when both sides of a product are
> > numeric literals,
>
>
> Yikes ! In this case I'd keep the spacing (or add \cdot) ! I want
> some form of visual distinction between twelve times thirty-four and
> one thousand two hundreds thirty-four accessible *also* to presbytic
> and hypermetropic people. Unless you want to reinforce the canard
> pretending that an acceptable mathematician is a young (or myopic)
> mathematician...

I fixed this last week at Sage Days 48:

http://trac.sagemath.org/sage_trac/ticket/13356

The new behavior is as follows:

sage: latex(2 * 2^x)
2 \cdot 2^{x}
sage: latex(2* x^2)
2 \, x^{2}


I will try removing the \, in the second example and see if it breaks
anything.


Cheers,
Burcin
Reply all
Reply to author
Forward
0 new messages