Skip to content
Snippets Groups Projects
Commit 3a11cfb9 authored by Luke Naylor's avatar Luke Naylor
Browse files

Finalize listing captions

involved raggedleft and using \discretionary to allow breaking at ::
parent c2aa0e08
No related branches found
No related tags found
No related merge requests found
function rust_listing (dir, subpath) function rust_listing (dir, subpath)
local module_name = subpath:gsub(".tex$",""):gsub("mod$",""):gsub("/","::") local module_name = subpath
--module_name = module_name:gsub((".?"):rep(47) .. "::", "%1\\breakline{}" ) :gsub(".tex$","")
local caption = "\\texttt{" .. module_name .. "}" :gsub("mod$","")
:gsub("/","\\discretionary{}{::}{::}")
local caption = "\\raggedleft \\texttt{" .. module_name .. "}"
return ( return (
"\\lstinputlisting[" "\\lstinputlisting["
.. "caption={" .. caption .. "}" .. "caption={" .. caption .. "}"
.. "]{" .. dir .. subpath .. "}" .. "]{" .. dir .. subpath .. "}"
) )
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment