Commit abf8c33e authored by Alessandra Gorla's avatar Alessandra Gorla
Browse files

added script to make conference proceedings really short. Updated the documentation

parent 6a92baf7
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
BIB_ABBREVIATE ?= ./bib-abbreviate.pl BIB_ABBREVIATE ?= ./bib-abbreviate.pl
# TODO: reinstate bibstring-crossrefs-abbrev.bib # TODO: reinstate bibstring-crossrefs-abbrev.bib
all: bibstring-unabbrev.bib bibstring-abbrev.bib bibroot crossrefs-abbrevv.bib docs/index.html all: bibstring-unabbrev.bib bibstring-abbrev.bib bibroot crossrefs-abbrevv.bib crossrefs-super-abbrev.bib docs/index.html
BIBFILES := $(shell ls *.bib | grep -v bibstring-unabbrev.bib | grep -v bibstring-abbrev.bib) BIBFILES := $(shell ls *.bib | grep -v bibstring-unabbrev.bib | grep -v bibstring-abbrev.bib)
clean: bibtest-aux-clean clean: bibtest-aux-clean
rm -f bibstring-unabbrev.bib bibstring-abbrev.bib bibroot bibtest.tex crossrefs-abbrev.bib crossrefs-abbrevv.bib rm -f bibstring-unabbrev.bib bibstring-abbrev.bib bibroot bibtest.tex crossrefs-abbrev.bib crossrefs-abbrevv.bib crossrefs-super-abbrev.bib
docs/index.html: README.md docs/index.html: README.md
asciidoctor $< --out-file=$@ asciidoctor $< --out-file=$@
...@@ -27,17 +27,21 @@ bibstring-abbrev.bib: bibstring-master.bib $(BIB_ABBREVIATE) ...@@ -27,17 +27,21 @@ bibstring-abbrev.bib: bibstring-master.bib $(BIB_ABBREVIATE)
crossrefs-abbrev.bib: crossrefs.bib crossrefs-abbrev.bib: crossrefs.bib
@rm -f $@ @rm -f $@
awk '!/address =/' $< > temp <crossrefs.bib sed \
awk '!/month =/' temp > $@ -e '/address =/d' \
rm temp -e '/month =/d' >$@
crossrefs-abbrevv.bib: crossrefs-abbrev.bib crossrefs-abbrevv.bib: crossrefs-abbrev.bib
@rm -f $@ @rm -f $@
sed '/title =/s/Proceedings/Proc./g' $< >temp <crossrefs-abbrev.bib sed \
sed '/booktitle =/s/Proceedings/Proc./g' <temp >temp1 -e '/title =/s/Proceedings/Proc./g' \
sed 's/International/Intl./g' <temp1 >temp2 -e '/booktitle =/s/Proceedings/Proc./g' \
sed 's/Conference/Conf./g' < temp2 >$@ -e 's/International/Intl./g' \
rm temp* -e 's/Conference/Conf./g' >$@
crossrefs-super-abbrev.bib: crossrefs-abbrev.bib
@rm -f $@
python cref-abbrev.py
## TODO: write a new abbreviaton script, only for [book]titles ## TODO: write a new abbreviaton script, only for [book]titles
# bibstring-crossrefs-abbrev.bib: bibstring-crossrefs-master.bib $(BIB_ABBREVIATE) # bibstring-crossrefs-abbrev.bib: bibstring-crossrefs-master.bib $(BIB_ABBREVIATE)
......
...@@ -50,9 +50,32 @@ USAGE ...@@ -50,9 +50,32 @@ USAGE
To choose the abbreviated (short) or unabbreviated (long) version of the To choose the abbreviated (short) or unabbreviated (long) version of the
bibliography strings, use one of these commands in your LaTeX file: bibliography strings, use one of these commands in your LaTeX file:
\bibliography{bibstring-abbrev,...,crossrefs-abbrevv} Most complete option. It will use full strings for journals
(`bibstring-unabbrev`) and full proceedings info for conferences
(`crossrefs`).
\bibliography{bibstring-unabbrev,...,crossrefs}
No month and address option. It will use short strings for journals
(`bibstring-abbrev`) and full proceedings info for conferences, but
omitting months and addresses. (`crossrefs-abbrev`).
\bibliography{bibstring-abbrev,...,crossrefs-abbrev} \bibliography{bibstring-abbrev,...,crossrefs-abbrev}
\bibliography{bibstring-unabbrev,...,crossrefs}
Abbreviations option. It will use short strings for journals
(`bibstring-abbrev`) and will shorten some words in the proceedings
info for conferences (e.g. Proceedings --> Proc., Conference -->
Conf.) as in `crossrefs-abbrevv`.
\bibliography{bibstring-abbrev,...,crossrefs-abbrevv}
Super-compressed option. It will use short strings for journals
(`bibstring-abbrev`) and will shorten proceedings for conferences
leaving only acronyms. (e.g. ICSE 2017: Proceedings of the
International Conference...--> ICSE 2017), as in
`crossrefs-super-abbrev`.
\bibliography{bibstring-abbrev,...,crossrefs-super-abbrev}
When using the bibliographies, add near the top of your LaTeX document: When using the bibliographies, add near the top of your LaTeX document:
......
'''This script was written by Alessandra Gorla to create a super
abbreviated version of the crossref bibliography. Given
crossrefs-abbrev.bib, which already excludes month and address, this
script keeps only the acronyms of the conferences, which are assumed
to be before the ":".
Thus, "ICSE 2017: Proceedings of the International Conference ..."
will be reduced to "ICSE 2017".
If title and booktitle do not include any ":" the script keeps the
strings as they are.
'''
import re
with open('crossrefs-super-abbrev.bib', 'w') as out_file:
with open('crossrefs-abbrev.bib') as cref_file:
for l in cref_file.readlines():
# this is the first line of title or booktitle, and we
# need to remove what comes after the :
if ("title =" in l):
s = re.sub(':.*$', '",', l)
out_file.write(s)
# this is either another field that we should keep
# entirely (e.g. year =) or the first line of the entry @Proceedings
elif ("=" in l or "@" in l):
out_file.write(l)
# this is the last line with only } and possible spaces
elif (re.match(' *} *', l)):
out_file.write(l+"\n")
# if the line does not fall in previous cases it means
# that it is a continuation of title/booktitle that should
# be discarded
...@@ -3416,10 +3416,10 @@ ...@@ -3416,10 +3416,10 @@
} }
@Proceedings{LFP92, @Proceedings{LFP92,
title = "LFP '92: Proceedings 1992 ACM Conf. on Lisp and Functional title = "LFP '92: Proceedings 1992 ACM Conference on Lisp and
Programming", Functional Programming",
booktitle = "LFP '92: Proceedings 1992 ACM Conf. on Lisp and Functional booktitle = "LFP '92: Proceedings 1992 ACM Conference on Lisp and
Programming", Functional Programming",
year = 1992, year = 1992,
} }
......
...@@ -3416,10 +3416,10 @@ ...@@ -3416,10 +3416,10 @@
} }
@Proceedings{LFP92, @Proceedings{LFP92,
title = "LFP '92: Proc. 1992 ACM Conf. on Lisp and Functional title = "LFP '92: Proc. 1992 ACM Conf. on Lisp and
Programming", Functional Programming",
booktitle = "LFP '92: Proc. 1992 ACM Conf. on Lisp and Functional booktitle = "LFP '92: Proc. 1992 ACM Conf. on Lisp and
Programming", Functional Programming",
year = 1992, year = 1992,
} }
......
This diff is collapsed.
...@@ -499,11 +499,47 @@ rather than one for each paper you write.</p> ...@@ -499,11 +499,47 @@ rather than one for each paper you write.</p>
<p>To choose the abbreviated (short) or unabbreviated (long) version of the <p>To choose the abbreviated (short) or unabbreviated (long) version of the
bibliography strings, use one of these commands in your LaTeX file:</p> bibliography strings, use one of these commands in your LaTeX file:</p>
</div> </div>
<div class="paragraph">
<p>Most complete option. It will use full strings for journals
(<code>bibstring-unabbrev</code>) and full proceedings info for conferences
(<code>crossrefs</code>).</p>
</div>
<div class="literalblock">
<div class="content">
<pre>\bibliography{bibstring-unabbrev,...,crossrefs}</pre>
</div>
</div>
<div class="paragraph">
<p>No month and address option. It will use short strings for journals
(<code>bibstring-abbrev</code>) and full proceedings info for conferences, but
omitting months and addresses. (<code>crossrefs-abbrev</code>).</p>
</div>
<div class="literalblock">
<div class="content">
<pre>\bibliography{bibstring-abbrev,...,crossrefs-abbrev}</pre>
</div>
</div>
<div class="paragraph">
<p>Abbreviations option. It will use short strings for journals
(<code>bibstring-abbrev</code>) and will shorten some words in the proceedings
info for conferences (e.g. Proceedings -&#8594; Proc., Conference -&#8594;
Conf.) as in <code>crossrefs-abbrevv</code>.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>\bibliography{bibstring-abbrev,...,crossrefs-abbrevv}</pre>
</div>
</div>
<div class="paragraph">
<p>Super-compressed option. It will use short strings for journals
(<code>bibstring-abbrev</code>) and will shorten proceedings for conferences
leaving only acronyms. (e.g. ICSE 2017: Proceedings of the
International Conference&#8230;&#8203;-&#8594; ICSE 2017), as in
<code>crossrefs-super-abbrev</code>.</p>
</div>
<div class="literalblock"> <div class="literalblock">
<div class="content"> <div class="content">
<pre>\bibliography{bibstring-abbrev,...,crossrefs-abbrevv} <pre>\bibliography{bibstring-abbrev,...,crossrefs-super-abbrev}</pre>
\bibliography{bibstring-abbrev,...,crossrefs-abbrev}
\bibliography{bibstring-unabbrev,...,crossrefs}</pre>
</div> </div>
</div> </div>
<div class="paragraph"> <div class="paragraph">
...@@ -683,7 +719,7 @@ example:</p> ...@@ -683,7 +719,7 @@ example:</p>
</div> </div>
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Last updated 2018-03-11 15:37:12 CET Last updated 2018-04-18 19:51:17 CEST
</div> </div>
</div> </div>
</body> </body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment