Re: > User Guide does not compile due to Unicode-in-Math stuff (rc3 on mac)
On Thu, Oct 02, 2008 at 04:09:53PM +0200, Konrad Hofbauer wrote: > Enrico wrote in the devel-thread that "This is already fixed but the fix > didn't go into rc3.", but I am not sure what he exactly refered to. I meant that the problem you report was fixed at r26577, but rc3 corresponds to r26576. -- Enrico
Re: > User Guide does not compile due to Unicode-in-Math stuff (rc3 on mac)
Uwe Stöhr wrote: > I cannot compile the userguide in rc3 due to some unicode-in-math problems. > > In the userguide.lyx we have: > \begin_inset Formula \[ > \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p²}{4}-q}\] > \end_inset I will change this to > \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p^2}{4}-q}\] Hehe - now I understand where all my confusion comes from. Thunderbird automatically displays "p-hat-2" as p followed by a raised 2. But the current version compiles here and it should compile. > ! Undefined control sequence. > p\lyxmathsym > {\texttwosuperior } > l.4285 ...\frac{p\lyxmathsym{\texttwosuperior}}{4} > -q}\] Could you please check if Lyx creates in the LateX output the following: [EMAIL PROTECTED] [EMAIL PROTECTED]@ld\textbf{##1}\else\textrm{##1}\fi} \mathchoice{\hbox{\rmorbf{#1}}}{\hbox{\rmorbf{#1}}} {\hbox{\smaller[2]\rmorbf{#1}}}{\hbox{\smaller[3]\rmorbf{#1}}} \endgroup\else#1\fi} No, it does not create this. The only occurence of lyxmathsym is in line 4285 where it is used. Enrico wrote in the devel-thread that "This is already fixed but the fix didn't go into rc3.", but I am not sure what he exactly refered to. If yes, does it work when you use the math option "Use AMS" instead of "Use AMS automatically"? No change. If not, what is your LaTeX distribution? MacTeX aka TexLive 2007 p.s. we have for documentation related tissues the lyx-docs mailing list OK. But how should I know if it is a doc or a lyx-bug. ;-) /Konrad
> User Guide does not compile due to Unicode-in-Math stuff (rc3 on mac)
> I cannot compile the userguide in rc3 due to some unicode-in-math problems. > > In the userguide.lyx we have: > \begin_inset Formula \[ > \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p²}{4}-q}\] > \end_inset I will change this to > \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p^2}{4}-q}\] But the current version compiles here and it should compile. > ! Undefined control sequence. > p\lyxmathsym > {\texttwosuperior } > l.4285 ...\frac{p\lyxmathsym{\texttwosuperior}}{4} > -q}\] Could you please check if Lyx creates in the LateX output the following: [EMAIL PROTECTED] [EMAIL PROTECTED]@ld\textbf{##1}\else\textrm{##1}\fi} \mathchoice{\hbox{\rmorbf{#1}}}{\hbox{\rmorbf{#1}}} {\hbox{\smaller[2]\rmorbf{#1}}}{\hbox{\smaller[3]\rmorbf{#1}}} \endgroup\else#1\fi} If yes, does it work when you use the math option "Use AMS" instead of "Use AMS automatically"? If not, what is your LaTeX distribution? regards Uwe p.s. we have for documentation related tissues the lyx-docs mailing list
Re: User Guide does not compile due to Unicode-in-Math stuff (rc3 on mac)
On Thu, Oct 02, 2008 at 02:57:52PM +0200, Konrad Hofbauer wrote: > Hi, > > I cannot compile the userguide in rc3 due to some unicode-in-math > problems. Since nobody has complained about this yet, could this be > Mac-only ??? > > > In the userguide.lyx we have: > \begin_inset Formula \[ > \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p²}{4}-q}\] > \end_inset > > In View Source and Latex this becomes: > The general form of its solution is:\[ > \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p\lyxmathsym{\texttwosuperior}}{4}-q}\] > > The Latex error is: > > ! Undefined control sequence. > p\lyxmathsym > {\texttwosuperior } > l.4285 ...\frac{p\lyxmathsym{\texttwosuperior}}{4} >-q}\] > The control sequence at the end of the top line > of your error message was never \def'ed. This is already fixed but the fix didn't go into rc3. > P.S. There is another user reporting that he had \textcelsius in his > doc, and (somehow) this got converted to the corresponding unicode > symbol, I really doubt that LyX was responsible for that. > and then LyX (rc2) crashing on this file for him. If you mean this report: http://thread.gmane.org/gmane.editors.lyx.devel/111750 I think that the crash is simply due to the fact that the file is not a valid LyX file, and I also doubt that it was produced by LyX. Maybe it was incorrectly post-processed after LyX created it. -- Enrico
User Guide does not compile due to Unicode-in-Math stuff (rc3 on mac)
Hi, I cannot compile the userguide in rc3 due to some unicode-in-math problems. Since nobody has complained about this yet, could this be Mac-only ??? In the userguide.lyx we have: \begin_inset Formula \[ \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p²}{4}-q}\] \end_inset In View Source and Latex this becomes: The general form of its solution is:\[ \lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p\lyxmathsym{\texttwosuperior}}{4}-q}\] The Latex error is: ! Undefined control sequence. p\lyxmathsym {\texttwosuperior } l.4285 ...\frac{p\lyxmathsym{\texttwosuperior}}{4} -q}\] The control sequence at the end of the top line of your error message was never \def'ed. /Konrad P.S. There is another user reporting that he had \textcelsius in his doc, and (somehow) this got converted to the corresponding unicode symbol, and then LyX (rc2) crashing on this file for him.
Re: unicode in math
On Fri, Sep 26, 2008 at 08:10:17AM +0100, José Matos wrote: > On Friday 26 September 2008 01:03:40 Enrico Forestieri wrote: > > José, I tested this patch and I think it is Ok. Can it be applied? > > Yes. I applied an updated version. It should be included in rc3 as it also fixes a small bug. Without this patch, when an unicode symbol appears in math, it may happen that the first latex run fails, i.e., you need to run latex twice. It was escaping my testings because I had the View->Source window activated (and that counts for a latex run). -- Enrico
Re: unicode in math
On Friday 26 September 2008 01:03:40 Enrico Forestieri wrote: > José, I tested this patch and I think it is Ok. Can it be applied? Yes. > -- > Enrico -- José Abílio
Re: unicode in math
On Wed, 24 Sep 2008 09:43:34 + (UTC) G Milde <[EMAIL PROTECTED]> wrote: > Enrico Forestieri <[EMAIL PROTECTED]> > schrieb: > > Please test. > > Unfortunately, I did not have the time to compile a patched LyX. But maybe, the attached test file can be some help? Thanks Günter latin-1-supplement.lyx Description: application/lyx
Re: unicode in math
Enrico Forestieri <[EMAIL PROTECTED]> schrieb: > You managed to convice me. With the attached patch, the unicode accented > characters are interpreted as math variables when they are entered in > mathmode. Please test. Thanks for your work. Unfortunately, I did not have the time to compile a patched LyX. Some thoughts from looking at the source: 1) +* When in mathmode, do we have to output this character as LaTeX +* command in any case? This is true if the "forcemath" flag is set. +* We use this as an input method for entering accented symbols, +* such that, as an example, Ä is output as \ddot{A}. +*/ + static bool isForcedMath(char_type c); and +# - forcemath Always output replacement command when in mathmode IMO, replacements should be (and are) always forced in mathmode(except for XeTeX with unicodemath.sty), so the boolean and flag are misnamed. As they are used to determine if the character is a "math letter" and should be typeset italic/slanted in the GUI, something like "mathalpha" seems more in place. 2) IMO it would be consistent to handle combining accents in math the same way, e.g. in unicodesymbols 0x0308 "\\\"" "" "combining,force" "\ddot" "" # COMBINING DIAERESIS This currently sets the ddot accent *behind* the accented character. I guess that the "combining" flag is not (yet) handled in mathmode. Thanks again Günter
Re: unicode in math
Helge Hafting <[EMAIL PROTECTED]> schrieb: > Enrico Forestieri wrote: >> On Thu, Sep 18, 2008 at 02:04:33PM +0200, G. Milde wrote: >>> On 18.09.08, Helge Hafting wrote: Enrico Forestieri wrote: > On Tue, Sep 16, 2008 at 02:13:49PM +0200, G. Milde wrote: >> With LyX 1.6, using unicode characters other than Basic Latin is >> possible also in math mode. >> With the attached patch, the unicode accented characters are >> interpreted as math variables when they are entered in mathmode. >> Please test. > Interesting. I tested the characters æøåÆØÅ > The 'æ' and 'Æ' is still upright. There is no math equivalent for them. Also, they are not part of any TeX math alphabet. If you really want æ in math, you need to use text-in-math (this is what LyX actually does) and if you want them italic, you need to do this with a text style (see the Help>Math manual). ... > So - this is better than nothing, but ideally the æøåÄ etc. should > be taken from the font Which font? In TeX, the text font and the math font are two very distinct entities. > instead of trying to synthesize by combining dots with an A and so on. > That is probably harder to do? Then this would no longer be math. I argue that if an author inputs 'ä' in a math context, "what you mean" is not "a-umlaut" but "a with two dots" (usually the second time derivative of a, d²a/dt²). With LyX, I want to get what I mean. Alternatively, I'd like to be told that ä in math is ambiguous and therefore not allowed (similar to the "you cannot input 2 spaces ..." warning). A nice compilation of letters that can appear in a math context is the `Mathematical Alphanumeric Symbols` Unicode block http://www.unicode.org/charts/PDF/U1D400.pdf. Günter
Re: unicode in math
Enrico Forestieri wrote: On Thu, Sep 18, 2008 at 02:04:33PM +0200, G. Milde wrote: On 18.09.08, Helge Hafting wrote: Enrico Forestieri wrote: On Tue, Sep 16, 2008 at 02:13:49PM +0200, G. Milde wrote: With LyX 1.6, using unicode characters other than Basic Latin is possible also in math mode. Note that in math mode TeX (and even XeTeX) doesn't support anything outside the ASCII set, Which is sad. The latin alphabet does not stop at 'z' unless you are english. or Latin ;-) You managed to convice me. With the attached patch, the unicode accented characters are interpreted as math variables when they are entered in mathmode. Please test. Interesting. I tested the characters æøåÆØÅ The 'æ' and 'Æ' is still upright. The 'ø' and 'Ø' is italic, but does not match the font. Looks more like plain o and O with a slanted line through it? The same for å and Å. Looks like the character leant to the right to become italic, but the ring remained in place. (Ring no longer over the top of A.) the same happens to Ä too, the dots are not properly centered over the A. So - this is better than nothing, but ideally the æøåÄ etc. should be taken from the font instead of trying to synthesize by combining dots with an A and so on. That is probably harder to do? Helge Hafting
Re: unicode in math
On 18.09.08, Helge Hafting wrote: > Enrico Forestieri wrote: >> On Tue, Sep 16, 2008 at 02:13:49PM +0200, G. Milde wrote: >>> With LyX 1.6, using unicode characters other than Basic Latin is possible >>> also in math mode. >> Note that in math mode TeX (and even XeTeX) doesn't support anything >> outside the ASCII set, > Which is sad. The latin alphabet does not stop at 'z' unless you are > english. or Latin ;-) Basically starting with the introduction of inputenc there was the understandable wish to use any keyboard character in text as well as in math. -- inpmath.pdf in http://www.latex-project.org/code/experimental/inpmath.zip >> so thinking that Ä should be typeset in italic is pretty arbitrary. > I think it is the other way around - the ascii subset of the alphabet > is pretty arbitrary, and there is no reason at all to draw a line just > there. A-Z is not in any way a special interval. This is true for text. However, in mathematics the situation is more complicated: The set on non-accented Latin letters a-zA-Z is "distinguished" by its use as symbols for variables. The same holds for the non-accented Greek letters. This is why the mathnormal alphabet will typeset them italic (although typesetting conventions differ between TeX and ISO for capital Greek letters). Accented letters are normally not interpreted as single units but as a combination of a letter symbol with some modifier. Example: The symbol Ä will (in most cases) not be interpreted as "variable A-umlaut" but as "second time derivative of variable A". >> The rationale is that when you use a non-ascii char in math mode, you >> really want to use it as a math symbol However, when this char is a precomposed letter+accent(s), I really want to use it as an input method for the composition of the basic letter + the accent. My rationale is that "when I have an Ä-key on my German keyboard, why should I type `ß ddot A` (or `ß textit Ä`) to get the second time derivative of variable A"? The inpmath.sty package does this:: \DeclareMathMeaning{\"}{\ddot} \DeclareMathMeaning{\'}{\acute} \DeclareMathMeaning{\.}{\dot} \DeclareMathMeaning{\=}{\bar} \DeclareMathMeaning{\^}{\hat} \DeclareMathMeaning{\`}{\grave} which toghther with inputencs replacement Ä -> \"A results in \ddot{A}. > Of course, TeX may have limitations that are very hard for LyX to > work around right now. Actually, it's quite easy for LyX to work around some basic TeX limitations for unicode-in-math (as discussed in inpmath.pdf) because it can do the unicode-latex conversion when generating the latex source while a latex package will have to work with unicode in the latex source. This way, replacements like the above can be easily defined in the unicodesymbols file. It's more complicated for cases where there is no simple math equivalent for a unicode symbol (like æ). > And I guess people using cyrillic and other alphabets might want to use > their own alphabets for math too? True. Supporting them in math is a bit more complicated, though, as the math-encoded fonts only contain (basic) Latin and Greek. Günter Please send me a copy of eventual replies.
Re: unicode in math
Enrico Forestieri wrote: On Tue, Sep 16, 2008 at 02:13:49PM +0200, G. Milde wrote: On 9.09.08, G. Milde wrote: Dear LyX users, ... but I was told that this is rather somethign for lyx-devel. So, please send me a copy of eventual replies, as I am just a user. With LyX 1.6, using unicode characters other than Basic Latin is possible also in math mode. This is a vast improvement over the silent failure in LyX 1.5, my thanks go out to the relevant developer(s)! However, there remain some inconsistencies, as the character in question is either replaced by a math-equivalent (if defined in the "unicodesymbols" file) or by "text in math" with the text-equivalent. * while A is typeset italic, Ä (and other accented characters) as well as Α (and other Greek characters) are typeset upright (and in the text font). The question is * should the "input->math" conversion only be done for characters from "Basic Latin" and "Mathematical Alphanumeric Symbols", or I think so, as this is what TeX does. * should "latin-1 supplement" characters for which a math equivalent exists use this instead of a text-version (e.g. Ä be replaced with \ddot{A} in math), and/or * should Greek characters from the "Greek and Coptic" unicode block use the math-equivalent? No, I don't think so. Note that in math mode TeX (and even XeTeX) doesn't support anything outside the ASCII set, Which is sad. The latin alphabet does not stop at 'z' unless you are english. so thinking that Ä should be typeset in italic is pretty arbitrary. I think it is the other way around - the ascii subset of the alphabet is pretty arbitrary, and there is no reason at all to draw a line just there. A-Z is not in any way a special interval. Of course, TeX may have limitations that are very hard for LyX to work around right now. If they disappear due to simple solutions in the form of an extra package, then the The rationale is that when you use a non-ascii char in math mode, you really want to use it as a math symbol, so LyX takes care that no error occurs without changing the shape of the symbol, as it would be arbitrary to do so. Even if it may seem natural to turn non-ascii latin chars into italic, this feature is not thought for using Ä as a substitute for \ddot{A}. If you want an italic Ä, you can use \textit{Ä} in math mode, which is a perfectly legal latex construct. If I use any _alphabetic letter_ in math, then I want them all treated the same way. AaBbCc...æÆåÅöÖ. For me, 'C' and 'Æ' are no more different than 'C' and 'O'. And I guess people using cyrillic and other alphabets might want to use their own alphabets for math too? Of course - non-aplpabetic symbols can be treated differently. Numerals, punctuation, special symbols. If this is easily achieved with simple latex constructs, then I hope LyX will do that for me someday. It is an odd and arbitrary surprise when an 'æ' doesn't work the same way as an 'e'. Well, perhaps not for someone who knows about the ascii-centric past history of computers, but the generic user doesn't necessarily do that. Helge Hafting
Re: unicode in math
On Wed, Sep 17, 2008 at 03:52:24PM +0200, G. Milde wrote: > On 16.09.08, Enrico Forestieri wrote: [...] > > Note that in math mode TeX (and even XeTeX) doesn't support anything > > outside the ASCII set, > > This limitation seems more due to technical restrictions than to a > design decision. At least XeTeX has recently gained unicode support in > math with the unicode-math package. There are similar efforts for plain > LaTeX (inputenx, ...). LyX has even better chances to gain a WYSIWYM > unicode-math support. So, using that package, what would be typeset if you use Ä in math mode? > > so thinking that Ä should be typeset in italic is pretty arbitrary. > > There are resons for both choices: > > > The rationale is that when you use a non-ascii char in math mode, you > > really want to use it as a math symbol, so LyX takes care that no error > > occurs without changing the shape of the symbol, as it would be > > arbitrary to do so. > > The alternative rationale is: If I input something in math-mode, I mean > it to be mathematical notation. > > The content of a math box should be converted to the appropriate math > construct following the conventions of mathematical typography. If I want > it to appear in the text font, I'll use text-in-math. Following this > rationale, using text-in-math for the unicode->latex conversion should > only be used if there is no meaningfull math equivalent. Hmmm... maybe that could be true for some accented characters that can be reproduced by \mathaccent, but what when that is not the case? We would have a non-uniform behavior and the code would be plastered by special cases. -- Enrico
Re: unicode in math
On 16.09.08, Enrico Forestieri wrote: > On Tue, Sep 16, 2008 at 02:13:49PM +0200, G. Milde wrote: > > On 9.09.08, G. Milde wrote: > > please send me a copy of eventual replies, as I am just a user. > > * should the "input->math" conversion only be done for characters > > from "Basic Latin" and "Mathematical Alphanumeric Symbols", or > I think so, as this is what TeX does. > > * should "latin-1 supplement" characters for which a math equivalent exists > > use this instead of a text-version (e.g. Ã be replaced with \ddot{A} in > > math), and/or > > > > * should Greek characters from the "Greek and Coptic" unicode block use > > the math-equivalent? > No, I don't think so. > Note that in math mode TeX (and even XeTeX) doesn't support anything > outside the ASCII set, This limitation seems more due to technical restrictions than to a design decision. At least XeTeX has recently gained unicode support in math with the unicode-math package. There are similar efforts for plain LaTeX (inputenx, ...). LyX has even better chances to gain a WYSIWYM unicode-math support. > so thinking that Ä should be typeset in italic is pretty arbitrary. There are resons for both choices: > The rationale is that when you use a non-ascii char in math mode, you > really want to use it as a math symbol, so LyX takes care that no error > occurs without changing the shape of the symbol, as it would be > arbitrary to do so. The alternative rationale is: If I input something in math-mode, I mean it to be mathematical notation. The content of a math box should be converted to the appropriate math construct following the conventions of mathematical typography. If I want it to appear in the text font, I'll use text-in-math. Following this rationale, using text-in-math for the unicode->latex conversion should only be used if there is no meaningfull math equivalent. > Even if it may seem natural to turn non-ascii latin > chars into italic, this feature is not thought for using Ä as a > substitute for \ddot{A}. I see it as an input convention, similar to e.g. · for \cdot. It would help text import (via drag and drop, say): when marking an equation and pressing Ctrl-M would also convert "text" Greek chars to "math" Greek chars. If I want text chars, I will mark this part of the equation and press Ctrl-M again. Günter
Re: unicode in math
On Tue, Sep 16, 2008 at 02:13:49PM +0200, G. Milde wrote: > On 9.09.08, G. Milde wrote: > > Dear LyX users, > ... > but I was told that this is rather somethign for lyx-devel. So, please send > me a copy of eventual replies, as I am just a user. > > With LyX 1.6, using unicode characters other than Basic Latin is possible > also in math mode. This is a vast improvement over the silent failure in > LyX 1.5, my thanks go out to the relevant developer(s)! > > > However, there remain some inconsistencies, as the character in question > is either replaced by a math-equivalent (if defined in the > "unicodesymbols" file) or by "text in math" with the text-equivalent. > > > * while A is typeset italic, Ã (and other accented characters) as well as > Î (and other Greek characters) are typeset upright (and in the text font). > > The question is > > * should the "input->math" conversion only be done for characters > from "Basic Latin" and "Mathematical Alphanumeric Symbols", or I think so, as this is what TeX does. > * should "latin-1 supplement" characters for which a math equivalent exists > use this instead of a text-version (e.g. Ã be replaced with \ddot{A} in > math), and/or > > * should Greek characters from the "Greek and Coptic" unicode block use > the math-equivalent? No, I don't think so. Note that in math mode TeX (and even XeTeX) doesn't support anything outside the ASCII set, so thinking that Ä should be typeset in italic is pretty arbitrary. The rationale is that when you use a non-ascii char in math mode, you really want to use it as a math symbol, so LyX takes care that no error occurs without changing the shape of the symbol, as it would be arbitrary to do so. Even if it may seem natural to turn non-ascii latin chars into italic, this feature is not thought for using Ä as a substitute for \ddot{A}. If you want an italic Ä, you can use \textit{Ä} in math mode, which is a perfectly legal latex construct. -- Enrico
unicode in math
On 9.09.08, G. Milde wrote: > Dear LyX users, ... but I was told that this is rather somethign for lyx-devel. So, please send me a copy of eventual replies, as I am just a user. With LyX 1.6, using unicode characters other than Basic Latin is possible also in math mode. This is a vast improvement over the silent failure in LyX 1.5, my thanks go out to the relevant developer(s)! However, there remain some inconsistencies, as the character in question is either replaced by a math-equivalent (if defined in the "unicodesymbols" file) or by "text in math" with the text-equivalent. * while A is typeset italic, Ä (and other accented characters) as well as Α (and other Greek characters) are typeset upright (and in the text font). The question is * should the "input->math" conversion only be done for characters from "Basic Latin" and "Mathematical Alphanumeric Symbols", or * should "latin-1 supplement" characters for which a math equivalent exists use this instead of a text-version (e.g. Ä be replaced with \ddot{A} in math), and/or * should Greek characters from the "Greek and Coptic" unicode block use the math-equivalent? Patches exist for math definitions for "Latin-1 Supplement" and "Greek and Coptic" in unicodesymbols. However, could these also show as italic in the LyX GUI? Attached is a survey of Math replacements for "Latin-1 Supplement" characters. Günter latin-1-supplement.lyx Description: application/lyx