Rename "Algorithm" to "Listing"
Solution
Do not mix lst:
with Algorithm floats. The previous solution used \newcommand{\algorithmname}{Listing}
, but this could result in LaTeX Error: Command \algorithmname already defined. Instead, apply the following changes:
- Rename
lst:
toalg:
. - Change the preamble to:
\usepackage{float} \floatname{algorithm}{Listing} \renewcommand{\algorithmname}{Listing}
This does not change the "List of Algorithms" to "List of Listings". The text is found in "stdfloats.inc":
Float
Type algorithm
GuiName Algorithm
Placement tbp
Extension loa
NumberWithin none
Style ruled
ListName "List of Algorithms"
LaTeXBuiltin false
End
The improper way to fix this is:
- Edit stdfloats.inc.
- Change "List of Algorithms" to "List of Listings".
- Click Tools >> Reconfigure.
- Restart LyX.
At this point, "List of Algorithms" will read "List of Listings".
Fora separate doc add in Document > Settings > Local Layout
:
Float
Type listing
GuiName Code Listing
Placement tbp
Extension lol
NumberWithin none
Style ruled
ListName "List of Listings"
LaTeXBuiltin false
End
Then you can insert this with menu Insert > Float > Listing
.
This makes the choice document-specific and allows you to use both, rather than change the entire Lyx install.
I changed the List of Algorithms
to List of Listings
with:
\renewcommand{\listofalgorithms}{
\begingroup
\listof{algorithm}{List of Listings}
\endgroup
}