function nl() return('\n') end newline='\n' TabOfBibliography={} Tabofitems={} function addtoTabofitems(item) local vyskyt = false for i = 1, #Tabofitems do if Tabofitems[i] == item then vyskyt = true end end if not(vyskyt) then table.insert(Tabofitems,item) end end function insertintobibliography(item, content) table.insert(TabOfBibliography,item,content) end function createbibliographyfile() -- This function creates a component that has already sorted the bibl. items -- which respectively appear in the bibliography. There are read command \component tmp_genbiblfile bibliography=io.open('tmp_genbiblfile.tex',"w+") local varbibliography='% This file is automatically generated createbibliographyfile lua function () '..newline..newline varbibliography=varbibliography..'\\startcomponent tmp_genbiblfile'..newline varbibliography=varbibliography..'\\product dphk'..newline varbibliography=varbibliography..'\\environment dp_env'..newline..newline varbibliography=varbibliography..'\\startbibliography'..newline..newline for i=1, table.getn(Tabofitems) do local tempvar1=Tabofitems[i] local tempvar2=TabOfBibliography[tonumber(tempvar1)] varbibliography=varbibliography..'\\item[bibl:'..tempvar1..'] ' varbibliography=varbibliography..'('..tempvar1..') ' -- nakonec zakomentovat varbibliography=varbibliography..tempvar2..newline..newline end varbibliography=varbibliography..'\\stopbibliography'..newline varbibliography=varbibliography..'\\stopcomponent'..newline varbibliography=string.gsub(varbibliography, 'ZNAKPROCENTA', '\\letterpercent') varbibliography=string.gsub(varbibliography, 'URLBIB:', '\\URLBIB:') bibliography:write(varbibliography) bibliography:close() end