-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
Is there an easy way to have the complete code in a lstlisting environment underlined?
My current solution looks like this, but I'm not really happy with it.
\begin{lstlisting}[mathescape]
$\ul{if(gt(x1, 0)) then} $
...
\end{lstlisting}
Thx for any tips.
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
How can I set certain parts of an lstlisting in boldface?
\begin{lstlisting}[escapechar=@]
fun(foo, bar, @\textbf{baz}@ );
\end{lstlisting}
This compiles, but baz isn't set in boldface :( What am I missing?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello,
I'm working on a LaTeX document and using lstlisting to display my Java source code. My setup looks like this:
\lstset{
basicstyle=\ttfamily,
keywordstyle=\bfseries,
language=Java,
frame=single,
aboveskip=11pt,
belowskip=11pt,
breaklines=true,
breakatwhitespace=false,
showspaces=false…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to have a vertical line for indentation in the lstlisting environment, similar to what one can get in algorithm2e. I tried doing something like the code below, but the the |'s are not contiguous and the result is ugly.
\lstset{
...
showtabs=true,
tabsize=3,
tab=\hfill$|$\hfill…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I tried to change the "List of Listings" text with the command
\renewcommand*{\lstlistlistingname}{List of XYZ}
before my \begin{document}. What's wrong with this?
By the way
\renewcommand*{\lstlistingname}{NewListing}
worked like a charm.
Thank you
>>> More