<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Home · BibTeX.jl</title><linkhref="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css"rel="stylesheet"type="text/css"/><linkhref="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL="."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"data-main="assets/documenter.js"></script><scriptsrc="siteinfo.js"></script><scriptsrc="../versions.js"></script><linkhref="assets/documenter.css"rel="stylesheet"type="text/css"/></head><body><navclass="toc"><h1>BibTeX.jl</h1><selectid="version-selector"onChange="window.location.href=this.value"style="visibility: hidden"></select><formclass="search"action="search.html"><inputid="search-query"name="q"type="text"placeholder="Search docs"/></form><ul><liclass="current"><aclass="toctext"href="index.html">Home</a><ulclass="internal"></ul></li></ul></nav><articleid="docs"><header><nav><ul><li><ahref="index.html">Home</a></li></ul><aclass="edit-page"href="https://github.com/bramtayl/BibTeX.jl/tree/673e30ce1f3bcd42b4f9f5735b49f13fa6f4037f/docs/src/index.md"><spanclass="fa"></span> Edit on GitHub</a></nav><hr/><divid="topbar"><span>Home</span><aclass="fa fa-bars"href="#"></a></div></header><h1><aclass="nav-anchor"id="BibTeX.jl-1"href="#BibTeX.jl-1">BibTeX.jl</a></h1><ul><li><ahref="index.html#BibTeX.Bibliography-Tuple{String}"><code>BibTeX.Bibliography</code></a></li><li><ahref="index.html#BibTeX.Citation"><code>BibTeX.Citation</code></a></li><li><ahref="index.html#BibTeX.parse_bibtex-Tuple{Any}"><code>BibTeX.parse_bibtex</code></a></li><li><ahref="index.html#BibTeX.search_latex_directive"><code>BibTeX.search_latex_directive</code></a></li><li><ahref="index.html#BibTeX.simplify_latex"><code>BibTeX.simplify_latex</code></a></li><li><ahref="index.html#BibTeX.strip_argument"><code>BibTeX.strip_argument</code></a></li></ul><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="BibTeX.Citation"href="#BibTeX.Citation"><code>BibTeX.Citation</code></a> — <spanclass="docstring-category">Type</span>.</div><div><pre><codeclass="language-none">Citation{S}(data::Dict{String,String})</code></pre><p>A bibliography item in a bibTeX database, based on a dictionary of strings to values. It is parameterized by a symbol <code>S</code> giving the type of the item (<code>:article</code> etcetera). A <code>b::Citation</code> supports <code>b[key]</code> access to retrieve the data and in general acts like a dictionary from <code>String</code> to <code>String</code>.</p></div><aclass="source-link"target="_blank"href="https://github.com/bramtayl/BibTeX.jl/tree/673e30ce1f3bcd42b4f9f5735b49f13fa6f4037f/src/citation.jl#L1-L9">source</a><br/></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="BibTeX.Bibliography-Tuple{String}"href="#BibTeX.Bibliography-Tuple{String}"><code>BibTeX.Bibliography</code></a> — <spanclass="docstring-category">Method</span>.</div><div><pre><codeclass="language-none">Bibliography(bibtex::String)
Bibliography(io::IO)</code></pre><p>Given a string (or IO stream) of bibtex-format bibliography data, parses the data and returns a <code>Dict</code>-like object <code>b::Bibliography</code> that behaves as a dictionary mapping strings to bibliography items <ahref="index.html#BibTeX.Citation"><code>Citation</code></a>.</p></div><aclass="source-link"target="_blank"href="https://github.com/bramtayl/BibTeX.jl/tree/673e30ce1f3bcd42b4f9f5735b49f13fa6f4037f/src/bibliography.jl#L6-L14">source</a><br/></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="BibTeX.parse_bibtex-Tuple{Any}"href="#BibTeX.parse_bibtex-Tuple{Any}"><code>BibTeX.parse_bibtex</code></a> — <spanclass="docstring-category">Method</span>.</div><div><pre><codeclass="language-none">parse_bibtex(text)</code></pre><p>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.</p><pre><codeclass="language-julia-repl">julia> using BibTeX: parse_bibtex
[...]</code></pre></div><aclass="source-link"target="_blank"href="https://github.com/bramtayl/BibTeX.jl/tree/673e30ce1f3bcd42b4f9f5735b49f13fa6f4037f/src/parser.jl#L120-L187">source</a><br/></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="BibTeX.search_latex_directive"href="#BibTeX.search_latex_directive"><code>BibTeX.search_latex_directive</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">search_latex_directive(astring, start_position = 1, inbrace=false)</code></pre><p>Search for a LaTeX directive \directive{argument} or similar in <code>string</code>, returning <code>(start_position, directive_end, argument_end)</code> such that <code>string[start_position:directive_end]</code> gives <code>\directive</code> and <code>string[directive_end+1:argument_end]</code> gives <code>{argument}</code>. Use <ahref="index.html#BibTeX.strip_argument"><code>strip_argument</code></a> to remove surrounding braces and whitespace from the <code>argument</code>.</p></div><aclass="source-link"target="_blank"href="https://github.com/bramtayl/BibTeX.jl/tree/673e30ce1f3bcd42b4f9f5735b49f13fa6f4037f/src/latex.jl#L22-L29">source</a><br/></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="BibTeX.simplify_latex"href="#BibTeX.simplify_latex"><code>BibTeX.simplify_latex</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">simplify_latex(astring, extra_directives)</code></pre><p>Simplify a LaTeX string <code>astring</code> into "plain text" if possible, stripping/converting known LaTeX directives in favor of e.g Unicode.</p><p><code>extra_directives</code> is a dictionary (<code>String=>String</code>) that maps LaTeX directives to replacements. It defaults to <code>BibTeX.text_directives</code>, which simply strips out things like bold and italics. Alternatively, you can pass <code>BibTeX.markdown_directives</code>, which uses Markdown syntax for such directives.</p></div><aclass="source-link"target="_blank"href="https://github.com/bramtayl/BibTeX.jl/tree/673e30ce1f3bcd42b4f9f5735b49f13fa6f4037f/src/latex.jl#L349-L359">source</a><br/></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="BibTeX.strip_argument"href="#BibTeX.strip_argument"><code>BibTeX.strip_argument</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">strip_argument(astring, start_position = start(astring), end_position = endof(astring))</code></pre><p>Return the substring of <code>astring</code> corresponding to the argument from <code>start_position:end_position</code>, stripping leading/trailing whitespace and braces.</p></div><aclass="source-link"target="_blank"href="https://github.com/bramtayl/BibTeX.jl/tree/673e30ce1f3bcd42b4f9f5735b49f13fa6f4037f/src/latex.jl#L139-L144">source</a><br/></section><footer><hr/></footer></article></body></html>