显然,标题的位置不太美观;标题文本和框架/列表本身之间需要更多的空间。
我怎样才能做到这一点?
如果这很重要,我正在使用IEEEtran
文档类和包listings
。相关代码是
\documentclass[10pt, conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{listings}
\begin{document}
\lstset{basicstyle=\normalsize\ttfamily, breaklines=true, xleftmargin=2em, frame=single, framexleftmargin=15pt}
\begin{lstlisting}[caption={Search-based change access}, label={lst:query}]
<url>/changes/?q=change:<change_id>&o=LABELS&o=DETAILED_LABELS&o=DETAILED_ACCOUNTS&o=REVIEWER_UPDATES&o=MESSAGES
\end{lstlisting}
\end{document}
答案1
该caption
套装与以下产品配合使用listings
:
\documentclass[10pt, conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{listings}
\usepackage{caption}
\begin{document}
\lstset{basicstyle=\normalsize\ttfamily, breaklines=true, xleftmargin=2em, frame=single, framexleftmargin=15pt, belowcaptionskip=8pt}
\begin{lstlisting}[caption={Search-based change access}, label={lst:query}]
<url>/changes/?q=change:<change_id>&o=LABELS&o=DETAILED_LABELS&o=DETAILED_ACCOUNTS&o=REVIEWER_UPDATES&o=MESSAGES
\end{lstlisting}
\end{document}