### Install DocumenterCitations.jl using Julia's Pkg REPL Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This command demonstrates the standard method to install the DocumenterCitations.jl package directly from the Julia Pkg REPL, making it available in the current environment. ```Julia pkg> add DocumenterCitations ``` -------------------------------- ### Install DocumenterCitations via Julia Pkg REPL Source: https://github.com/juliadocs/documentercitations.jl/blob/master/README.md Install the `DocumenterCitations` package using Julia's Pkg REPL. This is the standard method for adding Julia packages to your environment. ```Julia pkg> add DocumenterCitations ``` -------------------------------- ### Numeric Citation Style Examples in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md Examples demonstrating various citation commands (`@cite`, `@citet`, `@citep`, `@Citet`) and their rendering in the numeric citation style. This includes single and multiple citations, with and without additional text, and different capitalization options for in-text citations. ```Julia [GoerzQ2022](@cite) ``` ```Julia [FuerstNJP2014,SolaAAMOP2018](@cite) ``` ```Julia [GoerzQ2022](@citet) ``` ```Julia [GoerzQ2022](@citep) ``` ```Julia [GoerzQ2022; Eq. (1)](@cite) ``` ```Julia [GoerzQ2022; Eq. (1)](@citet) ``` ```Julia [GoerzQ2022](@citet*) ``` ```Julia [GoerzQ2022; Eq. (1)](@citet*) ``` ```Julia [WinckelIP2008](@citet) ``` ```Julia [WinckelIP2008](@Citet) ``` ```Julia [BrumerShapiro2003, BrifNJP2010, Shapiro2012, KochJPCM2016; and references therein](@cite) ``` ```Julia [BrumerShapiro2003, BrifNJP2010, Shapiro2012, KochJPCM2016; and references therein](@Citet) ``` ```Julia [arbitrary text](@cite GoerzQ2022) ``` -------------------------------- ### Author-Year Citation Style Examples in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md Examples demonstrating various citation commands (`@cite`, `@citet`, `@citep`, `@Citet`, `@cite*`, `@citet*`) and their rendering in the author-year citation style. This includes single and multiple citations, with and without additional text, and different capitalization and asterisk options. ```Julia [GoerzQ2022](@cite) ``` ```Julia [FuerstNJP2014,SolaAAMOP2018](@cite) ``` ```Julia [GoerzQ2022](@citet) ``` ```Julia [GoerzQ2022](@citep) ``` ```Julia [GoerzQ2022; Eq. (1)](@cite) ``` ```Julia [GoerzQ2022; Eq. (1)](@citet) ``` ```Julia [GoerzQ2022](@cite*) ``` ```Julia [GoerzQ2022](@citet*) ``` ```Julia [GoerzQ2022; Eq. (1)](@cite*) ``` ```Julia [GoerzQ2022; Eq. (1)](@citet*) ``` ```Julia [WinckelIP2008](@citet) ``` ```Julia [WinckelIP2008](@Citet) ``` ```Julia [BrumerShapiro2003, BrifNJP2010, Shapiro2012, KochJPCM2016; and references therein](@cite) ``` ```Julia [BrumerShapiro2003, BrifNJP2010, Shapiro2012, KochJPCM2016; and references therein](@Citet) ``` ```Julia [arbitrary text](@cite GoerzQ2022) ``` -------------------------------- ### Example CSS for Bibliography Styling Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/styling.md This snippet provides an example of a `citations.css` file, typically placed in `docs/src/assets`, which defines styles for bibliography entries. It can be customized to differentiate between canonical and non-canonical blocks using `.canonical` and `.noncanonical` classes. ```CSS .bibliography { margin-top: 2em; border-top: 1px solid #eee; padding-top: 1em; } .bibliography-item { margin-bottom: 0.5em; line-height: 1.5; } .bibliography-item .authors { font-weight: bold; } .bibliography-item .title { font-style: italic; } /* Styles for canonical bibliography blocks */ .canonical { color: #333; } /* Styles for non-canonical bibliography blocks */ .noncanonical { color: #666; font-size: 0.9em; } ``` -------------------------------- ### Documenter.jl Contents Directive with Path Examples Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part2/section2/p2_s2_page.md This snippet demonstrates the `@contents` directive in Documenter.jl, showing how to include content from specific pages. It highlights the use of `joinpath` and `normpath` for constructing relative paths to source files, indicating that `eval` might be involved in processing these paths. ```Julia @contents Pages = [ joinpath("..", "..", "part1", "section1", "p1_s1_page.md"), normpath("../../part1/section2/p1_s2_page.md"), normpath("../section1/p2_s1_page.md"), ] ``` -------------------------------- ### Documenter.jl Bibliography Directive with Path Examples Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part2/section2/p2_s2_page.md This snippet illustrates the `@bibliography` directive in Documenter.jl, used to generate a bibliography from specified pages. It shows how to list source files using relative paths and sets `Canonical = false`. ```Julia @bibliography Canonical = false Pages = [ joinpath("..", "..", "part1", "section1", "p1_s1_page.md"), "../../part1/section2/p1_s2_page.md", "../section1/p2_s1_page.md", ] ``` -------------------------------- ### Configure Alphabetic Style Disambiguation Example Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md Demonstrates the `:alpha` style's automatic label disambiguation for multiple publications by the same author in the same year, by including two distinct references. ```Julia @bibliography Pages = [] Style = :alpha Canonical = false GraceJMO2007 GraceJPB2007 ``` -------------------------------- ### Julia `@eval` block for dynamic badge generation Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This Julia code block is executed during the Documenter.jl build process to dynamically generate and display GitHub and version badges. It uses `Pkg.dependencies` to get the package version and adjusts the output format (Markdown badges or plain text) based on the `DOCUMENTER_BUILD_PDF` environment variable. ```Julia using Markdown using Pkg VERSION = Pkg.dependencies()[Base.UUID("daee34ce-89f3-4625-b898-19384cb65244")].version github_badge = "[![Github](https://img.shields.io/badge/JuliaDocs-DocumenterCitations.jl-blue.svg?logo=github)](https://github.com/JuliaDocs/DocumenterCitations.jl)" version_badge = "![v$VERSION](https://img.shields.io/badge/version-v$(replace("$VERSION", "-" => "--"))-green.svg)" if get(ENV, "DOCUMENTER_BUILD_PDF", "") == "" Markdown.parse("$github_badge $version_badge") else Markdown.parse(""" ----- On Github: [JuliaDocs/DocumenterCitations.jl](https://github.com/JuliaDocs/DocumenterCitations.jl) Version: $VERSION ----- """) end ``` -------------------------------- ### DocumenterCitations.jl Citation Macro Usage Examples Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md These examples illustrate various ways to use DocumenterCitations.jl macros within Markdown. They demonstrate how `@cite`, `@citet`, `@citep`, and `@Citet` can be applied to generate different citation formats, including parenthetical, textual, and modified citations, with single or multiple references. ```Markdown [GoerzQ2022](@cite) ``` ```Markdown [FuerstNJP2014,SolaAAMOP2018](@cite) ``` ```Markdown [GoerzQ2022](@citet) ``` ```Markdown [GoerzQ2022](@citep) ``` ```Markdown [GoerzQ2022; Eq. (1)](@cite) ``` ```Markdown [GoerzQ2022; Eq. (1)](@citet) ``` ```Markdown [GoerzQ2022](@citet*) ``` ```Markdown [GoerzQ2022; Eq. (1)](@citet*) ``` ```Markdown [WinckelIP2008](@citet) ``` ```Markdown [WinckelIP2008](@Citet) ``` ```Markdown [arbitrary text](@cite GoerzQ2022) ``` -------------------------------- ### Markdown Citation Syntax in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Explains various syntaxes for creating inline and parenthetical citations in Markdown text within Documenter.jl, including basic usage, notes, multiple keys, and direct text linking. Also covers variations like text-style (@citet) and parenthetical (@citep) citations, and capitalization for sentence start. ```Markdown [key](@cite) ``` ```Markdown [key; note](@cite) ``` ```Markdown [BrumerShapiro2003, BrifNJP2010, Shapiro2012, KochJPCM2016; and references therein](@cite) ``` ```Markdown [the Semi-AD paper](@cite GoerzQ2022) ``` ```Markdown [GoerzQ2022](@citet) ``` ```Markdown [GoerzQ2022](@citep) ``` ```Markdown [GoerzQ2022](@citet*) ``` ```Markdown [GoerzQ2022](@cite*) ``` ```Markdown [WinckelIP2008](@Citet) ``` -------------------------------- ### Documenter.jl Citation Key Normalization Examples Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_keys_with_underscores_ambiguities/src/index.md This snippet demonstrates how Documenter.jl's @cite macro handles citation keys containing underscores and asterisks. These characters are normalized, allowing different key formats to refer to the same citation transparently. ```Julia [rabiner_tutorial_1989](@cite) [rabiner_tutorial*1989](@cite) [rabiner*tutorial*1989](@cite) [Goerz_Q*2022](@cite) [Goerz_Q_2022](@cite) ``` -------------------------------- ### Example Documenter @contents Block Configuration Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_content_block/src/index.md Illustrates a typical @contents block configuration in Documenter.jl, specifying which pages to include in the table of contents. This configuration can cause issues if any of the listed pages (e.g., 'references.md') contain a @bibliography block when DocumenterCitations.jl is active. ```Documenter.jl `@contents Pages = ["index.md", "references.md"]` ``` -------------------------------- ### Render explicit citations in Documenter.jl bibliography Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md This example shows how to generate a bibliography containing only a few specific citation keys. By setting `Pages = []`, all other cited references are excluded, and only the explicitly listed keys are included in the rendered bibliography. `Canonical = false` ensures this block is not the primary link target. ```markdown ```@bibliography Pages = [] Canonical = false BrifNJP2010 GoerzDiploma2010 GoerzPhd2015 ``` ``` -------------------------------- ### Sort bibliography entries in Julia with Bibliography.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md This Julia snippet demonstrates how to programmatically sort the entries of a `CitationBibliography` object using `Bibliography.sort_bibliography!`. The example sorts entries by name-year-title (`:nyt`), allowing customization of the reference order beyond the default citation-based ordering. ```julia bib = CitationBibliography("refs.bib") using Bibliography sort_bibliography!(bib.entries, :nyt) # name-year-title ``` -------------------------------- ### Configure DocumenterCitations.jl in docs/make.jl for HTML Output Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This Julia script demonstrates a complete `docs/make.jl` configuration for a Documenter.jl project using DocumenterCitations.jl. It initializes the bibliography, sets up HTML formatting with custom assets, defines page structure, and deploys the documentation to GitHub Pages. ```julia using DocumenterCitations using Documenter using Pkg PROJECT_TOML = Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml")) VERSION = PROJECT_TOML["version"] NAME = PROJECT_TOML["name"] AUTHORS = join(PROJECT_TOML["authors"], ", ") * " and contributors" GITHUB = "https://github.com/JuliaDocs/DocumenterCitations.jl" bib = CitationBibliography( joinpath(@__DIR__, "src", "refs.bib"), style=:numeric # default ) makedocs(; authors=AUTHORS, sitename="DocumenterCitations.jl", format=Documenter.HTML( prettyurls=true, canonical="https://juliaquantumcontrol.github.io/DocumenterCitations.jl", assets=String["assets/citations.css"], footer="[$NAME.jl]($GITHUB) v$VERSION docs powered by [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl)." ), pages=[ "Home" => "index.md", "Syntax" => "syntax.md", "Citation Style Gallery" => "gallery.md", "CSS Styling" => "styling.md", "Internals" => "internals.md", "References" => "references.md" ], plugins=[bib] ) deploydocs(; repo="github.com/JuliaDocs/DocumenterCitations.jl.git") ``` -------------------------------- ### Configure DocumenterCitations Plugin in docs/make.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/README.md Instantiate the `CitationBibliography` plugin in your `docs/make.jl` file. This requires a `refs.bib` file in `docs/src` and passing the plugin object to `makedocs`'s `plugins` keyword argument. This sets up the citation processing for your documentation. ```Julia using DocumenterCitations bib = CitationBibliography(joinpath(@__DIR__, "src", "refs.bib")) makedocs(; plugins=[bib], ...) ``` -------------------------------- ### Documenter.jl Directive for DocumenterCitations.Example Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_collect_from_docstrings/src/index.md A Documenter.jl directive to include the documentation for the `DocumenterCitations.Example` object, typically used to generate API documentation from its docstrings. ```Julia @docs\nDocumenterCitations.Example ``` -------------------------------- ### Configure DocumenterCitations.jl plugin in Documenter.jl's make.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This Julia code illustrates how to integrate DocumenterCitations.jl into a Documenter.jl build script (`make.jl`). It initializes `CitationBibliography` with the path to a BibTeX file and sets the desired citation style, then passes this plugin to the `makedocs` function. ```Julia using DocumenterCitations bib = CitationBibliography( joinpath(@__DIR__, "src", "refs.bib"); style=:numeric ) makedocs(; plugins=[bib], ...) ``` -------------------------------- ### Internal `init_bibliography!` Function for Custom Styles Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Documents the internal `init_bibliography!` function, which is invoked during the `ExpandBibliography` pipeline step to initialize state for style objects or the `CitationBibliography` plugin, particularly useful for implementing stateful custom citation styles like `AlphaStyle()`. ```APIDOC init_bibliography!(style_object, bibliography_plugin_object) ``` -------------------------------- ### DocumenterCitations Pipeline Steps API Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/internals.md API reference for the three core steps of the citation pipeline: `CollectCitations` for gathering citations, `ExpandBibliography` for generating the bibliography, and `ExpandCitations` for rendering in-text citations. ```APIDOC CollectCitations ExpandBibliography ExpandCitations ``` -------------------------------- ### Configuring BibTeX for HAL Preprints Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Demonstrates how to include HAL preprint information. The Archiveprefix must be explicitly set to HAL, and the Eprint ID should include its prefix (e.g., hal-). ```BibTeX @article{SauvagePRXQ2020, author = {Sauvage, S.}, title = {HAL Preprint Example}, journal = {Journal of Examples}, year = {2020}, archiveprefix = {HAL}, eprint = {hal-02930000} } ``` -------------------------------- ### Add DocumenterCitations to Project.toml Dependencies Source: https://github.com/juliadocs/documentercitations.jl/blob/master/README.md Manually add `DocumenterCitations` to the `[deps]` section of your project's `Project.toml` file. This method is suitable for direct dependency management, especially for documentation build projects. ```TOML DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" ``` -------------------------------- ### Manually add DocumenterCitations.jl to Project.toml Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This snippet shows how to declare DocumenterCitations.jl as a dependency in a `Project.toml` file, typically found in the `docs/` directory of a project, by specifying its package UUID. ```TOML DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" ``` -------------------------------- ### DocumenterCitations Debugging Environment Variable Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/internals.md Instructions for enabling debug logging for Documenter and DocumenterCitations by setting a specific environment variable before generating documentation. ```Julia JULIA_DEBUG=Documenter,DocumenterCitations ``` -------------------------------- ### DocumenterCitations Core Plugin API Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/internals.md API reference for the main `CitationBibliography` plugin, which integrates citation management into Documenter's build process by hooking into the document pipeline. ```APIDOC CitationBibliography ``` -------------------------------- ### Generate Table of Contents for Documentation Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section2/p3_s2_page.md This snippet uses the `@contents` directive to dynamically generate a table of contents. It specifies the pages to include by constructing paths using `normpath` and `Iterators.product` for a structured set of files, along with an additional specific page. ```Julia ```@contents Pages = [ [ normpath("..", "..", "part$p", "section$s", "p$(p)_s$(s)_page.md") for (p, s) in Iterators.product((1, 2), (1, 2)) ]..., normpath("../section1/p3_s1_page.md"), ] ``` ``` -------------------------------- ### Support for `eprint` Field in BibTeX Entries Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Describes the added support for the `eprint` field in BibTeX entries, recommending its use for arXiv IDs, especially for articles with paywalled DOIs, to provide direct access to preprints. ```BibTeX @article{example, author = {Author, A.}, title = {Example Article}, journal = {Journal of Examples}, year = {2023}, eprint = {arXiv:2301.01234} } ``` -------------------------------- ### Using Multiple Bibliography Blocks in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Explains how to use multiple `@bibliography` blocks, noting that only one can be a "canonical" target for citations. Demonstrates how to combine a default block with a full block to show cited and then non-cited references consecutively. ```Markdown ```@bibliography ``` ```@bibliography * ``` ``` -------------------------------- ### DocumenterCitations Auxiliary Customization API Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/internals.md API reference for helper routines used by the default styles to implement specific formatting. These routines can be reused by custom styles for tasks like formatting labeled or author-year citations. ```APIDOC format_labeled_citation format_authoryear_citation citation_label format_labeled_bibliography_reference format_authoryear_bibliography_reference ``` -------------------------------- ### Configure Documenter.jl Table of Contents Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/index.md This snippet defines the page order for a Documenter.jl project's table of contents. It uses the `@contents` block to list markdown files, including those nested within subdirectories, ensuring a structured navigation sidebar for the documentation site. ```Julia @contents Pages = [ normpath("part1", "section1", "p1_s1_page.md"), normpath("part1", "section2", "p1_s2_page.md"), normpath("part2", "section1", "p2_s1_page.md"), normpath("part2", "section2", "p2_s2_page.md"), normpath("part3", "section1", "p3_s1_page.md"), normpath("part3", "section2", "p3_s2_page.md"), normpath("part3", "section2", "invalidpages.md"), "references.md", "addendum.md", ] ``` -------------------------------- ### Configure Documenter.HTML to Include CSS Asset Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/styling.md This Julia code snippet demonstrates how to configure `Documenter.HTML` in `docs/make.jl` to include the `citations.css` file as an asset, ensuring it is loaded with the generated documentation. The `plugins=[bib]` line is also shown for context. ```Julia makedocs(; format = Documenter.HTML( # ... assets=String["assets/citations.css"], ), plugins=[bib], # ... ) ``` -------------------------------- ### API Reference for DocumenterCitations.AlphaStyle Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md Documents the `DocumenterCitations.AlphaStyle` internal plugin, which is automatically used when `style=:alpha` is specified. ```APIDOC DocumenterCitations.AlphaStyle ``` -------------------------------- ### Supported Citation Commands in DocumenterCitations.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Lists the various `@cite` command variations available for creating different styles of in-text citations, including parenthetical, textual, and starred versions, providing flexibility in citation formatting. ```Julia @cite @citet @citep @cite* @citet* @citep* @Citet @Citep @Cite* @Citet* @Citep* ``` -------------------------------- ### Full Bibliography Block in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Illustrates the syntax to render a bibliography block that includes all references present in the .bib file, regardless of whether they are cited in the documentation. This corresponds to the pre-1.0 default behavior. ```Markdown ```@bibliography * ``` ``` -------------------------------- ### Update CitationBibliography Plugin Usage for Documenter 1.0 Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Describes the breaking change in Documenter 1.0 where `CitationBibliography` must now be passed via the `plugins` keyword argument to `makedocs` instead of as a positional argument, ensuring compatibility with the new Documenter API. ```Julia makedocs( plugins=[CitationBibliography("references.bib")], # ... other arguments ) ``` -------------------------------- ### Configuring BibTeX for BiorXiv Preprints Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Illustrates how to include BiorXiv preprint information. The Archiveprefix must be explicitly set to biorXiv, and the Eprint ID should be the final part of the DOI. ```BibTeX @article{KatrukhaNC2017, author = {Katrukha, A.}, title = {BiorXiv Preprint Example}, journal = {Journal of Examples}, year = {2022}, archiveprefix = {biorXiv}, eprint = {2022.09.09.507322} } ``` -------------------------------- ### Configure Alphabetic Citation Style Bibliography Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md Configures the bibliography to use the `:alpha` style, displaying references alphabetically with author-year labels. It includes a specific reference for demonstration. ```Julia @bibliography Pages = [@__FILE__] Style = :alpha Canonical = false SolaAAMOP2018 ``` -------------------------------- ### Generate Full Bibliography from Bib File in Markdown Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/references.md Illustrates how to include all references from an associated `.bib` file, regardless of whether they are cited, using the `@bibliography *` directive. This is useful for displaying a complete list of available references. ```markdown ```@bibliography * ``` ``` -------------------------------- ### Generate Bibliography for Documentation Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section2/p3_s2_page.md This snippet uses the `@bibliography` directive to generate a bibliography. It sets `Canonical` to `false` and specifies the pages from which to collect citations, similar to the `@contents` directive, using `joinpath` and `Iterators.product`. ```Julia ```@bibliography Canonical = false Pages = [ [ joinpath("..", "..", "part$p", "section$s", "p$(p)_s$(s)_page.md") for (p, s) in Iterators.product((1, 2), (1, 2)) ]..., "../section1/p3_s1_page.md", ] ``` ``` -------------------------------- ### Generate Bibliography with DocumenterCitations.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md This Documenter.jl block configures the bibliography generation. It specifies the source file for citations (`@__FILE__`), sets the citation style to `:keylabels`, and disables canonical linking for the bibliography entries. ```Julia @bibliography Pages = [@__FILE__] Style = :keylabels Canonical = false ``` -------------------------------- ### Configuring BibTeX for arXiv Preprints with Eprint Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Demonstrates how to include arXiv preprint information in a BibTeX entry using the Eprint field. The Archiveprefix is implicitly arXiv if not specified, unlike default BibTeX. The Primaryclass field can be added for categorization. Note that Eprinttype and Eprintclass fields are currently not supported. ```BibTeX @article{ExampleArticle, author = {Author, A.}, title = {My Awesome Paper}, journal = {Journal of Examples}, year = {2023}, eprint = {2301.00001}, primaryclass = {math.CO} } ``` -------------------------------- ### Markdown block for bibliography display in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This partial Markdown snippet indicates the syntax for embedding a bibliography or references section within a Documenter.jl page, which will be populated by DocumenterCitations.jl. ```Markdown ~~~markdown ``` -------------------------------- ### Available Citation Styles for CitationBibliography Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Documents the `style` keyword argument for `CitationBibliography`, listing the built-in options: `:numeric` (default), `:authoryear`, and `:alpha`, which allows users to customize the bibliography's appearance. ```Julia CitationBibliography(style=:numeric) CitationBibliography(style=:authoryear) CitationBibliography(style=:alpha) ``` -------------------------------- ### Adding References Section to Docstrings in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Describes the recommended method for including self-contained bibliography lists within docstrings using a "# References" section, linking to the main bibliography. Provides an alternative syntax for cases without explicit numerical citations. ```Markdown # References * [GoerzQ2022](@cite) Goerz et al. Quantum 6, 871 (2022) ``` ```Markdown * [Goerz et al. Quantum 6, 871 (2022)](@cite GoerzQ2022) ``` -------------------------------- ### DocumenterCitations LaTeX Output Customization API Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/internals.md API reference for functions to customize LaTeX output options for citations and bibliographies, allowing control over the generated LaTeX. ```APIDOC set_latex_options reset_latex_options ``` -------------------------------- ### Default Bibliography Block in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Shows the syntax for rendering a bibliography block that includes all references cited throughout the entire documentation. Notes that as of version 1.0, it will not include entries present in the .bib file but not cited. ```Markdown ```@bibliography ``` ``` -------------------------------- ### Generate Cited Bibliography in Markdown Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/references.md Demonstrates how to include a bibliography of only cited references in documentation using the `@bibliography` directive without any arguments. This directive automatically lists references that have been cited within the document. ```markdown ```@bibliography ``` ``` -------------------------------- ### Insert Bibliography Block in Documentation Markdown Source: https://github.com/juliadocs/documentercitations.jl/blob/master/README.md Include this Markdown block in your documentation where you want the bibliography to appear. It will automatically expand into a list of all cited references. ```Markdown ```@bibliography ``` ``` -------------------------------- ### Mix Existing and Nonexisting Page References in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section2/invalidpages.md Shows how `@bibliography` handles a mix of existing and non-existing or differently located pages. In this specific case, only references from `p3_s2_page.md` are expected to render, as `p3_s1_page.md` exists in a different folder and might not be correctly resolved. ```Documenter.jl @bibliography Canonical = false Pages = [ "p3_s1_page.md", "p3_s2_page.md", ] ``` -------------------------------- ### Load Custom Citation Style in Julia Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md This Julia snippet demonstrates how to load a custom citation style file (`keylabels.jl`) into a Markdown document using `Markdown.parse`. It checks if the file exists before attempting to read and embed its content, ensuring the style is applied to the documentation. ```Julia using Markdown custom_style = joinpath(@__DIR__, "..", "custom_styles", "keylabels.jl") if isfile(custom_style) Markdown.parse(""" $(read(custom_style, String)) """) end ``` -------------------------------- ### Handle References from Pages with No References in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section2/invalidpages.md Illustrates the `@bibliography` behavior when `Pages` points to files that exist but contain no references. The expectation is that nothing should render from such pages, as there are no citations to display. ```Documenter.jl @bibliography Canonical = false Pages = [ "../../addendum.md", ] ``` -------------------------------- ### Handle Non-List Input for Pages in Documenter.jl Bibliography Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section2/invalidpages.md Demonstrates the behavior of `@bibliography` when the `Pages` argument is not provided as a list of strings, but rather as a single value like `@__FILE__`. This tests the robustness of the bibliography block's input parsing. ```Documenter.jl @bibliography Canonical = false Pages = @__FILE__ ``` -------------------------------- ### Documenter.jl Bibliography with Non-Existing Key Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_undefined_citations/src/references.md This snippet demonstrates a Documenter.jl bibliography block that includes a key, `NoExistInBibliography2023`, which is noted as non-existing and non-cited in the accompanying text. This highlights how Documenter.jl processes bibliography entries, even those that might not resolve to actual references. ```Documenter.jl @bibliography Pages = [] NoExistInBibliography2023 ``` -------------------------------- ### Add Notes to Citations in DocumenterCitations.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Demonstrates the syntax for including custom notes within citations, allowing for additional context or specific references like equation numbers directly within the citation text. ```Julia See Ref. [GoerzQ2022; Eq. (1)](@cite) ``` -------------------------------- ### LaTeX Customization for Alphabetic Style Indent Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md Provides a LaTeX snippet discussing how to adjust hanging indent and label width parameters (`dl_hangindent`, `dl_labelwidth`) using `DocumenterCitations.set_latex_options` to improve the appearance of `:alpha` style references in LaTeX output. ```LaTeX Compared to the HTML version of the documentation, the hanging indent in the above list of references is too small for the longer labels of the \texttt{:alpha} style. This can be remedied by adjusting the \texttt{dl\_hangindent} and \texttt{dl\_labelwidth} parameters with \hyperlinkref{sec:customizing_latex_output}{\texttt{DocumenterCitations.set\_latex\_options}}. ``` -------------------------------- ### Handle References from Nonexisting Pages in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section2/invalidpages.md Demonstrates the behavior of `@bibliography` when `Pages` includes non-existent files or files that are not valid in a specific Documenter.jl version. Expects nothing to render, with a potential fallback in newer versions (e.g., 1.3.1). ```Documenter.jl @bibliography Canonical = false Pages = [ "index.md", # not valid in 1.3, valid in 1.3.1 (fallback) "p3_s1_page.md", "noexist.md", ] ``` -------------------------------- ### New `AlphaStyle()` for Unique Citation Labels Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Introduces the `AlphaStyle()` object, which generates unique citation labels. While it can be instantiated directly, the `:alpha` symbol style is automatically upgraded to use this internal style for consistent and unique referencing. ```Julia AlphaStyle() ``` -------------------------------- ### Support for `note` Field in BibTeX Entries Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Documents the added support for the `note` field in BibTeX entries, allowing for additional textual information or comments to be included with a reference. ```BibTeX @misc{example_misc, author = {Author, B.}, title = {Miscellaneous Work}, year = {2022}, note = {Presented at the conference on XYZ} } ``` -------------------------------- ### Insert Bibliography Block in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This directive is used within Documenter.jl markdown files to insert the bibliography for all cited references in the project. It acts as a placeholder that DocumenterCitations.jl processes to render the bibliography. ```Documenter Directive `@bibliography ` ``` -------------------------------- ### Cite References in Documenter.jl Markdown Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This syntax demonstrates how to insert a citation within Documenter.jl markdown pages or docstrings. The `(@cite)` directive processes the BibTeX key (e.g., `GoerzQ2022`) to render the citation according to the configured bibliography style, linking to the bibliography section. ```Documenter Markdown [GoerzQ2022](@cite) ``` -------------------------------- ### DocumenterCitations Custom Style API Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/internals.md API reference for functions used to customize citation and bibliography formatting, including methods for defining custom styles and managing bibliography labels and references. Custom styles can specialize on `Val` types or custom objects. ```APIDOC bib_html_list_style bib_sorting format_bibliography_label format_bibliography_reference format_citation init_bibliography! ``` -------------------------------- ### Insert In-line Citations in Documentation Markdown Source: https://github.com/juliadocs/documentercitations.jl/blob/master/README.md Use this Markdown syntax to insert an in-line citation anywhere in your documentation or docstrings. The `(@cite)` directive links to the full reference in the generated bibliography. ```Markdown [GoerzQ2022](@cite) ``` -------------------------------- ### DocumenterCitations Citation Link Data Structures API Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/internals.md API reference for the internal data structures representing different types of citation links, including the standard `CitationLink` and `DirectCitationLink` for direct references. ```APIDOC DocumenterCitations.CitationLink DocumenterCitations.DirectCitationLink ``` -------------------------------- ### Generate Table of Contents with Specific Pages (Documenter.jl) Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part2/section1/p2_s1_page.md This snippet demonstrates how to use the `@contents` block in Documenter.jl to generate a table of contents. It specifies a list of Markdown files from which to build the table of contents, including files from different parts of the documentation. Note that `@__FILE__` is not supported within the `Pages` array for `@contents`. ```Julia @contents Pages = [ "p2_s1_page.md", # @__FILE__ is not supported normpath("../../part1/section1/p1_s1_page.md"), normpath("../../part1/section2/p1_s2_page.md"), ] ``` -------------------------------- ### Adjust LaTeX Output for DocumenterCitations.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md This raw LaTeX block provides guidance for customizing the LaTeX output of DocumenterCitations.jl. It advises adjusting `dl_hangindent` and `dl_labelwidth` parameters using `DocumenterCitations.set_latex_options` to ensure the hanging indent of bibliography entries matches the HTML version. ```LaTeX As with the \texttt{:alpha} style, for \LaTeX{} output, the \texttt{dl\_hangindent} and \texttt{dl\_labelwidth} parameters should be adjusted with \hyperlinkref{sec:customizing_latex_output}{\texttt{DocumenterCitations.set\_latex\_options}} to obtain a more suitable hanging indent that matches the HTML version of this documentation. ``` -------------------------------- ### Julia Documenter Bibliography Directive Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_collect_from_docstrings/src/references.md This directive is used within Documenter.jl to automatically generate and display a bibliography or list of references. It typically pulls citation data from a BibTeX file or similar source configured in the Documenter build process, allowing for dynamic and consistent reference management. ```Julia @bibliography ``` -------------------------------- ### Configure Enumerated Author-Year Custom Style Bibliography Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md Configures the bibliography to use a custom `:enumauthoryear` style, which renders citations like `:authoryear` but displays references as an enumerated list. ```Julia @bibliography Pages = [@__FILE__] Style = :enumauthoryear Canonical = false ``` -------------------------------- ### Configure CitationBibliography Style in DocumenterCitations.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md Explains how to explicitly set the citation style for `CitationBibliography`, specifically how to revert to the pre-1.0 default of `:authoryear` after the default changed to `:numeric`. ```Julia CitationBibliography(style=:authoryear) ``` -------------------------------- ### Documenter.jl Bibliography Block Configuration Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part1/section1/p1_s1_page.md Configures a bibliography block in Documenter.jl, allowing specification of pages and canonical status. This snippet shows how to use `Canonical` and `Pages` attributes to control the bibliography's output. ```Documenter.jl @bibliography Canonical = false Pages = ["p1_s1_page.md"] ``` -------------------------------- ### Generate Bibliography with Specific Pages (Documenter.jl) Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part2/section1/p2_s1_page.md This snippet shows how to use the `@bibliography` block in Documenter.jl to generate a bibliography. It specifies `Canonical = false` and lists Markdown files from which to collect citations. Unlike `@contents`, `@bibliography` supports `@__FILE__` within its `Pages` array and does not require `normpath` for relative paths. ```Julia @bibliography Canonical = false Pages = [ @__FILE__, # In the @bibliography block, we can use `@__FILE` # Note that `@bibliography` (unlike `@contents`) doesn't need `normpath`. "../../part1/section1/p1_s1_page.md", "../../part1/section2/p1_s2_page.md", ] ``` -------------------------------- ### Filter Documenter.jl bibliography by page Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md This snippet demonstrates how to create a secondary `@bibliography` block that renders references only for citations found on specified pages. By setting `Canonical = false`, the block does not serve as a primary link target, allowing multiple bibliographies. The `Pages` field accepts a list of relative `.md` file paths, with `@__FILE__` referring to the current file. ```markdown ```@bibliography Pages = ["index.md"] Canonical = false ``` ``` -------------------------------- ### Configure Numeric Citation Style Bibliography in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md This snippet demonstrates how to configure a bibliography block to use the numeric citation style in Documenter.jl. It specifies that citations should be drawn from the current file and sets the style to `:numeric`. ```Julia @bibliography Pages = [@__FILE__] Style = :numeric Canonical = false ``` -------------------------------- ### Configure Documenter.jl Bibliography Pages Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/references.md This snippet uses the `@bibliography` directive from Documenter.jl to explicitly list the Markdown pages whose citations should be collected and included in the generated bibliography. It ensures that only references from these specified pages contribute to the bibliography. ```Julia @bibliography Pages = [ "index.md", "part1/section1/p1_s1_page.md", "part1/section2/p1_s2_page.md", "part2/section1/p2_s1_page.md", "part2/section2/p2_s2_page.md", "part3/section1/p3_s1_page.md", "part3/section2/p3_s2_page.md", ] ``` -------------------------------- ### BibTeX Entry for arXiv-Only Documents Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/syntax.md Shows how to cite documents available exclusively as arXiv eprints. The arXiv ID is placed in the Journal field, and a corresponding DOI (e.g., 10.48550/ARXIV.ID) is used in the Doi field, without an Eprint field. ```BibTeX @article{Wilhelm2003.10132, author = {Wilhelm, W.}, title = {A Title for an arXiv-only Paper}, journal = {arXiv:2003.10132}, doi = {10.48550/ARXIV.2003.10132}, year = {2020} } ``` -------------------------------- ### Configure Table of Contents for Specific Pages in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section1/p3_s1_page.md This snippet configures a table of contents to include content from specified pages in earlier parts of the documentation. It uses the `normpath` function to ensure correct, platform-independent file paths for the included pages. ```Julia @contents Pages = [ normpath("../../part1/section1/p1_s1_page.md"), normpath("../../part1/section2/p1_s2_page.md"), normpath("../../part2/section1/p2_s1_page.md"), normpath("../../part2/section2/p2_s2_page.md"), ] ``` -------------------------------- ### Documenter.jl Bibliography with Specific Cited Keys Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_undefined_citations/src/references.md This snippet defines a bibliography block in Documenter.jl, explicitly listing several cited keys. The `Pages` option is empty, indicating no page-specific filtering. This block is used to render a list of references in the documentation. ```Documenter.jl @bibliography Pages = [ ] GoerzQ2022 BrumerShapiro2003 BrifNJP2010 SolaAAMOP2018 Wilhelm2003.10132 KochEPJQT2022 ``` -------------------------------- ### Generate Bibliography for Specific Pages in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part3/section1/p3_s1_page.md This snippet generates a bibliography based on references found within a list of specified pages from earlier parts of the documentation. The `Canonical = false` setting indicates that canonical links for the bibliography entries will not be generated. ```Julia @bibliography Canonical = false Pages = [ "../../part1/section1/p1_s1_page.md", "../../part1/section2/p1_s2_page.md", "../../part2/section1/p2_s1_page.md", "../../part2/section2/p2_s2_page.md", ] ``` -------------------------------- ### API Change: `format_citation` Function Signature Update Source: https://github.com/juliadocs/documentercitations.jl/blob/master/NEWS.md This snippet details the breaking API change for the `format_citation` function in DocumenterCitations.jl. It shows the previous and new function signatures, explaining how the parameters and return value have changed, and its impact on custom citation styles. The function now returns markdown code for the entire citation link, converting indirect links to direct ones. ```APIDOC Function: format_citation Previous Signature: format_citation(style, entry, citations; note, cite_cmd, capitalize, starred) Returns: A string that would replace the link text of the citation link. New Signature: format_citation(style, cit, entries, citations) cit: A CitationLink object. Returns: A string of markdown code that replaces the *entire* citation link. This markdown code is expected to contain direct citation links (DirectCitationLink) which are automatically expanded subsequently. Generally, this converts indirect citation links (CitationLink) into direct citation links (DirectCitationLink). ``` -------------------------------- ### Documenter.jl Contents Block Configuration Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part1/section1/p1_s1_page.md Configures a table of contents block in Documenter.jl, specifying which pages to include. This snippet demonstrates how to use the `Pages` attribute to filter content for the table of contents. ```Documenter.jl @contents Pages = ["p1_s1_page.md"] ``` -------------------------------- ### Configure Author-Year Citation Style Bibliography in Documenter.jl Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/gallery.md This snippet shows how to configure a bibliography block to use the author-year citation style in Documenter.jl. It specifies that citations should be drawn from the current file and sets the style to `:authoryear`. ```Julia @bibliography Pages = [@__FILE__] Style = :authoryear Canonical = false ``` -------------------------------- ### Insert Page-Specific Bibliography Block Source: https://github.com/juliadocs/documentercitations.jl/blob/master/docs/src/index.md This directive inserts a bibliography that is filtered to show only references cited on specific pages, in this case, 'index.md'. The `Canonical = false` option prevents the generation of canonical URLs for these specific bibliography entries. ```Documenter Directive `@bibliography Pages = ["index.md"] Canonical = false ` ``` -------------------------------- ### Generate Table of Contents for Current File (Documenter.jl) Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part1/section2/p1_s2_page.md This snippet uses the `@contents` directive in Documenter.jl to generate a table of contents for the current file. The `Pages = [@__FILE__]` argument specifies that the table of contents should only include headings from the file where this directive is placed. It notes that `@__FILE__` is not fully supported for `@contents`. ```Julia @contents Pages = [@__FILE__] ``` -------------------------------- ### Generate Bibliography for Current File (Documenter.jl) Source: https://github.com/juliadocs/documentercitations.jl/blob/master/test/test_bibliography_block_pages/src/part1/section2/p1_s2_page.md This snippet uses the `@bibliography` directive in Documenter.jl to generate a bibliography section. `Canonical = false` indicates that the bibliography should not be canonical, and `Pages = [@__FILE__]` restricts the bibliography to citations found within the current file. Comments are supported within the directive block. ```Julia @bibliography Canonical = false Pages = [@__FILE__] # We can have comments! ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.