# clearpage with appendices

I am compiling my dissertation chapters. When I wrote a chapter in a standalone Latex file, the file did compile without any error. However, when I copied the text body from the standalone to an "input" file, I get the following error message:

! Undefined control sequence.
\clear@ppage ->\if@openright
\cleardoublepage \else \clearpage \fi
l.103 \begin{appendices}
The control sequence at the end of the top line
of your error message was never \def'ed.


Here is a minimal example which reproduces this error:

%Codes in the main latex file
\documentclass[oneside,final, letterpaper]{ucr}
\usepackage{lipsum}
\usepackage[toc, page]{appendix} %Package used to create appendix

\begin{document}
\input{chapter1}
\end{document}

%Codes in the inputted file "chapter1"
\section{Intro}

\lipsum

\begin{appendices}
1. It shows error.
\end{appendices}


I will appreciate if someone could guide me here.

• Well, the code you've not shared uses \if@openright but never defines it. This occurs around line 103, when you use \begin{appendices}. So either make sure it is defined or don't use anything which uses it. If you want help with diagnosis, we need code for a MNWE which produces that error when compiled. Otherwise, all anybody can do is tell you what the error message says, which you hopefully already read. – cfr Jul 7 '18 at 1:01
• @cfr I apologize for my shoddiness here. I basically used the following codes:\clearpage \begin{appendices} some text \end{appendices}. I am not sure where \if@openright appears from. – TRa Jul 7 '18 at 1:05
• That's why you need to provide code for a minimal document which reproduces the error. If you can't tell which part of your code is responsible, even with the code, how should we guess, without it? – cfr Jul 7 '18 at 1:13
• @cfr Ok, I have edited my original post and now it includes a minimal example reproducing the error. – TRa Jul 7 '18 at 6:13
• Can you get the error if you change ucr to book, say? If not, where can we get ucr.cls? – cfr Jul 7 '18 at 10:08

The class ucr is incompatible with the package appendix. However, the class supports the inclusion of appendices in the table of contents, with their page numbers. I'm not sure what you want the appendix package for, but you don't need it for those features, at least. Rather than the appendices environment, just use \appendix as shown in the sample appendix.tex.

\begin{filecontents}{\jobname-ch1.tex}
\chapter{Intro}

\lipsum
\appendix
\chapter{Aardvark Appendectomies 1456/1567}
\begin{enumerate}
\item No package is necessary.
\item No error is thrown.
\end{enumerate}

\end{filecontents}

\documentclass[oneside,final, letterpaper]{ucr}
\usepackage{lipsum}

\begin{document}
\tableofcontents
\input{\jobname-ch1}
\end{document}


• Thank you so much for your time and effort. This is useful. – TRa Jul 7 '18 at 11:08