How I can indent only text in paragraph in the body via definition in my template?

I know this setting

#set par( hanging-indent:-1em )

but it also influences the headers and table of content among other things.
How can I limit the scope to change to apply to only the text inside paragraphs in the body of document? (I am working on template)

Hey @danborek , please make sure to post to the Questions category next time :slight_smile: (Also, by the way, you can write ```typ to highlight your codeblock with Typst’s syntax as I do below)


To achieve what you need, currently, you’ll have to manually undo the setting as such:

#set par(hanging-indent: -1em)
#show outline: set par(hanging-indent: 0pt)
#show raw.where(block: true): set par(hanging-indent: 0pt)
// When changing the header:
#set page(header: [
  #set par(hanging-indent: 0pt)
  // header contents here
])
1 Like

Hey @danborek , make sure to mark my answer as a solution (the :white_check_mark: button) if it solved your problem, otherwise feel free to ask further questions. Thank you!

1 Like

Hi @PgBiel it helped me a lot to understand better the problem, but I weren’t able to fully test and implement it yet;
I suppose I need to do same for headings ?

Yes. To avoid writing too many identical show-set rules, you can use selector.or like so:

#show selector.or(
   outline,
   raw.where(block: true),
   heading
): set par(hanging-indent: 0pt)

// Will still need to do it manually for the page header