{"route":"/en-US-v0.13.1/reference/model/document/","title":"Document","description":"Documentation for the `document` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-title","name":"title","children":[]},{"id":"parameters-author","name":"author","children":[]},{"id":"parameters-description","name":"description","children":[]},{"id":"parameters-keywords","name":"keywords","children":[]},{"id":"parameters-date","name":"date","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"document","title":"Document","keywords":[],"oneliner":"The root element of a document and its metadata.","element":true,"contextual":false,"deprecation":null,"details":"<p>The root element of a document and its metadata.</p>\n<p>All documents are automatically wrapped in a <code>document</code> element. You cannot\ncreate a document element yourself. This function is only used with\n<a href=\"/en-US-v0.13.1/reference/styling/#set-rules\">set rules</a> to specify document metadata. Such a set\nrule must not occur inside of any layout container.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">document</span><span class=\"typ-punct\">(</span>title<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">[</span>Hello<span class=\"typ-punct\">]</span><span class=\"typ-punct\">)</span>\n\nThis has no visible output, but\nembeds metadata into the PDF!\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/83e478c245ceb459ebe50983447ca754.png\" alt=\"Preview\"></div></div>\n<p>Note that metadata set with this function is not rendered within the\ndocument. Instead, it is embedded in the compiled PDF file.</p>","example":null,"self":false,"params":[{"name":"title","details":"<p>The document's title. This is often rendered as the title of the\nPDF viewer window.</p>\n<p>While this can be arbitrary content, PDF viewers only support plain text\ntitles, so the conversion might be lossy.</p>","example":null,"types":["none","content"],"strings":[],"default":"<code><span class=\"typ-key\">none</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"author","details":"<p>The document's authors.</p>","example":null,"types":["str","array"],"strings":[],"default":"<code><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"description","details":"<p>The document's description.</p>","example":null,"types":["none","content"],"strings":[],"default":"<code><span class=\"typ-key\">none</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"keywords","details":"<p>The document's keywords.</p>","example":null,"types":["str","array"],"strings":[],"default":"<code><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"date","details":"<p>The document's creation date.</p>\n<p>If this is <code><span class=\"typ-key\">auto</span></code> (default), Typst uses the current date and time.\nSetting it to <code><span class=\"typ-key\">none</span></code> prevents Typst from embedding any creation date\ninto the PDF metadata.</p>\n<p>The year component must be at least zero in order to be embedded into a\nPDF.</p>\n<p>If you want to create byte-by-byte reproducible PDFs, set this to\nsomething other than <code><span class=\"typ-key\">auto</span></code>.</p>","example":null,"types":["none","auto","datetime"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[]}}}