You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.3 KiB

2 months ago
  1. #let conf(
  2. clong-title: "",
  3. title: "",
  4. author: "Annwan",
  5. date: datetime.today().display(),
  6. main-font: (font: "Andika", stylistic-set: 13),
  7. clong-font: it => text(font: "Charis SIL", it),
  8. doc
  9. ) = {
  10. set text(..main-font)
  11. set par(justify: true)
  12. set heading(numbering: "I.1.1.1")
  13. show heading.where(level: 1): it => align(center, it)
  14. align(horizon, {
  15. align(center, text(20pt)[*#title*])
  16. if clong-title != "" {
  17. align(center, clong-font(text(18pt)[*#clong-title*]))
  18. }
  19. align(center, author)
  20. align(center, date)
  21. })
  22. pagebreak()
  23. outline(
  24. fill: repeat([#h(1em).])
  25. )
  26. pagebreak(weak: true)
  27. set page(
  28. footer: [
  29. #h(1fr)
  30. #context counter(page).get().at(0)
  31. #h(1fr)
  32. ]
  33. )
  34. counter(page).update(1)
  35. doc
  36. }
  37. #let dict(
  38. data: (),
  39. key: it => it.at("w"),
  40. wformat: it => [*#it*]
  41. ) = {
  42. pagebreak(weak: true)
  43. set page(
  44. footer: [
  45. #h(1fr)
  46. #context numbering("i", counter(page).get().at(0))
  47. #h(1fr)
  48. ]
  49. )
  50. counter(page).update(1)
  51. set heading(
  52. numbering: none, outlined: false
  53. )
  54. [= Dictionary]
  55. columns(2, {
  56. let sorted_data = data.sorted(key: key)
  57. for word in sorted_data [
  58. #wformat(word.at("w")) /#word.at("i")/ _#word.at("p")_ #eval(word.at("n"), mode: "markup") \
  59. ]
  60. })
  61. }