Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-11 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> To slow down ;-) But I do intend to keep going with the bug
Angus> fixes and support for things like insetgraphics is probably
Angus> easy too. 

That's what I was about to suggest.

Angus> I've decided that I will not bother upgrading the output of
Angus> existing constructs to the current lyxformat, not least because
Angus> the current lyxformat is foobarred in the case of tables.

Probably a good move.

JMarc



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-11 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:

>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> The only outstanding reLyX patch for 1.3.x is the 'recognise m
> Angus> columns in tabulars' one. Have you formed an opinion about it
> Angus> yet?
> 
> Since nobody else complained about it, I think you can apply it.

Ok.

> What kind of plans do you have for reLyX (at least for 1.3.x)?

To slow down ;-)
But I do intend to keep going with the bug fixes and support for things like 
insetgraphics is probably easy too. I've decided that I will not bother 
upgrading the output of existing constructs to the current lyxformat, not 
least because the current lyxformat is foobarred in the case of tables.

-- 
Angus




Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-11 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> The only outstanding reLyX patch for 1.3.x is the 'recognise m
Angus> columns in tabulars' one. Have you formed an opinion about it
Angus> yet? 

Since nobody else complained about it, I think you can apply it.

What kind of plans do you have for reLyX (at least for 1.3.x)? 

JMarc



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-11 Thread Angus Leeming
On Tuesday 11 February 2003 1:43 pm, Jean-Marc Lasgouttes wrote:
> > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> Jean-Marc Lasgouttes wrote:
> >>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> This patch enables reLyX to recognise that these should all be
> Angus> output as insetLatexAccents. LyX can render all except \ss
> Angus> well. Is this a limitation of insetlatexaccent, or should \ss
> Angus> not be such a beast?
>
> >>  Angus, feel free to apply to 1.3.x your latest version of this
> >> patch.
>
> Angus> I think I'll hold off on this one for the time being.
>
> OK, I let you be judge.

The only outstanding reLyX patch for 1.3.x is the 'recognise m columns in 
tabulars' one. Have you formed an opinion about it yet? I'll throw you a 
patch to support minipages eventually, but would like to squash the '% at end 
of paragraph causes 2 pars to be joined' bug first.

Angus



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-11 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Jean-Marc Lasgouttes wrote:
>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>>
Angus> This patch enables reLyX to recognise that these should all be
Angus> output as insetLatexAccents. LyX can render all except \ss
Angus> well. Is this a limitation of insetlatexaccent, or should \ss
Angus> not be such a beast?
>>  Angus, feel free to apply to 1.3.x your latest version of this
>> patch.

Angus> I think I'll hold off on this one for the time being.

OK, I let you be judge.

JMarc



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-11 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:

>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> This patch enables reLyX to recognise that these should all be
> Angus> output as insetLatexAccents. LyX can render all except \ss
> Angus> well. Is this a limitation of insetlatexaccent, or should \ss
> Angus> not be such a beast?
> 
> Angus, feel free to apply to 1.3.x your latest version of this patch.
> 
> JMarc

I think I'll hold off on this one for the time being.

-- 
Angus




Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-11 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> This patch enables reLyX to recognise that these should all be
Angus> output as insetLatexAccents. LyX can render all except \ss
Angus> well. Is this a limitation of insetlatexaccent, or should \ss
Angus> not be such a beast?

Angus, feel free to apply to 1.3.x your latest version of this patch.

JMarc



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Dekel Tsur
On Mon, Feb 10, 2003 at 04:43:08PM +, Angus Leeming wrote:
> > I think \ss{} should be stored as a single char without any accent
> > inset or other wrapper.
> 
> So, you are proposing a LyX file format who's contents depend on the 
> locale in which it is read. Doesn't sound too clever to me. What if I 
> wanted to read your document with a locale set to non-latin1?

I thought that we want to move to unicode.
When we do that, we can store accents by a single char, and insetaccents can
be removed.



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Andre Poenitz
On Mon, Feb 10, 2003 at 04:43:08PM +, Angus Leeming wrote:
> So, you are proposing a LyX file format who's contents depend on the 
> locale in which it is read. Doesn't sound too clever to me. What if I 
> wanted to read your document with a locale set to non-latin1?

I don't know. What happens right now?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> My patch attempts to turn LaTeX '\ss{}' into something
Angus> recognised by LyX. I supposed that all that would be needed was
Angus> to tell reLyX that '\ss{}' is a valid LaTeX macro and that it
Angus> should export this macro as a LyX insetlatexchar. It is this
Angus> last step where things fall down, because insetlatexchar does
Angus> not recognise '\ss{}'. Fair enough.

To have insetlatexaccent able to render \ss{}, you would have to know
how to draw it by yourself. Also, the inset is not well prepared to
have `accents' that are a macro with several characters in their name.
I had a quick look some time ago to add support for \oe{}, and gave up
for this reason. Now, if you do add support for \ss, then adding \oe
would be trivial :)

JMarc



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Angus Leeming
Andre Poenitz wrote:

> On Mon, Feb 10, 2003 at 04:32:33PM +, Angus Leeming wrote:
>> > Maybe I should read the code to understand your problem. I
>> > certainly see \ss as proper glyph in my xforms-LyX and I enter it
>> > as Compose-s-s and it is stored as a single char in the .lyx.
>> 
>> No. You see a glyph that you entered as Compose-s-s and that is
>> stored as a single char in the .lyx.
>> 
>> If you import a LaTeX file into LyX that contains '\ss{}', you get
>> a bit of ERT in LyX.
> 
> So why doesn't reLyX convert \ss{} in that single char I see in my
> .lyx?
> 
>> My original question seems quite clear:
>> "LyX can render all except \ss well. Is this a limitation
>> of
>> insetlatexaccent, or should \ss not be such a beast?"
>> 
>> insetlatexaccent clearly can't handle '\ss{}' at the moment, but
>> no-one has answered the second part of the question. Any takers?
> 
> I think \ss{} should be stored as a single char without any accent
> inset or other wrapper.

So, you are proposing a LyX file format who's contents depend on the 
locale in which it is read. Doesn't sound too clever to me. What if I 
wanted to read your document with a locale set to non-latin1?


-- 
Angus




Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread José Matos
On Monday 10 February 2003 16:28, Andre Poenitz wrote:
>
> So why doesn't reLyX convert \ss{} in that single char I see in my .lyx?

  Because the user can be using an encoding that is not latin1 or latin15?

> Andre'

-- 
José Abílio



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Andre Poenitz
On Mon, Feb 10, 2003 at 04:32:33PM +, Angus Leeming wrote:
> > Maybe I should read the code to understand your problem. I certainly
> > see \ss as proper glyph in my xforms-LyX and I enter it as
> > Compose-s-s and it is stored as a single char in the .lyx.
> 
> No. You see a glyph that you entered as Compose-s-s and that is 
> stored as a single char in the .lyx.
> 
> If you import a LaTeX file into LyX that contains '\ss{}', you get a 
> bit of ERT in LyX. 

So why doesn't reLyX convert \ss{} in that single char I see in my .lyx?

> My original question seems quite clear:
> "LyX can render all except \ss well. Is this a limitation of 
> insetlatexaccent, or should \ss not be such a beast?"
> 
> insetlatexaccent clearly can't handle '\ss{}' at the moment, but 
> no-one has answered the second part of the question. Any takers?

I think \ss{} should be stored as a single char without any accent inset or
other wrapper.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Angus Leeming
Andre Poenitz wrote:

> On Mon, Feb 10, 2003 at 08:58:11AM +, Angus Leeming wrote:
>> Andre Poenitz wrote:
>> 
>> > On Fri, Feb 07, 2003 at 07:01:21PM +, Angus Leeming wrote:
>> >> This patch enables reLyX to recognise that these should all be
>> >> output as insetLatexAccents. LyX can render all except \ss well.
>> >> Is this a limitation of insetlatexaccent, or should \ss not be
>> >> such a beast?
>> > 
>> > I think, \ss simply is not an accent, it is a "real" letter.
>> > At least it cannot be combined from other, although historically
>> > it is a ligature...
>> > 
>> > Andre'
>> 
>> Yes, I understand this. But then \i{}, \j{}, \l{} and \L{} are all
>> real letters too
> 
> At least the \l and \L are made up in the TeXbook from an l and some
> line. Maybe an accent.
> 
> Maybe I should read the code to understand your problem. I certainly
> see \ss as proper glyph in my xforms-LyX and I enter it as
> Compose-s-s and it is stored as a single char in the .lyx.

No. You see a glyph that you entered as Compose-s-s and that is 
stored as a single char in the .lyx.

If you import a LaTeX file into LyX that contains '\ss{}', you get a 
bit of ERT in LyX. 

My patch attempts to turn LaTeX '\ss{}' into something recognised by 
LyX. I supposed that all that would be needed was to tell reLyX that 
'\ss{}' is a valid LaTeX macro and that it should export this macro 
as a LyX insetlatexchar. It is this last step where things fall down, 
because insetlatexchar does not recognise '\ss{}'. Fair enough.

My original question seems quite clear:
"LyX can render all except \ss well. Is this a limitation of 
insetlatexaccent, or should \ss not be such a beast?"

insetlatexaccent clearly can't handle '\ss{}' at the moment, but 
no-one has answered the second part of the question. Any takers?

-- 
Angus




Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:

>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> This patch enables reLyX to recognise that these should all
> be Angus> output as insetLatexAccents. LyX can render all except \ss
> Angus> well. Is this a limitation of insetlatexaccent, or should \ss
> Angus> not be such a beast?
> 
> I tested the patch, and I am glad to say that I found a case where
> it does not work: "\i{a}". The 'a' should not be eaten since
> actually \i does not take an argument.

Shrug. This is not a bug in my patch per se. You are merely 
succeeding in triggering bugs in the inherently fragile TeX.pm parser.

Trying:

\documentclass{article}
\begin{document}
\i{a}
\end{document}

with an unmodified version of reLyX produces:

#LyX 1.2 created this file. For more info see http://www.lyx.org/
\lyxformat 2.15
\textclass article

\layout Standard

\ia
\the_end

Which LyX fails to load ("Encountered one unknown token").

-- 
Angus




Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Jean-Marc Lasgouttes
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Mon, Feb 10, 2003 at 03:37:50PM +0100, Jean-Marc Lasgouttes
Andre> wrote:
Angus> This patch enables reLyX to recognise that these should all be
Angus> output as insetLatexAccents. LyX can render all except \ss
Angus> well. Is this a limitation of insetlatexaccent, or should \ss
Angus> not be such a beast?
>>  I tested the patch, and I am glad to say that I found a case where
>> it does not work: "\i{a}". The 'a' should not be eaten since
>> actually \i does not take an argument.

Andre> I really looks like TeX syntax was invented to prevent the
Andre> existence of another parser besides TeX itself.

Not really, but one has to know whether there are arguments or not.

Angus, another one for you: try "\' {e}". I think you should eat the
spaces between the accent command and the argument.

JMarc



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Andre Poenitz
On Mon, Feb 10, 2003 at 03:37:50PM +0100, Jean-Marc Lasgouttes wrote:
> Angus> This patch enables reLyX to recognise that these should all be
> Angus> output as insetLatexAccents. LyX can render all except \ss
> Angus> well. Is this a limitation of insetlatexaccent, or should \ss
> Angus> not be such a beast?
> 
> I tested the patch, and I am glad to say that I found a case where it
> does not work: "\i{a}". The 'a' should not be eaten since actually \i
> does not take an argument.

I really looks like TeX syntax was invented to prevent the existence of
another parser besides TeX itself.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> This patch enables reLyX to recognise that these should all be
Angus> output as insetLatexAccents. LyX can render all except \ss
Angus> well. Is this a limitation of insetlatexaccent, or should \ss
Angus> not be such a beast?

I tested the patch, and I am glad to say that I found a case where it
does not work: "\i{a}". The 'a' should not be eaten since actually \i
does not take an argument.

JMarc



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Andre Poenitz
On Mon, Feb 10, 2003 at 08:58:11AM +, Angus Leeming wrote:
> Andre Poenitz wrote:
> 
> > On Fri, Feb 07, 2003 at 07:01:21PM +, Angus Leeming wrote:
> >> This patch enables reLyX to recognise that these should all be output as
> >> insetLatexAccents. LyX can render all except \ss well. Is this a
> >> limitation of insetlatexaccent, or should \ss not be such a beast?
> > 
> > I think, \ss simply is not an accent, it is a "real" letter.
> > At least it cannot be combined from other, although historically
> > it is a ligature...
> > 
> > Andre'
> 
> Yes, I understand this. But then \i{}, \j{}, \l{} and \L{} are all real 
> letters too

At least the \l and \L are made up in the TeXbook from an l and some line.
Maybe an accent.

Maybe I should read the code to understand your problem. I certainly see
\ss as proper glyph in my xforms-LyX and I enter it as Compose-s-s and it
is stored as a single char in the .lyx. 

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Angus Leeming
Andre Poenitz wrote:

> On Fri, Feb 07, 2003 at 07:01:21PM +, Angus Leeming wrote:
>> This patch enables reLyX to recognise that these should all be output as
>> insetLatexAccents. LyX can render all except \ss well. Is this a
>> limitation of insetlatexaccent, or should \ss not be such a beast?
> 
> I think, \ss simply is not an accent, it is a "real" letter.
> At least it cannot be combined from other, although historically
> it is a ligature...
> 
> Andre'

Yes, I understand this. But then \i{}, \j{}, \l{} and \L{} are all real 
letters too and they are handled by insetlatexaccent. So, apart from the 
fact that the class requires a rename, is there any problem with me 
enabling it to display \ss{} ?

-- 
Angus




Re: reLyX support for \i, \j, \l, \L, \ss

2003-02-10 Thread Andre Poenitz
On Fri, Feb 07, 2003 at 07:01:21PM +, Angus Leeming wrote:
> This patch enables reLyX to recognise that these should all be output as 
> insetLatexAccents. LyX can render all except \ss well. Is this a limitation 
> of insetlatexaccent, or should \ss not be such a beast?

I think, \ss simply is not an accent, it is a "real" letter.
At least it cannot be combined from other, although historically
it is a ligature...

Andre'


-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



reLyX support for \i, \j, \l, \L, \ss

2003-02-07 Thread Angus Leeming
This patch enables reLyX to recognise that these should all be output as 
insetLatexAccents. LyX can render all except \ss well. Is this a limitation 
of insetlatexaccent, or should \ss not be such a beast?

-- 
Angus
Index: lib/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.369
diff -u -p -r1.369 ChangeLog
--- lib/ChangeLog	7 Feb 2003 16:48:41 -	1.369
+++ lib/ChangeLog	7 Feb 2003 18:55:37 -
@@ -18,6 +18,9 @@
 	* reLyX/syntax.default: no need to translate symbols that mathed
 	can handle natively.
 
+	* reLyX/BasicLyX.pm: enable reLyX to recognise i, \j, \l, \L and \ss
+	as InsetLatexAccents taking no argument.
+
 2003-02-04  Joao Luis Meloni Assirati  <[EMAIL PROTECTED]>
 
 	* images/math/rbracket.xpm: new file.
Index: lib/reLyX/BasicLyX.pm
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/BasicLyX.pm,v
retrieving revision 1.6
diff -u -p -r1.6 BasicLyX.pm
--- lib/reLyX/BasicLyX.pm	7 Feb 2003 12:11:58 -	1.6
+++ lib/reLyX/BasicLyX.pm	7 Feb 2003 18:55:39 -
@@ -194,8 +194,9 @@ my @GraphicsCommands = map {"\\$_"} qw(e
psfig epsfig includegraphics);
 
 # Accents. Most of these take an argument -- the thing to accent
-# (\l and \L are handled as InsetLatexAccents, so they go here too)
-my $AccentTokens = "[`'^#~=.bcdHklLrtuv\"]";
+# (\i, \j, \l, \L and \ss are handled as InsetLatexAccents,
+# so they go here too)
+my $AccentTokens = "([`'^#~=.bcdHijklLrtuv\"]|ss)";
 
 # Environments which describe justifying (converted to LyX \align commands)
 #and the corresponding LyX commands
@@ -390,8 +391,14 @@ sub basic_lyx {
 	my $name = $eaten->token_name; # name of the token, e.g., "\large"
 	print "'$name' " if $debug_on;
 
+	# Accents taking no argument.
+	if ($name =~ m/^$AccentTokens$/) {
+		&CheckForNewParagraph; # may be at the beginning of a par
+
+		print OUTFILE "$pre_space\n",'\i ',$name,'{}'
+
 	# Tokens which turn into a bit of LyX text
-	if (exists $TextTokenTransTable{$name}) {
+	} elsif (exists $TextTokenTransTable{$name}) {
 	&CheckForNewParagraph; #Start new paragraph if necessary
 
 		my $to_print = $TextTokenTransTable{$name};
@@ -566,7 +573,7 @@ sub basic_lyx {
 
 last TYPESW;
 }
-
+
 	# Handle tokens that take arguments, like \section{},\section*{}
 	if (/^BegArgsToken$/) {
 	my $name = $eaten->token_name;