# Transfer all options of “geometry” to my package

In my package I need to use all of geometry package options, I can define one option landscape like this

\DeclareOption{landscape}{
\geometry{landscape}
}

\ProcessOptions\relax


My hope is to find a simple way to insert all of them as options in my package

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mypackage}[2018/02/14]

\RequirePackage{etoolbox}
\RequirePackage[margin=2cm]{geometry}
\RequirePackage{amsmath,amsfonts,amssymb}
\RequirePackage{tikz}
\RequirePackage[totpages,user]{zref}
\RequirePackage[explicit,compact]{titlesec}
\RequirePackage{fancyhdr}

\DeclareOption{landscape}{
\geometry{landscape}
}

\DeclareOption*{\PackageWarning{mypackage}{Unknown ‘\CurrentOption’ option}}

\ProcessOptions\relax

\def\foo{foo}

\endinput

• I don't know a way to do this automatically for all Options. But you should use something like \DeclareVoidOption{}{}{} for declaring Option without a value and the command \PassOptionsToPackage{}{} for telling the package what to do. Here an example: \DeclareVoidOption{landscape}{\PassOptionsToPackage{landscape}{geometry}}. – baghira Feb 16 '18 at 9:25
• I forgot to mention that if you use \DeclareVoidOption{}{} you need the package kvoptions. – baghira Feb 16 '18 at 9:41

\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{geometry}}