0

I am trying to include source code as an appendix (one column style) in an IEEE format (two-column style) document. I have managed to get a single column appendix and the source code added, however for some reason my code is cut off at first page. I have tried to add a new page but it doesn't work. This is what I have:

\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}

I'm not too sure where I've gone wrong but any help would be appreciated.

Page cutoff

flavs
  • 3
  • 1
  • 1
    The optional argument of \twocolumn (or \onecolumn) is intended for things like chapter titles and cannot extend over multiple pages. See also https://tex.stackexchange.com/questions/477188/removing-the-space-in-the-page-before-appendix/477197?r=SearchResults&s=2|18.0398#477197 – John Kormylo Apr 25 '20 at 16:40

1 Answers1

0

Here is a simplified and revised version of your MWE which gives you what I believe you want.

% 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}

The class default is twocolumn. Using \onecolumn changes the mode from two to one column and starts a new page.

Peter Wilson
  • 28,066