BEGIN {
FS="\t"
title["refereed"]="Refereed Papers"
title["non-refereed"]="Papers"
title["late"]="Late Papers (not listed in table of contents)"
title["slides"]="Presentation Slides"
title["videos"]="Videos without papers or slides"
notes["refereed"]="refereed"
notes["non-refereed"]="not refereed"
notes["late"]="not refereed"
notes["slides"]="presentation slides"
notes["videos"]="Video only"
html="papers/index.html"
bib ="data/nopages.bib"
system("cat top.html >"html);
}
/^-[*]-/ { next }
{
if ($1 == ">") {
if ($2 != "videos")
print "\\addtocontents{toc}{\\textbf{"title[$2]"}}"
header++;
if (header > 1)
print "" >>html
print "
"title[$2]"
\n" >>html
note = notes[$2]
next
}
if ($1 != "") {
file="papers/"$1".pdf"
paper = system("test -f ../"file) == 0 ? file : ""
file="papers/"$1"-slides.pdf"
slides = system("test -f ../"file) == 0 ? file : ""
if (paper slides == "") {
print "no file for "$1 > "/dev/stderr"
exit 1
}
print "\\phantomsection\\addcontentsline{toc}{section}{"$2": "$3"}"
} else {
paper = "";
slides = "";
}
plaintext = gensub(/[}{]|\\[a-z]+/,"","g",$3);
authors = gensub(/,/," and","g",$2)
gsub(/>/,"\\>",plaintext)
#print "\\addcontentsline{toc}{section}{"$2": "$3"}{section*.\\thepage}"
if (paper != "")
print "\\includepdf[pages=-,pagecommand={\\thispagestyle{plain}},noautoscale]{"paper"}"
else if (slides != "") {
print "\\includepdf[pages=-,pagecommand={\\thispagestyle{plain}},nup=2x4,scale=0.9, delta=5 5,column]{"slides"}"
#print "\\includepdf[pages=-,pagecommand={\\thispagestyle{plain}},nup=1x2,scale=0.8, delta=0 20]{"slides"}"
}
print "- "$2": " \
($1=="" ? (""plaintext""): \
(paper!="" ? (""plaintext""):plaintext) \
(slides!="" ? (" (Slides)"):"") \
($4 != "" ? (" (Video)"):"") \
) >> html
if ($1!="") {
print "@InProceedings{"$1 year",\n\
author = {"authors"},\n\
title = {"$3"},\n\
crossref = {euroforml"year"}," >bib
if (paper!="")
print " url = {http://www.euroforth.org/ef"year"/"paper"}," >bib
if (slides!="")
print " url-slides = {http://www.euroforth.org/ef"year"/"slides"}," >bib
if ($4!="")
print " video = {"$4"}," >bib
print "\
OPTnote = {"note"},\n\
OPTabstract = {}\n\
}\n" >bib
} else {
video = $4;
sub(/^.*events:/,"",video);
sub(/[.]mp4$/,"",video);
print "@Misc{"video",\n\
author = {"authors"},\n\
title = {"$3"},\n\
howpublished = {"$4"},\n\
year = {20"year"},\n\
note = {Video of otherwise unpulished talk at EuroForth 20"year"}\n\
}\n" >bib
}
}
END {
print "
" >> html
system("cat bottom.html >>"html);
}