Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a simple solution to get the empty set symbol \varnothing in LaTeX #41

Merged
merged 3 commits into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 36 additions & 25 deletions undergradmath.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
// Meta data
#set document(title: "Typst Math for Undergrads", author: "johanvx")

// Margin
#set page(margin: 0.5in)
// headcolor
#let headcolor = rgb("004225")

// Margin and footer
#set page(
margin: 0.5in,
footer: context {
if counter(page).display() == "2" {
grid(
columns: (1fr, 1fr),
[],
block(
inset: 4pt,
stroke: (top: headcolor),
text(headcolor)[johanvx (https://github.com/johanvx) #h(1fr) #datetime.today().display()]
)
)
} else {
[]
}
}
)

// Font size
#let scriptsize = 7pt
Expand Down Expand Up @@ -37,10 +57,7 @@
box(L + kern(-0.36em) + A + kern(-0.15em) + TeX)
})

// Update date
#let date = datetime.today().display()

// Unavailable (last check date)
// Unavailable (last check version)
#show "??": box(text(red, [v#sys.version #emoji.crossmark]))
// Tricky
#show "!!": box(text(blue, emoji.drops))
Expand All @@ -56,9 +73,6 @@
// Justified paragraphs
#set par(justify: true)

// headcolor
#let headcolor = rgb("004225")

// Run-in sections, like LaTeX \paragraph
#show heading.where(
level: 1
Expand All @@ -72,9 +86,6 @@
// Black raw code
#show raw.where(block: false): it => { it.text }

// Put this here to avoid affecting the title
#show link: underline

// Two-column layout
#show: rest => columns(2, rest)

Expand All @@ -83,6 +94,9 @@
#text(large, headcolor)[*Typst Math for Undergrads*]
])

// Put this here to avoid affecting the title
#show link: underline

This is a Typst port with typst #sys.version of _#LaTeX Math for Undergrads_ by Jim Hefferon.
The original version is available at #link("https://gitlab.com/jim.hefferon/undergradmath").

Expand Down Expand Up @@ -192,14 +206,19 @@ Get the set complement $A^(sans(c))$ with `A^(sans(c))` (or $A^(complement)$ wit
// through Character Variant cv01. The fontsetup package provides the option
// 'varnothing' to easily switch to the alternative character.

// https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf
// The NewComputerModern FontFamily §13.3
// http://mirrors.ctan.org/fonts/newcomputermodern/doc/newcm-doc.pdf
//
// Version 5.1
//
// The NewComputerModern FontFamily §14.5
// The Math fonts provide the character \varnothing (⌀, U+2300), as an alternative to \emptyset (a slashed zero), through Character Variant cv01.
// The fontsetup package provides the option ‘varnothing’ to easily switch to the alternative character.

/ Remark: Using `diameter` for `\varnothing` may cause some confusion. However, #LaTeX also uses $diameter$ (`\u{2300}`) instead of $\u{2205}$ (`\u{2205}`), see #link("https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf")[newcm $section$13.3].
Another solution is to use `text(font: "Fira Sans", nothing)`, but the resultant glyph $text(font: "Fira Sans", nothing)$ is subtly different from the widely used one.
Ultimately, the choice is always *your decision*.
/ Remark: Using `diameter` for `\varnothing` may cause some confusion.
However, in #LaTeX, the `\varnothing` provided through Character Variant `cv01` is also `diameter`
(see #link("http://mirrors.ctan.org/fonts/newcomputermodern/doc/newcm-doc.pdf")[newcm $section$14.5]).
So a simple solution with the default math font _New Computer Modern Math_ is to define a new symbol `varnothing` with `#let varnothing = math.diameter`.
Other solutions can be found in #link("https://sitandr.github.io/typst-examples-book/book/basics/math/symbols.html#empty-set")[Typst Examples Book].

= Decorations
#align(center, table(
Expand Down Expand Up @@ -556,11 +575,3 @@ For permutations use $n^(underline(r))$ from `n^(underline(r))` (some authors us

= For more
See also the Typst Documentation at #link("https://typst.app/docs").

#v(1fr)

#block(
inset: 4pt,
stroke: (top: headcolor),
text(headcolor)[johanvx (https://github.com/johanvx) #h(1fr) #date]
)
Loading