File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/resources/filters/crossref Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,26 @@ function initialize_custom_crossref_categories(meta)
70
70
local function as_latex (inlines )
71
71
return trim (pandoc .write (pandoc .Pandoc (inlines ), " latex" ))
72
72
end
73
+ local function emit_warning (msg )
74
+ warn (msg )
75
+ quarto .log .output (entry )
76
+ warn (" Compilation will continue, but the output is likely going to be incorrect." )
77
+ end
73
78
metaInjectLatex (meta , function (inject )
79
+ local ref_type = entry [" key" ]
80
+ if ref_type == nil then
81
+ emit_warning (" field 'key' is required for custom crossref environments, but is missing for the following entry:" )
82
+ return
83
+ end
74
84
local env_name = entry [" latex-env" ]
85
+ if env_name == nil then
86
+ emit_warning (" field 'latex-env' is required for custom crossref environments, but is missing for the following entry:" )
87
+ end
75
88
local name = entry [" reference-prefix" ]
76
89
local env_prefix = entry [" caption-prefix" ] or name
77
- local ref_type = entry [" key" ]
90
+ if env_prefix == nil then
91
+ emit_warning (" fields 'caption-prefix' or 'reference-prefix' are required for custom crossref environments, but are missing for the following entry:" )
92
+ end
78
93
local list_of_name = entry [" latex-list-of-file-extension" ] or (" lo" .. ref_type )
79
94
local list_of_description = entry [" latex-list-of-description" ] or name
80
95
local cap_location = entry [" caption-location" ] or " bottom"
You can’t perform that action at this time.
0 commit comments