{"route":"/en-US-v0.13.1/tutorial/advanced-styling/","title":"Advanced Styling","description":"Typst's tutorial.","part":null,"outline":[{"id":"guidelines","name":"Guidelines","children":[]},{"id":"set-rules","name":"Set Rules","children":[]},{"id":"title-and-abstract","name":"Title And Abstract","children":[]},{"id":"columns-and-headings","name":"Columns And Headings","children":[]},{"id":"review","name":"Review","children":[]}],"body":{"kind":"html","content":"<h1>Advanced Styling</h1>\n<p>In the previous two chapters of this tutorial, you have learned how to write a\ndocument in Typst and how to change its formatting. The report you wrote\nthroughout the last two chapters got a straight A and your supervisor wants to\nbase a conference paper on it! The report will of course have to comply with the\nconference's style guide. Let's see how we can achieve that.</p>\n<p>Before we start, let's create a team, invite your supervisor and add them to the\nteam. You can do this by going back to the app dashboard with the back icon in\nthe top left corner of the editor. Then, choose the plus icon in the left\ntoolbar and create a team. Finally, click on the new team and go to its settings\nby clicking 'manage team' next to the team name. Now you can invite your\nsupervisor by email.</p>\n<p><img src=\"/en-US-v0.13.1/assets/3-advanced-team-settings.png\" alt=\"The team settings\" /></p>\n<p>Next, move your project into the team: Open it, going to its settings by\nchoosing the gear icon in the left toolbar and selecting your new team from the\nowners dropdown. Don't forget to save your changes!</p>\n<p>Now, your supervisor can also edit the project and you can both see the changes\nin real time. You can join our <a href=\"https://discord.gg/2uDybryKPe\">Discord server</a>\nto find other users and try teams with them!</p>\n<h2 id=\"guidelines\">The conference guidelines</h2>\n<p>The layout guidelines are available on the conference website. Let's take a look\nat them:</p>\n<ul>\n<li>The font should be an 11pt serif font</li>\n<li>The title should be in 17pt and bold</li>\n<li>The paper contains a single-column abstract and two-column main text</li>\n<li>The abstract should be centered</li>\n<li>The main text should be justified</li>\n<li>First level section headings should be 13pt, centered, and rendered in small\ncapitals</li>\n<li>Second level headings are run-ins, italicized and have the same size as the\nbody text</li>\n<li>Finally, the pages should be US letter sized, numbered in the center of the\nfooter and the top right corner of each page should contain the title of the\npaper</li>\n</ul>\n<p>We already know how to do many of these things, but for some of them, we'll need\nto learn some new tricks.</p>\n<h2 id=\"set-rules\">Writing the right set rules</h2>\n<p>Let's start by writing some set rules for the document.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">page</span><span class=\"typ-punct\">(</span>\n  paper<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;us-letter&quot;</span><span class=\"typ-punct\">,</span>\n  header<span class=\"typ-punct\">:</span> <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>right<span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n    A fluid dynamic model for\n    glacier flow\n  <span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n  numbering<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;1&quot;</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">par</span><span class=\"typ-punct\">(</span>justify<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>\n  font<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;Libertinus Serif&quot;</span><span class=\"typ-punct\">,</span>\n  size<span class=\"typ-punct\">:</span> <span class=\"typ-num\">11pt</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">600</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/a7a56d8f5a1c913233b1c4b06b9fe47b.png\" alt=\"Preview\"></div></div>\n<p>You are already familiar with most of what is going on here. We set the text\nsize to <code><span class=\"typ-num\">11pt</span></code> and the font to Libertinus Serif. We also enable paragraph\njustification and set the page size to US letter.</p>\n<p>The <code>header</code> argument is new: With it, we can provide content to fill the top\nmargin of every page. In the header, we specify our paper's title as requested\nby the conference style guide. We use the <code>align</code> function to align the text to\nthe right.</p>\n<p>Last but not least is the <code>numbering</code> argument. Here, we can provide a\n<a href=\"/en-US-v0.13.1/reference/model/numbering/\">numbering pattern</a> that defines how to number the pages. By\nsetting into to <code><span class=\"typ-str\">&quot;1&quot;</span></code>, Typst only displays the bare page number. Setting it to\n<code><span class=\"typ-str\">&quot;(1/1)&quot;</span></code> would have displayed the current page and total number of pages\nsurrounded by parentheses. And we could even have provided a completely custom\nfunction here to format things to our liking.</p>\n<h2 id=\"title-and-abstract\">Creating a title and abstract</h2>\n<p>Now, let's add a title and an abstract. We'll start with the title. We center\nalign it and increase its font weight by enclosing it in <code><span class=\"typ-strong\">*stars*</span></code>.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">,</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">17pt</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n  <span class=\"typ-strong\">*A fluid dynamic model\n  for glacier flow*</span>\n<span class=\"typ-punct\">]</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/11890cc3d000c075a40eaac66e590a06.png\" alt=\"Preview\"></div></div>\n<p>This looks right. We used the <code>text</code> function to override the previous text\nset rule locally, increasing the size to 17pt for the function's argument. Let's\nalso add the author list: Since we are writing this paper together with our\nsupervisor, we'll add our own and their name.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">grid</span><span class=\"typ-punct\">(</span>\n  columns<span class=\"typ-punct\">:</span> <span class=\"typ-punct\">(</span><span class=\"typ-num\">1fr</span><span class=\"typ-punct\">,</span> <span class=\"typ-num\">1fr</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n    Therese Tungsten <span class=\"typ-escape\">\\</span>\n    Artos Institute <span class=\"typ-escape\">\\</span>\n    <span class=\"typ-func\">#</span><span class=\"typ-func\">link</span><span class=\"typ-punct\">(</span><span class=\"typ-str\">&quot;mailto:tung@artos.edu&quot;</span><span class=\"typ-punct\">)</span>\n  <span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n    Dr. John Doe <span class=\"typ-escape\">\\</span>\n    Artos Institute <span class=\"typ-escape\">\\</span>\n    <span class=\"typ-func\">#</span><span class=\"typ-func\">link</span><span class=\"typ-punct\">(</span><span class=\"typ-str\">&quot;mailto:doe@artos.edu&quot;</span><span class=\"typ-punct\">)</span>\n  <span class=\"typ-punct\">]</span>\n<span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/23097fdcb4fb8a35fa75ca4bef560e58.png\" alt=\"Preview\"></div></div>\n<p>The two author blocks are laid out next to each other. We use the <a href=\"/en-US-v0.13.1/reference/layout/grid/\" title=\"`grid`\"><code>grid</code></a>\nfunction to create this layout. With a grid, we can control exactly how large\neach column is and which content goes into which cell. The <code>columns</code> argument\ntakes an array of <a href=\"/en-US-v0.13.1/reference/layout/relative/\">relative lengths</a> or <a href=\"/en-US-v0.13.1/reference/layout/fraction/\">fractions</a>. In\nthis case, we passed it two equal fractional sizes, telling it to split the\navailable space into two equal columns. We then passed two content arguments to\nthe grid function. The first with our own details, and the second with our\nsupervisors'. We again use the <code>align</code> function to center the content within the\ncolumn. The grid takes an arbitrary number of content arguments specifying the\ncells. Rows are added automatically, but they can also be manually sized with\nthe <code>rows</code> argument.</p>\n<p>Now, let's add the abstract. Remember that the conference wants the abstract to\nbe set ragged and centered.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-escape\">...</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n  <span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">par</span><span class=\"typ-punct\">(</span>justify<span class=\"typ-punct\">:</span> <span class=\"typ-key\">false</span><span class=\"typ-punct\">)</span>\n  <span class=\"typ-strong\">*Abstract*</span> <span class=\"typ-escape\">\\</span>\n  <span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">80</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/e0876b5537aaf3aadb82f07e44da20ea.png\" alt=\"Preview\"></div></div>\n<p>Well done! One notable thing is that we used a set rule within the content\nargument of <code>align</code> to turn off justification for the abstract. This does not\naffect the remainder of the document even though it was specified after the\nfirst set rule because content blocks <em>scope</em> styling. Anything set within a\ncontent block will only affect the content within that block.</p>\n<p>Another tweak could be to save the paper title in a variable, so that we do not\nhave to type it twice, for header and title. We can do that with the <code><span class=\"typ-key\">let</span></code>\nkeyword:</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">let</span> title <span class=\"typ-op\">=</span> <span class=\"typ-punct\">[</span>\n  A fluid dynamic model\n  for glacier flow\n<span class=\"typ-punct\">]</span>\n\n<span class=\"typ-escape\">...</span>\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">page</span><span class=\"typ-punct\">(</span>\n  header<span class=\"typ-punct\">:</span> <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>\n    right <span class=\"typ-op\">+</span> horizon<span class=\"typ-punct\">,</span>\n    title\n  <span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  <span class=\"typ-op\">..</span><span class=\"typ-punct\">.</span>\n<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">,</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">17pt</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n  <span class=\"typ-strong\">*<span class=\"typ-pol\">#</span><span class=\"typ-pol\">title</span>*</span>\n<span class=\"typ-punct\">]</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-escape\">...</span>\n\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/64ab19d847a2f915203d32de26b30462.png\" alt=\"Preview\"></div></div>\n<p>After we bound the content to the <code>title</code> variable, we can use it in functions\nand also within markup (prefixed by <code>#</code>, like functions). This way, if we decide\non another title, we can easily change it in one place.</p>\n<h2 id=\"columns-and-headings\">Adding columns and headings</h2>\n<p>The paper above unfortunately looks like a wall of lead. To fix that, let's add\nsome headings and switch our paper to a two-column layout. Fortunately, that's\neasy to do: We just need to amend our <code>page</code> set rule with the <code>columns</code>\nargument.</p>\n<p>By adding <code>columns: <span class=\"typ-num\">2</span></code> to the argument list, we have wrapped the whole\ndocument in two columns. However, that would also affect the title and authors\noverview. To keep them spanning the whole page, we can wrap them in a function\ncall to <a href=\"/en-US-v0.13.1/reference/layout/place/\"><code>place</code></a>. Place expects an alignment and the content it\nshould place as positional arguments. Using the named <code>scope</code> argument, we can\ndecide if the items should be placed relative to the current column or its\nparent (the page). There is one more thing to configure: If no other arguments\nare provided, <code>place</code> takes its content out of the flow of the document and\npositions it over the other content without affecting the layout of other\ncontent in its container:</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-func\">#</span><span class=\"typ-func\">place</span><span class=\"typ-punct\">(</span>\n  top <span class=\"typ-op\">+</span> center<span class=\"typ-punct\">,</span>\n  <span class=\"typ-func\">rect</span><span class=\"typ-punct\">(</span>fill<span class=\"typ-punct\">:</span> black<span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">30</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/df4b3b714f57dfa956dbceab25713747.png\" alt=\"Preview\"></div></div>\n<p>If we hadn't used <code>place</code> here, the square would be in its own line, but here\nit overlaps the few lines of text following it. Likewise, that text acts like as\nif there was no square. To change this behavior, we can pass the argument\n<code>float: <span class=\"typ-key\">true</span></code> to ensure that the space taken up by the placed item at the top\nor bottom of the page is not occupied by any other content.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">page</span><span class=\"typ-punct\">(</span>\n  paper<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;us-letter&quot;</span><span class=\"typ-punct\">,</span>\n  header<span class=\"typ-punct\">:</span> <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>\n    right <span class=\"typ-op\">+</span> horizon<span class=\"typ-punct\">,</span>\n    title\n  <span class=\"typ-punct\">)</span><span class=\"typ-punct\">,</span>\n  numbering<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;1&quot;</span><span class=\"typ-punct\">,</span>\n  columns<span class=\"typ-punct\">:</span> <span class=\"typ-num\">2</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">place</span><span class=\"typ-punct\">(</span>\n  top <span class=\"typ-op\">+</span> center<span class=\"typ-punct\">,</span>\n  float<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">,</span>\n  scope<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;parent&quot;</span><span class=\"typ-punct\">,</span>\n  clearance<span class=\"typ-punct\">:</span> <span class=\"typ-num\">2em</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n  <span class=\"typ-escape\">...</span>\n\n  <span class=\"typ-func\">#</span><span class=\"typ-func\">par</span><span class=\"typ-punct\">(</span>justify<span class=\"typ-punct\">:</span> <span class=\"typ-key\">false</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n    <span class=\"typ-strong\">*Abstract*</span> <span class=\"typ-escape\">\\</span>\n    <span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">80</span><span class=\"typ-punct\">)</span>\n  <span class=\"typ-punct\">]</span>\n<span class=\"typ-punct\">]</span>\n\n<span class=\"typ-heading\">= Introduction</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">300</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-heading\">= Related Work</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">lorem</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">200</span><span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/7402553fca5a66632f9cadb770c03fd0.png\" alt=\"Preview\"></div></div>\n<p>In this example, we also used the <code>clearance</code> argument of the <code>place</code> function\nto provide the space between it and the body instead of using the <a href=\"/en-US-v0.13.1/reference/layout/v/\"><code>v</code></a>\nfunction. We can also remove the explicit <code><span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">,</span> <span class=\"typ-op\">..</span><span class=\"typ-punct\">)</span></code> calls around the\nvarious parts since they inherit the center alignment from the placement.</p>\n<p>Now there is only one thing left to do: Style our headings. We need to make them\ncentered and use small capitals. Because the <code>heading</code> function does not offer\na way to set any of that, we need to write our own heading show rule.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> <span class=\"typ-func\">heading</span><span class=\"typ-punct\">:</span> it <span class=\"typ-op\">=&gt;</span> <span class=\"typ-punct\">[</span>\n  <span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">)</span>\n  <span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">13pt</span><span class=\"typ-punct\">,</span> weight<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;regular&quot;</span><span class=\"typ-punct\">)</span>\n  <span class=\"typ-func\">#</span><span class=\"typ-func\">block</span><span class=\"typ-punct\">(</span><span class=\"typ-func\">smallcaps</span><span class=\"typ-punct\">(</span>it<span class=\"typ-punct\">.</span>body<span class=\"typ-punct\">)</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-punct\">]</span>\n\n<span class=\"typ-escape\">...</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/649c4959d53249934a963d7f567d4d5a.png\" alt=\"Preview\"></div></div>\n<p>This looks great! We used a show rule that applies to all headings. We give it a\nfunction that gets passed the heading as a parameter. That parameter can be used\nas content but it also has some fields like <code>title</code>, <code>numbers</code>, and <code>level</code> from\nwhich we can compose a custom look. Here, we are center-aligning, setting the\nfont weight to <code><span class=\"typ-str\">&quot;regular&quot;</span></code> because headings are bold by default, and use the\n<a href=\"/en-US-v0.13.1/reference/text/smallcaps/\" title=\"`smallcaps`\"><code>smallcaps</code></a> function to render the heading's title in small capitals.</p>\n<p>The only remaining problem is that all headings look the same now. The\n&quot;Motivation&quot; and &quot;Problem Statement&quot; subsections ought to be italic run in\nheaders, but right now, they look indistinguishable from the section headings. We\ncan fix that by using a <code>where</code> selector on our set rule: This is a\n<a href=\"/en-US-v0.13.1/reference/scripting/#methods\">method</a> we can call on headings (and other\nelements) that allows us to filter them by their level. We can use it to\ndifferentiate between section and subsection headings:</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> heading<span class=\"typ-punct\">.</span><span class=\"typ-func\">where</span><span class=\"typ-punct\">(</span>\n  level<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1</span>\n<span class=\"typ-punct\">)</span><span class=\"typ-punct\">:</span> it <span class=\"typ-op\">=&gt;</span> <span class=\"typ-func\">block</span><span class=\"typ-punct\">(</span>width<span class=\"typ-punct\">:</span> <span class=\"typ-num\">100%</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n  <span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">)</span>\n  <span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">13pt</span><span class=\"typ-punct\">,</span> weight<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;regular&quot;</span><span class=\"typ-punct\">)</span>\n  <span class=\"typ-func\">#</span><span class=\"typ-func\">smallcaps</span><span class=\"typ-punct\">(</span>it<span class=\"typ-punct\">.</span>body<span class=\"typ-punct\">)</span>\n<span class=\"typ-punct\">]</span>\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">show</span> heading<span class=\"typ-punct\">.</span><span class=\"typ-func\">where</span><span class=\"typ-punct\">(</span>\n  level<span class=\"typ-punct\">:</span> <span class=\"typ-num\">2</span>\n<span class=\"typ-punct\">)</span><span class=\"typ-punct\">:</span> it <span class=\"typ-op\">=&gt;</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span>\n  size<span class=\"typ-punct\">:</span> <span class=\"typ-num\">11pt</span><span class=\"typ-punct\">,</span>\n  weight<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;regular&quot;</span><span class=\"typ-punct\">,</span>\n  style<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;italic&quot;</span><span class=\"typ-punct\">,</span>\n  it<span class=\"typ-punct\">.</span>body <span class=\"typ-op\">+</span> <span class=\"typ-punct\">[</span>.<span class=\"typ-punct\">]</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/7813729890ec906164615017905f5cb8.png\" alt=\"Preview\"></div></div>\n<p>This looks great! We wrote two show rules that each selectively apply to the\nfirst and second level headings. We used a <code>where</code> selector to filter the\nheadings by their level. We then rendered the subsection headings as run-ins. We\nalso automatically add a period to the end of the subsection headings.</p>\n<p>Let's review the conference's style guide:</p>\n<ul>\n<li>The font should be an 11pt serif font ✓</li>\n<li>The title should be in 17pt and bold ✓</li>\n<li>The paper contains a single-column abstract and two-column main text ✓</li>\n<li>The abstract should be centered ✓</li>\n<li>The main text should be justified ✓</li>\n<li>First level section headings should be centered, rendered in small caps and in\n13pt ✓</li>\n<li>Second level headings are run-ins, italicized and have the same size as the\nbody text ✓</li>\n<li>Finally, the pages should be US letter sized, numbered in the center and the\ntop right corner of each page should contain the title of the paper ✓</li>\n</ul>\n<p>We are now in compliance with all of these styles and can submit the paper to\nthe conference! The finished paper looks like this:</p>\n<p><img\n  src=\"/en-US-v0.13.1/assets/3-advanced-paper.png\"\n  alt=\"The finished paper\"\n  style=\"box-shadow: 0 4px 12px rgb(89 85 101 / 20%); width: 500px; max-width: 100%; display: block; margin: 24px auto;\"\n></p>\n<h2 id=\"review\">Review</h2>\n<p>You have now learned how to create headers and footers, how to use functions and\nscopes to locally override styles, how to create more complex layouts with the\n<a href=\"/en-US-v0.13.1/reference/layout/grid/\" title=\"`grid`\"><code>grid</code></a> function and how to write show rules for individual functions, and the\nwhole document. You also learned how to use the\n<a href=\"/en-US-v0.13.1/reference/styling/#show-rules\"><code>where</code> selector</a> to filter the headings by their level.</p>\n<p>The paper was a great success! You've met a lot of like-minded researchers at\nthe conference and are planning a project which you hope to publish at the same\nvenue next year. You'll need to write a new paper using the same style guide\nthough, so maybe now you want to create a time-saving template for you and your\nteam?</p>\n<p>In the next section, we will learn how to create templates that can be reused in\nmultiple documents. This is a more advanced topic, so feel free to come back\nto it later if you don't feel up to it right now.</p>"}}