GeneralDeclareOptionX

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
erwann
Posts: 75
Joined: Thu Aug 25, 2016 2:24 am

DeclareOptionX

Post by erwann »

How would I modify skeleton.dtx to pass an option with a default value?

Code: Select all

% \section{Implementation}
%
%    \begin{macrocode}
\DeclareOptionX{cartoon}[Betty Boop]{
\def\the@cartoon
	{
		#1
	}
}
%    \end{macrocode}
Where would I put

Code: Select all

\RequirePackage{xkeyval}
?
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

erwann
Posts: 75
Joined: Thu Aug 25, 2016 2:24 am

DeclareOptionX

Post by erwann »

No luck with Skeleton's template. But by rearranging things, I got DeclareOptionX to work:

Code: Select all

% \section{Implementation}
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{foo}[2018/02/12 v1.0]
\RequirePackage{xkeyval}
\DeclareOptionX{option}[value]{---code---}
\ProcessOptionsX
%    \end{macrocode}
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)
erwann
Posts: 75
Joined: Thu Aug 25, 2016 2:24 am

DeclareOptionX

Post by erwann »

x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)
Post Reply