为部分figure设置wrap

Signed-off-by: szdytom <szdytom@qq.com>
This commit is contained in:
方而静 2025-07-27 23:15:35 +08:00
parent fdb7253e34
commit d730f1068f
Signed by: szTom
GPG Key ID: 072D999D60C6473C
3 changed files with 18 additions and 15 deletions

View File

@ -520,6 +520,7 @@
table( table(
columns: 4, columns: 4,
stroke: none, stroke: none,
inset: 5pt,
align: top + left, align: top + left,
..for k in range(1, 5) { ..for k in range(1, 5) {
(box(cetz.canvas({ (box(cetz.canvas({

View File

@ -1,5 +1,6 @@
#import "@preview/cetz:0.4.0" #import "@preview/cetz:0.4.0"
#import "@preview/cetz-venn:0.1.4" #import "@preview/cetz-venn:0.1.4"
#import "@preview/wrap-it:0.1.1": wrap-content
#import "../styles.typ": exercise_sol, note, tab, exercise_ref, math_numbering #import "../styles.typ": exercise_sol, note, tab, exercise_ref, math_numbering
#import "../math.typ": span, Poly, rhs, lhs #import "../math.typ": span, Poly, rhs, lhs
@ -448,16 +449,13 @@
][ ][
有限集的并集的元素数量公式,由容斥原理给出,对于三个集合而言, 有限集的并集的元素数量公式,由容斥原理给出,对于三个集合而言,
$ \#(A union B union C) =& \#A + \#B + \#C \ #[
&- \#(A inter B) - \#(A inter C) - \#(B inter C) \ #show: wrap-content.with(figure(cetz.canvas({
&+ \#(A inter B inter C) $ let c1 = aux_color_set.at("80")
let c2 = theme_color_set.at("60")
#figure(cetz.canvas({ let c3 = theme_color_set.at("80")
let c1 = theme_color_set.at("60")
let c2 = aux_color_set.at("100")
let c3 = theme_color_set.at("100")
cetz-venn.venn3( cetz-venn.venn3(
stroke: 1pt + text_color_set.at("100"), stroke: 1pt + theme_color_set.at("100"),
a-fill: c1, a-fill: c1,
b-fill: c1, b-fill: c1,
c-fill: c1, c-fill: c1,
@ -466,13 +464,18 @@
bc-fill: c2, bc-fill: c2,
abc-fill: c3, abc-fill: c3,
) )
}), caption: [三个集合的韦恩图。], placement: auto) }), caption: [三个集合的韦恩图。]))
$ \#(A union B union C) =& \#A + \#B + \#C \
&- \#(A inter B) - \#(A inter C) - \#(B inter C) \
&+ \#(A inter B inter C) $
#tab 这能够很自然地迁移到有关子空间维数的公式上来。然而,这一猜想并不正确,考虑取 #tab 这能够很自然地迁移到有关子空间维数的公式上来。然而,这一猜想并不正确,考虑取
$ V_1 &= {(0, x) in RR^2 : x in RR} \ $ V_1 &= {(0, x) in RR^2 : x in RR} \
V_2 &= {(x, 0) in RR^2 : x in RR} \ V_2 &= {(x, 0) in RR^2 : x in RR} \
V_3 &= {(x, x) in RR^2 : x in RR} $ V_3 &= {(x, x) in RR^2 : x in RR} $
]
#tab $dim V_1 = dim V_2 = dim V_3 = 1$$dim(V_1 inter V_2) = dim(V_1 inter V_3) = dim(V_2 inter V_3) = 0$$dim(V_1 inter V_2 inter V_3) = 0$,然而 $dim(V_1 + V_2 + V_3) = 2 != 1 + 1 + 1 - 0 - 0 - 0 + 0 = 3$ #tab $dim V_1 = dim V_2 = dim V_3 = 1$$dim(V_1 inter V_2) = dim(V_1 inter V_3) = dim(V_2 inter V_3) = 0$$dim(V_1 inter V_2 inter V_3) = 0$,然而 $dim(V_1 + V_2 + V_3) = 2 != 1 + 1 + 1 - 0 - 0 - 0 + 0 = 3$

View File

@ -1,5 +1,4 @@
#import "@preview/showybox:2.0.4": showybox #import "@preview/showybox:2.0.4": showybox
#import "@preview/tableau-icons:0.1.0" as tbl
#import "@preview/cetz:0.4.0" #import "@preview/cetz:0.4.0"
#import "@preview/cetz-plot:0.1.2": plot #import "@preview/cetz-plot:0.1.2": plot
@ -23,7 +22,7 @@
#let showy_wrapper(title: "", margin: none, ..args) = { #let showy_wrapper(title: "", margin: none, ..args) = {
let b = if title != "" { let b = if title != "" {
showybox(title: text(font: zhfont_sans, title, weight: "regular"), ..args) showybox(title: text(font: zhfont_sans, title, weight: "semibold"), ..args)
} else { } else {
showybox(title: title, ..args) showybox(title: title, ..args)
} }
@ -36,7 +35,7 @@
} }
#let simple_box = showy_wrapper.with( #let simple_box = showy_wrapper.with(
breakable: true, breakable: false,
title-style: ( title-style: (
weight: 900, weight: 900,
color: text_color_set.at("100"), color: text_color_set.at("100"),
@ -92,8 +91,8 @@
set text(11pt) set text(11pt)
show figure.caption: set text(9pt, font: zhfont_fangsong) show figure.caption: set text(9pt, font: zhfont_fangsong)
show footnote.entry: set text(9pt, font: zhfont_fangsong) show footnote.entry: set text(9pt, font: zhfont_fangsong)
set table(stroke: 1pt + theme_color_set.at("100"), inset: 5pt) // set table(stroke: 1pt + theme_color_set.at("100"), inset: 5pt)
set grid(stroke: 1pt + theme_color_set.at("100")) // set grid(stroke: 1pt + theme_color_set.at("100"))
set highlight(fill: none, stroke: ( set highlight(fill: none, stroke: (
bottom: 4pt + theme_color_set.at("10") bottom: 4pt + theme_color_set.at("10")
)) ))