Re: editing lyx files

2000-04-24 Thread jdd

On dim, 23 avr 2000, Bruce Richardson à écrit
 (a lot of things)
thank, it's very impressive, I wiil try this soon.

-- 
http://www.dodin.net mailto:[EMAIL PROTECTED]
QUI EST CET HOMME ? Aidez-moi à le retrouver
WHO'S THAT GUY ? Help me found it
http://www.dodin.net/serge/index.html




Re: editing lyx files

2000-04-24 Thread jdd

On dim, 23 avr 2000, Bruce Richardson à écrit
 (a lot of things)
thank, it's very impressive, I wiil try this soon.

-- 
http://www.dodin.net mailto:[EMAIL PROTECTED]
QUI EST CET HOMME ? Aidez-moi à le retrouver
WHO'S THAT GUY ? Help me found it
http://www.dodin.net/serge/index.html




Re: editing lyx files

2000-04-24 Thread jdd

On dim, 23 avr 2000, Bruce Richardson à écrit
> (a lot of things)
thank, it's very impressive, I wiil try this soon.

-- 
 
QUI EST CET HOMME ? Aidez-moi à le retrouver
WHO'S THAT GUY ? Help me found it
http://www.dodin.net/serge/index.html




editing lyx files

2000-04-23 Thread jdd

with different help, I have found a solution to the problem of editing lyx
files _outside_ lyx. This is necessary, for example, when importing ascii
files or to search/replace special characters, not allowed in the
search/replace windows in lyx.

the problem comes from the fact that latex need carriage return between
instructions and this is not easy to do in usual text processors.

As one may think the solution is with emacs. For example, in emacs,

M-x replace-string
 !
C-q C-j
\protected_separator C-q C-j
!

inserts a protected separator before the !. C-q C-j inserts a cr in the
emacs field.

the result, in the source file, is:

this needs an exlamation point
\protected_separator
!

if any body nows how to do the same with sed or awks, I would appreciate
(to write scripts)

good editing.

-- 
http://www.dodin.net mailto:[EMAIL PROTECTED]
QUI EST CET HOMME ? Aidez-moi à le retrouver
WHO'S THAT GUY ? Help me found it
http://www.dodin.net/serge/index.html




Re: editing lyx files

2000-04-23 Thread Bruce Richardson

On Fri, Apr 21, 2000 at 08:11:02PM +0200, jdd wrote:
 As one may think the solution is with emacs. For example, in emacs,
 
 M-x replace-string
  !
 C-q C-j
 \protected_separator C-q C-j
 !
 
 inserts a protected separator before the !. C-q C-j inserts a cr in the
 emacs field.

And in vi you type 

:% s/!/^M\\protected_seperator^M!/g

where ^M is created by typing Ctrl-V Ctrl-M

 
 if any body nows how to do the same with sed or awks, I would appreciate
 (to write scripts)

With sed do:

sed 's/!/\
\\protected_seperator\
\!/g'

and make sure the carriage return comes immediately after the \ on each line or it 
won't work.

With Gawk (lovely tool!) you could do it this way

cut here
{ COUNT = split($0, LINE, "!")
  FIELD = 2
  print LINE[1]
  while (COUNT  1) {
printf "%s\n!%s\n","\\protected_seperator",LINE[FIELD]
++FIELD
--COUNT
  }
}
cut here

The solution would be more elegant if you could be sure that each line would
have no more than one exclamation mark, but this does lines with any number
of them.  I did this with gawk but it should run in any awk.

-- 
Bruce

Those of you who think you know everything are annoying to those of us who
do.



editing lyx files

2000-04-23 Thread jdd

with different help, I have found a solution to the problem of editing lyx
files _outside_ lyx. This is necessary, for example, when importing ascii
files or to search/replace special characters, not allowed in the
search/replace windows in lyx.

the problem comes from the fact that latex need carriage return between
instructions and this is not easy to do in usual text processors.

As one may think the solution is with emacs. For example, in emacs,

M-x replace-string
 !
C-q C-j
\protected_separator C-q C-j
!

inserts a protected separator before the !. C-q C-j inserts a cr in the
emacs field.

the result, in the source file, is:

this needs an exlamation point
\protected_separator
!

if any body nows how to do the same with sed or awks, I would appreciate
(to write scripts)

good editing.

-- 
http://www.dodin.net mailto:[EMAIL PROTECTED]
QUI EST CET HOMME ? Aidez-moi à le retrouver
WHO'S THAT GUY ? Help me found it
http://www.dodin.net/serge/index.html




Re: editing lyx files

2000-04-23 Thread Bruce Richardson

On Fri, Apr 21, 2000 at 08:11:02PM +0200, jdd wrote:
 As one may think the solution is with emacs. For example, in emacs,
 
 M-x replace-string
  !
 C-q C-j
 \protected_separator C-q C-j
 !
 
 inserts a protected separator before the !. C-q C-j inserts a cr in the
 emacs field.

And in vi you type 

:% s/!/^M\\protected_seperator^M!/g

where ^M is created by typing Ctrl-V Ctrl-M

 
 if any body nows how to do the same with sed or awks, I would appreciate
 (to write scripts)

With sed do:

sed 's/!/\
\\protected_seperator\
\!/g'

and make sure the carriage return comes immediately after the \ on each line or it 
won't work.

With Gawk (lovely tool!) you could do it this way

cut here
{ COUNT = split($0, LINE, "!")
  FIELD = 2
  print LINE[1]
  while (COUNT  1) {
printf "%s\n!%s\n","\\protected_seperator",LINE[FIELD]
++FIELD
--COUNT
  }
}
cut here

The solution would be more elegant if you could be sure that each line would
have no more than one exclamation mark, but this does lines with any number
of them.  I did this with gawk but it should run in any awk.

-- 
Bruce

Those of you who think you know everything are annoying to those of us who
do.



editing lyx files

2000-04-23 Thread jdd

with different help, I have found a solution to the problem of editing lyx
files _outside_ lyx. This is necessary, for example, when importing ascii
files or to search/replace special characters, not allowed in the
search/replace windows in lyx.

the problem comes from the fact that latex need carriage return between
instructions and this is not easy to do in usual text processors.

As one may think the solution is with emacs. For example, in emacs,

M-x replace-string
 !
C-q C-j
\protected_separator C-q C-j
!

inserts a protected separator before the !. C-q C-j inserts a cr in the
emacs field.

the result, in the source file, is:

this needs an exlamation point
\protected_separator
!

if any body nows how to do the same with sed or awks, I would appreciate
(to write scripts)

good editing.

-- 
<http://www.dodin.net> <mailto:[EMAIL PROTECTED]>
QUI EST CET HOMME ? Aidez-moi à le retrouver
WHO'S THAT GUY ? Help me found it
http://www.dodin.net/serge/index.html




Re: editing lyx files

2000-04-23 Thread Bruce Richardson

On Fri, Apr 21, 2000 at 08:11:02PM +0200, jdd wrote:
> As one may think the solution is with emacs. For example, in emacs,
> 
> M-x replace-string
>  !
> C-q C-j
> \protected_separator C-q C-j
> !
> 
> inserts a protected separator before the !. C-q C-j inserts a cr in the
> emacs field.

And in vi you type 

:% s/!/^M\\protected_seperator^M!/g

where ^M is created by typing Ctrl-V Ctrl-M

> 
> if any body nows how to do the same with sed or awks, I would appreciate
> (to write scripts)

With sed do:

sed 's/!/\
\\protected_seperator\
\!/g'

and make sure the carriage return comes immediately after the \ on each line or it 
won't work.

With Gawk (lovely tool!) you could do it this way

cut here
{ COUNT = split($0, LINE, "!")
  FIELD = 2
  print LINE[1]
  while (COUNT > 1) {
printf "%s\n!%s\n","\\protected_seperator",LINE[FIELD]
++FIELD
--COUNT
  }
}
cut here

The solution would be more elegant if you could be sure that each line would
have no more than one exclamation mark, but this does lines with any number
of them.  I did this with gawk but it should run in any awk.

-- 
Bruce

Those of you who think you know everything are annoying to those of us who
do.