On Thursday 28 November 2002 4:14 pm, Juergen Spitzmueller wrote:
> \begin{thebibliography}{510}
> \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
> \expandafter\ifx\csname url\endcsname\relax
>   \def\url#1{{\tt #1}}\fi
> \expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi
>
> \bibitem[{{\sc Abraham}(1988)}]{Abraham88}
> {\sc Abraham, Werner} (1988): Terminologie zur neueren {L}inguistik.
>   T\"ubingen, 2. v\"ollig neu bearb.~und erw. Aufl.  (Germanistische
>   Arbeitshefte: Erg\"anzungsreihe;~1).
>
> \bibitem[{{\sc Adamzik}(1995{\natexlab{a}})}]{Adamzik:Einleitung95}
> {\sc Adamzik, Kirsten} (1995{\natexlab{a}}): Einleitung: {A}spekte und
>   {P}erspektiven der {T}extsortenlinguistik. In:
>  \cite{Adamzik:Textsorten95}, S.~11--40.

Ok, this works. Shove it in bib2lyx.sh between
cat - > ${SEDFILE} <<EOF
and the following
EOF

Angus

#For all lines starting "\expandafter...
/^[\]expandafter/{
:loop1
# If the line ends "\fi", delete it and return to the top of the script.
/[\]fi$/d

# Else, try and load a new line, remove the "\n" and check for "\fi" again.
$!N; s/\n//; tloop1
}

# Remove all instances of these...
s/[\]newblock//g
s/[\]penalty[ ]*[0-9][ ]*//g
s/{[\]natexlab{\(.*\)}}/\1/g

# LyX gets confused if the xxx contents of \bibitem[xxx]{yyy} are not
# on the same line as \bibitem
/^[\]bibitem/{
:loop2
/\]/!N; s/\n/ /; tloop2
}

Reply via email to