diff --git a/src/resources/editor/tools/vs-code.mjs b/src/resources/editor/tools/vs-code.mjs
index 197df2c5fa5..609b6579541 100644
--- a/src/resources/editor/tools/vs-code.mjs
+++ b/src/resources/editor/tools/vs-code.mjs
@@ -12251,6 +12251,15 @@ var require_yaml_intelligence_resources = __commonJS({
string: {
description: 'The description of the crossreferenceable object to be used in the title of the "list of" command. If unspecified, the field `name` is used.'
}
+ },
+ "cap-location": {
+ enum: [
+ "top",
+ "bottom",
+ "margin"
+ ],
+ default: "bottom",
+ description: "The location of the caption relative to the crossreferenceable content."
}
}
}
@@ -20807,6 +20816,10 @@ var require_yaml_intelligence_resources = __commonJS({
short: "The math font options for use with xelatex
or\nlualatex
.",
long: 'The math font options for use with xelatex
or\nlualatex
allowing any options available through fontspec
.'
},
+ {
+ short: "Adds additional directories to search for fonts when compiling with\nTypst.",
+ long: "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
+ },
{
short: "The CJK font options for use with xelatex
or\nlualatex
.",
long: 'The CJK font options for use with xelatex
or\nlualatex
allowing any options available through fontspec
.'
@@ -21290,10 +21303,6 @@ var require_yaml_intelligence_resources = __commonJS({
short: "The mode to use when previewing this document.",
long: "The mode to use when previewing this document. To disable any special\npreviewing features, pass raw
as the preview-mode."
},
- {
- short: "Adds additional directories to search for fonts when compiling with\nTypst.",
- long: "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
- },
{
short: "Adds the necessary setup to the document preamble to generate PDF/A\nof the type specified.",
long: 'Adds the necessary setup to the document preamble to generate PDF/A\nof the type specified.\nIf the value is set to true
, 1b:2005
will\nbe used as default.\nTo successfully generate PDF/A the required ICC color profiles have\nto be available and the content and all included files (such as images)\nhave to be standard conforming. The ICC profiles and output intent may\nbe specified using the variables pdfaiccprofile
and\npdfaintent
. See also ConTeXt PDFA for more\ndetails.'
@@ -22245,11 +22254,7 @@ var require_yaml_intelligence_resources = __commonJS({
},
"Disambiguating year suffix in author-date styles (e.g. \u201Ca\u201D in \u201CDoe,\n1999a\u201D).",
"Manuscript configuration",
- "internal-schema-hack",
- {
- short: "Adds additional directories to search for fonts when compiling with\nTypst.",
- long: "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
- }
+ "internal-schema-hack"
],
"schema/external-schemas.yml": [
{
@@ -22473,12 +22478,12 @@ var require_yaml_intelligence_resources = __commonJS({
mermaid: "%%"
},
"handlers/mermaid/schema.yml": {
- _internalId: 178550,
+ _internalId: 178553,
type: "object",
description: "be an object",
properties: {
"mermaid-format": {
- _internalId: 178542,
+ _internalId: 178545,
type: "enum",
enum: [
"png",
@@ -22494,7 +22499,7 @@ var require_yaml_intelligence_resources = __commonJS({
exhaustiveCompletions: true
},
theme: {
- _internalId: 178549,
+ _internalId: 178552,
type: "anyOf",
anyOf: [
{
diff --git a/src/resources/editor/tools/yaml/web-worker.js b/src/resources/editor/tools/yaml/web-worker.js
index f45d12c7e2f..23983929e9f 100644
--- a/src/resources/editor/tools/yaml/web-worker.js
+++ b/src/resources/editor/tools/yaml/web-worker.js
@@ -12252,6 +12252,15 @@ try {
string: {
description: 'The description of the crossreferenceable object to be used in the title of the "list of" command. If unspecified, the field `name` is used.'
}
+ },
+ "cap-location": {
+ enum: [
+ "top",
+ "bottom",
+ "margin"
+ ],
+ default: "bottom",
+ description: "The location of the caption relative to the crossreferenceable content."
}
}
}
@@ -20808,6 +20817,10 @@ try {
short: "The math font options for use with xelatex
or\nlualatex
.",
long: 'The math font options for use with xelatex
or\nlualatex
allowing any options available through fontspec
.'
},
+ {
+ short: "Adds additional directories to search for fonts when compiling with\nTypst.",
+ long: "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
+ },
{
short: "The CJK font options for use with xelatex
or\nlualatex
.",
long: 'The CJK font options for use with xelatex
or\nlualatex
allowing any options available through fontspec
.'
@@ -21291,10 +21304,6 @@ try {
short: "The mode to use when previewing this document.",
long: "The mode to use when previewing this document. To disable any special\npreviewing features, pass raw
as the preview-mode."
},
- {
- short: "Adds additional directories to search for fonts when compiling with\nTypst.",
- long: "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
- },
{
short: "Adds the necessary setup to the document preamble to generate PDF/A\nof the type specified.",
long: 'Adds the necessary setup to the document preamble to generate PDF/A\nof the type specified.\nIf the value is set to true
, 1b:2005
will\nbe used as default.\nTo successfully generate PDF/A the required ICC color profiles have\nto be available and the content and all included files (such as images)\nhave to be standard conforming. The ICC profiles and output intent may\nbe specified using the variables pdfaiccprofile
and\npdfaintent
. See also ConTeXt PDFA for more\ndetails.'
@@ -22246,11 +22255,7 @@ try {
},
"Disambiguating year suffix in author-date styles (e.g. \u201Ca\u201D in \u201CDoe,\n1999a\u201D).",
"Manuscript configuration",
- "internal-schema-hack",
- {
- short: "Adds additional directories to search for fonts when compiling with\nTypst.",
- long: "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
- }
+ "internal-schema-hack"
],
"schema/external-schemas.yml": [
{
@@ -22474,12 +22479,12 @@ try {
mermaid: "%%"
},
"handlers/mermaid/schema.yml": {
- _internalId: 178550,
+ _internalId: 178553,
type: "object",
description: "be an object",
properties: {
"mermaid-format": {
- _internalId: 178542,
+ _internalId: 178545,
type: "enum",
enum: [
"png",
@@ -22495,7 +22500,7 @@ try {
exhaustiveCompletions: true
},
theme: {
- _internalId: 178549,
+ _internalId: 178552,
type: "anyOf",
anyOf: [
{
diff --git a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json
index 101cadc2a9b..b789a548ce4 100644
--- a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json
+++ b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json
@@ -5223,6 +5223,15 @@
"string": {
"description": "The description of the crossreferenceable object to be used in the title of the \"list of\" command. If unspecified, the field `name` is used."
}
+ },
+ "cap-location": {
+ "enum": [
+ "top",
+ "bottom",
+ "margin"
+ ],
+ "default": "bottom",
+ "description": "The location of the caption relative to the crossreferenceable content."
}
}
}
@@ -13779,6 +13788,10 @@
"short": "The math font options for use with xelatex
or\nlualatex
.",
"long": "The math font options for use with xelatex
or\nlualatex
allowing any options available through fontspec
."
},
+ {
+ "short": "Adds additional directories to search for fonts when compiling with\nTypst.",
+ "long": "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
+ },
{
"short": "The CJK font options for use with xelatex
or\nlualatex
.",
"long": "The CJK font options for use with xelatex
or\nlualatex
allowing any options available through fontspec
."
@@ -14262,10 +14275,6 @@
"short": "The mode to use when previewing this document.",
"long": "The mode to use when previewing this document. To disable any special\npreviewing features, pass raw
as the preview-mode."
},
- {
- "short": "Adds additional directories to search for fonts when compiling with\nTypst.",
- "long": "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
- },
{
"short": "Adds the necessary setup to the document preamble to generate PDF/A\nof the type specified.",
"long": "Adds the necessary setup to the document preamble to generate PDF/A\nof the type specified.\nIf the value is set to true
, 1b:2005
will\nbe used as default.\nTo successfully generate PDF/A the required ICC color profiles have\nto be available and the content and all included files (such as images)\nhave to be standard conforming. The ICC profiles and output intent may\nbe specified using the variables pdfaiccprofile
and\npdfaintent
. See also ConTeXt PDFA for more\ndetails."
@@ -15217,11 +15226,7 @@
},
"Disambiguating year suffix in author-date styles (e.g. “a” in “Doe,\n1999a”).",
"Manuscript configuration",
- "internal-schema-hack",
- {
- "short": "Adds additional directories to search for fonts when compiling with\nTypst.",
- "long": "Locally, Typst uses installed system fonts. In addition, some custom\npath can be specified to add directories that should be scanned for\nfonts. Setting this configuration will take precedence over any path set\nin TYPST_FONT_PATHS environment variable."
- }
+ "internal-schema-hack"
],
"schema/external-schemas.yml": [
{
@@ -15445,12 +15450,12 @@
"mermaid": "%%"
},
"handlers/mermaid/schema.yml": {
- "_internalId": 178550,
+ "_internalId": 178553,
"type": "object",
"description": "be an object",
"properties": {
"mermaid-format": {
- "_internalId": 178542,
+ "_internalId": 178545,
"type": "enum",
"enum": [
"png",
@@ -15466,7 +15471,7 @@
"exhaustiveCompletions": true
},
"theme": {
- "_internalId": 178549,
+ "_internalId": 178552,
"type": "anyOf",
"anyOf": [
{
diff --git a/src/resources/filters/crossref/custom.lua b/src/resources/filters/crossref/custom.lua
index 66c81c5d425..3710014c5a3 100644
--- a/src/resources/filters/crossref/custom.lua
+++ b/src/resources/filters/crossref/custom.lua
@@ -26,6 +26,7 @@ function initialize_custom_crossref_categories(meta)
["ref-type"] = function(v) return pandoc.utils.stringify(v) end,
["latex-env"] = function(v) return pandoc.utils.stringify(v) end,
["latex-list-of-file-extension"] = function(v) return pandoc.utils.stringify(v) end,
+ ["cap-location"] = function(v) return pandoc.utils.stringify(v) end,
["latex-list-of-description"] = function(v) return pandoc.utils.stringify(v) end,
["space-before-numbering"] = function(v) return v end,
}
@@ -33,6 +34,7 @@ function initialize_custom_crossref_categories(meta)
["default-caption-location"] = "default_caption_location",
["latex-env"] = "latex_env",
["latex-list-of-file-extension"] = "latex_list_of_file_extension",
+ ["cap-location"] = "cap_location",
["latex-list-of-description"] = "latex_list_of_description",
["ref-type"] = "ref_type",
["space-before-numbering"] = "space_before_numbering",
@@ -71,13 +73,11 @@ function initialize_custom_crossref_categories(meta)
local ref_type = entry["ref-type"]
local list_of_name = entry["latex-list-of-file-extension"] or ("lo" .. ref_type)
local list_of_description = entry["latex-list-of-description"] or name
+ local cap_location = entry["cap-location"] or "bottom"
local space_before_numbering = entry["space-before-numbering"]
if space_before_numbering == nil then
space_before_numbering = true
end
-
- -- FIXME do we need different "lop" extensions for each category?
- -- we should be able to test this by creating a document with listings and diagrams
inject(
usePackage("float") .. "\n" ..
@@ -86,6 +86,10 @@ function initialize_custom_crossref_categories(meta)
"\\floatname{".. env_name .. "}{" .. as_latex(title(ref_type, env_prefix)) .. "}\n"
)
+ if cap_location == "top" then
+ inject("\\floatstyle{plaintop}\n\\restylefloat{" .. env_name .. "}\n")
+ end
+
-- FIXME this is a bit of hack for the case of custom categories with
-- space-before-numbering: false
--
diff --git a/src/resources/schema/document-crossref.yml b/src/resources/schema/document-crossref.yml
index 97dfec80ccb..777ba55c011 100644
--- a/src/resources/schema/document-crossref.yml
+++ b/src/resources/schema/document-crossref.yml
@@ -38,6 +38,10 @@
latex-list-of-description:
string:
description: The description of the crossreferenceable object to be used in the title of the "list of" command. If unspecified, the field `name` is used.
+ cap-location:
+ enum: [top, bottom, margin]
+ default: bottom
+ description: The location of the caption relative to the crossreferenceable content.
chapters:
boolean: