Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-13 Thread Martin Vermeer
On Thu, Jul 12, 2007 at 05:15:38PM +0100, José Matos wrote:
 On Thursday 12 July 2007 13:59:08 Jean-Marc Lasgouttes wrote:
  Java?
 
  JMarc
 
 Python is more likely. ;-)

Curses -- and that's not entirely a joke.

- Martin
 


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-13 Thread Martin Vermeer
On Thu, Jul 12, 2007 at 05:15:38PM +0100, José Matos wrote:
> On Thursday 12 July 2007 13:59:08 Jean-Marc Lasgouttes wrote:
> > Java?
> >
> > JMarc
> 
> Python is more likely. ;-)

Curses -- and that's not entirely a joke.

- Martin
 


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Abdelrazak Younes a écrit :

Philippe Charpentier wrote:

During my tests I found the three bugs below, I did not found in 
bugzilla:


* About layouts: the tag DependsOn does not works when it calls a 
Style whose name contains
 special characters. I cannot test everything, but I suspect that it 
does not works when the name of

 called Style contains an underscore ( _ )


What does that mean does not work? Is it a crash? Or just the LateX 
that does not compile?


Abdel.
The Preamble of the Style called by the tag is not put in the Preamble 
of the document and LaTeX

does not compile.

PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Philippe Charpentier wrote:
 The Preamble of the Style called by the tag is not put in the Preamble
 of the document and LaTeX
 does not compile.

So bug 3521?
http://bugzilla.lyx.org/show_bug.cgi?id=3521

Jürgen


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Jürgen Spitzmüller a écrit :

Philippe Charpentier wrote:
  

The Preamble of the Style called by the tag is not put in the Preamble
of the document and LaTeX
does not compile.



So bug 3521?
http://bugzilla.lyx.org/show_bug.cgi?id=3521

Jürgen
  
I don't think so. If I understand well, bug 3521 is related to non ascii 
characters in layouts which is solved now.
I will try to get time to create simple Styles with the same problem and 
I will post the result in the list.


PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Philippe Charpentier a écrit :

Jürgen Spitzmüller a écrit :

Philippe Charpentier wrote:
 

The Preamble of the Style called by the tag is not put in the Preamble
of the document and LaTeX
does not compile.



So bug 3521?
http://bugzilla.lyx.org/show_bug.cgi?id=3521

Jürgen
  
I don't think so. If I understand well, bug 3521 is related to non 
ascii characters in layouts which is solved now.
I will try to get time to create simple Styles with the same problem 
and I will post the result in the list.


PhC


I made the test and my first impression was wright:
Create the following Styles:

Style Test_A
 Margin  Static
 LatexType Command
 LatexName TestA
 ParIndentMM
 ParSkip 0.4
 Align Block
 AlignPossible Block, Left, Right, Center
 LabelType No_Label
 Preamble
\def\TestA#1{\textcolor{blue}{#1}}
 EndPreamble
End

Style TestA
 CopyStyleTest_A
 DependsOnTest_A
 Preamble
 EndPreamble
End

Style TestB
 Margin  Static
 LatexType Command
 LatexName TestB
 ParIndentMM
 ParSkip 0.4
 Align Block
 AlignPossible Block, Left, Right, Center
 LabelType No_Label
 Preamble
\def\TestB#1{\textcolor{red}{#1}}
 EndPreamble
End

Style Test_B
 CopyStyleTestB
 DependsOnTestB
 Preamble
 EndPreamble
End

Then:

Test_B works : the Preamble of TestB is put in the Preamble of the document
TestA does not works : the Preamble of Test_A is not put in the Preamble 
of the document


PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
 Philippe == Philippe Charpentier [EMAIL PROTECTED] writes:

Philippe I made the test and my first impression was wright: 

Does the following patch help?

JMarc

Index: src/Layout.cpp
===
--- src/Layout.cpp	(révision 19050)
+++ src/Layout.cpp	(copie de travail)
@@ -241,7 +241,8 @@ bool Layout::read(Lexer  lexrc, TextCla
 
 		case LT_OBSOLETEDBY: // replace with a known style
 			if (lexrc.next()) {
-docstring const style = lexrc.getDocString();
+docstring const style = 
+	subst(lexrc.getDocString(), '_', ' ');
 
 if (tclass.hasLayout(style)) {
 	docstring const tmpname = name_;
@@ -262,7 +263,7 @@ bool Layout::read(Lexer  lexrc, TextCla
 
 		case LT_DEPENDSON:
 			if (lexrc.next())
-depends_on_ = lexrc.getDocString();
+			depends_on_ = subst(lexrc.getDocString(), '_', ' ');
 			break;
 
 		case LT_MARGIN:		// margin style definition.


Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 09:03:41 Jean-Marc Lasgouttes wrote:
 Does the following patch help?

  If it works put it in as it is the right fix.

 JMarc

-- 
José Abílio


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Jean-Marc Lasgouttes a écrit :

Philippe == Philippe Charpentier [EMAIL PROTECTED] writes:



Philippe I made the test and my first impression was wright: 


Does the following patch help?

JMarc

  

I just test it on the latest svn : it works fine

PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
 José == José Matos [EMAIL PROTECTED] writes:

José On Thursday 12 July 2007 09:03:41 Jean-Marc Lasgouttes wrote:
 Does the following patch help?

José   If it works put it in as it is the right fix.

Done.

JMarc


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
 Philippe == Philippe Charpentier [EMAIL PROTECTED] writes:

Philippe I just test it on the latest svn : it works fine

OK, put it in. This issue existed also with 1.3.x and 1.4.x, right?

JMarc


[patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
  * In a new document write: a word
    Then change the size of the two words to small; then change the color
  of a (to red for example).
    Then lyx traduce it as : \textcolor{red}{\small a}{\small  word} and
  the space between a and
    word disappear.

 this is
 http://bugzilla.lyx.org/show_bug.cgi?id=3382

Here's an alternative patch for this issue. The problem is that blanks are 
swallowed if they follow another blank that is ending a command, such as in 
\small  word

We need to care about that, notwithstanding whether we manage to improve the 
LaTeX output (as Uwe suggests rightly in the bug report), because this case 
can nevertheless occur, so the two attempts are orthogonal.

The attached patch is a bit more complicated than my first attempt on bugzilla 
that just ends every font size command by '{}' instead of a blank, but it 
results in better LaTeX output. It checks whether a font switch command with 
a trailing blank has occured, and if so, it outputs a normal space (\ ) 
instead of a blank, i.e. in the case above:
\textcolor{red}{\small a}{\small \ word}

Even better would be \small\ word, but I don't see how I could get that.

So I think this is the best we can do for now, however I'm not entirely sure 
about the implementation details. So please have a look if it strikes you 
correct.

Jürgen
Index: src/Paragraph.cpp
===
--- src/Paragraph.cpp	(Revision 19033)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -66,6 +66,7 @@
 namespace lyx {
 
 using support::contains;
+using support::suffixIs;
 using support::rsplit;
 
 
@@ -2065,24 +2066,38 @@
 			}
 		}
 
+		bool trailing_blank = false;
 		// Do we need to change font?
 		if ((font != running_font ||
 		 font.language() != running_font.language()) 
 			i != body_pos - 1)
 		{
-			column += font.latexWriteStartChanges(os, bparams,
+			odocstringstream ods;
+			column += font.latexWriteStartChanges(ods, bparams,
 			  runparams, basefont,
 			  last_font);
 			running_font = font;
 			open_font = true;
+			docstring fontchange = ods.str();
+			// check if the fontchange ends with a trailing blank
+			if (suffixIs(fontchange, 0x0020))
+trailing_blank = true;
+			os  fontchange;
 		}
 
 		if (c == ' ') {
+			// If a blank follows a font change that is itself finished
+			// by a blank (e.g. {\Huge ), we need a normal space
+			// in order to prevent the blank from being swallowed.
+			if (trailing_blank) {
+os  \\ ;
+column += 2;
+			}
 			// Do not print the separation of the optional argument
 			// if style-pass_thru is false. This works because
 			// simpleTeXSpecialChars ignores spaces if
 			// style-pass_thru is false.
-			if (i != body_pos - 1) {
+			else if (i != body_pos - 1) {
 if (pimpl_-simpleTeXBlanks(
 		*(runparams.encoding), os, texrow,
 		i, column, font, *style))


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Jean-Marc Lasgouttes a écrit :

Philippe == Philippe Charpentier [EMAIL PROTECTED] writes:



Philippe I just test it on the latest svn : it works fine

OK, put it in. This issue existed also with 1.3.x and 1.4.x, right?

JMarc
  

Yes

PhC



Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
 Jürgen == Jürgen Spitzmüller [EMAIL PROTECTED] writes:

Jürgen The attached patch is a bit more complicated than my first
Jürgen attempt on bugzilla that just ends every font size command by
Jürgen '{}' instead of a blank, but it results in better LaTeX
Jürgen output. It checks whether a font switch command with a
Jürgen trailing blank has occured, and if so, it outputs a normal
Jürgen space (\ ) instead of a blank, i.e. in the case above:
Jürgen \textcolor{red}{\small a}{\small \ word}

What about replacing the final blank by {} instead , and output
\textcolor{red}{\small a}{\small{}  word}

It should be easy with what you have already done.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 What about replacing the final blank by {} instead , and output
 \textcolor{red}{\small a}{\small{}  word}

 It should be easy with what you have already done.

This is what I proposed first, but Uwe doesn't like it ;-)
It is of course much easier, but it's less elegant LaTeX code, even more so as 
the {} is always output, whereas the \  in my recent patch is only output 
if there are really two subsequent blanks.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:


 This is what I proposed first, but Uwe doesn't like it ;-)
 It is of course much easier, but it's less elegant LaTeX code, even more so 
 as 
 the {} is always output, whereas the \  in my recent patch is only output 
 if there are really two subsequent blanks.

No, I meant output rhe {} only when there are two consecutive blanks.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 No, I meant output rhe {} only when there are two consecutive blanks.

You mean, pass information to Font::latexWriteStartChanges that the character 
following the font change will be a blank? That could be doable.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
 You mean, pass information to Font::latexWriteStartChanges that the character 
 following the font change will be a blank? That could be doable.

It is even simpler than that.

JMarc

Index: src/Paragraph.cpp
===
--- src/Paragraph.cpp	(révision 19050)
+++ src/Paragraph.cpp	(copie de travail)
@@ -67,6 +67,7 @@ using std::ostream;
 namespace lyx {
 
 using support::contains;
+using support::suffixIs;
 using support::rsplit;
 
 
@@ -2076,11 +2077,19 @@ bool Paragraph::simpleTeXOnePar(Buffer c
 		 font.language() != running_font.language()) 
 			i != body_pos - 1)
 		{
-			column += font.latexWriteStartChanges(os, bparams,
+			odocstringstream ods;
+			column += font.latexWriteStartChanges(ods, bparams,
 			  runparams, basefont,
 			  last_font);
 			running_font = font;
 			open_font = true;
+			docstring fontchange = ods.str();
+			// check if the fontchange ends with a trailing blank
+			if (suffixIs(fontchange, 0x0020)  c == ' ')
+os  fontchange.substr(0, fontchange.size() - 1) 
+from_ascii({});
+			else
+os  fontchange;
 		}
 
 		if (c == ' ') {


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
  No, I meant output rhe {} only when there are two consecutive blanks.

 You mean, pass information to Font::latexWriteStartChanges that the
 character following the font change will be a blank? That could be doable.

As in the attached? This looks like a pretty safe approach to me.

Jürgen
Index: src/Font.cpp
===
--- src/Font.cpp	(Revision 19033)
+++ src/Font.cpp	(Arbeitskopie)
@@ -743,7 +743,7 @@
 int Font::latexWriteStartChanges(odocstream  os, BufferParams const  bparams,
 OutputParams const  runparams,
 Font const  base,
-Font const  prev) const
+Font const  prev, bool blank_follows) const
 {
 	bool env = false;
 
@@ -803,8 +803,13 @@
 	if (number() == ON  prev.number() != ON
 		 (language()-lang() == hebrew
 			|| language()-lang() == farsi)) {
-		os  {\\beginL ;
-		count += 9;
+		if (blank_follows) {
+			os  {\\beginL{};
+			count += 10;
+		} else {
+			os  {\\beginL ;
+			count += 9;
+		}
 	}
 
 	Font f = *this;
@@ -861,9 +866,14 @@
 			++count;
 		}
 		os  '\\'
-		LaTeXSizeNames[f.size()]
-		' ';
-		count += strlen(LaTeXSizeNames[f.size()]) + 2;
+		LaTeXSizeNames[f.size()];
+		if (blank_follows) {
+			os  {};
+			count += strlen(LaTeXSizeNames[f.size()]) + 3;
+		} else {
+			os  ' ';
+			count += strlen(LaTeXSizeNames[f.size()]) + 2;
+		}
 	}
 	return count;
 }
Index: src/Font.h
===
--- src/Font.h	(Revision 19033)
+++ src/Font.h	(Arbeitskopie)
@@ -300,7 +300,8 @@
 	int latexWriteStartChanges(odocstream , BufferParams const  bparams,
    OutputParams const  runparams,
    Font const  base,
-   Font const  prev) const;
+   Font const  prev,
+   bool blank_follows) const;
 
 	/** Writes the tail of the LaTeX needed to change to this font.
 	Returns number of chars written. Base is the font state we want
Index: src/Paragraph.cpp
===
--- src/Paragraph.cpp	(Revision 19033)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -2070,9 +2070,12 @@
 		 font.language() != running_font.language()) 
 			i != body_pos - 1)
 		{
+			bool blank_follows = false;
+			if (c == ' ')
+blank_follows = true;
 			column += font.latexWriteStartChanges(os, bparams,
 			  runparams, basefont,
-			  last_font);
+			  last_font, blank_follows);
 			running_font = font;
 			open_font = true;
 		}


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 It is even simpler than that.

Sight. So which one should we take? I think either one is ok. Yours is 
probably simpler. I'll let you and José decide.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 11:54:39 Jürgen Spitzmüller wrote:
 Sight. So which one should we take? I think either one is ok. Yours is
 probably simpler. I'll let you and José decide.

  If you agree on one of the versions you have my OK.

  As you see I am learning. Now instead of throwing a coin I expect you to do 
so. ;-)

 Jürgen

-- 
José Abílio


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
 So which one should we take? I think either one is ok. Yours is
 probably simpler. I'll let you and José decide.

On a second thought, I think you should just commit yours. José?

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
 On a second thought, I think you should just commit yours

I also think this should be ported back to 1.4.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 12:00:14 Jürgen Spitzmüller wrote:
 On a second thought, I think you should just commit yours. José?

 Jürgen

As I said before if you agree on one version, as it seems to be case, you have 
my OK.

-- 
José Abílio


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
 On a second thought, I think you should just commit yours. 

Yes, it is IMO simpler. Note that this would be moot if we had the
latexstream I've been dreaming about for ages :)

JMarc



Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
 I also think this should be ported back to 1.4.

No, the bug does not exist in 1.4, where spaces are kept outside of
font changes.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Alfredo Braunstein
Jean-Marc Lasgouttes wrote:

 Yes, it is IMO simpler. Note that this would be moot if we had the
 latexstream I've been dreaming about for ages :)

Like the one you'll give us in Bromarv? ;-)

A/




Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

Alfredo Braunstein [EMAIL PROTECTED] writes:
 Jean-Marc Lasgouttes wrote:

 Yes, it is IMO simpler. Note that this would be moot if we had the
 latexstream I've been dreaming about for ages :)

 Like the one you'll give us in Bromarv? ;-)

I have other plans, but we'll see :)

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 I have other plans, but we'll see :)

Break some eggs perhaps? ;-)

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
 Jean-Marc Lasgouttes wrote:
 I have other plans, but we'll see :)

 Break some eggs perhaps? ;-)

Yes. It is not fair to see always the same people having fun (what
about replacing qt4 with Xaw?)

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
 Yes. It is not fair to see always the same people having fun (what
 about replacing qt4 with Xaw?)

Or just ditch Unix and use the Windows API.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
 Jean-Marc Lasgouttes wrote:
 Yes. It is not fair to see always the same people having fun (what
 about replacing qt4 with Xaw?)

 Or just ditch Unix and use the Windows API.

Java?

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Abdelrazak Younes

Jean-Marc Lasgouttes wrote:

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:

Jean-Marc Lasgouttes wrote:

Yes. It is not fair to see always the same people having fun (what
about replacing qt4 with Xaw?)

Or just ditch Unix and use the Windows API.


Java?


Ajax

Abdel.



Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
Abdelrazak Younes [EMAIL PROTECTED] writes:

 Ajax

Basix (http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/basix.html)

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes [EMAIL PROTECTED] writes:
 [EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
 You mean, pass information to Font::latexWriteStartChanges that the 
 character 
 following the font change will be a blank? That could be doable.

 It is even simpler than that.

I appled this patch.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:17:57PM +0200, Jürgen Spitzmüller wrote:
 Jean-Marc Lasgouttes wrote:
  I have other plans, but we'll see :)
 
 Break some eggs perhaps? ;-)

I wonder what I will do this year... after all, there are not too many
frontends left to kill...

Andre'
 


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:44:21PM +0200, Jean-Marc Lasgouttes wrote:
 
 [EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
  Jean-Marc Lasgouttes wrote:
  I have other plans, but we'll see :)
 
  Break some eggs perhaps? ;-)
 
 Yes. It is not fair to see always the same people having fun (what
 about replacing qt4 with Xaw?)

Xt. At most.

Andre'


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 13:59:08 Jean-Marc Lasgouttes wrote:
 Java?

 JMarc

Python is more likely. ;-)

-- 
José Abílio


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:52:31PM +0200, Jürgen Spitzmüller wrote:
 Jean-Marc Lasgouttes wrote:
  Yes. It is not fair to see always the same people having fun (what
  about replacing qt4 with Xaw?)
 
 Or just ditch Unix and use the Windows API.

Or use Java.

Andre'


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:59:08PM +0200, Jean-Marc Lasgouttes wrote:
 [EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
  Jean-Marc Lasgouttes wrote:
  Yes. It is not fair to see always the same people having fun (what
  about replacing qt4 with Xaw?)
 
  Or just ditch Unix and use the Windows API.
 
 Java?

*grmpf*

Andre'


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Abdelrazak Younes a écrit :

During my tests I found the three bugs below, I did not found in 
bugzilla:


* About layouts: the tag "DependsOn" does not works when it calls a 
Style whose name contains
 special characters. I cannot test everything, but I suspect that it 
does not works when the name of

 called Style contains an underscore ( _ )


What does that mean "does not work"? Is it a crash? Or just the LateX 
that does not compile?


Abdel.
The Preamble of the Style called by the tag is not put in the Preamble 
of the document and LaTeX

does not compile.

PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Philippe Charpentier wrote:
> The Preamble of the Style called by the tag is not put in the Preamble
> of the document and LaTeX
> does not compile.

So bug 3521?
http://bugzilla.lyx.org/show_bug.cgi?id=3521

Jürgen


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Jürgen Spitzmüller a écrit :

Philippe Charpentier wrote:
  

The Preamble of the Style called by the tag is not put in the Preamble
of the document and LaTeX
does not compile.



So bug 3521?
http://bugzilla.lyx.org/show_bug.cgi?id=3521

Jürgen
  
I don't think so. If I understand well, bug 3521 is related to non ascii 
characters in layouts which is solved now.
I will try to get time to create simple Styles with the same problem and 
I will post the result in the list.


PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Philippe Charpentier a écrit :

Jürgen Spitzmüller a écrit :

Philippe Charpentier wrote:
 

The Preamble of the Style called by the tag is not put in the Preamble
of the document and LaTeX
does not compile.



So bug 3521?
http://bugzilla.lyx.org/show_bug.cgi?id=3521

Jürgen
  
I don't think so. If I understand well, bug 3521 is related to non 
ascii characters in layouts which is solved now.
I will try to get time to create simple Styles with the same problem 
and I will post the result in the list.


PhC


I made the test and my first impression was wright:
Create the following Styles:

Style Test_A
 Margin  Static
 LatexType Command
 LatexName TestA
 ParIndentMM
 ParSkip 0.4
 Align Block
 AlignPossible Block, Left, Right, Center
 LabelType No_Label
 Preamble
\def\TestA#1{\textcolor{blue}{#1}}
 EndPreamble
End

Style TestA
 CopyStyleTest_A
 DependsOnTest_A
 Preamble
 EndPreamble
End

Style TestB
 Margin  Static
 LatexType Command
 LatexName TestB
 ParIndentMM
 ParSkip 0.4
 Align Block
 AlignPossible Block, Left, Right, Center
 LabelType No_Label
 Preamble
\def\TestB#1{\textcolor{red}{#1}}
 EndPreamble
End

Style Test_B
 CopyStyleTestB
 DependsOnTestB
 Preamble
 EndPreamble
End

Then:

Test_B works : the Preamble of TestB is put in the Preamble of the document
TestA does not works : the Preamble of Test_A is not put in the Preamble 
of the document


PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
> "Philippe" == Philippe Charpentier <[EMAIL PROTECTED]> writes:

Philippe> I made the test and my first impression was wright: 

Does the following patch help?

JMarc

Index: src/Layout.cpp
===
--- src/Layout.cpp	(révision 19050)
+++ src/Layout.cpp	(copie de travail)
@@ -241,7 +241,8 @@ bool Layout::read(Lexer & lexrc, TextCla
 
 		case LT_OBSOLETEDBY: // replace with a known style
 			if (lexrc.next()) {
-docstring const style = lexrc.getDocString();
+docstring const style = 
+	subst(lexrc.getDocString(), '_', ' ');
 
 if (tclass.hasLayout(style)) {
 	docstring const tmpname = name_;
@@ -262,7 +263,7 @@ bool Layout::read(Lexer & lexrc, TextCla
 
 		case LT_DEPENDSON:
 			if (lexrc.next())
-depends_on_ = lexrc.getDocString();
+			depends_on_ = subst(lexrc.getDocString(), '_', ' ');
 			break;
 
 		case LT_MARGIN:		// margin style definition.


Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 09:03:41 Jean-Marc Lasgouttes wrote:
> Does the following patch help?

  If it works put it in as it is the right fix.

> JMarc

-- 
José Abílio


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Jean-Marc Lasgouttes a écrit :

"Philippe" == Philippe Charpentier <[EMAIL PROTECTED]> writes:



Philippe> I made the test and my first impression was wright: 


Does the following patch help?

JMarc

  

I just test it on the latest svn : it works fine

PhC



Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
> "José" == José Matos <[EMAIL PROTECTED]> writes:

José> On Thursday 12 July 2007 09:03:41 Jean-Marc Lasgouttes wrote:
>> Does the following patch help?

José>   If it works put it in as it is the right fix.

Done.

JMarc


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
> "Philippe" == Philippe Charpentier <[EMAIL PROTECTED]> writes:

Philippe> I just test it on the latest svn : it works fine

OK, put it in. This issue existed also with 1.3.x and 1.4.x, right?

JMarc


[patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
> > * In a new document write: a word
> >   Then change the size of the two words to small; then change the color
> > of "a" (to red for example).
> >   Then lyx traduce it as : \textcolor{red}{\small a}{\small  word} and
> > the space between "a" and
> >   "word" disappear.
>
> this is
> http://bugzilla.lyx.org/show_bug.cgi?id=3382

Here's an alternative patch for this issue. The problem is that blanks are 
swallowed if they follow another blank that is ending a command, such as in 
\small  word

We need to care about that, notwithstanding whether we manage to improve the 
LaTeX output (as Uwe suggests rightly in the bug report), because this case 
can nevertheless occur, so the two attempts are orthogonal.

The attached patch is a bit more complicated than my first attempt on bugzilla 
that just ends every font size command by '{}' instead of a blank, but it 
results in better LaTeX output. It checks whether a font switch command with 
a trailing blank has occured, and if so, it outputs a normal space ("\ ") 
instead of a blank, i.e. in the case above:
\textcolor{red}{\small a}{\small \ word}

Even better would be "\small\ word", but I don't see how I could get that.

So I think this is the best we can do for now, however I'm not entirely sure 
about the implementation details. So please have a look if it strikes you 
correct.

Jürgen
Index: src/Paragraph.cpp
===
--- src/Paragraph.cpp	(Revision 19033)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -66,6 +66,7 @@
 namespace lyx {
 
 using support::contains;
+using support::suffixIs;
 using support::rsplit;
 
 
@@ -2065,24 +2066,38 @@
 			}
 		}
 
+		bool trailing_blank = false;
 		// Do we need to change font?
 		if ((font != running_font ||
 		 font.language() != running_font.language()) &&
 			i != body_pos - 1)
 		{
-			column += font.latexWriteStartChanges(os, bparams,
+			odocstringstream ods;
+			column += font.latexWriteStartChanges(ods, bparams,
 			  runparams, basefont,
 			  last_font);
 			running_font = font;
 			open_font = true;
+			docstring fontchange = ods.str();
+			// check if the fontchange ends with a trailing blank
+			if (suffixIs(fontchange, 0x0020))
+trailing_blank = true;
+			os << fontchange;
 		}
 
 		if (c == ' ') {
+			// If a blank follows a font change that is itself finished
+			// by a blank (e.g. "{\Huge "), we need a normal space
+			// in order to prevent the blank from being swallowed.
+			if (trailing_blank) {
+os << "\\ ";
+column += 2;
+			}
 			// Do not print the separation of the optional argument
 			// if style->pass_thru is false. This works because
 			// simpleTeXSpecialChars ignores spaces if
 			// style->pass_thru is false.
-			if (i != body_pos - 1) {
+			else if (i != body_pos - 1) {
 if (pimpl_->simpleTeXBlanks(
 		*(runparams.encoding), os, texrow,
 		i, column, font, *style))


Re: UTF-8 and layouts - bugs

2007-07-12 Thread Philippe Charpentier

Jean-Marc Lasgouttes a écrit :

"Philippe" == Philippe Charpentier <[EMAIL PROTECTED]> writes:



Philippe> I just test it on the latest svn : it works fine

OK, put it in. This issue existed also with 1.3.x and 1.4.x, right?

JMarc
  

Yes

PhC



Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
> "Jürgen" == Jürgen Spitzmüller <[EMAIL PROTECTED]> writes:

Jürgen> The attached patch is a bit more complicated than my first
Jürgen> attempt on bugzilla that just ends every font size command by
Jürgen> '{}' instead of a blank, but it results in better LaTeX
Jürgen> output. It checks whether a font switch command with a
Jürgen> trailing blank has occured, and if so, it outputs a normal
Jürgen> space ("\ ") instead of a blank, i.e. in the case above:
Jürgen> \textcolor{red}{\small a}{\small \ word}

What about replacing the final blank by {} instead , and output
\textcolor{red}{\small a}{\small{}  word}

It should be easy with what you have already done.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> What about replacing the final blank by {} instead , and output
> \textcolor{red}{\small a}{\small{}  word}
>
> It should be easy with what you have already done.

This is what I proposed first, but Uwe doesn't like it ;-)
It is of course much easier, but it's less elegant LaTeX code, even more so as 
the {} is always output, whereas the "\ " in my recent patch is only output 
if there are really two subsequent blanks.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:


> This is what I proposed first, but Uwe doesn't like it ;-)
> It is of course much easier, but it's less elegant LaTeX code, even more so 
> as 
> the {} is always output, whereas the "\ " in my recent patch is only output 
> if there are really two subsequent blanks.

No, I meant output rhe {} only when there are two consecutive blanks.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> No, I meant output rhe {} only when there are two consecutive blanks.

You mean, pass information to Font::latexWriteStartChanges that the character 
following the font change will be a blank? That could be doable.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
> You mean, pass information to Font::latexWriteStartChanges that the character 
> following the font change will be a blank? That could be doable.

It is even simpler than that.

JMarc

Index: src/Paragraph.cpp
===
--- src/Paragraph.cpp	(révision 19050)
+++ src/Paragraph.cpp	(copie de travail)
@@ -67,6 +67,7 @@ using std::ostream;
 namespace lyx {
 
 using support::contains;
+using support::suffixIs;
 using support::rsplit;
 
 
@@ -2076,11 +2077,19 @@ bool Paragraph::simpleTeXOnePar(Buffer c
 		 font.language() != running_font.language()) &&
 			i != body_pos - 1)
 		{
-			column += font.latexWriteStartChanges(os, bparams,
+			odocstringstream ods;
+			column += font.latexWriteStartChanges(ods, bparams,
 			  runparams, basefont,
 			  last_font);
 			running_font = font;
 			open_font = true;
+			docstring fontchange = ods.str();
+			// check if the fontchange ends with a trailing blank
+			if (suffixIs(fontchange, 0x0020) && c == ' ')
+os << fontchange.substr(0, fontchange.size() - 1) 
+   << from_ascii("{}");
+			else
+os << fontchange;
 		}
 
 		if (c == ' ') {


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
> > No, I meant output rhe {} only when there are two consecutive blanks.
>
> You mean, pass information to Font::latexWriteStartChanges that the
> character following the font change will be a blank? That could be doable.

As in the attached? This looks like a pretty safe approach to me.

Jürgen
Index: src/Font.cpp
===
--- src/Font.cpp	(Revision 19033)
+++ src/Font.cpp	(Arbeitskopie)
@@ -743,7 +743,7 @@
 int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
 OutputParams const & runparams,
 Font const & base,
-Font const & prev) const
+Font const & prev, bool blank_follows) const
 {
 	bool env = false;
 
@@ -803,8 +803,13 @@
 	if (number() == ON && prev.number() != ON
 		&& (language()->lang() == "hebrew"
 			|| language()->lang() == "farsi")) {
-		os << "{\\beginL ";
-		count += 9;
+		if (blank_follows) {
+			os << "{\\beginL{}";
+			count += 10;
+		} else {
+			os << "{\\beginL ";
+			count += 9;
+		}
 	}
 
 	Font f = *this;
@@ -861,9 +866,14 @@
 			++count;
 		}
 		os << '\\'
-		   << LaTeXSizeNames[f.size()]
-		   << ' ';
-		count += strlen(LaTeXSizeNames[f.size()]) + 2;
+		   << LaTeXSizeNames[f.size()];
+		if (blank_follows) {
+			os << "{}";
+			count += strlen(LaTeXSizeNames[f.size()]) + 3;
+		} else {
+			os << ' ';
+			count += strlen(LaTeXSizeNames[f.size()]) + 2;
+		}
 	}
 	return count;
 }
Index: src/Font.h
===
--- src/Font.h	(Revision 19033)
+++ src/Font.h	(Arbeitskopie)
@@ -300,7 +300,8 @@
 	int latexWriteStartChanges(odocstream &, BufferParams const & bparams,
    OutputParams const & runparams,
    Font const & base,
-   Font const & prev) const;
+   Font const & prev,
+   bool blank_follows) const;
 
 	/** Writes the tail of the LaTeX needed to change to this font.
 	Returns number of chars written. Base is the font state we want
Index: src/Paragraph.cpp
===
--- src/Paragraph.cpp	(Revision 19033)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -2070,9 +2070,12 @@
 		 font.language() != running_font.language()) &&
 			i != body_pos - 1)
 		{
+			bool blank_follows = false;
+			if (c == ' ')
+blank_follows = true;
 			column += font.latexWriteStartChanges(os, bparams,
 			  runparams, basefont,
-			  last_font);
+			  last_font, blank_follows);
 			running_font = font;
 			open_font = true;
 		}


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> It is even simpler than that.

Sight. So which one should we take? I think either one is ok. Yours is 
probably simpler. I'll let you and José decide.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 11:54:39 Jürgen Spitzmüller wrote:
> Sight. So which one should we take? I think either one is ok. Yours is
> probably simpler. I'll let you and José decide.

  If you agree on one of the versions you have my OK.

  As you see I am learning. Now instead of throwing a coin I expect you to do 
so. ;-)

> Jürgen

-- 
José Abílio


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
> So which one should we take? I think either one is ok. Yours is
> probably simpler. I'll let you and José decide.

On a second thought, I think you should just commit yours. José?

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote:
> On a second thought, I think you should just commit yours

I also think this should be ported back to 1.4.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 12:00:14 Jürgen Spitzmüller wrote:
> On a second thought, I think you should just commit yours. José?
>
> Jürgen

As I said before if you agree on one version, as it seems to be case, you have 
my OK.

-- 
José Abílio


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
> On a second thought, I think you should just commit yours. 

Yes, it is IMO simpler. Note that this would be moot if we had the
latexstream I've been dreaming about for ages :)

JMarc



Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
> I also think this should be ported back to 1.4.

No, the bug does not exist in 1.4, where spaces are kept outside of
font changes.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Alfredo Braunstein
Jean-Marc Lasgouttes wrote:

> Yes, it is IMO simpler. Note that this would be moot if we had the
> latexstream I've been dreaming about for ages :)

Like the one you'll give us in Bromarv? ;-)

A/




Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

Alfredo Braunstein <[EMAIL PROTECTED]> writes:
> Jean-Marc Lasgouttes wrote:
>
>> Yes, it is IMO simpler. Note that this would be moot if we had the
>> latexstream I've been dreaming about for ages :)
>
> Like the one you'll give us in Bromarv? ;-)

I have other plans, but we'll see :)

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> I have other plans, but we'll see :)

Break some eggs perhaps? ;-)

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
> Jean-Marc Lasgouttes wrote:
>> I have other plans, but we'll see :)
>
> Break some eggs perhaps? ;-)

Yes. It is not fair to see always the same people having fun (what
about replacing qt4 with Xaw?)

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote:
> Yes. It is not fair to see always the same people having fun (what
> about replacing qt4 with Xaw?)

Or just ditch Unix and use the Windows API.

Jürgen


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
> Jean-Marc Lasgouttes wrote:
>> Yes. It is not fair to see always the same people having fun (what
>> about replacing qt4 with Xaw?)
>
> Or just ditch Unix and use the Windows API.

Java?

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Abdelrazak Younes

Jean-Marc Lasgouttes wrote:

[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:

Jean-Marc Lasgouttes wrote:

Yes. It is not fair to see always the same people having fun (what
about replacing qt4 with Xaw?)

Or just ditch Unix and use the Windows API.


Java?


Ajax

Abdel.



Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
Abdelrazak Younes <[EMAIL PROTECTED]> writes:

> Ajax

Basix (http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/basix.html)

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
>> You mean, pass information to Font::latexWriteStartChanges that the 
>> character 
>> following the font change will be a blank? That could be doable.
>
> It is even simpler than that.

I appled this patch.

JMarc


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:17:57PM +0200, Jürgen Spitzmüller wrote:
> Jean-Marc Lasgouttes wrote:
> > I have other plans, but we'll see :)
> 
> Break some eggs perhaps? ;-)

I wonder what I will do this year... after all, there are not too many
frontends left to kill...

Andre'
> 


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:44:21PM +0200, Jean-Marc Lasgouttes wrote:
> 
> [EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
> > Jean-Marc Lasgouttes wrote:
> >> I have other plans, but we'll see :)
> >
> > Break some eggs perhaps? ;-)
> 
> Yes. It is not fair to see always the same people having fun (what
> about replacing qt4 with Xaw?)

Xt. At most.

Andre'


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread José Matos
On Thursday 12 July 2007 13:59:08 Jean-Marc Lasgouttes wrote:
> Java?
>
> JMarc

Python is more likely. ;-)

-- 
José Abílio


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:52:31PM +0200, Jürgen Spitzmüller wrote:
> Jean-Marc Lasgouttes wrote:
> > Yes. It is not fair to see always the same people having fun (what
> > about replacing qt4 with Xaw?)
> 
> Or just ditch Unix and use the Windows API.

Or use Java.

Andre'


Re: [patch] Re: UTF-8 and layouts - bugs

2007-07-12 Thread Andre Poenitz
On Thu, Jul 12, 2007 at 02:59:08PM +0200, Jean-Marc Lasgouttes wrote:
> [EMAIL PROTECTED] (Jürgen Spitzmüller) writes:
> > Jean-Marc Lasgouttes wrote:
> >> Yes. It is not fair to see always the same people having fun (what
> >> about replacing qt4 with Xaw?)
> >
> > Or just ditch Unix and use the Windows API.
> 
> Java?

*grmpf*

Andre'


UTF-8 and layouts - bugs

2007-07-11 Thread Philippe Charpentier

Hi,
yesterday I test Abdel's patch layout_name_is_unicode.patch with the 
latest svn. I send a message
to lyx-devel, but as I don't see it on mail-archive.com 
http://www.mail-archive.com/lyx-devel@lists.lyx.org/ I send an other 
one and add some bugs I found.


Abdel's patch works perfectly with all my layouts and all my old lyx 
files (with the exceptions below):

the only thing I did was to convert my layouts in UTF-8.
Thus, for me, this patch is a perfect solution for the upgrade from 1.4 
to 1.5!


During my tests I found the three bugs below, I did not found in bugzilla:

* About layouts: the tag DependsOn does not works when it calls a 
Style whose name contains
 special characters. I cannot test everything, but I suspect that it 
does not works when the name of

 called Style contains an underscore ( _ )

*About lyx2lyx: it fails to convert an old lyx file containing the 
command \language frenchb


* In a new document write: a word
 Then change the size of the two words to small; then change the color 
of a (to red for example).
 Then lyx traduce it as : \textcolor{red}{\small a}{\small  word} and 
the space between a and

 word disappear.

PhC



Re: UTF-8 and layouts - bugs

2007-07-11 Thread Jürgen Spitzmüller
Philippe Charpentier wrote:
 *About lyx2lyx: it fails to convert an old lyx file containing the
 command \language frenchb

just fixed by José I think (rev. 19044).

 * In a new document write: a word
   Then change the size of the two words to small; then change the color
 of a (to red for example).
   Then lyx traduce it as : \textcolor{red}{\small a}{\small  word} and
 the space between a and
   word disappear.

this is
http://bugzilla.lyx.org/show_bug.cgi?id=3382

Jürgen


Re: UTF-8 and layouts - bugs

2007-07-11 Thread Abdelrazak Younes

Philippe Charpentier wrote:
Abdel's patch works perfectly with all my layouts and all my old lyx 
files (with the exceptions below):

the only thing I did was to convert my layouts in UTF-8.
Thus, for me, this patch is a perfect solution for the upgrade from 1.4 
to 1.5!


This patch is in svn now.



During my tests I found the three bugs below, I did not found in bugzilla:

* About layouts: the tag DependsOn does not works when it calls a 
Style whose name contains
 special characters. I cannot test everything, but I suspect that it 
does not works when the name of

 called Style contains an underscore ( _ )


What does that mean does not work? Is it a crash? Or just the LateX 
that does not compile?


Abdel.



UTF-8 and layouts - bugs

2007-07-11 Thread Philippe Charpentier

Hi,
yesterday I test Abdel's patch "layout_name_is_unicode.patch" with the 
latest svn. I send a message
to lyx-devel, but as I don't see it on mail-archive.com 
 I send an other 
one and add some bugs I found.


Abdel's patch works perfectly with all my layouts and all my old lyx 
files (with the exceptions below):

the only thing I did was to convert my layouts in UTF-8.
Thus, for me, this patch is a perfect solution for the upgrade from 1.4 
to 1.5!


During my tests I found the three bugs below, I did not found in bugzilla:

* About layouts: the tag "DependsOn" does not works when it calls a 
Style whose name contains
 special characters. I cannot test everything, but I suspect that it 
does not works when the name of

 called Style contains an underscore ( _ )

*About lyx2lyx: it fails to convert an old lyx file containing the 
command "\language frenchb"


* In a new document write: a word
 Then change the size of the two words to small; then change the color 
of "a" (to red for example).
 Then lyx traduce it as : \textcolor{red}{\small a}{\small  word} and 
the space between "a" and

 "word" disappear.

PhC



Re: UTF-8 and layouts - bugs

2007-07-11 Thread Jürgen Spitzmüller
Philippe Charpentier wrote:
> *About lyx2lyx: it fails to convert an old lyx file containing the
> command "\language frenchb"

just fixed by José I think (rev. 19044).

> * In a new document write: a word
>   Then change the size of the two words to small; then change the color
> of "a" (to red for example).
>   Then lyx traduce it as : \textcolor{red}{\small a}{\small  word} and
> the space between "a" and
>   "word" disappear.

this is
http://bugzilla.lyx.org/show_bug.cgi?id=3382

Jürgen


Re: UTF-8 and layouts - bugs

2007-07-11 Thread Abdelrazak Younes

Philippe Charpentier wrote:
Abdel's patch works perfectly with all my layouts and all my old lyx 
files (with the exceptions below):

the only thing I did was to convert my layouts in UTF-8.
Thus, for me, this patch is a perfect solution for the upgrade from 1.4 
to 1.5!


This patch is in svn now.



During my tests I found the three bugs below, I did not found in bugzilla:

* About layouts: the tag "DependsOn" does not works when it calls a 
Style whose name contains
 special characters. I cannot test everything, but I suspect that it 
does not works when the name of

 called Style contains an underscore ( _ )


What does that mean "does not work"? Is it a crash? Or just the LateX 
that does not compile?


Abdel.