
님의 캡션 에 줄바꿈하는 옵션이 있나요 lstlisting
? 예를 들어:
\begin{lstlisting}[frame=single, caption=uppertext\\lowertext)]
나는 \\
다른 솔루션을 시도했지만 그중 하나가 작동합니다.
답변1
caption
를 사용하여 설정할 수 있습니다 tabular
. 그러나 또한선택 과목캡션(에 대한 \lstlistoflistings
)없이줄 바꿈 tabular
:
\documentclass{article}
\usepackage{listings}
\begin{document}
\lstlistoflistings
\begin{lstlisting}[
frame = single,
caption = {[upper/lower text]%
\begin{tabular}[t]{@{}l@{}}
upper text \\
lower text \\[.5\normalbaselineskip]
\end{tabular}}
]
Hello world
\end{lstlisting}
\end{document}
로 인해 frame
일부 수직 조정이 필요합니다( 형식 \\[.5\normalbaselineskip]
).