Re: Major problem with \textdegree

2007-05-22 Thread Helge Hafting

Georg Baum wrote:

Then you can surely explain what inputenc is supposed to do? I always
believed that

\usepackage[xxx]{inputenc}

would allow me to type directly in xxx encoding, without the need to use
commands like \textdegree directly, but now you are telling me that that is
wrong?
  

Looks like inputenc is incomplete then - the correct action then
is to fix inputenc.

Helge Hafting


Re: Major problem with \textdegree

2007-05-22 Thread Georg Baum
Herbert Voss wrote:

> Georg Baum wrote:
> 
>>>
>>> ??
>>> With latin9 you get a working \textdegree ...
>>> and also some other symbols different to latin1
>> 
>> Sure, \textdegree does not depend on the inputenc package.
> 
> ??? \inputenc does nothing else than loading
> the definition file ...

I don't understand what you want to tell here.

>> What does not work with \usepackage[latin9]{inputenc} (in TeXlive 2005)
>> is a literal °. It does work with latin1. And this is stupid, because °
>> is contained in the latin9 encoding at the same position as in latin1:
>> 0xb0.
> 
> sure, nobody did such a \DeclareTextCommand. But it is really easy
> to do it yourself.

Of course I can. But I believe that inputenc is supposed to do that for me.

> This has nothing to do with inputenc as package. 

Then you can surely explain what inputenc is supposed to do? I always
believed that

\usepackage[xxx]{inputenc}

would allow me to type directly in xxx encoding, without the need to use
commands like \textdegree directly, but now you are telling me that that is
wrong?


Georg



Re: Major problem with \textdegree

2007-05-22 Thread Georg Baum
Jürgen Spitzmüller wrote:

> Georg Baum wrote:
>> I did not use textcomp, this is a separate problem. The problem that was
>> originally reported is a pure inputenc problem.
> 
> No, the problem originally reported was that $\textdegree$ does not work
> in 1.5 (in a file that requested textcomp). This is at least indicated by
> the testcase (I didn't follow the actual thread).

The test case was by Abdel, the original report to which I refered (cited by
Abdel) was a bit different.

>> Without using textcomp you
>> get the following:
>>
>> latin1   latin9
>> ° in math                   works    does not work
>> \textdegree in math         works    works
>> ° in text                   works    does not work
>> \textdegree in text (ERT)   works    works
>>
>>
>> This is with TeXLive 2005.
> 
> TeXLive 2007, without textcomp loaded:
> 
> latin1   latin9
> ° in math   worksworks*
> \textdegree in math worksworks*
> ° in text   works**  works**
> \textdegree in text (ERT)   worksworks
> 
> TeXLive 2007, with textcomp loaded:
> 
> latin1latin9
> ° in math   does not work does not work
> \textdegree in math does not work does not work
> ° in text   works**   works**
> \textdegree in text (ERT)   works works
> 
> * although I get error messages:
> ./degree.tex:16: Command \textdegree invalid in math mode on input line
> 16. ./degree.tex:18: Command \^ invalid in math mode on input line 18.
> ./degree.tex:18: Command \textdegree invalid in math mode on input line
> 18.

I get these, too, but the output is still OK.

> ** sort of: in both encodigs, I get an additional weird character
> 
> So the problem is: what can we do with $\textdegree$ and $°$ in case
> textcomp is requested?

Nothing IMHO, since this problem is not new. In the long run mathed should
probably use some mechanism similar to the unicodesymbols file to replace
unicode characters with appropriate commands, and then it could also
replace ° with a command that works always.

It might be possible that this would already work with the lib/symbols file,
but I am not sure if you can put single characters in there and only
redefine the LaTeX output.


Georg



Re: Major problem with \textdegree

2007-05-22 Thread Herbert Voss
Jürgen Spitzmüller wrote:

> So the problem is: what can we do with $\textdegree$ and $°$ in case textcomp 
> is requested?

a _correct_ and save way is to do nothing inside LyX and using
always the LaTeX definitions. In fact of some compatibility
you can do inside LyX

\providecommand\LyXtextdegree{\ensuremath{^\circ}}
\let\textdegree\LyXtextdegree

and using \LyXtextdegree _always_ in math mode.

all other cases cannot be handled in a save way, because the user
can load packages in his own order, packages which redefine this
setting, ...

However, using the gensymb package with its \degree-Symbol is
the best choice.


Herbert



Re: Major problem with \textdegree

2007-05-22 Thread Herbert Voss
Georg Baum wrote:

>>
>> ??
>> With latin9 you get a working \textdegree ...
>> and also some other symbols different to latin1
> 
> Sure, \textdegree does not depend on the inputenc package.

??? \inputenc does nothing else than loading
the definition file ...


> What does not work with \usepackage[latin9]{inputenc} (in TeXlive 2005) is 
> a literal °. It does work with latin1. And this is stupid, because ° is 
> contained in the latin9 encoding at the same position as in latin1: 0xb0.

sure, nobody did such a \DeclareTextCommand. But it is really easy
to do it yourself. This has nothing to do with inputenc as package.

Hebrert



Re: Major problem with \textdegree

2007-05-22 Thread Jürgen Spitzmüller
Georg Baum wrote:
> I did not use textcomp, this is a separate problem. The problem that was
> originally reported is a pure inputenc problem. 

No, the problem originally reported was that $\textdegree$ does not work in 
1.5 (in a file that requested textcomp). This is at least indicated by the 
testcase (I didn't follow the actual thread).

> Without using textcomp you 
> get the following:
>
>                             latin1   latin9
> ° in math                   works    does not work
> \textdegree in math         works    works
> ° in text                   works    does not work
> \textdegree in text (ERT)   works    works
>
>
> This is with TeXLive 2005.

TeXLive 2007, without textcomp loaded:

latin1   latin9
° in math   worksworks*
\textdegree in math worksworks*
° in text   works**  works**
\textdegree in text (ERT)   worksworks

TeXLive 2007, with textcomp loaded:

latin1  latin9
° in math   does not work   does not work
\textdegree in math does not work   does not work
° in text   works** works**
\textdegree in text (ERT)   works   works

* although I get error messages: 
./degree.tex:16: Command \textdegree invalid in math mode on input line 16.
./degree.tex:18: Command \^ invalid in math mode on input line 18.
./degree.tex:18: Command \textdegree invalid in math mode on input line 18.

** sort of: in both encodigs, I get an additional weird character

So the problem is: what can we do with $\textdegree$ and $°$ in case textcomp 
is requested?

Jürgen


Re: Major problem with \textdegree

2007-05-22 Thread Georg Baum
Jürgen Spitzmüller wrote:

> Georg Baum wrote:
>> This does also mean that at the time when the language encoding of some
>> languages was changed to latin9 there should have been a lyx2lyx change,
>> because old documents with encoding setting auto and ° in math or text
>> will not work anymore.

BTW this would not be correct either for multilanguage docs.

> But it dosen't work either in latin1 if you use textcomp. I don't see a
> difference.

I did not use textcomp, this is a separate problem. The problem that was
originally reported is a pure inputenc problem. Without using textcomp you
get the following:

latin1   latin9
° in math   worksdoes not work
\textdegree in math worksworks
° in text   worksdoes not work
\textdegree in text (ERT)   worksworks


This is with TeXLive 2005. It might be fixed in newer versions of the
inputenc package, but ° with latin9 encoding does definitely not work with
TeXLive 2005. The error message is

! Package inputenc Error: Keyboard character used is undefined
(inputenc)in inputencoding `latin9'.


Georg



Re: Major problem with \textdegree

2007-05-21 Thread Jürgen Spitzmüller
Georg Baum wrote:
> This does also mean that at the time when the language encoding of some
> languages was changed to latin9 there should have been a lyx2lyx change,
> because old documents with encoding setting auto and ° in math or text
> will not work anymore.

But it dosen't work either in latin1 if you use textcomp. I don't see a 
difference.

Jürgen


Re: Major problem with \textdegree

2007-05-21 Thread Darren Freeman
I thought I'd re-use this thread.

Hit C-m, "\circ", on my system I get red writing "circ" which is
basically what I would get if I typed anything else with a backslash.

But the generated output has a circle.

Something missing from my system? I think when this happened in the
distant past it was related to missing fonts that the X-server didn't
know how to find.

It's not very good behaviour because I was trying to figure out why
something I remembered from 4 years ago wasn't recognised. I think the
correct behaviour for a missing font is to emphasise it somehow so I
know it's going to be recognised by LaTeX at least.

Have fun,
Darren



Re: Major problem with \textdegree

2007-05-21 Thread Georg Baum
Am Montag, 21. Mai 2007 19:51 schrieb Jürgen Spitzmüller:
> Abdelrazak Younes wrote:
> > > I'm not sure yet what we can do about it.
> >
> > Remove the hack in lib/symbols?
> 
> Maybe. But then lyx2lyx will have to translate the textdegrees to text 
mode.

No. This part of lib/symbols is only used for display, so removing the hack 
does not cause a fileformat change.

The problem is really that both a literal ° and \textdegree work with 
latin1 encoding _in mathed_. They don't work with latin9 encoding.

So the hack in lib/symbols only reflects the fact that \textdegree 
sometimes works even in mathed, but it does not cause any harm.

Don't ask me why the inputenc package does what it does, I don't understand 
it, I only see the results.

This does also mean that at the time when the language encoding of some 
languages was changed to latin9 there should have been a lyx2lyx change, 
because old documents with encoding setting auto and ° in math or text 
will not work anymore.


Georg



Re: Major problem with \textdegree

2007-05-21 Thread Herbert Voss
Jürgen Spitzmüller wrote:
> Herbert Voss wrote:
>> with latin9 encoding it works in math and text mode anymay.
> 
> but as soon as textcomp is loaded, it fails:
> 
> \documentclass[english]{article}
> \usepackage[T1]{fontenc}
> \usepackage[latin9]{inputenc}
> \usepackage{textcomp} %<---
> \usepackage{babel}
> 
> \begin{document}
> 
> mathed: $\textdegree$
> text: °
> 
> \end{document}
> 
> Even if ° would not request textcomp, there's always the possibility that 
> some 
> other package does.

sure, textcomp overwrites the definition without an \ensuremath command.

Herbert



Re: Major problem with \textdegree

2007-05-21 Thread Georg Baum
Am Montag, 21. Mai 2007 19:48 schrieb Herbert Voss:
> Georg Baum wrote:
> > Abdelrazak Younes wrote:
> > 
> >> Jürgen Spitzmüller wrote:
> >>> Abdelrazak Younes wrote:
>  There's some problems with \textdegree reported on the users list 
that I
>  can easily reproduce. With the attached LyX file, the LateX export 
will
>  translate the degree symbol in mathed to \textdegree.
> 
>  Neither the dvi nor the pdf (pdflatex) file shows the \textdegree 
symnol
>  but both of them shows the unicode symbol just fine.
> 
>  Bernd Sellentin (message reproduced below) suggests to put
>  \usepackage[latin1]{inputenc} in the preamble. But this leads to a 
LateX
>  error about a clash in the inputenc package.
> > 
> > The inputenc package is stupid. The latin9 encoding does contain the 
degree
> > symbol, but the inputenc package does not know that. The same is true 
for
> 
> 
> ??
> With latin9 you get a working \textdegree ...
> and also some other symbols different to latin1

Sure, \textdegree does not depend on the inputenc package.

What does not work with \usepackage[latin9]{inputenc} (in TeXlive 2005) is 
a literal °. It does work with latin1. And this is stupid, because ° is 
contained in the latin9 encoding at the same position as in latin1: 0xb0.


Georg



Re: Major problem with \textdegree

2007-05-21 Thread Jürgen Spitzmüller
Herbert Voss wrote:
> with latin9 encoding it works in math and text mode anymay.

but as soon as textcomp is loaded, it fails:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{textcomp} %<---
\usepackage{babel}

\begin{document}

mathed: $\textdegree$
text: °

\end{document}

Even if ° would not request textcomp, there's always the possibility that some 
other package does.

Jürgen


Re: Major problem with \textdegree

2007-05-21 Thread Herbert Voss
Abdelrazak Younes wrote:

>>> Right, if I insert \textdegree inside an ERT, the degree symbol is
>>> shown. So, the correction would be to automatically encapsulate
>>> \textdegree inside an mbox when with mathed. Is it possible to do that
>>> thanks to some definition in lib/symbols?
>>
>> No. With ERT you are allowed to shoot yourself in the foot, both in
>> normal
>> text and in mathed.
> 
> I meant automatically replace \textdegree with \mbox{\textdegree}
> inside mathed. But I see that Jurgen has discovered what the real
> problem is.


with latin9 encoding it works in math and text mode anymay.

Herbert



Re: Major problem with \textdegree

2007-05-21 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote:
> > I'm not sure yet what we can do about it.
>
> Remove the hack in lib/symbols?

Maybe. But then lyx2lyx will have to translate the textdegrees to text mode.

Jürgen


Re: Major problem with \textdegree

2007-05-21 Thread Herbert Voss
Georg Baum wrote:
> Abdelrazak Younes wrote:
> 
>> Jürgen Spitzmüller wrote:
>>> Abdelrazak Younes wrote:
 There's some problems with \textdegree reported on the users list that I
 can easily reproduce. With the attached LyX file, the LateX export will
 translate the degree symbol in mathed to \textdegree.

 Neither the dvi nor the pdf (pdflatex) file shows the \textdegree symnol
 but both of them shows the unicode symbol just fine.

 Bernd Sellentin (message reproduced below) suggests to put
 \usepackage[latin1]{inputenc} in the preamble. But this leads to a LateX
 error about a clash in the inputenc package.
> 
> The inputenc package is stupid. The latin9 encoding does contain the degree
> symbol, but the inputenc package does not know that. The same is true for


??
With latin9 you get a working \textdegree ...
and also some other symbols different to latin1

> \textmu, so if you use the same workaround for \textdegree as is used for
> \textmu (force flag in unicodesymbols) it should work.


Herbert



Re: Major problem with \textdegree

2007-05-21 Thread Abdelrazak Younes

Jürgen Spitzmüller wrote:

Abdelrazak Younes wrote:

Right, if I insert \textdegree inside an ERT, the degree symbol is
shown. So, the correction would be to automatically encapsulate
\textdegree inside an mbox when with mathed. Is it possible to do that
thanks to some definition in lib/symbols?


Now I know what the problem is. $\textdegree$ works in 1.4 (and also in 1.5) 
because it is defined in lib/symbols:

\def\textdegree{\kern-1mu^{\circ}\kern-4mu}

However, as soon as the package textcomp is loaded, this definition will be 
overridden by textcomps definition, which does only work in text mode.


Now in the test file, there's an additional unicode symbol °, which requests 
unicode. Delete that symbol, and the math \textdegree will show up.


I'm not sure yet what we can do about it.


Remove the hack in lib/symbols?

Abdel.



Re: Major problem with \textdegree

2007-05-21 Thread Abdelrazak Younes

Georg Baum wrote:

Abdelrazak Younes wrote:


Jürgen Spitzmüller wrote:

Abdelrazak Younes wrote:

There's some problems with \textdegree reported on the users list that I
can easily reproduce. With the attached LyX file, the LateX export will
translate the degree symbol in mathed to \textdegree.

Neither the dvi nor the pdf (pdflatex) file shows the \textdegree symnol
but both of them shows the unicode symbol just fine.

Bernd Sellentin (message reproduced below) suggests to put
\usepackage[latin1]{inputenc} in the preamble. But this leads to a LateX
error about a clash in the inputenc package.


The inputenc package is stupid. The latin9 encoding does contain the degree
symbol, but the inputenc package does not know that. The same is true for
\textmu, so if you use the same workaround for \textdegree as is used for
\textmu (force flag in unicodesymbols) it should work.


Right, if I insert \textdegree inside an ERT, the degree symbol is
shown. So, the correction would be to automatically encapsulate
\textdegree inside an mbox when with mathed. Is it possible to do that
thanks to some definition in lib/symbols?


No. With ERT you are allowed to shoot yourself in the foot, both in normal
text and in mathed.


I meant automatically replace \textdegree with \mbox{\textdegree} 
inside mathed. But I see that Jurgen has discovered what the real 
problem is.


Abdel.



Re: Major problem with \textdegree

2007-05-21 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
> Now in the test file, there's an additional unicode symbol °, which
> requests unicode.

which requests textcomp, of course.

Jürgen


Re: Major problem with \textdegree

2007-05-21 Thread Georg Baum
Abdelrazak Younes wrote:

> Jürgen Spitzmüller wrote:
>> Abdelrazak Younes wrote:
>>> There's some problems with \textdegree reported on the users list that I
>>> can easily reproduce. With the attached LyX file, the LateX export will
>>> translate the degree symbol in mathed to \textdegree.
>>>
>>> Neither the dvi nor the pdf (pdflatex) file shows the \textdegree symnol
>>> but both of them shows the unicode symbol just fine.
>>>
>>> Bernd Sellentin (message reproduced below) suggests to put
>>> \usepackage[latin1]{inputenc} in the preamble. But this leads to a LateX
>>> error about a clash in the inputenc package.

The inputenc package is stupid. The latin9 encoding does contain the degree
symbol, but the inputenc package does not know that. The same is true for
\textmu, so if you use the same workaround for \textdegree as is used for
\textmu (force flag in unicodesymbols) it should work.

> Right, if I insert \textdegree inside an ERT, the degree symbol is
> shown. So, the correction would be to automatically encapsulate
> \textdegree inside an mbox when with mathed. Is it possible to do that
> thanks to some definition in lib/symbols?

No. With ERT you are allowed to shoot yourself in the foot, both in normal
text and in mathed.


Georg



Re: Major problem with \textdegree

2007-05-21 Thread Abdelrazak Younes

Jean-Marc Lasgouttes wrote:

"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:


Abdelrazak> Hello, There's some problems with \textdegree reported on
Abdelrazak> the users list that I can easily reproduce. With the
Abdelrazak> attached LyX file, the LateX export will translate the
Abdelrazak> degree symbol in mathed to \textdegree.

Does adding \usepackage{textcomp} help?


No.

Abdel.



Re: Major problem with \textdegree

2007-05-21 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote:
> Right, if I insert \textdegree inside an ERT, the degree symbol is
> shown. So, the correction would be to automatically encapsulate
> \textdegree inside an mbox when with mathed. Is it possible to do that
> thanks to some definition in lib/symbols?

Now I know what the problem is. $\textdegree$ works in 1.4 (and also in 1.5) 
because it is defined in lib/symbols:
\def\textdegree{\kern-1mu^{\circ}\kern-4mu}

However, as soon as the package textcomp is loaded, this definition will be 
overridden by textcomps definition, which does only work in text mode.

Now in the test file, there's an additional unicode symbol °, which requests 
unicode. Delete that symbol, and the math \textdegree will show up.

I'm not sure yet what we can do about it.

Jürgen


Re: Major problem with \textdegree

2007-05-21 Thread Herbert Voss
Abdelrazak Younes wrote:

> There's some problems with \textdegree reported on the users list that I
> can easily reproduce. With the attached LyX file, the LateX export will
> translate the degree symbol in mathed to \textdegree.
> 
> Neither the dvi nor the pdf (pdflatex) file shows the \textdegree symnol
> but both of them shows the unicode symbol just fine.


the log file says it all ...

Herbert



Re: Major problem with \textdegree

2007-05-21 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

Abdelrazak> Hello, There's some problems with \textdegree reported on
Abdelrazak> the users list that I can easily reproduce. With the
Abdelrazak> attached LyX file, the LateX export will translate the
Abdelrazak> degree symbol in mathed to \textdegree.

Does adding \usepackage{textcomp} help?

JMarc



Re: Major problem with \textdegree

2007-05-21 Thread Abdelrazak Younes

Jürgen Spitzmüller wrote:

Abdelrazak Younes wrote:

There's some problems with \textdegree reported on the users list that I
can easily reproduce. With the attached LyX file, the LateX export will
translate the degree symbol in mathed to \textdegree.

Neither the dvi nor the pdf (pdflatex) file shows the \textdegree symnol
but both of them shows the unicode symbol just fine.

Bernd Sellentin (message reproduced below) suggests to put
\usepackage[latin1]{inputenc} in the preamble. But this leads to a LateX
error about a clash in the inputenc package.


I don't know how he inserted it, but the problem is that \textdegree is in 
math mode, while it should be in math-text mode.


Right, if I insert \textdegree inside an ERT, the degree symbol is 
shown. So, the correction would be to automatically encapsulate 
\textdegree inside an mbox when with mathed. Is it possible to do that 
thanks to some definition in lib/symbols?


This has nothing to do with 
the encoding. It doesn't work either if you change the document encoding to 
latin1.


Maybe a case of this
http://bugzilla.lyx.org/show_bug.cgi?id=2315


I am not expert enough to see the similarities :-/

Abdel.



Re: Major problem with \textdegree

2007-05-21 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote:
> There's some problems with \textdegree reported on the users list that I
> can easily reproduce. With the attached LyX file, the LateX export will
> translate the degree symbol in mathed to \textdegree.
>
> Neither the dvi nor the pdf (pdflatex) file shows the \textdegree symnol
> but both of them shows the unicode symbol just fine.
>
> Bernd Sellentin (message reproduced below) suggests to put
> \usepackage[latin1]{inputenc} in the preamble. But this leads to a LateX
> error about a clash in the inputenc package.

I don't know how he inserted it, but the problem is that \textdegree is in 
math mode, while it should be in math-text mode. This has nothing to do with 
the encoding. It doesn't work either if you change the document encoding to 
latin1.

Maybe a case of this
http://bugzilla.lyx.org/show_bug.cgi?id=2315

Jürgen


Major problem with \textdegree

2007-05-21 Thread Abdelrazak Younes

Hello,

There's some problems with \textdegree reported on the users list that I 
can easily reproduce. With the attached LyX file, the LateX export will 
translate the degree symbol in mathed to \textdegree.


Neither the dvi nor the pdf (pdflatex) file shows the \textdegree symnol 
but both of them shows the unicode symbol just fine.


Bernd Sellentin (message reproduced below) suggests to put 
\usepackage[latin1]{inputenc} in the preamble. But this leads to a LateX 
error about a clash in the inputenc package.


This is a major bug IMHO, LateX expert someone?

Abdel.



Hi,
studying the Latex error messages, I noticed that lyx-1.4 sets the
inputencoding to latin1. This works for textdegree. lyx-1.5 sets it to
latin9, this does not work for textdegree.

On my debian system are both encodings installed:
[EMAIL PROTECTED]:~$ locale -a|grep de
de_DE
[EMAIL PROTECTED]
de_DE.iso88591
[EMAIL PROTECTED]
de_DE.utf8
deutsch

In the preferences dialog I found no possibility to tell lyx, which 
encoding
to use. My workaround: put the "Use language's default encoding" off and 
put

in the latex preamble \usepackage[latin1]{inputenc}.

Now textdegree works, and as I am writing text about chemistry with a 
lot of

textdegree symbols I have only one change to do to make my scripts working
again with this very nice lyx-1.5.

Bernd


textdegree-problems.pdf
Description: Adobe PDF document


textdegree-problems.tex
Description: TeX document


textdegree-problems.lyx
Description: application/lyx


textdegree-problems.dvi
Description: Binary data