Re: Unicode characters in mathed

2023-07-05 Thread Jean-Marc Lasgouttes

Le 05/07/2023 à 13:39, Thibaut Cuvelier a écrit :
On Sat, 1 Apr 2023, 15:10 Jean-Marc Lasgouttes, > wrote:


Hello,

A relative has been using LyX recently, and it is interesting to see
how
the use is different from what I would do.

In particular, instead of typing \neq in mathed, why not copy and paste
a ≠ from some PDF or HTML page?

When doing this, two things happen :
1/ on screen, there is no spacing around the ≠
2/ in LaTeX output, the character is exported as \neq and all is well


This nice behaviour doesn't happen with all Unicode symbols. On my 
keyboard, I have direct access to ², ³, and µ: LyX wraps them in text 
boxes, meaning that the LaTeX output is wrong for these characters.


I cannot tell about ² and ³, but the upright µ is useful in text for 
units AFAIR.


We could indeed discuss a way to have a different behavior in texted and 
mathed.


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-05-29 Thread Jean-Marc Lasgouttes

Le 30/05/2023 à 00:37, Jean-Marc Lasgouttes a écrit :
Thanks for your input, this is the direction I would take if I ever find 
the time to solve this issue.


This is now ticket #12788.
https://www.lyx.org/trac/ticket/12788

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-05-29 Thread Jean-Marc Lasgouttes

Le 30/05/2023 à 00:14, Udicoudco a écrit :

So how should I solve problem 1/ ? I see 3 solutions
a/ replace ≠ with a \neq directly in the document at input time; we
might not want to do that in case we eventually use unicode in math too
b/ replace ≠ with a \neq on screen only
c/ keep the ≠ on screen, but use the mathrel math class from \neq so
that we have a good spacing


I would say option b, as unicode-math supports unicode characters inside
math mode. Maybe some users would prefer a latex source that
contains the unicode symbols  and not the corresponding macros.


Thanks for your input, this is the direction I would take if I ever find 
the time to solve this issue.


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-05-29 Thread Udicoudco
On Sat, Apr 1, 2023 at 4:10 PM Jean-Marc Lasgouttes  wrote:
> In particular, instead of typing \neq in mathed, why not copy and paste
> a ≠ from some PDF or HTML page?
>
> When doing this, two things happen :
> 1/ on screen, there is no spacing around the ≠
> 2/ in LaTeX output, the character is exported as \neq and all is well
>
> So how should I solve problem 1/ ? I see 3 solutions
> a/ replace ≠ with a \neq directly in the document at input time; we
> might not want to do that in case we eventually use unicode in math too
> b/ replace ≠ with a \neq on screen only
> c/ keep the ≠ on screen, but use the mathrel math class from \neq so
> that we have a good spacing

I would say option b, as unicode-math supports unicode characters inside
math mode. Maybe some users would prefer a latex source that
contains the unicode symbols  and not the corresponding macros.

Ot maybe a better solution would be to add a checkbox in
Document->Settings->Math Options and let the user decide
between option a and option b. but that would probably
require more work.

> --
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-13 Thread Kornel Benko
Am Thu, 13 Apr 2023 16:57:27 +0200
schrieb Jean-Marc Lasgouttes :

> Le 13/04/2023 à 16:29, Kornel Benko a écrit :
> > Would be nice to have a list of these math-commands which can map to 
> > unicode. (Not all
> > are in file unicodesymbols). This is important for advanced find too.  
> 
> And in lib/symbols ?
> 
> JMarc
> 

Looks better.

Kornel


pgpEIQOwXwtgh.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-13 Thread Jean-Marc Lasgouttes

Le 13/04/2023 à 16:29, Kornel Benko a écrit :

Would be nice to have a list of these math-commands which can map to unicode. 
(Not all
are in file unicodesymbols). This is important for advanced find too.


And in lib/symbols ?

JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-13 Thread Kornel Benko
Am Thu, 6 Apr 2023 10:43:42 +0200
schrieb Jean-Marc Lasgouttes :

> Le 03/04/2023 à 00:36, Enrico Forestieri a écrit :
> >> So how should I solve problem 1/ ? I see 3 solutions
> >> a/ replace ≠ with a \neq directly in the document at input time; we 
> >> might not want to do that in case we eventually use unicode in math too
> >> b/ replace ≠ with a \neq on screen only
> >> c/ keep the ≠ on screen, but use the mathrel math class from \neq so 
> >> that we have a good spacing  
> > 
> > I would say (a) but only for symbols that are actually translated in 
> > output.  
> 
> What I wonder is whether keeping the unicode characters in the document 
> could be helpful (for html/docbook export, for example) and avoid 
> overrriding users actions. I think I will try b/ first, until I have 
> other people (Günther, do you read this?) tell me that I can get rid of 
> unicode keys early.
> 
> Also, things like ² are translated to more complex commands like {}^2, I 
> am not sure that I want to insert it with an editable nucleus.
> 
> >> Then, I see that there are two ways of matching \neq to U+2260:
> >> i/ lib/unicodesymbol has a "mathcommand" entry for that (which is 
> >> presumably used right now)
> >> ii/ lib/symbols also links these elements
> >>
> >> Which one is more reliable for what I want to do?  
> > 
> > As I see it, (i) is for export and (ii) is for screen representation, so 
> > I would suggest using (i).  
> 
> Right.
> 
> >> My general problem is that, while I see what happens with \neq, I 
> >> suspect that many weird things can happen with other characters.
> >>
> >> Any advice?  
> > 
> > Be careful ;)  
> 
> Indeed. This is probably not 2.4 material anyway, unless it turns out to 
> be very easy to implement.
> 
> JMarc
> 

Would be nice to have a list of these math-commands which can map to unicode. 
(Not all
are in file unicodesymbols). This is important for advanced find too.

Kornel


pgpfygFoQR5h8.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-06 Thread Jean-Marc Lasgouttes

Le 03/04/2023 à 00:36, Enrico Forestieri a écrit :

So how should I solve problem 1/ ? I see 3 solutions
a/ replace ≠ with a \neq directly in the document at input time; we 
might not want to do that in case we eventually use unicode in math too

b/ replace ≠ with a \neq on screen only
c/ keep the ≠ on screen, but use the mathrel math class from \neq so 
that we have a good spacing


I would say (a) but only for symbols that are actually translated in 
output.


What I wonder is whether keeping the unicode characters in the document 
could be helpful (for html/docbook export, for example) and avoid 
overrriding users actions. I think I will try b/ first, until I have 
other people (Günther, do you read this?) tell me that I can get rid of 
unicode keys early.


Also, things like ² are translated to more complex commands like {}^2, I 
am not sure that I want to insert it with an editable nucleus.



Then, I see that there are two ways of matching \neq to U+2260:
i/ lib/unicodesymbol has a "mathcommand" entry for that (which is 
presumably used right now)

ii/ lib/symbols also links these elements

Which one is more reliable for what I want to do?


As I see it, (i) is for export and (ii) is for screen representation, so 
I would suggest using (i).


Right.

My general problem is that, while I see what happens with \neq, I 
suspect that many weird things can happen with other characters.


Any advice?


Be careful ;)


Indeed. This is probably not 2.4 material anyway, unless it turns out to 
be very easy to implement.


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-02 Thread Enrico Forestieri

On Sat, Apr 01, 2023 at 03:09:58PM +0200, Jean-Marc Lasgouttes wrote:


Hello,

A relative has been using LyX recently, and it is interesting to see 
how the use is different from what I would do.


In particular, instead of typing \neq in mathed, why not copy and 
paste a ≠ from some PDF or HTML page?


When doing this, two things happen :
1/ on screen, there is no spacing around the ≠
2/ in LaTeX output, the character is exported as \neq and all is well

So how should I solve problem 1/ ? I see 3 solutions
a/ replace ≠ with a \neq directly in the document at input time; we 
might not want to do that in case we eventually use unicode in math 
too

b/ replace ≠ with a \neq on screen only
c/ keep the ≠ on screen, but use the mathrel math class from \neq so 
that we have a good spacing


I would say (a) but only for symbols that are actually translated in 
output.



Then, I see that there are two ways of matching \neq to U+2260:
i/ lib/unicodesymbol has a "mathcommand" entry for that (which is 
presumably used right now)

ii/ lib/symbols also links these elements

Which one is more reliable for what I want to do?


As I see it, (i) is for export and (ii) is for screen representation, so 
I would suggest using (i).


My general problem is that, while I see what happens with \neq, I 
suspect that many weird things can happen with other characters.


Any advice?


Be careful ;)

--
Enrico
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-01 Thread Scott Kostyshak
On Sat, Apr 01, 2023 at 09:13:22PM +0200, Jean-Marc Lasgouttes wrote:
> Le 01/04/2023 à 20:57, Scott Kostyshak a écrit :
> > On Sat, Apr 01, 2023 at 03:09:58PM +0200, Jean-Marc Lasgouttes wrote:
> > Would another possibility be to prompt the user? I'm not sure what a 
> > friendly prompt would be though since many LyX users do not know what 
> > unicode is. I could try to work on some user-friendly text if we think a 
> > prompt would be reasonable. A prompt would be my ideal behavior though 
> > since I often paste unicode by mistake. This type of thing hits me from 
> > time to time, not with symbols that are obviously non-ascii like ≠ but more 
> > with double-quotes or things like that that I forget are often non-ascii.
> 
> Thanks for your thoughts. Does this quote thing apply to mathed too, or
> rather text ?

Indeed I was thinking of text.

> > If we do preserve the unicode ≠, I would personally prefer to have some 
> > sort of signal that it is unicode in the LyX display. Actually, that's how 
> > I have my text editor set up (see screenshot).
> 
> But what is unicode? Only things over 0xFF?

No idea :)

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-01 Thread Jean-Marc Lasgouttes

Le 01/04/2023 à 20:57, Scott Kostyshak a écrit :

On Sat, Apr 01, 2023 at 03:09:58PM +0200, Jean-Marc Lasgouttes wrote:
Would another possibility be to prompt the user? I'm not sure what a friendly 
prompt would be though since many LyX users do not know what unicode is. I 
could try to work on some user-friendly text if we think a prompt would be 
reasonable. A prompt would be my ideal behavior though since I often paste 
unicode by mistake. This type of thing hits me from time to time, not with 
symbols that are obviously non-ascii like ≠ but more with double-quotes or 
things like that that I forget are often non-ascii.


Thanks for your thoughts. Does this quote thing apply to mathed too, or 
rather text ?



If we do preserve the unicode ≠, I would personally prefer to have some sort of 
signal that it is unicode in the LyX display. Actually, that's how I have my 
text editor set up (see screenshot).


But what is unicode? Only things over 0xFF?

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Unicode characters in mathed

2023-04-01 Thread Scott Kostyshak
On Sat, Apr 01, 2023 at 03:09:58PM +0200, Jean-Marc Lasgouttes wrote:
> Hello,
> 
> A relative has been using LyX recently, and it is interesting to see how the
> use is different from what I would do.
> 
> In particular, instead of typing \neq in mathed, why not copy and paste a ≠
> from some PDF or HTML page?
> 
> When doing this, two things happen :
> 1/ on screen, there is no spacing around the ≠
> 2/ in LaTeX output, the character is exported as \neq and all is well
> 
> So how should I solve problem 1/ ? I see 3 solutions
> a/ replace ≠ with a \neq directly in the document at input time; we might
> not want to do that in case we eventually use unicode in math too
> b/ replace ≠ with a \neq on screen only
> c/ keep the ≠ on screen, but use the mathrel math class from \neq so that we
> have a good spacing
> 
> Then, I see that there are two ways of matching \neq to U+2260:
> i/ lib/unicodesymbol has a "mathcommand" entry for that (which is presumably
> used right now)
> ii/ lib/symbols also links these elements
> 
> Which one is more reliable for what I want to do?
> 
> My general problem is that, while I see what happens with \neq, I suspect
> that many weird things can happen with other characters.
> 
> Any advice?

Would another possibility be to prompt the user? I'm not sure what a friendly 
prompt would be though since many LyX users do not know what unicode is. I 
could try to work on some user-friendly text if we think a prompt would be 
reasonable. A prompt would be my ideal behavior though since I often paste 
unicode by mistake. This type of thing hits me from time to time, not with 
symbols that are obviously non-ascii like ≠ but more with double-quotes or 
things like that that I forget are often non-ascii.

If we do preserve the unicode ≠, I would personally prefer to have some sort of 
signal that it is unicode in the LyX display. Actually, that's how I have my 
text editor set up (see screenshot).

All that said, I understand that my personal preferences might not be best for 
the default behavior of LyX.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel