Skip to content

Commit

Permalink
Merge pull request #180 from TomVer99/feature/line-numbering
Browse files Browse the repository at this point in the history
Feature/line numbering
  • Loading branch information
TomVer99 authored Nov 6, 2024
2 parents faeef01 + c4cf5da commit d9de5f2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
Binary file modified documentation/manual.pdf
Binary file not shown.
11 changes: 11 additions & 0 deletions documentation/manual.typ
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ This is a simple document.
arg[appendix],
arg[watermark],
arg[censored],
arg[line-numbering],
arg[line-numbering-scope],
arg[print-extra-white-page],
arg[secondary-organisation-color],
arg[secondary-organisation-logo],
Expand Down Expand Up @@ -292,6 +294,14 @@ This is a simple document.
`1` for censorship, `0` for no censorship.
]

#argument("line-numbering", types: "bool", default: false)[
Controls if lines are numbered in the document. Only the pre-toc and body content will be numbered.
]

#argument("line-numbering-scope", types: "string", default: "page")[
If set to "page", the counter will reset on each page. If set to "document", the counter will not reset on each page, and will keep counting.
]

#argument("print-extra-white-page", types: "bool", default: false)[
Wether to make sure the beginning of sections start on the 'right hand' page.
This does not affect chapter headings.
Expand All @@ -308,6 +318,7 @@ This is a simple document.
```
]

#colbreak()
#argument("secondary-organisation-logo-height", types: "size", default: 6%)[
The height of the secondary organisation logo.
]
Expand Down
1 change: 1 addition & 0 deletions examples/showcase/showcase.typ
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// table-of-listings: true,
// table-of-tables: true,
// print-extra-white-page: true,
// line-numbering: true,
bibliography-file: bibliography("my-sources.bib"),
glossary-terms: term-list,
secondary-organisation-logo: read("Company.svg"),
Expand Down
16 changes: 14 additions & 2 deletions template/fhict-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
appendix: none,
watermark: none,
censored: 0,
line-numbering: false,
line-numbering-scope: "page",
print-extra-white-page: false,
secondary-organisation-color: none,
secondary-organisation-logo: none,
Expand Down Expand Up @@ -670,7 +672,12 @@
// Show the pre-toc
// Disable heading numbering and appearing in the TOC
set heading(numbering: none, outlined: false)
pre-toc
if line-numbering == true {
set par.line(numbering: "1", numbering-scope: line-numbering-scope)
pre-toc
} else {
pre-toc
}
pagebreak()
set heading(numbering: numbering-set, outlined: true)
// if disable-toc == false or (glossary-terms != none and glossary-front == true) or table-of-figures == true or table-of-listings == true {
Expand Down Expand Up @@ -791,7 +798,12 @@
counter(page).update(1)

// Show the page's contents
body
if line-numbering == true {
set par.line(numbering: "1", numbering-scope: line-numbering-scope)
body
} else {
body
}

if (
glossary-terms != none and glossary-front == false
Expand Down

0 comments on commit d9de5f2

Please sign in to comment.