BibTeX.jl
BibTeX.Citation
— Type.Citation{S}(data::Dict{String,String})
A bibliography item in a bibTeX database, based on a dictionary of strings to values. It is parameterized by a symbol S
giving the type of the item (:article
etcetera). A b::Citation
supports b[key]
access to retrieve the data and in general acts like a dictionary from String
to String
.
BibTeX.Bibliography
— Method.Bibliography(bibtex::String)
-Bibliography(io::IO)
Given a string (or IO stream) of bibtex-format bibliography data, parses the data and returns a Dict
-like object b::Bibliography
that behaves as a dictionary mapping strings to bibliography items Citation
.
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: parse_bibtex
+Home · BibTeX.jl
BibTeX.jl
BibTeX.Bibliography
BibTeX.Citation
BibTeX.parse_bibtex
BibTeX.search_latexdirective
BibTeX.simplify_latex
BibTeX.striparg
BibTeX.Citation
— Type.Citation{S}(data::Dict{String,String})
A bibliography item in a bibTeX database, based on a dictionary of strings to values. It is parameterized by a symbol S
giving the type of the item (:article
etcetera). A b::Citation
supports b[key]
access to retrieve the data and in general acts like a dictionary from String
to String
.
source
BibTeX.Bibliography
— Method.Bibliography(bibtex::String)
+Bibliography(io::IO)
Given a string (or IO stream) of bibtex-format bibliography data, parses the data and returns a Dict
-like object b::Bibliography
that behaves as a dictionary mapping strings to bibliography items Citation
.
source
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: parse_bibtex
julia> preamble, result = parse_bibtex("""
@preamble{some instructions}
@@ -51,4 +51,4 @@ julia> parse_bibtex("""
title = B}
""")
ERROR: Duplicated field title on line 3
-[...]
source
+[...]
BibTeX.search_latexdirective
— Function.search_latexdirective(string, istart=1, inbrace=false)
Search for a LaTeX directive \directive{arg} or similar in string
, returning (ds, de, ae)
such that string[ds:de]
gives \directive
and string[de+1:ae]
gives {arg}
. Use striparg
to remove surrounding braces and whitespace from the arg
.
BibTeX.simplify_latex
— Function.simplify_latex(s::AbstractString, extra_directives=BibTeX.text_directives)
Simplify a LaTeX string s
into "plain text" if possible, stripping/converting known LaTeX directives in favor of e.g Unicode.
extra_directives
is a dictionary (String=>String
) that maps LaTeX directives to replacements. It defaults to BibTeX.text_directives
, which simply strips out things like bold and italics. Alternatively, you can pass BibTeX.md_directives
, which uses Markdown syntax for such directives.
BibTeX.striparg
— Function.striparg(s, argstart=start(s), argend=endof(s))
Return the substring of s
corresponding to the argument from argstart:argend
, stripping leading/trailing whitespace and braces.