Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 06:33:37PM +0200, Pascal Francq wrote:
 I am using the algorithm package. In the preamble of my LyX document, I have 
 inserted \usepackage[chapter]{algorithm}. When I insert an algorithm trough

LyX 1.2.x does not use the algorithm package.

 the corresponding float menu in LyX, the algorithm numerotation is global 
 (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
 Any ideas?

Add to the preamble:

\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
\@addtoreset{algorithm}{chapter}



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Pascal Francq

On Saturday 21 September 2002 19:00, Dekel Tsur wrote:
 On Sat, Sep 21, 2002 at 06:33:37PM +0200, Pascal Francq wrote:
  I am using the algorithm package. In the preamble of my LyX document, I
  have inserted \usepackage[chapter]{algorithm}. When I insert an
  algorithm trough

 LyX 1.2.x does not use the algorithm package.

  the corresponding float menu in LyX, the algorithm numerotation is global
  (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
  Any ideas?

 Add to the preamble:

 \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
 \@addtoreset{algorithm}{chapter}

It works, but there problems when using with the hyperref package. On the LyX 
website, it is explain to add in the preamble something like:
 \newcommand{\theHalgorithm}{\thechapter.\arabic{algorithm}}

But, when doing this, I have the linear numerotation and if I use your system, 
it works but I have got an error. I Suppose there must be some 'trick' to 
combine both?
-- 


Ir Pascal Francq
Researcher
Université Libre de Bruxelles
CAD/CAM Department
Avenue F.D. Roosevelt, 50
CP 165/14
B-1050 Brussels
BELGIUM
Tel. +32-2-650 47 65
Fax +32-2-650 47 24
ICQ: 91206668




Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Bo Peng

I have a question with algorithm environment. When I insert a float
algorithm box and then paste my source code from emacs to lyx, all new
lines disappear and I have to add them manually. I understand that this
has something to do with the way latex deal with newlines but is there a
way to keep the format of pasted text?

-- 
Bo Peng



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 07:17:09PM +0200, Pascal Francq wrote:
   the corresponding float menu in LyX, the algorithm numerotation is global
   (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
   Any ideas?
 
  Add to the preamble:
 
  \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
  \@addtoreset{algorithm}{chapter}
 
 It works, but there problems when using with the hyperref package. On the LyX 
 website, it is explain to add in the preamble something like:
  \newcommand{\theHalgorithm}{\thechapter.\arabic{algorithm}}
   ^^should be \theHchapter

 But, when doing this, I have the linear numerotation and if I use your system
 it works but I have got an error. I Suppose there must be some 'trick' to 
 combine both?

Just use them both:

\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}} 
\@addtoreset{algorithm}{chapter}
\newcommand{\theHalgorithm}{\theHchapter.\arabic{algorithm}} 



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 01:37:21PM -0500, Bo Peng wrote:
 I have a question with algorithm environment. When I insert a float
 algorithm box and then paste my source code from emacs to lyx, all new
 lines disappear and I have to add them manually. I understand that this
 has something to do with the way latex deal with newlines but is there a
 way to keep the format of pasted text?

First, select the LyX-code layout before pasting.
Then, do the pasting using Edit-Paste external selection-as lines.



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Peter Harkins

On Sat, Sep 21, 2002 at 08:00:10PM +0300, Dekel Tsur wrote:
  the corresponding float menu in LyX, the algorithm numerotation is global 
  (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
  Any ideas?
 
 Add to the preamble:
 
 \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
 \@addtoreset{algorithm}{chapter}

I was able to use this as follows to fix a problem I was having, but
is there a way to make it reset to -1 so my sections will be numbered from 0
up?

\@addtoreset{section}{part}




Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 01:36:27PM -0700, Peter Harkins wrote:
 On Sat, Sep 21, 2002 at 08:00:10PM +0300, Dekel Tsur wrote:
   the corresponding float menu in LyX, the algorithm numerotation is global 
   (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
   Any ideas?
  
  Add to the preamble:
  
  \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
  \@addtoreset{algorithm}{chapter}
 
   I was able to use this as follows to fix a problem I was having, but
 is there a way to make it reset to -1 so my sections will be numbered from 0
 up?

Assuming you dont use the optional argument to \chapter:

\let\mychapter=\chapter
\def\chapter{\@ifstar\starchapter\ordchapter}
\def\starchapter#1{\mychapter*{#1}}
\def\ordchapter#1{\mychapter{#1}\setcounter{section}{-1}}



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 06:33:37PM +0200, Pascal Francq wrote:
 I am using the algorithm package. In the preamble of my LyX document, I have 
 inserted \usepackage[chapter]{algorithm}. When I insert an algorithm trough

LyX 1.2.x does not use the algorithm package.

 the corresponding float menu in LyX, the algorithm numerotation is global 
 (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
 Any ideas?

Add to the preamble:

\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
\@addtoreset{algorithm}{chapter}



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Pascal Francq

On Saturday 21 September 2002 19:00, Dekel Tsur wrote:
 On Sat, Sep 21, 2002 at 06:33:37PM +0200, Pascal Francq wrote:
  I am using the algorithm package. In the preamble of my LyX document, I
  have inserted \usepackage[chapter]{algorithm}. When I insert an
  algorithm trough

 LyX 1.2.x does not use the algorithm package.

  the corresponding float menu in LyX, the algorithm numerotation is global
  (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
  Any ideas?

 Add to the preamble:

 \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
 \@addtoreset{algorithm}{chapter}

It works, but there problems when using with the hyperref package. On the LyX 
website, it is explain to add in the preamble something like:
 \newcommand{\theHalgorithm}{\thechapter.\arabic{algorithm}}

But, when doing this, I have the linear numerotation and if I use your system, 
it works but I have got an error. I Suppose there must be some 'trick' to 
combine both?
-- 


Ir Pascal Francq
Researcher
Université Libre de Bruxelles
CAD/CAM Department
Avenue F.D. Roosevelt, 50
CP 165/14
B-1050 Brussels
BELGIUM
Tel. +32-2-650 47 65
Fax +32-2-650 47 24
ICQ: 91206668




Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Bo Peng

I have a question with algorithm environment. When I insert a float
algorithm box and then paste my source code from emacs to lyx, all new
lines disappear and I have to add them manually. I understand that this
has something to do with the way latex deal with newlines but is there a
way to keep the format of pasted text?

-- 
Bo Peng



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 07:17:09PM +0200, Pascal Francq wrote:
   the corresponding float menu in LyX, the algorithm numerotation is global
   (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
   Any ideas?
 
  Add to the preamble:
 
  \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
  \@addtoreset{algorithm}{chapter}
 
 It works, but there problems when using with the hyperref package. On the LyX 
 website, it is explain to add in the preamble something like:
  \newcommand{\theHalgorithm}{\thechapter.\arabic{algorithm}}
   ^^should be \theHchapter

 But, when doing this, I have the linear numerotation and if I use your system
 it works but I have got an error. I Suppose there must be some 'trick' to 
 combine both?

Just use them both:

\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}} 
\@addtoreset{algorithm}{chapter}
\newcommand{\theHalgorithm}{\theHchapter.\arabic{algorithm}} 



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 01:37:21PM -0500, Bo Peng wrote:
 I have a question with algorithm environment. When I insert a float
 algorithm box and then paste my source code from emacs to lyx, all new
 lines disappear and I have to add them manually. I understand that this
 has something to do with the way latex deal with newlines but is there a
 way to keep the format of pasted text?

First, select the LyX-code layout before pasting.
Then, do the pasting using Edit-Paste external selection-as lines.



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Peter Harkins

On Sat, Sep 21, 2002 at 08:00:10PM +0300, Dekel Tsur wrote:
  the corresponding float menu in LyX, the algorithm numerotation is global 
  (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
  Any ideas?
 
 Add to the preamble:
 
 \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
 \@addtoreset{algorithm}{chapter}

I was able to use this as follows to fix a problem I was having, but
is there a way to make it reset to -1 so my sections will be numbered from 0
up?

\@addtoreset{section}{part}




Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 01:36:27PM -0700, Peter Harkins wrote:
 On Sat, Sep 21, 2002 at 08:00:10PM +0300, Dekel Tsur wrote:
   the corresponding float menu in LyX, the algorithm numerotation is global 
   (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
   Any ideas?
  
  Add to the preamble:
  
  \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
  \@addtoreset{algorithm}{chapter}
 
   I was able to use this as follows to fix a problem I was having, but
 is there a way to make it reset to -1 so my sections will be numbered from 0
 up?

Assuming you dont use the optional argument to \chapter:

\let\mychapter=\chapter
\def\chapter{\@ifstar\starchapter\ordchapter}
\def\starchapter#1{\mychapter*{#1}}
\def\ordchapter#1{\mychapter{#1}\setcounter{section}{-1}}



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 06:33:37PM +0200, Pascal Francq wrote:
> I am using the algorithm package. In the preamble of my LyX document, I have 
> inserted "\usepackage[chapter]{algorithm}". When I insert an algorithm trough

LyX 1.2.x does not use the algorithm package.

> the corresponding float menu in LyX, the algorithm numerotation is global 
> (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
> Any ideas?

Add to the preamble:

\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
\@addtoreset{algorithm}{chapter}



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Pascal Francq

On Saturday 21 September 2002 19:00, Dekel Tsur wrote:
> On Sat, Sep 21, 2002 at 06:33:37PM +0200, Pascal Francq wrote:
> > I am using the algorithm package. In the preamble of my LyX document, I
> > have inserted "\usepackage[chapter]{algorithm}". When I insert an
> > algorithm trough
>
> LyX 1.2.x does not use the algorithm package.
>
> > the corresponding float menu in LyX, the algorithm numerotation is global
> > (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
> > Any ideas?
>
> Add to the preamble:
>
> \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
> \@addtoreset{algorithm}{chapter}

It works, but there problems when using with the hyperref package. On the LyX 
website, it is explain to add in the preamble something like:
 \newcommand{\theHalgorithm}{\thechapter.\arabic{algorithm}}

But, when doing this, I have the linear numerotation and if I use your system, 
it works but I have got an error. I Suppose there must be some 'trick' to 
combine both?
-- 


Ir Pascal Francq
Researcher
Université Libre de Bruxelles
CAD/CAM Department
Avenue F.D. Roosevelt, 50
CP 165/14
B-1050 Brussels
BELGIUM
Tel. +32-2-650 47 65
Fax +32-2-650 47 24
ICQ: 91206668




Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Bo Peng

I have a question with algorithm environment. When I insert a float
algorithm box and then paste my source code from emacs to lyx, all new
lines disappear and I have to add them manually. I understand that this
has something to do with the way latex deal with newlines but is there a
way to keep the format of pasted text?

-- 
Bo Peng



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 07:17:09PM +0200, Pascal Francq wrote:
> > > the corresponding float menu in LyX, the algorithm numerotation is global
> > > (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
> > > Any ideas?
> >
> > Add to the preamble:
> >
> > \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
> > \@addtoreset{algorithm}{chapter}
> 
> It works, but there problems when using with the hyperref package. On the LyX 
> website, it is explain to add in the preamble something like:
>  \newcommand{\theHalgorithm}{\thechapter.\arabic{algorithm}}
   ^^should be \theHchapter

> But, when doing this, I have the linear numerotation and if I use your system
> it works but I have got an error. I Suppose there must be some 'trick' to 
> combine both?

Just use them both:

\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}} 
\@addtoreset{algorithm}{chapter}
\newcommand{\theHalgorithm}{\theHchapter.\arabic{algorithm}} 



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 01:37:21PM -0500, Bo Peng wrote:
> I have a question with algorithm environment. When I insert a float
> algorithm box and then paste my source code from emacs to lyx, all new
> lines disappear and I have to add them manually. I understand that this
> has something to do with the way latex deal with newlines but is there a
> way to keep the format of pasted text?

First, select the LyX-code layout before pasting.
Then, do the pasting using Edit->Paste external selection->as lines.



Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Peter Harkins

On Sat, Sep 21, 2002 at 08:00:10PM +0300, Dekel Tsur wrote:
> > the corresponding float menu in LyX, the algorithm numerotation is global 
> > (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
> > Any ideas?
> 
> Add to the preamble:
> 
> \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
> \@addtoreset{algorithm}{chapter}

I was able to use this as follows to fix a problem I was having, but
is there a way to make it reset to -1 so my sections will be numbered from 0
up?

\@addtoreset{section}{part}




Re: Algorithm in Lyx 1.2.0

2002-09-21 Thread Dekel Tsur

On Sat, Sep 21, 2002 at 01:36:27PM -0700, Peter Harkins wrote:
> On Sat, Sep 21, 2002 at 08:00:10PM +0300, Dekel Tsur wrote:
> > > the corresponding float menu in LyX, the algorithm numerotation is global 
> > > (1,2,3, ...) rather chapter specific (1.1,1.2,2.1,).
> > > Any ideas?
> > 
> > Add to the preamble:
> > 
> > \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
> > \@addtoreset{algorithm}{chapter}
> 
>   I was able to use this as follows to fix a problem I was having, but
> is there a way to make it reset to -1 so my sections will be numbered from 0
> up?

Assuming you dont use the optional argument to \chapter:

\let\mychapter=\chapter
\def\chapter{\@ifstar\starchapter\ordchapter}
\def\starchapter#1{\mychapter*{#1}}
\def\ordchapter#1{\mychapter{#1}\setcounter{section}{-1}}