Skip to content

Commit 49c8593

Browse files
Show reference only if >=1 citation is used
1 parent 0cd7464 commit 49c8593

4 files changed

Lines changed: 29 additions & 42 deletions

File tree

pages/blog/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const Page: NextPageWithLayout<PageProps> = ({ post }) => {
179179
<Layout>
180180
<div className="flex h-full justify-center">
181181
<div
182-
className={`${blogBodyFont.className} prose prose-mnf flex flex-col gap-4 dark:prose-invert prose-h1:my-0`}
182+
className={`${blogBodyFont.className} prose flex flex-col gap-4 dark:prose-invert prose-h1:my-0`}
183183
// className={`prose flex flex-col gap-4 dark:prose-invert`}
184184
>
185185
<Header {...post.metadata} />

posts/_utils/lib.typ

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
#metadata(title) <TITLE>
100100
#metadata(keywords) <KEYWORDS>
101101
#doc
102-
#bibliography("/posts/Zotero.bib", style: "apa", title: "References")
102+
103+
// Do not emit the title if there are no citations.
104+
#context {
105+
if query(cite).len() > 0 {
106+
bibliography("/posts/Zotero.bib", style: "apa", title: "References")
107+
}
108+
}
103109

104110
]

posts/test.typ

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
#set heading(numbering: "1.1")
2222

2323

24+
#let op(name) = {
25+
if name == "D" {
26+
return $Dif$
27+
} else {
28+
return $std.math.op(name)$
29+
}
30+
}
31+
32+
2433
= Something Something <sec:Some>
2534

2635
#lorem(50)
@@ -202,6 +211,7 @@ computer thinks of $X$ as some bing
202211

203212
= Derivative-Once and For All <sec:Derivative-Once-and-For-All>
204213

214+
205215
Let $f: RR^(m) -> RR^(n)$ be a function between vector spaces $RR^(m)$ and
206216
$RR^(n)$. The derivative of $f$ at point $p in RR^(m)$ is the linear function
207217
$op("D") f(p): RR^(m) -> RR^(n)$ so that
@@ -254,7 +264,7 @@ $x_(3) = g_(1) x_(1) in op("Orb")(x_(1))$, we see that
254264
$x_(3) in op("Orb")(x_(2))$ because
255265
$x_(3) = g_(1) compose x_(1) = g_(1) compose g compose x_(2)$, and since
256266
$g_(1) compose g in G$ we know that
257-
$g_(1) compose g compose x_(2) in op("Orb")(x_(2)).$. The other way is similar
267+
$g_(1) compose g compose x_(2) in op("Orb")(x_(2))$. The other way is similar
258268
to show, and we have that every
259269
$x'_(1) in op("Orb")(x_(1)) <=> x'_(1) in op("Orb")(x_(2))$, where in the
260270
forward case we have $x'_(1) in op("Orb")(x_(2))$ because

tailwind.config.js

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ module.exports = {
103103
},
104104
typography: () => ({
105105
// A more "print-like" rhythm for longform reading (Typst → HTML).
106+
// THIS IS NOT USED ANymore it didnt look good
106107
mnf: {
107108
css: {
108109
// Base
109110
// fontSize: "clamp(1rem, 0.96rem + 0.25vw, 1.125rem)",
110-
lineHeight: "1.65",
111-
textRendering: "optimizeLegibility",
112-
fontKerning: "normal",
111+
lineHeight: "1.3",
112+
// textRendering: "optimizeLegibility",
113+
// fontKerning: "normal",
113114

114115
// Better line breaking
115116
// Paragraph rhythm (less airy than Tailwind defaults)
@@ -120,32 +121,6 @@ module.exports = {
120121
marginBottom: "0.85em",
121122
},
122123

123-
// Headings: closer to Typst/LaTeX proportions than default prose
124-
h2: {
125-
fontSize: "1.35em",
126-
lineHeight: "1.25",
127-
marginTop: "1.8em",
128-
marginBottom: "0.75em",
129-
fontWeight: "600",
130-
textWrap: "balance",
131-
},
132-
h3: {
133-
fontSize: "1.15em",
134-
lineHeight: "1.3",
135-
marginTop: "1.6em",
136-
marginBottom: "0.6em",
137-
fontWeight: "600",
138-
textWrap: "balance",
139-
},
140-
h4: {
141-
fontSize: "1.05em",
142-
lineHeight: "1.35",
143-
marginTop: "1.4em",
144-
marginBottom: "0.55em",
145-
fontWeight: "600",
146-
textWrap: "balance",
147-
},
148-
149124
// Lists
150125
ul: {
151126
marginTop: "0.85em",
@@ -164,14 +139,10 @@ module.exports = {
164139
marginBottom: "0.25em",
165140
},
166141

167-
// Typst emits display math as <figure class="math-display ...">
142+
//Typst emits display math as <figure class="math-display ...">
168143
"figure.math-display": {
169-
marginTop: "1em",
170-
marginBottom: "1em",
171-
overflowX: "auto",
172-
},
173-
"figure.math-display > svg.typst-frame": {
174-
maxWidth: "100%",
144+
marginTop: "1.15em",
145+
marginBottom: "1.15em",
175146
},
176147

177148
// Typst HTML: definitions/theorems often come out as plain <div>
@@ -182,9 +153,9 @@ module.exports = {
182153
marginBottom: "0.85em",
183154
},
184155

185-
// Keep large inline SVG math from overflowing on narrow screens.
186-
".typst-content span.inline-block": { maxWidth: "100%" },
187-
".typst-content svg.typst-frame": { maxWidth: "100%" },
156+
// // Keep large inline SVG math from overflowing on narrow screens.
157+
// ".typst-content span.inline-block": { maxWidth: "100%" },
158+
// ".typst-content svg.typst-frame": { maxWidth: "100%" },
188159

189160
// Typst uses list containers with `list-style-type: none` for
190161
// bibliography + endnotes; override Tailwind prose indentation.

0 commit comments

Comments
 (0)