Andre Poenitz | 1 Mar 06:52 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Wed, Feb 28, 2007 at 10:27:18PM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:
> 
> Martin> The attached patches make both these mechanisms respond to the
> Martin> ProvidesNatbib textclass flag. I am not sure I did this right
> Martin> -- I am especially uncertain about the handling of the numeric
> Martin> vs. author-year thing. Shouldn't this also be in the .layout
> Martin> file if the class is loading natbib?
> 
>  CiteEngine_enum getEngine(Buffer const & buffer)
>  {
> -	return buffer.params().cite_engine;
> +	BufferParams const & p = buffer.params();
> +	if (p.getLyXTextClass().provides(LyXTextClass::natbib)) {
> +		if (p.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL)
> +			return ENGINE_NATBIB_NUMERICAL;
> +		else
> +			return ENGINE_NATBIB_AUTHORYEAR;
> +	} else
> +		return p.cite_engine;
>  }

> What is the logic here?

Looks equivalent to

  CiteEngine_enum getEngine(Buffer const & buffer)
  {
		BufferParams const & p = buffer.params();
  	if (p.getLyXTextClass().provides(LyXTextClass::natbib)
(Continue reading)

Martin Vermeer | 1 Mar 07:14 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

On Thu, Mar 01, 2007 at 06:52:11AM +0100, Andre Poenitz wrote:
> On Wed, Feb 28, 2007 at 10:27:18PM +0100, Jean-Marc Lasgouttes wrote:
> > >>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:
> > 
> > Martin> The attached patches make both these mechanisms respond to the
> > Martin> ProvidesNatbib textclass flag. I am not sure I did this right
> > Martin> -- I am especially uncertain about the handling of the numeric
> > Martin> vs. author-year thing. Shouldn't this also be in the .layout
> > Martin> file if the class is loading natbib?
> > 
> >  CiteEngine_enum getEngine(Buffer const & buffer)
> >  {
> > -	return buffer.params().cite_engine;
> > +	BufferParams const & p = buffer.params();
> > +	if (p.getLyXTextClass().provides(LyXTextClass::natbib)) {
> > +		if (p.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL)
> > +			return ENGINE_NATBIB_NUMERICAL;
> > +		else
> > +			return ENGINE_NATBIB_AUTHORYEAR;
> > +	} else
> > +		return p.cite_engine;
> >  }
> 
> > What is the logic here?
> 
> Looks equivalent to
> 
>   CiteEngine_enum getEngine(Buffer const & buffer)
>   {
> 		BufferParams const & p = buffer.params();
(Continue reading)

Juergen Spitzmueller | 1 Mar 13:27 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

Martin Vermeer wrote:

> Yes, indeed. Still, the question remains, is this sensible.

No. Numerical needs the styles as well, so it should be supported likewise.

Jürgen

Martin Vermeer | 18 Mar 11:51 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

On Thu, Mar 01, 2007 at 01:27:17PM +0100, Juergen Spitzmueller wrote:
> Martin Vermeer wrote:
> 
> > Yes, indeed. Still, the question remains, is this sensible.
> 
> No. Numerical needs the styles as well, so it should be supported likewise.
> 
> Jürgen

Attached an updated version of this patch, so it is not forgotten.

I added a pair of FIXMEs to remind that it is the document class that
"knows" whether we have a numerical or author-year ciation style, and
ideally LyX should be told this through a layout file option.

Were there any other issues with this? I would like to check this in, as
it would gain us one user who might become a contributor.

- Martin 
Attachment (y.diff): text/x-diff, 5298 bytes
Jean-Marc Lasgouttes | 19 Mar 11:14 2007

Re: Getting citep etc. to work for egs.cls


Why not use 
    cite_engine = p.getEngine();
in the code below?

+	// FIXME the class should also provide 
+	// the numerical/ authoryear choce
+	if (p.getLyXTextClass().provides(LyXTextClass::natbib)
+	   && p.cite_engine != biblio::ENGINE_NATBIB_NUMERICAL)
+		cite_engine = biblio::ENGINE_NATBIB_AUTHORYEAR;
+	else	
+		cite_engine = p.cite_engine;

Also, a "trick" could be to allow the value '2' for providenatbib, or
add a new ProvideNumericalNatbib tag.

JMarc

Martin Vermeer | 19 Mar 17:42 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

On Mon, 2007-03-19 at 11:14 +0100, Jean-Marc Lasgouttes wrote:
> Why not use 
>     cite_engine = p.getEngine();
> in the code below?
> 
> +	// FIXME the class should also provide 
> +	// the numerical/ authoryear choce
> +	if (p.getLyXTextClass().provides(LyXTextClass::natbib)
> +	   && p.cite_engine != biblio::ENGINE_NATBIB_NUMERICAL)
> +		cite_engine = biblio::ENGINE_NATBIB_AUTHORYEAR;
> +	else	
> +		cite_engine = p.cite_engine;

Yes indeed, why not ;-/ Getting dumber by the day.

New attached.

> Also, a "trick" could be to allow the value '2' for providenatbib, or
> add a new ProvideNumericalNatbib tag.

Or make it a string valued thing: "No", "Numerical", "AuthorYear". More
legible. Have to sleep on that...

> JMarc

- Martin

Attachment (z.diff): text/x-patch, 6956 bytes
Jean-Marc Lasgouttes | 19 Mar 18:08 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:

Martin> Yes indeed, why not ;-/ Getting dumber by the day.

Martin> New attached.

Very good. If you think it is good enough and working for 1.4, you can
apply it (since having egs working better in 1.4 would be valuable,
from what I understand).

>> Also, a "trick" could be to allow the value '2' for providenatbib,
>> or add a new ProvideNumericalNatbib tag.

Martin> Or make it a string valued thing: "No", "Numerical",
Martin> "AuthorYear". More legible. Have to sleep on that...

Or have ProvidesNatbib and ProvidesNumNatbib (but the two should be
exclusive). In the future, the idea is to move to something like
  Provides "foo"
where "foo" is an arbitrary feature. It would have been good to do
that before 1.5, actually.

JMarc

José Matos | 19 Mar 18:57 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Monday 19 March 2007 5:08:48 pm Jean-Marc Lasgouttes wrote:
>
> Or have ProvidesNatbib and ProvidesNumNatbib (but the two should be
> exclusive). In the future, the idea is to move to something like
>   Provides "foo"
> where "foo" is an arbitrary feature. It would have been good to do
> that before 1.5, actually.

  What needs to be done?

> JMarc

--

-- 
José Abílio

Leuven, E. | 19 Mar 19:02 2007
Picon
Picon

RE : Getting citep etc. to work for egs.cls

José Matos wrote:
> What needs to be done?

release 1.5 asap...
José Matos | 19 Mar 19:08 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Monday 19 March 2007 6:02:18 pm Leuven, E. wrote:
> José Matos wrote:
> > What needs to be done?
>
> release 1.5 asap...

  AS long as critical bugs are fixed I don't have any problem with that. :-)

--

-- 
José Abílio

Edwin Leuven | 19 Mar 23:37 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

José Matos wrote:
> On Monday 19 March 2007 6:02:18 pm Leuven, E. wrote:
>> José Matos wrote:
>>> What needs to be done?
>> release 1.5 asap...
> 
>   AS long as critical bugs are fixed I don't have any problem with that. :-)

bernhard patch fixes one... shall i apply it?

Abdelrazak Younes | 25 Mar 00:24 2007
Picon

Re: Getting citep etc. to work for egs.cls

Edwin Leuven wrote:
> José Matos wrote:
>> On Monday 19 March 2007 6:02:18 pm Leuven, E. wrote:
>>> José Matos wrote:
>>>> What needs to be done?
>>> release 1.5 asap...
>>
>>   AS long as critical bugs are fixed I don't have any problem with 
>> that. :-)
> 
> bernhard patch fixes one... shall i apply it?

I can't believe this is still not applied :-)

Abdel.

José Matos | 26 Mar 14:50 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Saturday 24 March 2007 11:24:17 pm Abdelrazak Younes wrote:
> I can't believe this is still not applied :-)

  Could you apply it please?

> Abdel.

--

-- 
José Abílio

Abdelrazak Younes | 26 Mar 15:01 2007
Picon

Re: Getting citep etc. to work for egs.cls

José Matos wrote:
> On Saturday 24 March 2007 11:24:17 pm Abdelrazak Younes wrote:
>> I can't believe this is still not applied :-)
> 
>   Could you apply it please?

OK (even if I think Bernard should apply it himself).

Bernard, I need a log before committing this. Could you please write 
that for me?

Abdel.

Abdelrazak Younes | 26 Mar 15:45 2007
Picon

Re: Getting citep etc. to work for egs.cls

José Matos wrote:
> On Saturday 24 March 2007 11:24:17 pm Abdelrazak Younes wrote:
>> I can't believe this is still not applied :-)
> 
>   Could you apply it please?

done.

Bernhard Roider | 26 Mar 19:43 2007

Re: Getting citep etc. to work for egs.cls

Abdelrazak Younes wrote:
> José Matos wrote:
>> On Saturday 24 March 2007 11:24:17 pm Abdelrazak Younes wrote:
>>> I can't believe this is still not applied :-)
>>
>>   Could you apply it please?
> 
> done.
> 

Thank you. I just read the log you used and it is from my first mail containing this patch. There 
was a change since that:

the sentence

if you want to know if the lexer still has data to read (either from the stream or from the pushed 
token) then use "lex.isOK()".

should be

if you want to know if the lexer still has data to read from the stream then use "lex.isOK()".

(i had no time today (till now) to do anything for lyx...)

Bernhard

Abdelrazak Younes | 27 Mar 10:29 2007
Picon

Re: Getting citep etc. to work for egs.cls

Bernhard Roider wrote:
> Abdelrazak Younes wrote:
>> José Matos wrote:
>>> On Saturday 24 March 2007 11:24:17 pm Abdelrazak Younes wrote:
>>>> I can't believe this is still not applied :-)
>>>
>>>   Could you apply it please?
>>
>> done.
>>
> 
> Thank you. I just read the log you used and it is from my first mail 
> containing this patch. There was a change since that:
> 
> the sentence
> 
> if you want to know if the lexer still has data to read (either from the 
> stream or from the pushed token) then use "lex.isOK()".
> 
> should be
> 
> if you want to know if the lexer still has data to read from the stream 
> then use "lex.isOK()".

When you get SVN access, I suggest that you document this properly in 
code ;-)

Abdel.

(Continue reading)

Abdelrazak Younes | 26 Mar 14:34 2007
Picon

Re: Getting citep etc. to work for egs.cls

Edwin Leuven wrote:
> José Matos wrote:
>> On Monday 19 March 2007 6:02:18 pm Leuven, E. wrote:
>>> José Matos wrote:
>>>> What needs to be done?
>>> release 1.5 asap...
>>
>>   AS long as critical bugs are fixed I don't have any problem with 
>> that. :-)
> 
> bernhard patch fixes one... shall i apply it?

I think that waiting for the last minute before beta 2 is not a good 
idea for this one...

Abdel.

Leuven, E. | 26 Mar 14:37 2007
Picon
Picon

RE: Re: Getting citep etc. to work for egs.cls

Abdel wrote:
> I think that waiting for the last minute before beta 2 is
> not a good idea for this one...

why not? it fixes a critical bug and would get some testing. 

(and i haven't experienced any problems myself with it...)

Abdelrazak Younes | 26 Mar 14:43 2007
Picon

Re: Getting citep etc. to work for egs.cls

Leuven, E. wrote:
> Abdel wrote:
>> I think that waiting for the last minute before beta 2 is
>> not a good idea for this one...
> 
> why not?

I mean that we should apply it ASAP, not two minute before beta 2.

> it fixes a critical bug and would get some testing. 
> 
> (and i haven't experienced any problems myself with it...)

ditto.

Abdel.

Jean-Marc Lasgouttes | 19 Mar 23:03 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "José" == José Matos <jamatos@...> writes:

José> On Monday 19 March 2007 5:08:48 pm Jean-Marc Lasgouttes wrote:
>>  Or have ProvidesNatbib and ProvidesNumNatbib (but the two should
>> be exclusive). In the future, the idea is to move to something like
>> Provides "foo" where "foo" is an arbitrary feature. It would have
>> been good to do that before 1.5, actually.

José>   What needs to be done?

Currently we have an enum in lyxtextclass.h:

	/// Packages that are already loaded by the class
	enum Provides {
		///
		nothing = 0,
		///
		amsmath = 1,
		///
		makeidx = 2,
		///
		url = 4,
		///
		natbib = 8
	};

The idea is to replace it with a std::set<string> and change
LyXTextClass::provides() accordingly. The rest is purely mechanical
(replace enum by string). It could be possible to simplify further the
code, but it is not needed now (and may be more dangerous)
(Continue reading)

Martin Vermeer | 20 Mar 07:03 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Mon, Mar 19, 2007 at 11:03:18PM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "José" == José Matos <jamatos@...> writes:
> 
> José> On Monday 19 March 2007 5:08:48 pm Jean-Marc Lasgouttes wrote:
> >>  Or have ProvidesNatbib and ProvidesNumNatbib (but the two should
> >> be exclusive). In the future, the idea is to move to something like
> >> Provides "foo" where "foo" is an arbitrary feature. It would have
> >> been good to do that before 1.5, actually.
> 
> José>   What needs to be done?
> 
> Currently we have an enum in lyxtextclass.h:
> 
> 	/// Packages that are already loaded by the class
> 	enum Provides {
> 		///
> 		nothing = 0,
> 		///
> 		amsmath = 1,
> 		///
> 		makeidx = 2,
> 		///
> 		url = 4,
> 		///
> 		natbib = 8
> 	};
> 
> The idea is to replace it with a std::set<string> and change
> LyXTextClass::provides() accordingly. The rest is purely mechanical
> (replace enum by string). It could be possible to simplify further the
(Continue reading)

Jean-Marc Lasgouttes | 20 Mar 10:23 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <lasgouttes@...> writes:

Jean-Marc> The idea is to replace it with a std::set<string> and
Jean-Marc> change LyXTextClass::provides() accordingly. The rest is
Jean-Marc> purely mechanical (replace enum by string). It could be
Jean-Marc> possible to simplify further the code, but it is not needed
Jean-Marc> now (and may be more dangerous)

This is how the basic (untested patch would look like). layout2layout
support is still missing of course (so that this patch is useless as
is). This trivial patch only works for the features that could already
be provided earlier. Adding a "Provides graphics" will have no effect,
for example. It is tempting to redefine isRequired() to return false
when provides returns true, but we have to be a bit more careful than
that.

One solution would be to define a isNeeded() for this use case, and
still use isRequired in the few cases where this makes sense.

JMarc

Attachment (provides.diff): text/x-patch, 6094 bytes
Jean-Marc Lasgouttes | 20 Mar 10:24 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <lasgouttes@...> writes:

>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <lasgouttes@...> writes:
Jean-Marc> The idea is to replace it with a std::set<string> and
Jean-Marc> change LyXTextClass::provides() accordingly. The rest is
Jean-Marc> purely mechanical (replace enum by string). It could be
Jean-Marc> possible to simplify further the code, but it is not needed
Jean-Marc> now (and may be more dangerous)

Jean-Marc> This is how the basic (untested patch would look like).
Jean-Marc> layout2layout support is still missing of course (so that
Jean-Marc> this patch is useless as is). This trivial patch only works
Jean-Marc> for the features that could already be provided earlier.
Jean-Marc> Adding a "Provides graphics" will have no effect, for
Jean-Marc> example. It is tempting to redefine isRequired() to return
Jean-Marc> false when provides returns true, but we have to be a bit
Jean-Marc> more careful than that.

Jean-Marc> One solution would be to define a isNeeded() for this use
Jean-Marc> case, and still use isRequired in the few cases where this
Jean-Marc> makes sense.

I forgot to add that I do not know how std::set works, so my code
could be bogus (but at least it compiles :).

JMarc

Martin Vermeer | 20 Mar 21:47 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Tue, Mar 20, 2007 at 10:24:52AM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Jean-Marc" == Jean-Marc Lasgouttes <lasgouttes@...> writes:
> 
> >>>>> "Jean-Marc" == Jean-Marc Lasgouttes <lasgouttes@...> writes:
> Jean-Marc> The idea is to replace it with a std::set<string> and
> Jean-Marc> change LyXTextClass::provides() accordingly. The rest is
> Jean-Marc> purely mechanical (replace enum by string). It could be
> Jean-Marc> possible to simplify further the code, but it is not needed
> Jean-Marc> now (and may be more dangerous)
> 
> Jean-Marc> This is how the basic (untested patch would look like).
> Jean-Marc> layout2layout support is still missing of course (so that
> Jean-Marc> this patch is useless as is). This trivial patch only works
> Jean-Marc> for the features that could already be provided earlier.
> Jean-Marc> Adding a "Provides graphics" will have no effect, for
> Jean-Marc> example. It is tempting to redefine isRequired() to return
> Jean-Marc> false when provides returns true, but we have to be a bit
> Jean-Marc> more careful than that.
> 
> Jean-Marc> One solution would be to define a isNeeded() for this use
> Jean-Marc> case, and still use isRequired in the few cases where this
> Jean-Marc> makes sense.
> 
> I forgot to add that I do not know how std::set works, so my code
> could be bogus (but at least it compiles :).

From what I remember it is valid... 

- Martin

(Continue reading)

Jean-Marc Lasgouttes | 21 Mar 10:48 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:

>>  I forgot to add that I do not know how std::set works, so my code
>> could be bogus (but at least it compiles :).

Martin> From what I remember it is valid...

Very good.

JMarc 

José Matos | 21 Mar 19:11 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Tuesday 20 March 2007 9:23:56 am Jean-Marc Lasgouttes wrote:
>
> One solution would be to define a isNeeded() for this use case, and
> still use isRequired in the few cases where this makes sense.

  The patch seems quite interesting indeed. I think that it is not yet ready 
to beta 2 but I would to see it (and to help testing it) for a later release.

> JMarc

--

-- 
José Abílio

Jean-Marc Lasgouttes | 22 Mar 09:41 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "José" == José Matos <jamatos@...> writes:

José> On Tuesday 20 March 2007 9:23:56 am Jean-Marc Lasgouttes wrote:
>>  One solution would be to define a isNeeded() for this use case,
>> and still use isRequired in the few cases where this makes sense.

José>   The patch seems quite interesting indeed. I think that it is
José> not yet ready to beta 2 but I would to see it (and to help
José> testing it) for a later release.

OK, here is the still untested second iteration. I introduce a helper
isNeeded, which is equivalent to "isRequired && ! provided" (if you
have a better name, please tell). With this change, any feature known
to LyX can be provided by a class. 

What needs to be done

- update layout2layout. I need help there pretty please.

- actually test it. I do not expect any major problem, since I tried
  to be conservative.

- document the changes (trivial).

JMarc 

Attachment (provides2.diff): text/x-patch, 12 KiB
Georg Baum | 22 Mar 09:58 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

Jean-Marc Lasgouttes wrote:

> What needs to be done
> 
> - update layout2layout. I need help there pretty please.

I can have a look over the weekend. I need to fix a bug in layout2lyaout
anyway (conversion from version 1 to 3 does not work).

Georg

Martin Vermeer | 22 Mar 13:10 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Thu, 22 Mar 2007 09:41:07 +0100
Jean-Marc Lasgouttes <lasgouttes@...> wrote:

> >>>>> "José" == José Matos <jamatos@...> writes:
> 
> José> On Tuesday 20 March 2007 9:23:56 am Jean-Marc Lasgouttes wrote:
> >>  One solution would be to define a isNeeded() for this use case,
> >> and still use isRequired in the few cases where this makes sense.
> 
> José>   The patch seems quite interesting indeed. I think that it is
> José> not yet ready to beta 2 but I would to see it (and to help
> José> testing it) for a later release.
> 
> OK, here is the still untested second iteration. I introduce a helper
> isNeeded, which is equivalent to "isRequired && ! provided" (if you
> have a better name, please tell). With this change, any feature known
> to LyX can be provided by a class. 

"mustProvide"

> What needs to be done
> 
> - update layout2layout. I need help there pretty please.
> 
> - actually test it. I do not expect any major problem, since I tried
>   to be conservative.
> 
> - document the changes (trivial).
> 
> JMarc 
(Continue reading)

Jean-Marc Lasgouttes | 23 Mar 09:40 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:

>>  OK, here is the still untested second iteration. I introduce a
>> helper isNeeded, which is equivalent to "isRequired && ! provided"
>> (if you have a better name, please tell). With this change, any
>> feature known to LyX can be provided by a class.

Martin> "mustProvide"

Good idea.

Martin> I think this is an important simplification, even deserving
Martin> the name "bug fix". With it, I can fix the "Provide babel" bug
Martin> for EGS (and presumably others) much more easily.

While this provides the infrastructure for "Provides babel", I suspect
that some code changes will be needed to make it work (and the
semantics of this should be defined).

JMarc

Georg Baum | 24 Mar 14:06 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

Am Donnerstag, 22. März 2007 09:41 schrieb Jean-Marc Lasgouttes:

> OK, here is the still untested second iteration. I introduce a helper
> isNeeded, which is equivalent to "isRequired && ! provided" (if you
> have a better name, please tell). With this change, any feature known
> to LyX can be provided by a class. 
> 
> What needs to be done
> 
> - update layout2layout. I need help there pretty please.
> 
> - actually test it. I do not expect any major problem, since I tried
>   to be conservative.
> 
> - document the changes (trivial).

This is the updated patch with layout2layout support. I needed to change 
one other place as well (compile error due to Martin's recent natbib 
change).

Georg
Attachment (x.diff): text/x-diff, 14 KiB
Jean-Marc Lasgouttes | 27 Mar 15:11 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Georg" == Georg Baum <Georg.Baum@...> writes:

Georg> This is the updated patch with layout2layout support. I needed
Georg> to change one other place as well (compile error due to
Georg> Martin's recent natbib change).

Georg, the layout2layout code does not work because the wanted syntax is 
  Provides amsmath
instead of
  Provides Amsmath 1

There are two problems:

- I did not keep the 0/1 value, because I do not think it is useful. 

- the feature should be put in lowecase. I could do it when reading,
  but there may be cases where features should be case-dependent.

I did not manage to grok the python regex myself, but any help would
be welcome.

JMarc

Georg Baum | 27 Mar 15:32 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

Jean-Marc Lasgouttes wrote:

> Georg, the layout2layout code does not work because the wanted syntax is
>   Provides amsmath
> instead of
>   Provides Amsmath 1
> 
> There are two problems:
> 
> - I did not keep the 0/1 value, because I do not think it is useful.

IMHO it is. Otherwise it is not possible to "undefine" such a feature that
comes from a .inc file (this is used in ijmpc.layout). If you really want
to get rid of this then we need to add an additional check for the '1', but
then the translated layout file may not be 100% compatible.

> - the feature should be put in lowecase. I could do it when reading,
>   but there may be cases where features should be case-dependent.
> 
> I did not manage to grok the python regex myself, but any help would
> be welcome.

The regex does not need to be modified (if the current keywords are case
insensitive, but I think they are).

Writing

match.group(1).lower()

instead of
(Continue reading)

José Matos | 27 Mar 17:19 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Tuesday 27 March 2007 2:32:50 pm Georg Baum wrote:
> Writing
>
> match.group(1).lower()
>
> instead of
>
> match.group(1) should give you the lowercase version (or maybe
> string.lower(match.group(1)), I don't know by heart if the former works).

  Both work, but as you said the former is preferable.

> Georg

--

-- 
José Abílio

Jean-Marc Lasgouttes | 28 Mar 14:42 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Georg" == Georg Baum <Georg.Baum@...> writes:

>> - I did not keep the 0/1 value, because I do not think it is
>> useful.

Georg> IMHO it is. Otherwise it is not possible to "undefine" such a
Georg> feature that comes from a .inc file (this is used in
Georg> ijmpc.layout). 

These uses are bogus, I just removed them.

I will keep the 0/1 argument nevertheless.

JMarc

Michael Gerz | 2 Apr 10:56 2007

Re: Getting citep etc. to work for egs.cls

Georg Baum schrieb:
> Am Donnerstag, 22. März 2007 09:41 schrieb Jean-Marc Lasgouttes:
>   
>> OK, here is the still untested second iteration. I introduce a helper
>> isNeeded, which is equivalent to "isRequired && ! provided" (if you
>> have a better name, please tell). With this change, any feature known
>> to LyX can be provided by a class. 
>>
>> What needs to be done
>>
>> - update layout2layout. I need help there pretty please.
>>
>> - actually test it. I do not expect any major problem, since I tried
>>   to be conservative.
>>
>> - document the changes (trivial).
>>     
>
> This is the updated patch with layout2layout support. I needed to change 
> one other place as well (compile error due to Martin's recent natbib 
> change).
>   

While cleaning up my email folder, I stumbled over this patch.

What happened to it?

Michael

(Continue reading)

Jean-Marc Lasgouttes | 2 Apr 10:58 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Michael" == Michael Gerz <michael.gerz@...> writes:

>>  This is the updated patch with layout2layout support. I needed to
>> change one other place as well (compile error due to Martin's
>> recent natbib change).
>> 

Michael> While cleaning up my email folder, I stumbled over this
Michael> patch.

Michael> What happened to it?

I am slowly working on it.

JMarc

Jean-Marc Lasgouttes | 3 Apr 12:05 2007

[PATCH] new Provide directive for layout files (was: Re: Getting citep etc. to work for egs.cls)

>>>>> "Georg" == Georg Baum <Georg.Baum@...> writes:

Georg> This is the updated patch with layout2layout support. I needed
Georg> to change one other place as well (compile error due to
Georg> Martin's recent natbib change).

This is finally the working and tested patch. The only thing missing
is the documentation (easy) and maybe the update of the layout files
(Georg, shall we do it now?)

To summarize, the patch replaces things like
  ProvidesAmsmath 1
by
  Provides amsmath 1

This means that any feature handled by LaTeXFeature can be overridden
(of course, some of them will need some fixing, we'll see).

So, what shall I do with it now?

JMarc

Attachment (provides3.diff): text/x-patch, 15 KiB
Georg Baum | 3 Apr 13:15 2007
Picon
Picon

Re: [PATCH] new Provide directive for layout files (was: Re: Getting citep etc. to work for egs.cls)

Jean-Marc Lasgouttes wrote:

> Georg> This is the updated patch with layout2layout support. I needed
> Georg> to change one other place as well (compile error due to
> Georg> Martin's recent natbib change).
> 
> This is finally the working and tested patch. The only thing missing
> is the documentation (easy) and maybe the update of the layout files
> (Georg, shall we do it now?)

I think so.

> To summarize, the patch replaces things like
>   ProvidesAmsmath 1
> by
>   Provides amsmath 1
> 
> This means that any feature handled by LaTeXFeature can be overridden
> (of course, some of them will need some fixing, we'll see).
> 
> So, what shall I do with it now?

I would say commit it.

Georg

José Matos | 3 Apr 13:20 2007
Picon

Re: [PATCH] new Provide directive for layout files (was: Re: Getting citep etc. to work for egs.cls)

On Tuesday 03 April 2007 12:15:22 pm Georg Baum wrote:
> I would say commit it.

  +1

> Georg

--

-- 
José Abílio

Martin Vermeer | 3 Apr 14:47 2007
Picon

Re: [PATCH] new Provide directive for layout files (was: Re: Getting citep etc. to work for egs.cls)

On Tue, 03 Apr 2007 12:20:39 +0100
José Matos <jamatos@...> wrote:

> On Tuesday 03 April 2007 12:15:22 pm Georg Baum wrote:
> > I would say commit it.
> 
>   +1
> 
> > Georg

+1

Martin

Jean-Marc Lasgouttes | 6 Apr 11:03 2007

Re: [PATCH] new Provide directive for layout files

>>>>> "José" == José Matos <jamatos@...> writes:

José> On Tuesday 03 April 2007 12:15:22 pm Georg Baum wrote:
>> I would say commit it.

José>   +1

I did that. I'll update the doc now.

JMarc

José Matos | 6 Apr 11:24 2007
Picon

Re: [PATCH] new Provide directive for layout files

On Friday 06 April 2007 10:03:48 am Jean-Marc Lasgouttes wrote:
>
> I did that. I'll update the doc now.

  Thanks Jean-Marc.

> JMarc

--

-- 
José Abílio

Martin Vermeer | 19 Mar 22:03 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Mon, Mar 19, 2007 at 06:08:48PM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:
> 
> Martin> Yes indeed, why not ;-/ Getting dumber by the day.
> 
> Martin> New attached.
> 
> Very good. If you think it is good enough and working for 1.4, you can
> apply it (since having egs working better in 1.4 would be valuable,
> from what I understand).

Here is the version for 1.4, tried and works as advertised for me. 
I will apply this tomorrow if nobody spots a problem.

- Martin

Index: src/insets/insetcite.C
===================================================================
--- src/insets/insetcite.C	(revision 15477)
+++ src/insets/insetcite.C	(working copy)
 <at>  <at>  -304,7 +304,7  <at>  <at> 
 	string const after  = getOptions();

 	string label;
-	biblio::CiteEngine const engine = buffer.params().cite_engine;
+	biblio::CiteEngine const engine = buffer.params().getEngine();
 	if (engine != biblio::ENGINE_BASIC) {
 		label = getNatbibLabel(buffer, getCmdName(), getContents(),
(Continue reading)

Jean-Marc Lasgouttes | 19 Mar 23:04 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:

Martin> Here is the version for 1.4, tried and works as advertised for
Martin> me. I will apply this tomorrow if nobody spots a problem.

It is OK, but please remove the debug commands in getEngine().

JMarc

Martin Vermeer | 20 Mar 16:53 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Mon, 19 Mar 2007 18:08:48 +0100
Jean-Marc Lasgouttes <lasgouttes@...> wrote:

> >>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:
> 
> Martin> Yes indeed, why not ;-/ Getting dumber by the day.
> 
> Martin> New attached.
> 
> Very good. If you think it is good enough and working for 1.4, you can
> apply it (since having egs working better in 1.4 would be valuable,
> from what I understand).

It's committed. Log: 

 Get ProvidesNatbib working correctly, esp. for egs.layout.

* insetcite: call getEngine()
* bufferparams: move getEngine() here, and let it sense the provides(natbib)
flag
* ControlBibtex, ControlCitation: correct getEngine() call
* biblio: remove old getEngine()

- Martin

Jean-Marc Lasgouttes | 20 Mar 16:59 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:

Martin> On Mon, 19 Mar 2007 18:08:48 +0100
Martin> Jean-Marc Lasgouttes <lasgouttes@...> wrote:

>> >>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:
>> 
Martin> Yes indeed, why not ;-/ Getting dumber by the day.
>>
Martin> New attached.
>>  Very good. If you think it is good enough and working for 1.4, you
>> can apply it (since having egs working better in 1.4 would be
>> valuable, from what I understand).

Martin> It's committed. Log:

Thanks.

You forgot status.14x, didn't you? And changelog too, of course.

JMarc

Martin Vermeer | 20 Mar 18:43 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Tue, Mar 20, 2007 at 04:59:44PM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:

... 

> Martin> It's committed. Log:
> 
> Thanks.
> 
> You forgot status.14x, didn't you? And changelog too, of course.

Oops... status.14x is in now.

Which changelog? They haven't been updated since somewhere october last year.

- Martin

Jürgen Spitzmüller | 20 Mar 18:48 2007
Picon

Re: Getting citep etc. to work for egs.cls

Martin Vermeer wrote:
> Which changelog? They haven't been updated since somewhere october last
> year.

Look twice:
http://www.lyx.org/trac/changeset/17480

Jürgen

Martin Vermeer | 20 Mar 20:31 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Tue, Mar 20, 2007 at 06:48:24PM +0100, Jürgen Spitzmüller wrote:
> Martin Vermeer wrote:
> > Which changelog? They haven't been updated since somewhere october last
> > year.
> 
> Look twice:
> http://www.lyx.org/trac/changeset/17480

OK, done. Seems I hadn't updated _or_ committed in branch since 
last october ;-/

- Martin

Jean-Marc Lasgouttes | 21 Mar 10:48 2007

Re: Getting citep etc. to work for egs.cls

>>>>> "Martin" == Martin Vermeer <martin.vermeer@...> writes:

Martin> On Tue, Mar 20, 2007 at 06:48:24PM +0100, Jürgen Spitzmüller
Martin> wrote:
>> Martin Vermeer wrote: > Which changelog? They haven't been updated
>> since somewhere october last > year.
>> 
>> Look twice: http://www.lyx.org/trac/changeset/17480

Martin> OK, done. Seems I hadn't updated _or_ committed in branch
Martin> since last october ;-/

Thanks.

JMarc

Andre Poenitz | 19 Mar 18:14 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Mon, Mar 19, 2007 at 06:42:53PM +0200, Martin Vermeer wrote:
> On Mon, 2007-03-19 at 11:14 +0100, Jean-Marc Lasgouttes wrote:
> > Why not use 
> >     cite_engine = p.getEngine();
> > in the code below?
> > 
> > +	// FIXME the class should also provide 
> > +	// the numerical/ authoryear choce
> > +	if (p.getLyXTextClass().provides(LyXTextClass::natbib)
> > +	   && p.cite_engine != biblio::ENGINE_NATBIB_NUMERICAL)
> > +		cite_engine = biblio::ENGINE_NATBIB_AUTHORYEAR;
> > +	else	
> > +		cite_engine = p.cite_engine;
> 
> Yes indeed, why not ;-/ Getting dumber by the day.
> 
> New attached.
> 
> > Also, a "trick" could be to allow the value '2' for providenatbib, or
> > add a new ProvideNumericalNatbib tag.
> 
> Or make it a string valued thing: "No", "Numerical", "AuthorYear". More
> legible. Have to sleep on that...

An enum perhaps?

Andre', usually hating enums.

Martin Vermeer | 19 Mar 19:50 2007
Picon

Re: Getting citep etc. to work for egs.cls

On Mon, Mar 19, 2007 at 06:14:25PM +0100, Andre Poenitz wrote:
> On Mon, Mar 19, 2007 at 06:42:53PM +0200, Martin Vermeer wrote:
> > On Mon, 2007-03-19 at 11:14 +0100, Jean-Marc Lasgouttes wrote:
> > > Why not use 
> > >     cite_engine = p.getEngine();
> > > in the code below?
> > > 
> > > +	// FIXME the class should also provide 
> > > +	// the numerical/ authoryear choce
> > > +	if (p.getLyXTextClass().provides(LyXTextClass::natbib)
> > > +	   && p.cite_engine != biblio::ENGINE_NATBIB_NUMERICAL)
> > > +		cite_engine = biblio::ENGINE_NATBIB_AUTHORYEAR;
> > > +	else	
> > > +		cite_engine = p.cite_engine;
> > 
> > Yes indeed, why not ;-/ Getting dumber by the day.
> > 
> > New attached.
> > 
> > > Also, a "trick" could be to allow the value '2' for providenatbib, or
> > > add a new ProvideNumericalNatbib tag.
> > 
> > Or make it a string valued thing: "No", "Numerical", "AuthorYear". More
> > legible. Have to sleep on that...
> 
> An enum perhaps?
> 
> Andre', usually hating enums.

That's actually what I thought. A string in the file, converted to an enum on imput (like we have already so
(Continue reading)

Abdelrazak Younes | 25 Mar 00:22 2007
Picon

Re: Getting citep etc. to work for egs.cls

Martin Vermeer wrote:
> On Thu, Mar 01, 2007 at 01:27:17PM +0100, Juergen Spitzmueller wrote:
>> Martin Vermeer wrote:
>>
>>> Yes, indeed. Still, the question remains, is this sensible.
>> No. Numerical needs the styles as well, so it should be supported likewise.
>>
>> Jürgen
> 
> Attached an updated version of this patch, so it is not forgotten.
> 
> I added a pair of FIXMEs to remind that it is the document class that
> "knows" whether we have a numerical or author-year ciation style, and
> ideally LyX should be told this through a layout file option.
> 
> Were there any other issues with this? I would like to check this in, as
> it would gain us one user who might become a contributor.

I have the same cleanup locally, looks like I'll have to do a bit of 
hand-merging :-(

Abdel.

Stephan Witt | 1 Mar 10:58 2007

Re: Getting citep etc. to work for egs.cls

Andre Poenitz wrote:
> On Wed, Feb 28, 2007 at 10:27:18PM +0100, Jean-Marc Lasgouttes wrote:
> 
>>>>>>>"Martin" == Martin Vermeer <martin.vermeer@...> writes:
>>
>>Martin> The attached patches make both these mechanisms respond to the
>>Martin> ProvidesNatbib textclass flag. I am not sure I did this right
>>Martin> -- I am especially uncertain about the handling of the numeric
>>Martin> vs. author-year thing. Shouldn't this also be in the .layout
>>Martin> file if the class is loading natbib?
>>
>> CiteEngine_enum getEngine(Buffer const & buffer)
>> {
>>-	return buffer.params().cite_engine;
>>+	BufferParams const & p = buffer.params();
>>+	if (p.getLyXTextClass().provides(LyXTextClass::natbib)) {
>>+		if (p.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL)
>>+			return ENGINE_NATBIB_NUMERICAL;
>>+		else
>>+			return ENGINE_NATBIB_AUTHORYEAR;
>>+	} else
>>+		return p.cite_engine;
>> }
> 
> 
>>What is the logic here?
> 
> 
> Looks equivalent to
> 
(Continue reading)

Martin Vermeer | 1 Mar 11:29 2007
Picon
Picon

Re: Getting citep etc. to work for egs.cls

On Thu, 2007-03-01 at 10:58 +0100, Stephan Witt wrote:
> Andre Poenitz wrote:
> > On Wed, Feb 28, 2007 at 10:27:18PM +0100, Jean-Marc Lasgouttes wrote:
> > 
> >>>>>>>"Martin" == Martin Vermeer <martin.vermeer@...> writes:
> >>
> >>Martin> The attached patches make both these mechanisms respond to the
> >>Martin> ProvidesNatbib textclass flag. I am not sure I did this right
> >>Martin> -- I am especially uncertain about the handling of the numeric
> >>Martin> vs. author-year thing. Shouldn't this also be in the .layout
> >>Martin> file if the class is loading natbib?
> >>
> >> CiteEngine_enum getEngine(Buffer const & buffer)
> >> {
> >>-	return buffer.params().cite_engine;
> >>+	BufferParams const & p = buffer.params();
> >>+	if (p.getLyXTextClass().provides(LyXTextClass::natbib)) {
> >>+		if (p.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL)
> >>+			return ENGINE_NATBIB_NUMERICAL;
> >>+		else
> >>+			return ENGINE_NATBIB_AUTHORYEAR;
> >>+	} else
> >>+		return p.cite_engine;
> >> }
> > 
> > 
> >>What is the logic here?
> > 
> > 
> > Looks equivalent to
(Continue reading)


Gmane