BibTeX.jl
BibTeX.parse_bibtex
— Method.parse_bibtex(text)
This is a simple input parser for BibTex. I had trouble finding a standard specification, but I've included several features of real BibTex.
julia> using BibTeX
+Home · BibTeX.jl
BibTeX.jl
BibTeX.parse_bibtex
— Method.parse_bibtex(text)
This is a simple input parser for BibTex. I had trouble finding a standard specification, but I've included several features of real BibTex. Returns a preamble (or an empty string) and a dict of dicts.
julia> using BibTeX
-julia> result = parse_bibtex("""
+julia> preamble, result = parse_bibtex("""
+ @preamble{some instructions}
+ @comment blah blah
@string{short = long}
@a{b,
c = { {c} c},
@@ -10,6 +12,9 @@ julia> result = parse_bibtex("""
}
""");
+julia> preamble
+"some instructions"
+
julia> result["b"]["type"]
"a"
@@ -28,4 +33,4 @@ ERROR: Expected { on line 1
julia> parse_bibtex("@book@")
ERROR: Expected { on line 1
-[...]
source
+[...]