From d730f1068fa410cf124fe06eef2477f7688d8dbe Mon Sep 17 00:00:00 2001 From: szdytom Date: Sun, 27 Jul 2025 23:15:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E9=83=A8=E5=88=86figure=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEwrap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: szdytom --- sections/2A.typ | 1 + sections/2C.typ | 23 +++++++++++++---------- styles.typ | 9 ++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/sections/2A.typ b/sections/2A.typ index ddf92e6..843ab23 100644 --- a/sections/2A.typ +++ b/sections/2A.typ @@ -520,6 +520,7 @@ table( columns: 4, stroke: none, + inset: 5pt, align: top + left, ..for k in range(1, 5) { (box(cetz.canvas({ diff --git a/sections/2C.typ b/sections/2C.typ index 43003b3..58a39f0 100644 --- a/sections/2C.typ +++ b/sections/2C.typ @@ -1,5 +1,6 @@ #import "@preview/cetz:0.4.0" #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 "../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) \ - &+ \#(A inter B inter C) $ - - #figure(cetz.canvas({ - let c1 = theme_color_set.at("60") - let c2 = aux_color_set.at("100") - let c3 = theme_color_set.at("100") + #[ + #show: wrap-content.with(figure(cetz.canvas({ + let c1 = aux_color_set.at("80") + let c2 = theme_color_set.at("60") + let c3 = theme_color_set.at("80") cetz-venn.venn3( - stroke: 1pt + text_color_set.at("100"), + stroke: 1pt + theme_color_set.at("100"), a-fill: c1, b-fill: c1, c-fill: c1, @@ -466,13 +464,18 @@ bc-fill: c2, 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 这能够很自然地迁移到有关子空间维数的公式上来。然而,这一猜想并不正确,考虑取 $ V_1 &= {(0, x) 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} $ + ] #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$。 diff --git a/styles.typ b/styles.typ index 99c9d02..7ee8ce5 100644 --- a/styles.typ +++ b/styles.typ @@ -1,5 +1,4 @@ #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-plot:0.1.2": plot @@ -23,7 +22,7 @@ #let showy_wrapper(title: "", margin: none, ..args) = { 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 { showybox(title: title, ..args) } @@ -36,7 +35,7 @@ } #let simple_box = showy_wrapper.with( - breakable: true, + breakable: false, title-style: ( weight: 900, color: text_color_set.at("100"), @@ -92,8 +91,8 @@ set text(11pt) show figure.caption: 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 grid(stroke: 1pt + theme_color_set.at("100")) + // set table(stroke: 1pt + theme_color_set.at("100"), inset: 5pt) + // set grid(stroke: 1pt + theme_color_set.at("100")) set highlight(fill: none, stroke: ( bottom: 4pt + theme_color_set.at("10") ))