-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto-add tags cetz/tikz to diagram.metadata.tags based on file extension
- Loading branch information
Showing
11 changed files
with
153 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
} | ||
|
||
#canvas({ | ||
// Set up the plot | ||
draw.set-style( | ||
axes: ( | ||
y: (label: (anchor: "south-west")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#import "@preview/cetz:0.3.1": canvas, draw | ||
|
||
#set page(width: auto, height: auto, margin: 8pt) | ||
|
||
#let x-range = 3 | ||
#let y-range = 3 | ||
#let ratio = 3 / 4 | ||
|
||
#canvas({ | ||
// Set up coordinate system | ||
import draw: circle, content, line | ||
|
||
// Draw blue circle with fill in background | ||
circle( | ||
(0, 0), | ||
radius: 2 / 3 * y-range, | ||
stroke: blue, | ||
fill: blue.lighten(80%), | ||
fill-opacity: 0.2, | ||
name: "fermi-circle", | ||
) | ||
|
||
// Draw dot grid | ||
for x in range(-x-range, x-range + 1) { | ||
for y in range(-y-range, y-range + 1) { | ||
circle((x, ratio * y), radius: 2pt, fill: black) | ||
} | ||
} | ||
|
||
// Draw axes with arrows | ||
let arrow-style = (mark: (end: "stealth", fill: black)) | ||
let x-end = (x-range + 0.5, 0) | ||
let y-end = (0, ratio * y-range + 0.5) | ||
|
||
line((-x-range - 0.5, 0), x-end, ..arrow-style) | ||
line((0, -ratio * y-range - 0.5), y-end, ..arrow-style, name: "y-axis") | ||
|
||
// Add axis labels | ||
content(x-end, $k_x$, anchor: "south-west") | ||
content((rel: (.55, 0), to: "y-axis.end"), $k_y$, anchor: "north-east") | ||
|
||
// Draw lattice spacing indicators with arrows | ||
let spacing-arrow = (mark: (start: "stealth", end: "stealth", fill: black, scale: .3, offset: 0.1), stroke: 0.7pt) | ||
let x-start = (x-range - 1, -ratio * y-range) | ||
let x-end = (x-range, -ratio * y-range) | ||
let x-mid = ((x-start.at(0) + x-end.at(0)) / 2, x-start.at(1)) | ||
|
||
line(x-start, x-end, ..spacing-arrow, name: "x-spacing") | ||
content("x-spacing.mid", $(2pi) / L_x$, anchor: "north", padding: 0.2) | ||
|
||
let y-start = (x-range, -ratio * y-range) | ||
let y-end = (x-range, -ratio * y-range + ratio) | ||
|
||
line(y-start, y-end, ..spacing-arrow, name: "y-spacing") | ||
content("y-spacing.mid", $(2pi) / L_y$, anchor: "west", padding: 0.2) | ||
|
||
// Add N(k) label | ||
let angle = 130deg | ||
let label-pos = (calc.cos(angle) * 2.4, calc.sin(angle) * 2.4) | ||
content(label-pos, text(blue)[$N(k)$]) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters