From 42afa410ae561eb5b267080d088bca529a5d0b54 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 17 May 2023 14:38:03 +0200 Subject: Better documentation outlines --- docs/src/tutorial/1-writing.md | 8 ++++---- docs/src/tutorial/2-formatting.md | 12 ++++++------ docs/src/tutorial/3-advanced.md | 10 +++++----- docs/src/tutorial/4-template.md | 10 +++++----- docs/src/tutorial/welcome.md | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) (limited to 'docs/src/tutorial') diff --git a/docs/src/tutorial/1-writing.md b/docs/src/tutorial/1-writing.md index 21292d21..6bb6087e 100644 --- a/docs/src/tutorial/1-writing.md +++ b/docs/src/tutorial/1-writing.md @@ -67,7 +67,7 @@ the first item of the list above by indenting it. + The geology ``` -## Adding a figure +## Adding a figure { #figure } You think that your report would benefit from a figure. Let's add one. Typst supports images in the formats PNG, JPEG, GIF, and SVG. To add an image file to your project, first open the _file panel_ by clicking the box icon in the left @@ -174,7 +174,7 @@ On the contrary, strings work wherever content is expected because text is a valid kind of content. -## Adding a bibliography +## Adding a bibliography { #bibliography } As you write up your report, you need to back up some of your claims. You can add a bibliography to your document with the [`bibliography`]($func/bibliography) function. This function expects a path @@ -200,7 +200,7 @@ established in @glacier-melt. #bibliography("works.bib") ``` -## Maths +## Maths { #maths } After fleshing out the methods section, you move on to the meat of the document: Your equations. Typst has built-in mathematical typesetting and uses its own math notation. Let's start with a simple equation. We wrap it in `[$]` signs @@ -293,7 +293,7 @@ This notation is also available in markup mode, but the symbol name must be preceded with `#sym.` there. See the [symbols section]($category/symbols/sym) for a list of all available symbols. -## Review +## Review { #review } You have now seen how to write a basic document in Typst. You learned how to emphasize text, write lists, insert images, align content, and typeset mathematical expressions. You also learned about Typst's functions. There are diff --git a/docs/src/tutorial/2-formatting.md b/docs/src/tutorial/2-formatting.md index d5b810b2..c231b878 100644 --- a/docs/src/tutorial/2-formatting.md +++ b/docs/src/tutorial/2-formatting.md @@ -9,7 +9,7 @@ that you are using a new typesetting system, and you want your report to fit in with the other student's submissions. In this chapter, we will see how to format your report using Typst's styling system. -## Set rules +## Set rules { #set-rules } As we have seen in the previous chapter, Typst has functions that _insert_ content (e.g. the [`image`]($func/image) function) and others that _manipulate_ content that they received as arguments (e.g. the [`align`]($func/align) @@ -70,7 +70,7 @@ for some of the parameters of a function for all future uses of that function. -## The autocomplete panel +## The autocomplete panel { #autocomplete } If you followed along and tried a few things in the app, you might have noticed that always after you enter a `#` character, a panel pops up to show you the available functions, and, within an argument list, the available parameters. @@ -84,7 +84,7 @@ what they do. ![Autocomplete panel](2-formatting-autocomplete.png) -## Set up the page +## Set up the page { #page-setup } Back to set rules: When writing a rule, you choose the function depending on what type of element you want to style. Here is a list of some functions that are commonly used in set rules: @@ -175,7 +175,7 @@ Finally, we have bottom aligned our image by adding a vertical alignment to our center alignment. Vertical and horizontal alignments can be combined with the `{+}` operator to yield a 2D alignment. -## A hint of sophistication +## A hint of sophistication { #sophistication } To structure our document more clearly, we now want to number our headings. We can do this by setting the `numbering` parameter of the [`heading`]($func/heading) function. @@ -228,7 +228,7 @@ markup above. Other markup elements work similarly, they are only _syntax sugar_ for the corresponding function calls. -## Show rules +## Show rules { #show-rules } You are already pretty happy with how this turned out. But one last thing needs to be fixed: The report you are writing is intended for a larger project and that project's name should always be accompanied by a logo, even in prose. @@ -272,7 +272,7 @@ expects code instead of markup, the leading `#` is not needed to access functions, keywords, and variables. This can be observed in parameter lists, function definitions, and [code blocks]($scripting). -## Review +## Review { #review } You now know how to apply basic formatting to your Typst documents. You learned how to set the font, justify your paragraphs, change the page dimensions, and add numbering to your headings with set rules. You also learned how to use a diff --git a/docs/src/tutorial/3-advanced.md b/docs/src/tutorial/3-advanced.md index 4749c547..42a810fd 100644 --- a/docs/src/tutorial/3-advanced.md +++ b/docs/src/tutorial/3-advanced.md @@ -26,7 +26,7 @@ Now, your supervisor can also edit the project and you can both see the changes in real time. You can join our [Discord server](https://discord.gg/2uDybryKPe) to find others with preview access and try teams with them! -## The conference guidelines +## The conference guidelines { #guidelines } The layout guidelines are available on the conference website. Let's take a look at them: @@ -46,7 +46,7 @@ at them: We already know how to do many of these things, but for some of them, we'll need to learn some new tricks. -## Writing the right set rules +## Writing the right set rules { #set-rules } Let's start by writing some set rules for the document. ```example @@ -84,7 +84,7 @@ setting into to `{"1"}`, Typst only displays the bare page number. Setting it to surrounded by parentheses. And we could even have provided a completely custom function here to format things to our liking. -## Creating a title and abstract +## Creating a title and abstract { #title-and-abstract } Now, let's add a title and an abstract. We'll start with the title. We center align it and increase its font weight by enclosing it in `[*stars*]`. @@ -246,7 +246,7 @@ After we bound the content to the `title` variable, we can use it in functions and also within markup (prefixed by `#`, like functions). This way, if we decide on another title, we can easily change it in one place. -## Adding columns and headings +## Adding columns and headings { #columns-and-headings } The paper above unfortunately looks like a wall of lead. To fix that, let's add some headings and switch our paper to a two-column layout. The [`columns`]($func/columns) function takes a number and content, and layouts the @@ -493,7 +493,7 @@ the conference! The finished paper looks like this: style="box-shadow: 0 4px 12px rgb(89 85 101 / 20%); width: 500px; max-width: 100%; display: block; margin: 24px auto;" > -## Review +## Review { #review } You have now learned how to create headers and footers, how to use functions and scopes to locally override styles, how to create more complex layouts with the [`grid`]($func/grid) function and how to write show rules for individual functions, and the whole document. You also learned how to use the [`where` selector]($styling/#show-rules) to filter the headings by their level. diff --git a/docs/src/tutorial/4-template.md b/docs/src/tutorial/4-template.md index 52557281..320f82b2 100644 --- a/docs/src/tutorial/4-template.md +++ b/docs/src/tutorial/4-template.md @@ -12,7 +12,7 @@ you created in the previous chapter and turn it into a reusable template. In this chapter you will learn how to create a template that you and your team can use with just one show rule. Let's get started! -## A toy template +## A toy template { #toy-template } In Typst, templates are functions in which you can wrap your whole document. To learn how to do that, let's first review how to write your very own functions. They can do anything you want them to, so why not go a bit crazy? @@ -60,7 +60,7 @@ wrapped it around it. This is not especially useful with this particular function, but when combined with set rules and named arguments, it can be very powerful. -## Embedding set and show rules +## Embedding set and show rules { #set-and-show-rules } To apply some set and show rules to our template, we can use `set` and `show` within a content block in our function and then insert the document into that content block. @@ -159,7 +159,7 @@ Also note where the title comes from: We previously had it inside of a variable. Now, we are receiving it as the first parameter of the template function. Thus, we must specify it in the show rule where we call the template. -## Templates with named arguments +## Templates with named arguments { #named-arguments } Our paper in the previous chapter had a title and an author list. Let's add these things to our template. In addition to the title, we want our template to accept a list of authors with their affiliations and the paper's abstract. To keep @@ -253,7 +253,7 @@ The resulting template function looks like this: } ``` -## A separate file +## A separate file { #separate-file } Most of the time, a template is specified in a different file and then imported into the document. This way, the main file you write in is kept clutter free and your template is easily reused. Create a new text file in the file panel by @@ -365,7 +365,7 @@ conference! Why not share it on [Typst's Discord server](https://discord.gg/2uDybryKPe) so that others can use it too? -## Review +## Review { #review } Congratulations, you have completed Typst's Tutorial! In this section, you have learned how to define your own functions and how to create and apply templates that define reusable document styles. You've made it far and learned a lot. You diff --git a/docs/src/tutorial/welcome.md b/docs/src/tutorial/welcome.md index e2882561..530336cb 100644 --- a/docs/src/tutorial/welcome.md +++ b/docs/src/tutorial/welcome.md @@ -14,7 +14,7 @@ with the steps below. The app gives you instant preview, syntax highlighting and helpful autocompletions. Alternatively, you can follow along in your local text editor with the [open-source CLI](https://github.com/typst/typst). -## When to use Typst +## When to use Typst { #when-typst } Before we get started, let's check what Typst is and when to use it. Typst is a markup language for typesetting documents. It is designed to be easy to learn, fast, and versatile. Typst takes text files with markup in them and outputs @@ -27,7 +27,7 @@ in the math, physics, and engineering fields. Finally, due to its strong styling and automation features, it is an excellent choice for any set of documents that share a common style, such as a book series. -## What you will learn +## What you will learn { #learnings } This tutorial has four chapters. Each chapter builds on the previous one. Here is what you will learn in each of them: -- cgit v1.2.3