1
1
mirror of https://github.com/varkor/quiver.git synced 2024-09-11 05:46:13 +03:00

Fix export of multi-line labels

This commit is contained in:
varkor 2024-05-01 17:44:51 +03:00
parent c3dfd9d51f
commit 46269555e2
4 changed files with 14 additions and 6 deletions

View File

@ -7,7 +7,7 @@ authors:
given-names: Nathanael
orcid: https://orcid.org/0000-0002-4092-7930
url: https://q.uiver.app/
version: 1.5.0
date-released: 2024-04-12
version: 1.5.1
date-released: 2024-05-01
repository-code: https://github.com/varkor/quiver
license: MIT

View File

@ -4,7 +4,7 @@
% This package is currently a wrapper around the `tikz-cd` package, importing necessary TikZ
% libraries, and defining a new TikZ style for curves of a fixed height.
%
% Version: 1.5.0
% Version: 1.5.1
% Authors:
% - varkor (https://github.com/varkor)
% - AndréC (https://tex.stackexchange.com/users/138900/andr%C3%A9c)

View File

@ -370,9 +370,17 @@ QuiverImportExport.tikz_cd = new class extends QuiverImportExport {
const simple_label = /^[a-zA-Z0-9\\]+$/;
// Adapt a label to be appropriate for TikZ output, by surrounding it in curly brackets when
// necessary, and using `\shortstack` for newlines.
// necessary, and using `\array` for newlines.
const format_label = (label) => {
return !simple_label.test(label) ? `{${label}}` : label;
if (label.includes("\\\\")) {
// The label may contain a newline. In this case, we place the label inside a table,
// which is permitted to contain newlines.
return `\\begin{array}{c} ${label} \\end{array}`;
}
if (!simple_label.test(label)) {
return `{${label}}`;
}
return label;
};
// We handle the export in two stages: vertices and edges. These are fundamentally handled

View File

@ -3,7 +3,7 @@
/// Various parameters.
Object.assign(CONSTANTS, {
/// The current quiver version.
VERSION: "1.5.0",
VERSION: "1.5.1",
/// When the `quiver.sty` package was last modified.
PACKAGE_VERSION: "2021/01/11",
/// We currently only support n-cells for (n ≤ 4). This restriction is not technical: it can be