Re: marking something as ERT

2008-06-24 Thread G. Milde
On 20.06.08, Philip A. Viton wrote:

 I've written a utility which takes results (in the J programing  
 language) and converts them to latex tables, specifically formal tables, 
 using booktabs.sty. One problem with importing them into lyx is that 
 setup instructions like \cmidrule(r){1-2} ...  gets imported as ERT for 
 \cmidrule, followed by text for the rest, another ERT for the next 
 \cmidrule etc.

 Question: since I have complete control over how the file gets written, 
 is there some way I could indicate to the lyx importer that the whole 
 sequence of \cmidrule's is to be treated as one big ERT? 

Nothing I know of.

 Something on the order of \ERT{\cmidrule(r){1-2}  } ?

This is 
a) invalid LaTeX
b) has the same problems.

However, as you have complete control, you could consider exporting
CSV tables and using the CSV importer to convert them to lyx or
generate LyX code right away.

Günter



Re: marking something as ERT

2008-06-24 Thread Enrico Forestieri
G. Milde writes:

 
 On 20.06.08, Philip A. Viton wrote:
 
  I've written a utility which takes results (in the J programing  
  language) and converts them to latex tables, specifically formal tables, 
  using booktabs.sty. One problem with importing them into lyx is that 
  setup instructions like \cmidrule(r){1-2} ...  gets imported as ERT for 
  \cmidrule, followed by text for the rest, another ERT for the next 
  \cmidrule etc.
 
  Question: since I have complete control over how the file gets written, 
  is there some way I could indicate to the lyx importer that the whole 
  sequence of \cmidrule's is to be treated as one big ERT? 
 
 Nothing I know of.
 
  Something on the order of \ERT{\cmidrule(r){1-2}  } ?
 
 This is 
 a) invalid LaTeX
 b) has the same problems.

Not quite. The problem with \cmidrule is its non-standard syntax.
If the command had used only brackets [] and braces {}, the solution
would be simple. In order to obtain what the OP wants, a hack must be used.
First of all, put in the preamble of the .tex file the following line:

\def\ERT#1{#1}

then, surround each \cmidrule command that you want to import as a
single ERT, with \ERT{your command here}, just as in your example above.
Now, use a text editor and create a file named as you like, for example
syntax.extra, and put in there the following line:

\ERT{}

Having done that, run LyX, go to Tools-Preferences-Converters and
select the LaTeX (plain) - LyX converter. Change the line that reads
tex2lyx -f $$i $$o into tex2lyx -s path/syntax.extra -f $$i $$o
(where path is the full path to the syntax.extra file), hit the Modify
button and then Apply (or Save, for a permanent change).
Now use the menu File-Import-LaTeX (plain) and select the .tex file
you want to import. All your \ERT{whatever} commands will be imported
as a single ERT. Note that you don't have to take away the surrounding
\ERT{} in LyX, as it will work as expected.

-- 
Enrico



Re: marking something as ERT

2008-06-24 Thread G. Milde
On 20.06.08, Philip A. Viton wrote:

 I've written a utility which takes results (in the J programing  
 language) and converts them to latex tables, specifically formal tables, 
 using booktabs.sty. One problem with importing them into lyx is that 
 setup instructions like \cmidrule(r){1-2} ...  gets imported as ERT for 
 \cmidrule, followed by text for the rest, another ERT for the next 
 \cmidrule etc.

 Question: since I have complete control over how the file gets written, 
 is there some way I could indicate to the lyx importer that the whole 
 sequence of \cmidrule's is to be treated as one big ERT? 

Nothing I know of.

 Something on the order of \ERT{\cmidrule(r){1-2}  } ?

This is 
a) invalid LaTeX
b) has the same problems.

However, as you have complete control, you could consider exporting
CSV tables and using the CSV importer to convert them to lyx or
generate LyX code right away.

Günter



Re: marking something as ERT

2008-06-24 Thread Enrico Forestieri
G. Milde writes:

 
 On 20.06.08, Philip A. Viton wrote:
 
  I've written a utility which takes results (in the J programing  
  language) and converts them to latex tables, specifically formal tables, 
  using booktabs.sty. One problem with importing them into lyx is that 
  setup instructions like \cmidrule(r){1-2} ...  gets imported as ERT for 
  \cmidrule, followed by text for the rest, another ERT for the next 
  \cmidrule etc.
 
  Question: since I have complete control over how the file gets written, 
  is there some way I could indicate to the lyx importer that the whole 
  sequence of \cmidrule's is to be treated as one big ERT? 
 
 Nothing I know of.
 
  Something on the order of \ERT{\cmidrule(r){1-2}  } ?
 
 This is 
 a) invalid LaTeX
 b) has the same problems.

Not quite. The problem with \cmidrule is its non-standard syntax.
If the command had used only brackets [] and braces {}, the solution
would be simple. In order to obtain what the OP wants, a hack must be used.
First of all, put in the preamble of the .tex file the following line:

\def\ERT#1{#1}

then, surround each \cmidrule command that you want to import as a
single ERT, with \ERT{your command here}, just as in your example above.
Now, use a text editor and create a file named as you like, for example
syntax.extra, and put in there the following line:

\ERT{}

Having done that, run LyX, go to Tools-Preferences-Converters and
select the LaTeX (plain) - LyX converter. Change the line that reads
tex2lyx -f $$i $$o into tex2lyx -s path/syntax.extra -f $$i $$o
(where path is the full path to the syntax.extra file), hit the Modify
button and then Apply (or Save, for a permanent change).
Now use the menu File-Import-LaTeX (plain) and select the .tex file
you want to import. All your \ERT{whatever} commands will be imported
as a single ERT. Note that you don't have to take away the surrounding
\ERT{} in LyX, as it will work as expected.

-- 
Enrico



Re: marking something as ERT

2008-06-24 Thread G. Milde
On 20.06.08, Philip A. Viton wrote:

> I've written a utility which takes results (in the J programing  
> language) and converts them to latex tables, specifically formal tables, 
> using booktabs.sty. One problem with importing them into lyx is that 
> setup instructions like \cmidrule(r){1-2} ...  gets imported as ERT for 
> \cmidrule, followed by text for the rest, another ERT for the next 
> \cmidrule etc.

> Question: since I have complete control over how the file gets written, 
> is there some way I could indicate to the lyx importer that the whole 
> sequence of \cmidrule's is to be treated as one big ERT? 

Nothing I know of.

> Something on the order of \ERT{\cmidrule(r){1-2}  } ?

This is 
a) invalid LaTeX
b) has the same problems.

However, as you have "complete control", you could consider exporting
CSV tables and using the CSV importer to convert them to lyx or
generate LyX code right away.

Günter



Re: marking something as ERT

2008-06-24 Thread Enrico Forestieri
G. Milde writes:

> 
> On 20.06.08, Philip A. Viton wrote:
> 
> > I've written a utility which takes results (in the J programing  
> > language) and converts them to latex tables, specifically formal tables, 
> > using booktabs.sty. One problem with importing them into lyx is that 
> > setup instructions like \cmidrule(r){1-2} ...  gets imported as ERT for 
> > \cmidrule, followed by text for the rest, another ERT for the next 
> > \cmidrule etc.
> 
> > Question: since I have complete control over how the file gets written, 
> > is there some way I could indicate to the lyx importer that the whole 
> > sequence of \cmidrule's is to be treated as one big ERT? 
> 
> Nothing I know of.
> 
> > Something on the order of \ERT{\cmidrule(r){1-2}  } ?
> 
> This is 
> a) invalid LaTeX
> b) has the same problems.

Not quite. The problem with \cmidrule is its non-standard syntax.
If the command had used only brackets [] and braces {}, the solution
would be simple. In order to obtain what the OP wants, a hack must be used.
First of all, put in the preamble of the .tex file the following line:

\def\ERT#1{#1}

then, surround each \cmidrule command that you want to import as a
single ERT, with \ERT{}, just as in your example above.
Now, use a text editor and create a file named as you like, for example
"syntax.extra", and put in there the following line:

\ERT{}

Having done that, run LyX, go to Tools->Preferences->Converters and
select the "LaTeX (plain) -> LyX" converter. Change the line that reads
"tex2lyx -f $$i $$o" into "tex2lyx -s /syntax.extra -f $$i $$o"
(where  is the full path to the syntax.extra file), hit the Modify
button and then Apply (or Save, for a permanent change).
Now use the menu "File->Import->LaTeX (plain)" and select the .tex file
you want to import. All your \ERT{} commands will be imported
as a single ERT. Note that you don't have to take away the surrounding
\ERT{} in LyX, as it will work as expected.

-- 
Enrico



marking something as ERT

2008-06-20 Thread Philip A. Viton


I've written a utility which takes results (in the J programing 
language) and converts them to latex tables, specifically formal 
tables, using booktabs.sty. One problem with importing them into lyx 
is that setup instructions like \cmidrule(r){1-2} ...  gets imported 
as ERT for \cmidrule, followed by text for the rest, another ERT for 
the next \cmidrule etc. It's sorta ugly, as well as making the table 
cell very wide.


Question: since I have complete control over how the file gets 
written, is there some way I could indicate to the lyx importer that 
the whole sequence of \cmidrule's is to be treated as one big ERT? 
Something on the order of \ERT{\cmidrule(r){1-2}  } ?


Thanks!


Philip A. Viton
City Planning, Ohio State University
275 West Woodruff Avenue, Columbus OH 43210
[EMAIL PROTECTED]



marking something as ERT

2008-06-20 Thread Philip A. Viton


I've written a utility which takes results (in the J programing 
language) and converts them to latex tables, specifically formal 
tables, using booktabs.sty. One problem with importing them into lyx 
is that setup instructions like \cmidrule(r){1-2} ...  gets imported 
as ERT for \cmidrule, followed by text for the rest, another ERT for 
the next \cmidrule etc. It's sorta ugly, as well as making the table 
cell very wide.


Question: since I have complete control over how the file gets 
written, is there some way I could indicate to the lyx importer that 
the whole sequence of \cmidrule's is to be treated as one big ERT? 
Something on the order of \ERT{\cmidrule(r){1-2}  } ?


Thanks!


Philip A. Viton
City Planning, Ohio State University
275 West Woodruff Avenue, Columbus OH 43210
[EMAIL PROTECTED]



marking something as ERT

2008-06-20 Thread Philip A. Viton


I've written a utility which takes results (in the J programing 
language) and converts them to latex tables, specifically formal 
tables, using booktabs.sty. One problem with importing them into lyx 
is that setup instructions like \cmidrule(r){1-2} ...  gets imported 
as ERT for \cmidrule, followed by text for the rest, another ERT for 
the next \cmidrule etc. It's sorta ugly, as well as making the table 
cell very wide.


Question: since I have complete control over how the file gets 
written, is there some way I could indicate to the lyx importer that 
the whole sequence of \cmidrule's is to be treated as one big ERT? 
Something on the order of \ERT{\cmidrule(r){1-2}  } ?


Thanks!


Philip A. Viton
City Planning, Ohio State University
275 West Woodruff Avenue, Columbus OH 43210
[EMAIL PROTECTED]