Skip to content

Commit

Permalink
Add cramped option
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Jul 29, 2023
1 parent 5cbcf48 commit 9ed3c0f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/quiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ QuiverExport.tikz_cd = new class extends QuiverExport {
if (settings.get("export.ampersand_replacement")) {
diagram_options.push("ampersand replacement=\\&");
}
// Cramped.
if (settings.get("export.cramped")) {
diagram_options.push("cramped");
}
// Column and row separation.
const sep = {
column: `${options.sep.column.toFixed(2)}em`,
Expand Down
11 changes: 11 additions & 0 deletions src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3533,6 +3533,8 @@ class Settings {
"export.centre_diagram": true,
// Whether to use `\&` instead of `&` for column separators in tikz-cd output.
"export.ampersand_replacement": false,
// Whether to export diagrams with the `cramped` option.
"export.cramped": false,
// Whether to use a fixed size for the embedded `<iframe>`, or compute the size based on
// the diagram.
"export.embed.fixed_size": false,
Expand Down Expand Up @@ -4425,6 +4427,10 @@ class Panel {
type: "checkbox",
"data-setting": "export.ampersand_replacement",
});
const cramped = new DOM.Element("input", {
type: "checkbox",
"data-setting": "export.cramped",
});
latex_options = new DOM.Div({ class: "options latex hidden" })
.add(new DOM.Element("label")
.add(centre_checkbox)
Expand All @@ -4434,6 +4440,10 @@ class Panel {
.add(ampersand_replacement)
.add("Ampersand replacement")
)
.add(new DOM.Element("label")
.add(cramped)
.add("Cramped")
)
.add(sep_sliders.column.label)
.add(sep_sliders.row.label)
.add_to(export_pane);
Expand Down Expand Up @@ -4470,6 +4480,7 @@ class Panel {
const checkboxes = [
[centre_checkbox, "tikz-cd", "C"],
[ampersand_replacement, "tikz-cd", "A"],
[cramped, "tikz-cd", "R"],
[fixed_size_checkbox, "html", "F"],
];
const shortcuts = [];
Expand Down

0 comments on commit 9ed3c0f

Please sign in to comment.