how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Martin A. Hansen
hello


i would like to save my document to ascii text, but bibtex references
are not saved. is there a way to solve this?



best regards


martin


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Angus Leeming
Martin A. Hansen wrote:
 I would like to save my document to ascii text, but bibtex references
 are not saved. is there a way to solve this?

You mean that they are cited in the text, but that there's no Reference
section at the end of the document with the cited entries? That's not
easy.

You can do it with a bit of hacking and a script though.

First, gather together all your citations:

$ sed -n -f citation_keys.sed yourfile.lyx | sort -u | \
  sed -f citation_1liner.sed  citation_keys.txt

I attach both sed files.

Then, use this dataset to create yet another sed script and use that to
modify the attached script, bib2bbl.sh.in

$ sed s/CITATION_DATA/`cat citation_keys.txt`/ bib2latex.sh.in  \
  bib2latex.sh

Finally, run this shell script to generate a latex file of your references.
Something like:

$ sh bib2latex.sh docs/references.bib citations.tex plainnat article

where docs/references.bib is my BibTeX database and the output is to go in
citations.tex

You should even be able to import this document into LyX and output as
ASCII ;-)

Hope it works but caveat emptor.

-- 
Angus

bib2latex.sh.in
Description: application/shellscript
:loop
$!{
N
s/\n/,/
tloop
}
# We're interested only in the lines containing citation insets
/^\\begin_inset LatexCommand \\cite/{

# Extract the keys
s/^\\begin_inset LatexCommand \\cite[^{]*{\([^}]*\)} */\1/

# Split multiple, comma-separated keys onto multiple lines
s/,/\
/g

# Print the output
p
}


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread G. Milde
On 28.01.05, Martin A. Hansen wrote:
 hello
 
 
 i would like to save my document to ascii text, but bibtex references
 are not saved. is there a way to solve this?

You could run a dvi to ASCII converter (like dvi2tty) after exporting to dvi.
See man dvi2tty for usage. 
The output quality is said to be low, though.

You could even define a new ASCII(dvi2tty) format and converters in
EditPreferences to get an FileExportASCII(dvi2tty) entry.

Günter



-- 
G.Milde web.de


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Matej Cepl
G. Milde wrote:
 i would like to save my document to ascii text, but bibtex references
 are not saved. is there a way to solve this?
 
 You could run a dvi to ASCII converter (like dvi2tty) after exporting to
 dvi. See man dvi2tty for usage.
 The output quality is said to be low, though.
 
 You could even define a new ASCII(dvi2tty) format and converters in
 EditPreferences to get an FileExportASCII(dvi2tty) entry.

Alternatively use some export to HTML and then run the result with lynx
-dump.

Matej

-- 
Matej Cepl, http://www.ceplovi.cz/matej
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
There's a long-standing bug relating to the x86 architecture that
allows you to install Windows.
-- Matthew D. Fuller




how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Martin A. Hansen
hello


i would like to save my document to ascii text, but bibtex references
are not saved. is there a way to solve this?



best regards


martin


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Angus Leeming
Martin A. Hansen wrote:
 I would like to save my document to ascii text, but bibtex references
 are not saved. is there a way to solve this?

You mean that they are cited in the text, but that there's no Reference
section at the end of the document with the cited entries? That's not
easy.

You can do it with a bit of hacking and a script though.

First, gather together all your citations:

$ sed -n -f citation_keys.sed yourfile.lyx | sort -u | \
  sed -f citation_1liner.sed  citation_keys.txt

I attach both sed files.

Then, use this dataset to create yet another sed script and use that to
modify the attached script, bib2bbl.sh.in

$ sed s/CITATION_DATA/`cat citation_keys.txt`/ bib2latex.sh.in  \
  bib2latex.sh

Finally, run this shell script to generate a latex file of your references.
Something like:

$ sh bib2latex.sh docs/references.bib citations.tex plainnat article

where docs/references.bib is my BibTeX database and the output is to go in
citations.tex

You should even be able to import this document into LyX and output as
ASCII ;-)

Hope it works but caveat emptor.

-- 
Angus

bib2latex.sh.in
Description: application/shellscript
:loop
$!{
N
s/\n/,/
tloop
}
# We're interested only in the lines containing citation insets
/^\\begin_inset LatexCommand \\cite/{

# Extract the keys
s/^\\begin_inset LatexCommand \\cite[^{]*{\([^}]*\)} */\1/

# Split multiple, comma-separated keys onto multiple lines
s/,/\
/g

# Print the output
p
}


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread G. Milde
On 28.01.05, Martin A. Hansen wrote:
 hello
 
 
 i would like to save my document to ascii text, but bibtex references
 are not saved. is there a way to solve this?

You could run a dvi to ASCII converter (like dvi2tty) after exporting to dvi.
See man dvi2tty for usage. 
The output quality is said to be low, though.

You could even define a new ASCII(dvi2tty) format and converters in
EditPreferences to get an FileExportASCII(dvi2tty) entry.

Günter



-- 
G.Milde web.de


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Matej Cepl
G. Milde wrote:
 i would like to save my document to ascii text, but bibtex references
 are not saved. is there a way to solve this?
 
 You could run a dvi to ASCII converter (like dvi2tty) after exporting to
 dvi. See man dvi2tty for usage.
 The output quality is said to be low, though.
 
 You could even define a new ASCII(dvi2tty) format and converters in
 EditPreferences to get an FileExportASCII(dvi2tty) entry.

Alternatively use some export to HTML and then run the result with lynx
-dump.

Matej

-- 
Matej Cepl, http://www.ceplovi.cz/matej
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
There's a long-standing bug relating to the x86 architecture that
allows you to install Windows.
-- Matthew D. Fuller




how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Martin A. Hansen
hello


i would like to save my document to ascii text, but bibtex references
are not saved. is there a way to solve this?



best regards


martin


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Angus Leeming
Martin A. Hansen wrote:
> I would like to save my document to ascii text, but bibtex references
> are not saved. is there a way to solve this?

You mean that they are cited in the text, but that there's no "Reference"
section at the end of the document with the cited entries? That's not
easy.

You can do it with a bit of hacking and a script though.

First, gather together all your citations:

$ sed -n -f citation_keys.sed yourfile.lyx | sort -u | \
  sed -f citation_1liner.sed > citation_keys.txt

I attach both sed files.

Then, use this dataset to create yet another sed script and use that to
modify the attached script, bib2bbl.sh.in

$ sed "s/CITATION_DATA/`cat citation_keys.txt`/" bib2latex.sh.in > \
  bib2latex.sh

Finally, run this shell script to generate a latex file of your references.
Something like:

$ sh bib2latex.sh docs/references.bib citations.tex plainnat article

where docs/references.bib is my BibTeX database and the output is to go in
citations.tex

You should even be able to import this document into LyX and output as
ASCII ;-)

Hope it works but caveat emptor.

-- 
Angus

bib2latex.sh.in
Description: application/shellscript
:loop
$!{
N
s/\n/,/
tloop
}
# We're interested only in the lines containing citation insets
/^\\begin_inset LatexCommand \\cite/{

# Extract the keys
s/^\\begin_inset LatexCommand \\cite[^{]*{\([^}]*\)} */\1/

# Split multiple, comma-separated keys onto multiple lines
s/,/\
/g

# Print the output
p
}


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread G. Milde
On 28.01.05, Martin A. Hansen wrote:
> hello
> 
> 
> i would like to save my document to ascii text, but bibtex references
> are not saved. is there a way to solve this?

You could run a dvi to ASCII converter (like dvi2tty) after exporting to dvi.
See man dvi2tty for usage. 
The output quality is said to be low, though.

You could even define a new ASCII(dvi2tty) format and converters in
Edit>Preferences to get an File>Export>ASCII(dvi2tty) entry.

Günter



-- 
G.Milde web.de


Re: how to export lyx files to ascii with bibtex references ?

2005-01-28 Thread Matej Cepl
G. Milde wrote:
>> i would like to save my document to ascii text, but bibtex references
>> are not saved. is there a way to solve this?
> 
> You could run a dvi to ASCII converter (like dvi2tty) after exporting to
> dvi. See man dvi2tty for usage.
> The output quality is said to be low, though.
> 
> You could even define a new ASCII(dvi2tty) format and converters in
> Edit>Preferences to get an File>Export>ASCII(dvi2tty) entry.

Alternatively use some export to HTML and then run the result with lynx
-dump.

Matej

-- 
Matej Cepl, http://www.ceplovi.cz/matej
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
There's a long-standing bug relating to the x86 architecture that
allows you to install Windows.
-- Matthew D. Fuller