i am not sure this is simple - at least not for me.
if ones does:
1) export lyx to latex.
2) run latex and bibtex in order to generate the .bbl file containing
the bibliographic data.
3) convert the latex file to txt file (is that groff's doing?).
4) concatenate the bibliographic data to the txt file.
now, the citation keys within the text also needs to be substituted
with respect to the bibliography style selected (numbered, alphabetic,
sorted etc.). that is tricky?!?
maybe it is more feasible to utilize pstotext or catdvi or
ghostscript? but that leaves a problem with line numbers, page
numbers, footnotes, form feeds, and text wrapping. however, that could
be handled by a post processing script:
Lyx->PS->pstotext->script->txt (perfect - bibliography and all)
how about that?
martin
On 23/08/05, Angus Leeming <[EMAIL PROTECTED]> wrote:
> Martin A. Hansen wrote:
>
> > On 22/08/05, Michael-E. Voges
> > <[EMAIL PROTECTED]> wrote:
> >> Am Montag, 22. August 2005 17:54 schrieb Martin A. Hansen:
> >>
> >> > how can one export as ascii paragraphs instead of ascii lines?
> >>
> >> did You try to put "preferences" "export" "ASCII" to "0" (zero) length?
> >> but it probably wrecks empty lines between paragraphs.
> >> > and has anyone got the solution to export/convert with bibtex?
> >> what do You mean by "solution with bibtex"?
> >
> > exporting ascii does not invoke bibtex and hence the references in a
> > document is missing.
> >
> > now, how does one generate a ascii file with the references?
> > preferrably without invoking export via rtf or html formats.
>
> If you're willing to hack a little it's easy enough. For example, using the
> unix utilites sed and sort:
>
> $ sed -n '/^\\begin_inset LatexCommand \\cite/{s/[^{]*{//;s/}//p;}' \
> structure3D.lyx | sort -u
> Denny:Schroter96
> Mercer:Crapo87
> Mercer:etal91
> Press:etal92
> Storey:Staub62
>
> Use these to create a .aux file that can be handed over to BibTeX:
>
> $ cat hack.aux
> \citation{Denny:Schroter96}
> \citation{Mercer:Crapo87}
> \citation{Mercer:etal91}
> \citation{Press:etal92}
> \citation{Storey:Staub62}
> \bibstyle{plainnat}
> \bibdata{references}
>
> where references.bib is the name of my BibTeX database. Run this .aux file
> through the BibTeX compiler:
>
> $ bibtex hack
> $ cat hack.bbl
> \begin{thebibliography}{5}
> \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
> \expandafter\ifx\csname url\endcsname\relax
> \def\url#1{{\tt #1}}\fi
>
> \bibitem[Denny and Schroter(1996)]{Denny:Schroter96}
> E.~Denny and R.C. Schroter.
> \newblock A mathematical model of the morphology of a pulmonary acinus.
> \newblock {\em Trans. ASME J.~Biomech. Eng.}, 118:\penalty0 210--215, 1996.
>
> \bibitem[Mercer et~al.(1991)Mercer, Anjilvel, Miller, and Crapo
> {Mercer:etal91}
> R.R. Mercer, S.~Anjilvel, F.J. Miller, and J.D. Crapo.
> \newblock Inhomogeneity of ventilatory unit volume and its effects on
> reactive
> gas uptake.
> \newblock {\em J.~Appl. Physiol.}, 70:\penalty0 2193--2205, 1991.
>
> \bibitem[Mercer and Crapo(1987)]{Mercer:Crapo87}
> R.R. Mercer and J.D. Crapo.
> \newblock Three dimensional reconstruction of the rat acinus.
> \newblock {\em J.~Appl. Physiol.}, 63:\penalty0 785--794, 1987.
>
> \bibitem[Press et~al.(1992)Press, Teukolsky, Vetterling, and
> Flannery]{Press:etal92}
> W.~Press, S.~Teukolsky, W.~Vetterling, and B.~Flannery.
> \newblock {\em Numerical recipes in {C}}.
> \newblock Cambridge University Press, second edition, 1992.
>
> \bibitem[Storey and Staub(1962)]{Storey:Staub62}
> W.F. Storey and N.C. Staub.
> \newblock Ventilation of terminal airway units.
> \newblock {\em J.~Appl. Physiol.}, 17:\penalty0 391--397, 1962.
>
> \end{thebibliography}
>
> Clearly, you could automate this process in a shell script. You could also
> use sed to clean up the .bbl file ready for insertion in your .txt file.
>
> As a little bit of fun, I've written such a script. Attached. You'll need
> to alter the names of the various files. (See "Please alter these to
> suit.") Use it as
>
> $ sh ./bib2txt.sh
>
> Regards,
> Angus
>
>
>