Using answer given in Procedure name with small caps in algorithm2e shows how to make procedure name all small caps in algorithm2e.
But I want to add _
between the names, as it is long name. Adding \_
in the name gives error.
What other options are there? Here is MWE that works, and below that I show the one that does not work
\documentclass[12pt]{article}
\usepackage[algosection, boxruled]{algorithm2e}
\usepackage{algpseudocode}
\usepackage{amsmath}
\begin{document}
\SetProcNameSty{textsc}
\SetProcArgSty{textsc}
\SetKwInOut{Input}{input}
\SetKwInOut{Output}{output}
\begin{procedure}
\caption{secondorderseriessolver()}
\Input{ode $y''=f(x,y,y')$}
\Output{solution}
\If{$f(x,y,y')$ analytic at $x=0$}
{
process\;
\textbf{return}
}
\end{procedure}
\end{document}
Changing the name of the procedure to \caption{second_order_series_solver()}
or \caption{second\_order\_series\_solver()}
both fail.
Then I tried the trick given in Can't use underscore in algorithm2e caption? but this produced the following
\usepackage{amsmath}
\begin{document}
\SetProcNameSty{textsc}
\SetProcArgSty{textsc}
\SetKwInOut{Input}{input}
\SetKwInOut{Output}{output}
\begin{procedure}
\caption{(second\_order\_series\_solver)}
\Input{ode $y''=f(x,y,y')$}
\Output{solution}
\If{$f(x,y,y')$ analytic at $x=0$}
{
process\;
\textbf{return}
}
\end{procedure}
\end{document}
Which produced this
Which is close to what I want, but not exactly. I wanted it to look like the first but with underscores like the second version. The second version has (..)
around it.
How to make name of procedure contain underscore? Btw, having small caps is not important at all for me. I just used it from the example given. I simply want the add _
between the names of the proc itself (not its arguments as given in the second answer below).
TL 2022
_
and not the names inside(....)
. i.e. I want same output as the first example shows, but with underscores. Your solution gives that but it also adds(...)
to the name as you can see.