我正在尝试将源代码作为附录(单列样式)包含在 IEEE 格式(双列样式)文档中。我设法获得了单列附录并添加了源代码,但由于某种原因,我的代码在第一页就被截断了。我尝试添加新页面,但没有成功。这是我所拥有的:
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{minted}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}
\twocolumn[
\begin{@twocolumnfalse}
\include{Appendix}\newpage\cleardoublepage
\end{@twocolumnfalse}
]
\end{document}
In my Appendix I have
\appendix
\section{Source Code}
\begin{minted}
[frame=lines,
framesep=2mm,
baselinestretch=0.8,
fontsize=\small, linenos]{lua}
Source code here...
2 pages long
\end{minted}
我不太确定我哪里做错了但如果能得到任何帮助我都会很感激。
答案1
这是您的 MWE 的简化和修订版本,我认为它可以提供您想要的内容。
% ieeetranprob.tex SE 540633 twocol to onecol
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
%\usepackage{minted}
%\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{lipsum} % my addition fior convenience
\usepackage{comment} % my addition for convenience
\begin{document}
\section{Main} % just to start things off
\lipsum[1]
\begin{comment} % don't need this code
\twocolumn[
\begin{@twocolumnfalse}
\include{Appendix}\newpage\cleardoublepage
\end{comment}
In my Appendix I have
\onecolumn % starts a new page on onecolumn mode
\appendix[Source code] % give a title for the appendix
\lipsum[3]
% \section{Source Code} % \section inoperable within Appendix
\lipsum[2] % use this instead of the minted stuff
\begin{comment}
\begin{minted}
[frame=lines,
framesep=2mm,
baselinestretch=0.8,
fontsize=\small, linenos]{lua}
Source code here...
2 pages long
\end{minted}
\end{comment}
\begin{comment} % don't need the next two lines anymore
\end{@twocolumnfalse}
]
\end{comment}
\end{document}
该类的默认值是twocolumn
。使用 将\onecolumn
模式从两列更改为一列并开始一个新页面。