Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Thesis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
luke naylor latex documents
research
Thesis
Commits
3a11cfb9
Commit
3a11cfb9
authored
1 year ago
by
Luke Naylor
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
listing.lua
+9
-5
9 additions, 5 deletions
listing.lua
with
9 additions
and
5 deletions
listing.lua
+
9
−
5
View file @
3a11cfb9
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment