Document ClassesFile ended while scanning use of \@defdefault@ds.

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Ethan Phan
Posts: 3
Joined: Tue Mar 31, 2015 10:58 am

File ended while scanning use of \@defdefault@ds.

Post by Ethan Phan »

Hi,

I'm now reading section 4.5 of 'clsguide'. As in this section, the writer discussed about the effects and use of the two constructions:

[code]\LoadClassWithOptions
\LoadPackageWithOptions[/code]
with
[code]\PassOptionsToClass
\PassOptionsToPackage[/code]
He then gave examples compared them to see the difference as following:

First Example
[code]\DeclareOption{landscape}{\@landscapetrue}
\ProcessOptions\relax
\LoadClassWithOptions{article}[/code]
Second Example
[code]\DeclareOption{landscape}{\@landscapetrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass{article}[/code]

Well, I'm not quite clear of what the author explained, so I made some testing by creating a 'temp.tex'

[code]
% temp.tex using for testing purpose only
\documentclass[<option-list>]{custart}
\begin{document}
\begin{abstract}
It is shown that...
\end{abstract}
\section{Introduction}
A module $ M $ is called ...
\end{document}[/code]
and a custart.cls (customary article class) with its content to be either the first or second example, respectively.

After all, I got some 'strange' results and I don't understand them nor how to fix them. Please help :geek:

With the 'custart.cls' together with First Example, and <option-list> to be "landscape" and "titlepage", the typesetting results in PDF is a normal paper (no landspace) in both cases---with or without <option-list>.

With the 'custart.cls' together with Second Example, <option-list> are the same as above, all I got is Errors(!)
If the <option-list> is on, then LaTeX says that the 'abstract' enviroment and also 'section' are undefinded sequences (whereas, in my mind, by calling 'LoadClass{article} they should be well-defined as well).
If either I delete those options, i.e., <option-list> off, or I delete all those 'section' and 'abstract', then last result is "temp.tex | line 2 | File ended while scanning use of \@defdefault@ds. \begin".

Would you explain me again what was happened? If possible, please also help me clearly understand their differences between First and Second Examples. Thank you for reading this.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

File ended while scanning use of \@defdefault@ds.

Post by Johannes_B »

I don't have much time right now. Here is a short example for you to play around, some notes. Please also have a look at Class for CVs where i was explaining the option handling a bit. If you have further questions, to the linked thread or here, please feel free to ask.

Code: Select all

%\RequirePackage{filecontents}
\begin{filecontents}{\jobname-first.cls}
	\DeclareOption{landscape}{\PassOptionsToClass{landscape}{article}}
	\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
	\ProcessOptions\relax
	\LoadClass{article}
\end{filecontents}
\begin{filecontents}{\jobname-second.cls}
	\DeclareOption{landscape}{\@landscapetrue}%that is never defined
	\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
	\ProcessOptions\relax
	\LoadClass{article}
\end{filecontents}
\documentclass[landscape,titlepage
%]{\jobname-first}
%]{\jobname-second}
]{article}
\title{test}
\author{ethan}
%\input{pdftex.def}
\begin{document}
\maketitle
\begin{abstract}
	It is shown that...
\end{abstract}
\section{Introduction}
A module $ M $ is called
...
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply