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

[fix] equation numbering with circuits #4

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 7 additions & 6 deletions src/draw-functions.typ
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@



// create a sized brace with given length.
// Creates a sized brace with given length.
// `brace` can be auto, defaulting to "{" if alignment is right
// and "}" if alignment is left.
// and "}" if alignment is left. Other possible values are
// "[", "]", "|", "{", and "}".
#let create-brace(brace, alignment, length) = {
let brace-symbol = if brace == auto {
if alignment == right {"{"} else {"}"}
} else { brace }
return $ lr(#brace-symbol#block(height: length)) $
if brace == auto {
brace = if alignment == right {"{"} else {"}"}
}
return $ lr(#brace, size: length) $
}


Expand Down
3 changes: 2 additions & 1 deletion src/quill.typ
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
panic("Unexpected named argument '" + children.named().keys().at(0) + "' for quantum-circuit()")
}
set text(color, size: font-size)

set math.equation(numbering: none)

style(styles => {

// Parameter object to pass to draw-function containing current style info
Expand Down
Binary file added tests/decorations/lstick rstick/ref/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion tests/decorations/lstick rstick/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@

#quantum-circuit(
1, rstick("very long rstick")
)
)

#pagebreak()

// lstick with equation numbering
#set math.equation(numbering: "1")
#quantum-circuit(
lstick($|0〉$, brace: "{"), 1
)
Loading