Re: Converter not in /usr/bin; fixing nbsp

2009-07-15 Thread rgheck

On 07/15/2009 12:01 PM, Tomasz Kołodziejski wrote:

Hi,

due to some reasons I don't want to put my converter into /usr/bin
neither /usr/local/bin. It's, let's say, somewhere in my home
directory. But when I put into converter list: /home/me/my_converter -
it doesn't work. Yep, path's correct and double checked ;-)

   
Add this to the bug tracker. I don't have time to check on it right now. 
Probably you should cc me.


In the short term, why not put the converters into your local $HOME/bin?


The second problem for me is making non-breaking spaces between a
single letter and a word. It's necessary in polish typography. It can
be done with a simple script:

#!/bin/bash
if [ $1 ]; then
cat $1 | sed '
/ [aeiouwzAEIOUWZ] *$/ {
N
s/  *\([aeiouwzAEIOUWZ]\)\n */ \1~/g
}' | sed 's/^ *\([aeiouwzAEIOUWZ]\)  */ \1~/g'  | sed 's/
*\([aeiouwzAEIOUWZ]\)  */ \1~/g'
fi

but sometimes it breaks my document. Is there a way to run this script
only in text blocks, i.e. omit arguments of commands and maths.

   
A slightly more complicated script will do. You'll need to run through 
the LyX file and detect when you've hit the sort of inset where you do 
not want to do this. We do this kind of thing all the time in the 
lyx2lyx script, which you'll have in /usr/share/lyx/lyx2lyx/. Look e.g. 
at lyx_1_5.py file.


rh



Re: Converter not in /usr/bin; fixing nbsp

2009-07-15 Thread rgheck

On 07/15/2009 12:01 PM, Tomasz Kołodziejski wrote:

Hi,

due to some reasons I don't want to put my converter into /usr/bin
neither /usr/local/bin. It's, let's say, somewhere in my home
directory. But when I put into converter list: /home/me/my_converter -
it doesn't work. Yep, path's correct and double checked ;-)

   
Add this to the bug tracker. I don't have time to check on it right now. 
Probably you should cc me.


In the short term, why not put the converters into your local $HOME/bin?


The second problem for me is making non-breaking spaces between a
single letter and a word. It's necessary in polish typography. It can
be done with a simple script:

#!/bin/bash
if [ $1 ]; then
cat $1 | sed '
/ [aeiouwzAEIOUWZ] *$/ {
N
s/  *\([aeiouwzAEIOUWZ]\)\n */ \1~/g
}' | sed 's/^ *\([aeiouwzAEIOUWZ]\)  */ \1~/g'  | sed 's/
*\([aeiouwzAEIOUWZ]\)  */ \1~/g'
fi

but sometimes it breaks my document. Is there a way to run this script
only in text blocks, i.e. omit arguments of commands and maths.

   
A slightly more complicated script will do. You'll need to run through 
the LyX file and detect when you've hit the sort of inset where you do 
not want to do this. We do this kind of thing all the time in the 
lyx2lyx script, which you'll have in /usr/share/lyx/lyx2lyx/. Look e.g. 
at lyx_1_5.py file.


rh



Re: Converter not in /usr/bin; fixing nbsp

2009-07-15 Thread rgheck

On 07/15/2009 12:01 PM, Tomasz Kołodziejski wrote:

Hi,

due to some reasons I don't want to put my "converter" into /usr/bin
neither /usr/local/bin. It's, let's say, somewhere in my home
directory. But when I put into converter list: /home/me/my_converter -
it doesn't work. Yep, path's correct and double checked ;-)

   
Add this to the bug tracker. I don't have time to check on it right now. 
Probably you should cc me.


In the short term, why not put the converters into your local $HOME/bin?


The second problem for me is making non-breaking spaces between a
single letter and a word. It's necessary in polish typography. It can
be done with a simple script:

#!/bin/bash
if [ "$1" ]; then
cat "$1" | sed '
/ [aeiouwzAEIOUWZ] *$/ {
N
s/  *\([aeiouwzAEIOUWZ]\)\n */ \1~/g
}' | sed 's/^ *\([aeiouwzAEIOUWZ]\)  */ \1~/g'  | sed 's/
*\([aeiouwzAEIOUWZ]\)  */ \1~/g'
fi

but sometimes it breaks my document. Is there a way to run this script
only in text blocks, i.e. omit arguments of commands and maths.

   
A slightly more complicated script will do. You'll need to run through 
the LyX file and detect when you've hit the sort of inset where you do 
not want to do this. We do this kind of thing all the time in the 
lyx2lyx script, which you'll have in /usr/share/lyx/lyx2lyx/. Look e.g. 
at lyx_1_5.py file.


rh