Fix regression in latex output

This commit is contained in:
Y. Wang 2024-01-28 19:40:08 +01:00
parent 51504061ab
commit 72ec38d947

View File

@ -47,6 +47,18 @@ function latex.describe_color(cstr)
end
end
--- Describe a coupler in LaTeX.
-- @tparam string coupler The name of the coupler.
-- @treturn string The string describing the coupler.
function latex.describe_coupler(coupler)
local name = utils.get_coupler_name(coupler)
if name then
return ([[%s (\texttt{%s})]]):format(SL(name), SL(coupler))
else
return ([[\texttt{%s}]]):format(SL(coupler))
end
end
--- Describe a wagon prototype in LaTeX.
-- @tparam string itemname The item name of the wagon prototype.
-- @treturn string The description of the prototype.
@ -151,7 +163,7 @@ function latex.describe_wagon_prototype(itemname)
ccouplers[k] = true
end
for k in pairs(ccouplers) do
local desc = SL(utils.get_coupler_name(k))
local desc = latex.describe_coupler(k)
table.insert(lcouplers, desc)
couplerid[desc] = k
end