#!/bin/bash # # Author: Chris Karakas # http://www.karakas-online.de # # Part of the LyX-to-X project. # See http://www.karakas-online.de/mySGML/ for a detailed # description. # # Copyright (c) 2004, Chris Karakas # http://www.karakas-online.de # chris at mydomain dot de (see above for my domain) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. AWK="/usr/bin/awk" # declare -i j=0 k=0 l=0 function preample() { cat <<-EOF #LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 220 \textclass article \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default EOF } function label() { n=$1 echo "" echo "\layout Standard" echo "" echo "" echo "\begin_inset LatexCommand \label{cit:$n}" echo "" echo "\end_inset" } preample # `$AWK -f awkscr_cit $1 > labels.tmp` `$AWK 'BEGIN {FS=" - "} /ID/ {printf("\n%s\n\n%s%s%s\n\n%s\n","\\\\layout Standard","\\\\begin_inset LatexCommand \\\\label{cit:",$2,"}","\\\\end_inset")}' $1 > labels.tmp` cat labels.tmp rm labels.tmp echo "\the_end"