# Option clash from another class emulating package

I am using ShareLaTex with the UC Berkeley Thesis template.

I want to load appendix with the titletoc and header options:

\usepackage[titletoc,header]{appendix}
\usepackage{algorithmic}


It throws a compile error.

LaTeX Error: Option clash for package appendix.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.24 \usepackage
{algorithmic}
[]
There has now been an attempt to load it with options
[titletoc,toc]


I gather appendix is being loaded from the memoire class used by the ucbthesis class included with the template. Digging into the raw logs I find this:

Package appendix [2008/07/23] emulated by memoir.


So... is there a way I can tell memoir to not emulate appendix?

Here is a sample from the ucbthesis class where memoire is passed a bunch of options.

\newcommand\thes@sidedness{-1}
\DeclareOption{oneside}
{\renewcommand\thes@sidedness{1}\PassOptionsToClass{\CurrentOption}{memoir}}
\DeclareOption{twoside}
{\renewcommand\thes@sidedness{2}\PassOptionsToClass{\CurrentOption}{memoir}}

%  Changing the default point size from 10pt to 12pt uses a similar procedure,
%  but it's messier.

\newcommand\thes@ptsize{0}
\DeclareOption{9pt}
{\renewcommand\thes@ptsize{9}\PassOptionsToClass{\CurrentOption}{memoir}}
\DeclareOption{*pt}
{\renewcommand\thes@ptsize{99}\PassOptionsToClass{\CurrentOption}{memoir}}

% Other options are passed on to the memoir class.

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}

• memoir does provide \DisemulatePackage{appendix}, but that only ensures that you can load the package. It does not, however, take care of commands that are already defined. Perhaps, instead of following this route, you could explain what appendix provides that memoir does not, as it may be easier to update memoir to do what you're after. – Werner Nov 10 '16 at 0:52

Not really, you can use

\DisemulatePackage{appendix}


to stop memoir claiming that appendix is loaded, but then if you try to load it

\documentclass[titletoc,header]{memoir}
\DisemulatePackage{appendix}

! LaTeX Error: Command \c@@ppsavesec already defined.

the appendix functionality isn't implemented by loading appendix with some fixed options, it is just embedded in the core memoir code as far as I can see in the sources. You should look to see if there is a "memoir-way" for whatever layout you wanted.