Weave.jl/dev/publish/index.html

10 lines
8.7 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Publishing to HTML and PDF · Weave.jl</title><link rel="canonical" href="http://weavejl.mpastell.com/stable/publish/"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit">Weave.jl</span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Weave.jl - Scientific Reports Using Julia</a></li><li><a class="tocitem" href="../getting_started/">Getting started</a></li><li><a class="tocitem" href="../usage/">Using Weave</a></li><li class="is-active"><a class="tocitem" href>Publishing to HTML and PDF</a><ul class="internal"><li><a class="tocitem" href="#Templates"><span>Templates</span></a></li><li><a class="tocitem" href="#Supported-Markdown-syntax"><span>Supported Markdown syntax</span></a></li></ul></li><li><a class="tocitem" href="../chunk_options/">Chunk Options</a></li><li><a class="tocitem" href="../header/">Header Configuration</a></li><li><a class="tocitem" href="../notebooks/">Working with Jupyter notebooks</a></li><li><a class="tocitem" href="../function_index/">Function index</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Publishing to HTML and PDF</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Publishing to HTML and PDF</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JunoLab/Weave.jl/blob/master/doc/src/publish.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Publishing-to-HTML-and-PDF"><a class="docs-heading-anchor" href="#Publishing-to-HTML-and-PDF">Publishing to HTML and PDF</a><a id="Publishing-to-HTML-and-PDF-1"></a><a class="docs-heading-anchor-permalink" href="#Publishing-to-HTML-and-PDF" title="Permalink"></a></h1><p>You can also publish any supported input format to HTML and PDF documents.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Producing PDF output requires that you have XeLaTex installed and in your path.</p></div></div><p>You can use a YAML header in the beginning of the input document delimited with <code>---</code> to set the document title, author and date, e.g.:</p><pre><code class="language-none">---
title : Weave example
author : Matti Pastell
date: 15th December 2016
---</code></pre><p>Here are sample input and outputs:</p><ul><li>input (Julia markdown format): <a href="../examples/FIR_design_plots.jl"><code>FIR_design_plots.jl</code></a> (its path is bound to <code>Weave.SAMPLE_JL_DOC</code>)</li><li>HTML output: <a href="../examples/FIR_design_plots.html"><code>FIR_design_plots.html</code></a></li><li>PDF output: <a href="../examples/FIR_design_plots.pdf"><code>FIR_design_plots.pdf</code></a></li></ul><p>They are generated as follows:</p><pre><code class="language-julia">weave(Weave.SAMPLE_JL_DOC)) # default to md2html output format
weave(Weave.SAMPLE_JL_DOC; doctype = &quot;md2pdf&quot;)</code></pre><div class="admonition is-category-tips"><header class="admonition-header">Tips</header><div class="admonition-body"><p><code>Weave.SAMPLE_JL_DOC</code> is the path of <a href="../examples/FIR_design.jl">FIR_design.jl</a>.</p></div></div><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p><code>&quot;md2html&quot;</code> and <code>&quot;md2pdf&quot;</code> assume Julia markdown format as an input, while <code>pandoc2pdf</code> and <code>pandoc2html</code> assume Noweb input format (i.e. Pandoc markdown).</p></div></div><h2 id="Templates"><a class="docs-heading-anchor" href="#Templates">Templates</a><a id="Templates-1"></a><a class="docs-heading-anchor-permalink" href="#Templates" title="Permalink"></a></h2><p>You can use a custom template with <code>md2html</code> and <code>md2pdf</code> formats with <code>template</code> keyword option, e.g.: <code>weave(&quot;FIR_design_plots.jl&quot;, template = &quot;custom.tpl&quot;</code>.</p><p>As starting point, you can use the existing templates:</p><ul><li>HTML (<code>md2html</code>): <a href="https://github.com/JunoLab/Weave.jl/blob/master/templates/md2html.tpl"><code>md2html.tpl</code></a></li><li>LaTex (<code>md2pdf</code>): <a href="https://github.com/JunoLab/Weave.jl/blob/master/templates/md2pdf.tpl"><code>md2pdf.tpl</code></a></li></ul><p>Templates are rendered using <a href="https://github.com/jverzani/Mustache.jl">Mustache.jl</a>.</p><h2 id="Supported-Markdown-syntax"><a class="docs-heading-anchor" href="#Supported-Markdown-syntax">Supported Markdown syntax</a><a id="Supported-Markdown-syntax-1"></a><a class="docs-heading-anchor-permalink" href="#Supported-Markdown-syntax" title="Permalink"></a></h2><p>The markdown variant used by Weave is <a href="https://docs.julialang.org/en/v1/stdlib/Markdown/#">Julia markdown</a>. In addition Weave supports few additional Markdown features:</p><h3 id="Comments"><a class="docs-heading-anchor" href="#Comments">Comments</a><a id="Comments-1"></a><a class="docs-heading-anchor-permalink" href="#Comments" title="Permalink"></a></h3><p>You can add comments using html syntax: <code>&lt;!-- --&gt;</code></p><h3 id="Multiline-equations"><a class="docs-heading-anchor" href="#Multiline-equations">Multiline equations</a><a id="Multiline-equations-1"></a><a class="docs-heading-anchor-permalink" href="#Multiline-equations" title="Permalink"></a></h3><p>You can add multiline equations using:</p><pre><code class="language-none">$$
x^2 = x*x
$$</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../usage/">« Using Weave</a><a class="docs-footer-nextpage" href="../chunk_options/">Chunk Options »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Tuesday 1 June 2021 07:58">Tuesday 1 June 2021</span>. Using Julia version 1.5.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>