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)
local module_name = subpath:gsub(".tex$",""):gsub("mod$",""):gsub("/","::")
--module_name = module_name:gsub((".?"):rep(47) .. "::", "%1\\breakline{}" )
local caption = "\\texttt{" .. module_name .. "}"
local module_name = subpath
:gsub(".tex$","")
:gsub("mod$","")
:gsub("/","\\discretionary{}{::}{::}")
local caption = "\\raggedleft \\texttt{" .. module_name .. "}"
return (
"\\lstinputlisting["
.. "caption={" .. caption .. "}"
.. "]{" .. dir .. subpath .. "}"
.. "caption={" .. caption .. "}"
.. "]{" .. dir .. subpath .. "}"
)
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