Sebastian Walz 860d31cee1
Tohu vaBohu
2023-04-21 00:22:52 +02:00

33 lines
941 B
Lua

function ghsEUHazards ( ghs )
local options = ""
if next ( ghs.euHazards )
then
for index, value in ipairs ( ghs.euHazards )
do
if type ( value ) == "number"
then
if value < 100
then
value = "0" .. tostring ( value )
else
value = tostring ( value )
end
elseif type ( value ) == "table"
then
if value.substance ~= nil
then
options = options .. "substance=" .. value.organs
end
value = tostring ( value.id )
end
if options == ""
then
tex.print("\\ghs{euh}{"..value.."}")
else
tex.print("\\ghs["..options.."]{euh}{"..value.."}")
end
end
tex.print(tex.newline)
end
end