<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Header Configuration · Weave.jl</title><linkrel="canonical"href="http://weavejl.mpastell.com/stable/header/"/><linkhref="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><scriptsrc="../siteinfo.js"></script><scriptsrc="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><scriptsrc="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><divclass="docs-package-name"><spanclass="docs-autofit">Weave.jl</span></div><formclass="docs-search"action="../search/"><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Weave.jl - Scientific Reports Using Julia</a></li><li><aclass="tocitem"href="../getting_started/">Getting started</a></li><li><aclass="tocitem"href="../usage/">Using Weave</a></li><li><aclass="tocitem"href="../publish/">Publishing to HTML and PDF</a></li><li><aclass="tocitem"href="../chunk_options/">Chunk Options</a></li><liclass="is-active"><aclass="tocitem"href>Header Configuration</a><ulclass="internal"><li><aclass="tocitem"href="#Document-Metadata"><span>Document Metadata</span></a></li><li><aclass="tocitem"href="#Configuration-Options"><span>Configuration Options</span></a></li><li><aclass="tocitem"href="#Format-Specific-Options"><span>Format Specific Options</span></a></li></ul></li><li><aclass="tocitem"href="../notebooks/">Working with Jupyter notebooks</a></li><li><aclass="tocitem"href="../function_index/">Function index</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><liclass="is-active"><ahref>Header Configuration</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Header Configuration</a></li></ul></nav><divclass="docs-right"><aclass="docs-edit-link"href="https://github.com/JunoLab/Weave.jl/blob/master/doc/src/header.md"title="Edit on GitHub"><spanclass="docs-icon fab"></span><spanclass="docs-label is-hidden-touch">Edit on GitHub</span></a><aclass="docs-settings-button fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><articleclass="content"id="documenter-page"><h1id="Header-Configuration"><aclass="docs-heading-anchor"href="#Header-Configuration">Header Configuration</a><aid="Header-Configuration-1"></a><aclass="docs-heading-anchor-permalink"href="#Header-Configuration"title="Permalink"></a></h1><p>When <code>weave</code>ing a markdown document, you use YAML header to provide additi
title : Header Example
author : Shuhei Kadowaki
date: 16th May 2020
---</code></pre><divclass="admonition is-info"><headerclass="admonition-header">Note</header><divclass="admonition-body"><p>You can also have other metadata, but they won't appear in the resulting HTML and PDF. If you weave to Julia markdown to GitHub/Hugo markdown, all the metadata will be preserved.</p></div></div><h3id="Dynamic-Metadata"><aclass="docs-heading-anchor"href="#Dynamic-Metadata">Dynamic Metadata</a><aid="Dynamic-Metadata-1"></a><aclass="docs-heading-anchor-permalink"href="#Dynamic-Metadata"title="Permalink"></a></h3><p>The metadata can be given "dynamically"; if you have <ahref="../usage/#inline-code">inline code</a> within YAML header, they will be evaluated <em>after</em> evaluating all the chunks and replaced with the results.</p><p>The example document below will set <code>date</code> metadata dynamically. Note that <code>Date</code> is available since the chunk is evaluated first.</p><pre><codeclass="language-md"> ---
title : Header Example
author : Shuhei Kadowaki
date: `j import Dates; Dates.Date(Dates.now())`
---
```julia; echo = false
using Dates
```</code></pre><h2id="Configuration-Options"><aclass="docs-heading-anchor"href="#Configuration-Options">Configuration Options</a><aid="Configuration-Options-1"></a><aclass="docs-heading-anchor-permalink"href="#Configuration-Options"title="Permalink"></a></h2><p>Each of keyword arguments of <ahref="../usage/#Weave.weave"><code>weave</code></a> can be set in the YAML header under <code>options</code> field. You can also set <ahref="@ref">Chunks Options</a> there that will be applied globally.</p><p>The example below sets <code>out_path</code> and <code>doctype</code> options and overwrites <code>term</code> and <code>wrap</code> chunk options:</p><pre><codeclass="language-yaml">---
title : Header Example
author : Shuhei Kadowaki
date: 16th May 2020
weave_options:
out_path: relative/path/to/this/document
doctype: github
term: true
wrap: false
---</code></pre><divclass="admonition is-info"><headerclass="admonition-header">Note</header><divclass="admonition-body"><ul><li>configurations specified within the YAML header have higher precedence than those specified via <code>weave</code> keyword arguments</li><li>chunk options specified within each chunk have higher precedence than the global global chunk options specified within the YAML header</li></ul></div></div><divclass="admonition is-warning"><headerclass="admonition-header">Warning</header><divclass="admonition-body"><p>As opposed to metadata, <em>most</em> of those configuration options can't be given dynamically (i.e. can't be via inline code), since they are needed for evaluation of chunks themselves. But some configuration options that are needed "formatting" document can still be given dynamically:</p><ul><li><code>template</code></li><li><code>css</code></li><li><code>highlight_theme</code></li><li><code>pandoc_options</code></li><li><code>latex_cmd</code></li><li><code>keep_unicode</code></li></ul><p>See also: <ahref="../usage/#Weave.weave"><code>weave</code></a></p></div></div><h2id="Format-Specific-Options"><aclass="docs-heading-anchor"href="#Format-Specific-Options">Format Specific Options</a><aid="Format-Specific-Options-1"></a><aclass="docs-heading-anchor-permalink"href="#Format-Specific-Options"title="Permalink"></a></h2><p>The header configurations can be format specific. Here is how to set different <code>out_path</code> for <code>md2html</code> and <code>md2pdf</code> and set <code>fig_ext</code> globally:</p><pre><codeclass="language-yaml">---
---</code></pre></article><navclass="docs-footer"><aclass="docs-footer-prevpage"href="../chunk_options/">« Chunk Options</a><aclass="docs-footer-nextpage"href="../notebooks/">Working with Jupyter notebooks »</a><divclass="flexbox-break"></div><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <spanclass="colophon-date"title="Wednesday 30 September 2020 09:30">Wednesday 30 September 2020</span>. Using Julia version 1.5.2.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></html>