From 711b20c81da0d9dc759f515e4ede034243ec23f1 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 8 Jan 2025 01:20:12 -0800 Subject: [PATCH] feat: improve dvd.typ formatting --- .../by-course/math-4b/course-notes/dvd.typ | 31 ++++++++++++------- .../by-course/math-6a/course-notes/dvd.typ | 31 ++++++++++++------- .../by-course/math-8/course-notes/dvd.typ | 31 ++++++++++++------- .../by-course/math-8/course-notes/main.typ | 16 ++++++++++ documents/by-course/math-8/pset-1/dvd.typ | 31 ++++++++++++------- .../by-course/pstat-120a/course-notes/dvd.typ | 31 ++++++++++++------- 6 files changed, 116 insertions(+), 55 deletions(-) diff --git a/documents/by-course/math-4b/course-notes/dvd.typ b/documents/by-course/math-4b/course-notes/dvd.typ index 1b6ae29..76f3b35 100644 --- a/documents/by-course/math-4b/course-notes/dvd.typ +++ b/documents/by-course/math-4b/course-notes/dvd.typ @@ -66,14 +66,16 @@ set heading(numbering: "1.") show heading: it => { set text(font: "Libertinus Serif") - set par(first-line-indent: 0em) - if it.numbering != none { - text(rgb("#2196F3"), weight: 500)[#sym.section] + block[ + #if it.numbering != none { + text(rgb("#2196F3"), weight: 500)[#sym.section] - text(rgb("#2196F3"))[#counter(heading).display() ] - } - it.body + text(rgb("#2196F3"))[#counter(heading).display() ] + } + #it.body + #v(0.5em) + ] } set text(font: "New Computer Modern", lang: "en") @@ -126,7 +128,8 @@ // Main body. set par( justify: true, - first-line-indent: 1em, + spacing: 0.65em, + first-line-indent: 2em, ) body @@ -170,7 +173,7 @@ namefmt: x => [(#x)], titlefmt: strong, bodyfmt: x => x, - separator: [#h(0.1em).#h(0.2em) \ ], + separator: [. \ ], base: "heading", base_level: none, ) = { @@ -190,7 +193,7 @@ title += " " + number } title = titlefmt(title) - body = bodyfmt(body) + body = [#pad(top: 2pt, bodyfmt(body))] pad( ..padding, showybox( @@ -200,7 +203,9 @@ padding: (top: 0em, bottom: 0em), ..blockargs.named(), ..blockargs_individual.named(), - [#title#name#titlefmt(separator)#body], + [ + #title#name#titlefmt(separator)#body + ], ), ) } @@ -286,6 +291,7 @@ #let example = example-style("item", "Example") #let proof(body, name: none) = { + v(0.5em) [_Proof_] if name != none { [ #thmname[#name]] @@ -303,6 +309,7 @@ sym.space.nobreak $square.stroked$ + v(0.5em) } #let fact = thmplain( @@ -310,8 +317,8 @@ "Fact", titlefmt: strong, separator: ".", - inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let abuse = thmplain( "item", @@ -319,6 +326,7 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let definition = thmplain( "item", @@ -326,4 +334,5 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) diff --git a/documents/by-course/math-6a/course-notes/dvd.typ b/documents/by-course/math-6a/course-notes/dvd.typ index 1b6ae29..76f3b35 100644 --- a/documents/by-course/math-6a/course-notes/dvd.typ +++ b/documents/by-course/math-6a/course-notes/dvd.typ @@ -66,14 +66,16 @@ set heading(numbering: "1.") show heading: it => { set text(font: "Libertinus Serif") - set par(first-line-indent: 0em) - if it.numbering != none { - text(rgb("#2196F3"), weight: 500)[#sym.section] + block[ + #if it.numbering != none { + text(rgb("#2196F3"), weight: 500)[#sym.section] - text(rgb("#2196F3"))[#counter(heading).display() ] - } - it.body + text(rgb("#2196F3"))[#counter(heading).display() ] + } + #it.body + #v(0.5em) + ] } set text(font: "New Computer Modern", lang: "en") @@ -126,7 +128,8 @@ // Main body. set par( justify: true, - first-line-indent: 1em, + spacing: 0.65em, + first-line-indent: 2em, ) body @@ -170,7 +173,7 @@ namefmt: x => [(#x)], titlefmt: strong, bodyfmt: x => x, - separator: [#h(0.1em).#h(0.2em) \ ], + separator: [. \ ], base: "heading", base_level: none, ) = { @@ -190,7 +193,7 @@ title += " " + number } title = titlefmt(title) - body = bodyfmt(body) + body = [#pad(top: 2pt, bodyfmt(body))] pad( ..padding, showybox( @@ -200,7 +203,9 @@ padding: (top: 0em, bottom: 0em), ..blockargs.named(), ..blockargs_individual.named(), - [#title#name#titlefmt(separator)#body], + [ + #title#name#titlefmt(separator)#body + ], ), ) } @@ -286,6 +291,7 @@ #let example = example-style("item", "Example") #let proof(body, name: none) = { + v(0.5em) [_Proof_] if name != none { [ #thmname[#name]] @@ -303,6 +309,7 @@ sym.space.nobreak $square.stroked$ + v(0.5em) } #let fact = thmplain( @@ -310,8 +317,8 @@ "Fact", titlefmt: strong, separator: ".", - inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let abuse = thmplain( "item", @@ -319,6 +326,7 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let definition = thmplain( "item", @@ -326,4 +334,5 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) diff --git a/documents/by-course/math-8/course-notes/dvd.typ b/documents/by-course/math-8/course-notes/dvd.typ index 1b6ae29..76f3b35 100644 --- a/documents/by-course/math-8/course-notes/dvd.typ +++ b/documents/by-course/math-8/course-notes/dvd.typ @@ -66,14 +66,16 @@ set heading(numbering: "1.") show heading: it => { set text(font: "Libertinus Serif") - set par(first-line-indent: 0em) - if it.numbering != none { - text(rgb("#2196F3"), weight: 500)[#sym.section] + block[ + #if it.numbering != none { + text(rgb("#2196F3"), weight: 500)[#sym.section] - text(rgb("#2196F3"))[#counter(heading).display() ] - } - it.body + text(rgb("#2196F3"))[#counter(heading).display() ] + } + #it.body + #v(0.5em) + ] } set text(font: "New Computer Modern", lang: "en") @@ -126,7 +128,8 @@ // Main body. set par( justify: true, - first-line-indent: 1em, + spacing: 0.65em, + first-line-indent: 2em, ) body @@ -170,7 +173,7 @@ namefmt: x => [(#x)], titlefmt: strong, bodyfmt: x => x, - separator: [#h(0.1em).#h(0.2em) \ ], + separator: [. \ ], base: "heading", base_level: none, ) = { @@ -190,7 +193,7 @@ title += " " + number } title = titlefmt(title) - body = bodyfmt(body) + body = [#pad(top: 2pt, bodyfmt(body))] pad( ..padding, showybox( @@ -200,7 +203,9 @@ padding: (top: 0em, bottom: 0em), ..blockargs.named(), ..blockargs_individual.named(), - [#title#name#titlefmt(separator)#body], + [ + #title#name#titlefmt(separator)#body + ], ), ) } @@ -286,6 +291,7 @@ #let example = example-style("item", "Example") #let proof(body, name: none) = { + v(0.5em) [_Proof_] if name != none { [ #thmname[#name]] @@ -303,6 +309,7 @@ sym.space.nobreak $square.stroked$ + v(0.5em) } #let fact = thmplain( @@ -310,8 +317,8 @@ "Fact", titlefmt: strong, separator: ".", - inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let abuse = thmplain( "item", @@ -319,6 +326,7 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let definition = thmplain( "item", @@ -326,4 +334,5 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) diff --git a/documents/by-course/math-8/course-notes/main.typ b/documents/by-course/math-8/course-notes/main.typ index 775c559..c1c9a27 100644 --- a/documents/by-course/math-8/course-notes/main.typ +++ b/documents/by-course/math-8/course-notes/main.typ @@ -116,3 +116,19 @@ middle_, these comprise the axioms of a system of propositional logic. + $and$ connects the smallest propositions surrounding it. + $or$ connects the smallest propositions surrounding it. ] + += Notes on Logic and Proofs, 1.2 + +_Prototypical example for this section:_ If $sin pi = 1$, then $6$ is prime. + +#definition[ + For a *antedecent* $P$ and *consequent* $Q$, the *conditional sentence* $P => +Q$ is the proposition "If $P$, then $Q$." +] + +#remark[ + The statement $P => Q$ states $P$ _implies_ $Q$ and is only false if $P$ is + true and $Q$ is false, since this is the only case where $P$ did not imply $Q$. +] + +A conditional may be true even when the antedecent and consequent are unrelated. diff --git a/documents/by-course/math-8/pset-1/dvd.typ b/documents/by-course/math-8/pset-1/dvd.typ index 1b6ae29..76f3b35 100644 --- a/documents/by-course/math-8/pset-1/dvd.typ +++ b/documents/by-course/math-8/pset-1/dvd.typ @@ -66,14 +66,16 @@ set heading(numbering: "1.") show heading: it => { set text(font: "Libertinus Serif") - set par(first-line-indent: 0em) - if it.numbering != none { - text(rgb("#2196F3"), weight: 500)[#sym.section] + block[ + #if it.numbering != none { + text(rgb("#2196F3"), weight: 500)[#sym.section] - text(rgb("#2196F3"))[#counter(heading).display() ] - } - it.body + text(rgb("#2196F3"))[#counter(heading).display() ] + } + #it.body + #v(0.5em) + ] } set text(font: "New Computer Modern", lang: "en") @@ -126,7 +128,8 @@ // Main body. set par( justify: true, - first-line-indent: 1em, + spacing: 0.65em, + first-line-indent: 2em, ) body @@ -170,7 +173,7 @@ namefmt: x => [(#x)], titlefmt: strong, bodyfmt: x => x, - separator: [#h(0.1em).#h(0.2em) \ ], + separator: [. \ ], base: "heading", base_level: none, ) = { @@ -190,7 +193,7 @@ title += " " + number } title = titlefmt(title) - body = bodyfmt(body) + body = [#pad(top: 2pt, bodyfmt(body))] pad( ..padding, showybox( @@ -200,7 +203,9 @@ padding: (top: 0em, bottom: 0em), ..blockargs.named(), ..blockargs_individual.named(), - [#title#name#titlefmt(separator)#body], + [ + #title#name#titlefmt(separator)#body + ], ), ) } @@ -286,6 +291,7 @@ #let example = example-style("item", "Example") #let proof(body, name: none) = { + v(0.5em) [_Proof_] if name != none { [ #thmname[#name]] @@ -303,6 +309,7 @@ sym.space.nobreak $square.stroked$ + v(0.5em) } #let fact = thmplain( @@ -310,8 +317,8 @@ "Fact", titlefmt: strong, separator: ".", - inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let abuse = thmplain( "item", @@ -319,6 +326,7 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let definition = thmplain( "item", @@ -326,4 +334,5 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) diff --git a/documents/by-course/pstat-120a/course-notes/dvd.typ b/documents/by-course/pstat-120a/course-notes/dvd.typ index 1b6ae29..76f3b35 100644 --- a/documents/by-course/pstat-120a/course-notes/dvd.typ +++ b/documents/by-course/pstat-120a/course-notes/dvd.typ @@ -66,14 +66,16 @@ set heading(numbering: "1.") show heading: it => { set text(font: "Libertinus Serif") - set par(first-line-indent: 0em) - if it.numbering != none { - text(rgb("#2196F3"), weight: 500)[#sym.section] + block[ + #if it.numbering != none { + text(rgb("#2196F3"), weight: 500)[#sym.section] - text(rgb("#2196F3"))[#counter(heading).display() ] - } - it.body + text(rgb("#2196F3"))[#counter(heading).display() ] + } + #it.body + #v(0.5em) + ] } set text(font: "New Computer Modern", lang: "en") @@ -126,7 +128,8 @@ // Main body. set par( justify: true, - first-line-indent: 1em, + spacing: 0.65em, + first-line-indent: 2em, ) body @@ -170,7 +173,7 @@ namefmt: x => [(#x)], titlefmt: strong, bodyfmt: x => x, - separator: [#h(0.1em).#h(0.2em) \ ], + separator: [. \ ], base: "heading", base_level: none, ) = { @@ -190,7 +193,7 @@ title += " " + number } title = titlefmt(title) - body = bodyfmt(body) + body = [#pad(top: 2pt, bodyfmt(body))] pad( ..padding, showybox( @@ -200,7 +203,9 @@ padding: (top: 0em, bottom: 0em), ..blockargs.named(), ..blockargs_individual.named(), - [#title#name#titlefmt(separator)#body], + [ + #title#name#titlefmt(separator)#body + ], ), ) } @@ -286,6 +291,7 @@ #let example = example-style("item", "Example") #let proof(body, name: none) = { + v(0.5em) [_Proof_] if name != none { [ #thmname[#name]] @@ -303,6 +309,7 @@ sym.space.nobreak $square.stroked$ + v(0.5em) } #let fact = thmplain( @@ -310,8 +317,8 @@ "Fact", titlefmt: strong, separator: ".", - inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let abuse = thmplain( "item", @@ -319,6 +326,7 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), ) #let definition = thmplain( "item", @@ -326,4 +334,5 @@ titlefmt: strong, separator: ".", inset: 0pt, + padding: (bottom: 0.5em, top: 0.5em), )