Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NeedsTeXFormat{LaTeX2e}
- ProvidesClass{myclass}
- RequirePackage{kvoptions}
- DeclareBoolOption{foo}
- ProcessKeyvalOptions*
- ifmyclass@foo
- def@title{foo}
- else
- def@title{bar}
- fi
- ProcessOptionsrelax
- LoadClass{article}
- documentclass[foo]{myclass}
- begin{document}
- maketitle
- end{document}
- LaTeX Warning: Unused global option(s):
- [foo].
- ifx@unusedoptionlist@emptyelse
- @latex@warning@no@line{Unused global option(s):^^J%
- @spaces[@unusedoptionlist]}%
- fi
- NeedsTeXFormat{LaTeX2e}
- ProvidesClass{testkeyval}[2018/01/19 Test key-value options]
- RequirePackage{kvoptions}
- DeclareStringOption[?]{foo}
- DeclareDefaultOption{PassOptionsToClass{CurrentOptionKey}{article}}
- ProcessKeyvalOptions*
- newcommandthefoo{`testkeyval@foo'}
- LoadClass{article}
- documentclass[foo=bar]{testkeyval}
- %documentclass[foo=bar,11pt]{testkeyval} % passes 11pt to article
- %documentclass[11pt]{testkeyval} % passes 11pt to article
- %documentclass{testkeyval} % default copyright and default fontsize for article
- %documentclass[foo]{testkeyval} % error
- begin{document}
- % Number of 'x's on second line: 10pt 0, 11pt 3.
- noindent
- x x x x x x x x x x x x x x x x x x x x x x x x x x x x
- x x x x x x x x x x x x x x
- foo is thefoo.
- end{document}
Add Comment
Please, Sign In to add comment