Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new option for paper size #74

Open
ghost opened this issue Apr 11, 2019 · 0 comments
Open

new option for paper size #74

ghost opened this issue Apr 11, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 11, 2019

Hi check this new options for Dissertate.cls

It allows to choose between A4 and US Letter with:

dpaperafour OR dpaperletter

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{Dissertate}[2014/03/25 v2.0 Dissertate Class]

%
% Options
%
\RequirePackage{etoolbox}

%************************************%
\usepackage{ifthen}

% Paper size
%   Allows to use A4 or Letter paper sizes.

\newboolean{paperafour}
\newboolean{paperletter}

\DeclareOption{dpaperafour}{
    \setboolean{paperafour}{true}
}
\DeclareOption{dpaperletter}{
    \setboolean{paperletter}{true}
}
%************************************%

% Line spacing: dsingle/ddouble
%   Whether to use single- or doublespacing.
\newtoggle{DissertateSingleSpace}
\togglefalse{DissertateSingleSpace}
\DeclareOption{dsingle}{
    \toggletrue{DissertateSingleSpace}
    \ClassWarning{Dissertate}{Single-spaced mode on.}
}
\DeclareOption{ddouble}{\togglefalse{DissertateSingleSpace}}

%************************************%
% Process the options before reading them
\ProcessOptions\relax

% Paper size
\ifthenelse{\boolean{paperafour}}{
    \LoadClass[12pt, oneside,a4paper]{book}
    \ClassWarning{Dissertate}{Paper size set to A4.}
}{}

\ifthenelse{\boolean{paperletter}}{
    \LoadClass[12pt, oneside,letterpaper]{book}
    \ClassWarning{Dissertate}{Paper size set to US Letter.}
}{}
%************************************%

% Line Spacing
%   Define two line spacings: one for the body, and one that is more compressed.
\iftoggle{DissertateSingleSpace}{
    \newcommand{\dnormalspacing}{1.2}
    \newcommand{\dcompressedspacing}{1.0}
}{
    \newcommand{\dnormalspacing}{2.0}
    \newcommand{\dcompressedspacing}{1.2}
}

% Block quote with compressed spacing
\let\oldquote\quote
\let\endoldquote\endquote
\renewenvironment{quote}
    {\begin{spacing}{\dcompressedspacing}\oldquote}
    {\endoldquote\end{spacing}}

% Itemize with compressed spacing
\let\olditemize\itemize
\let\endolditemize\enditemize
\renewenvironment{itemize}
    {\begin{spacing}{\dcompressedspacing}\olditemize}
    {\endolditemize\end{spacing}}

% Enumerate with compressed spacing
\let\oldenumerate\enumerate
\let\endoldenumerate\endenumerate
\renewenvironment{enumerate}
    {\begin{spacing}{\dcompressedspacing}\oldenumerate}
    {\endoldenumerate\end{spacing}}

%************************************%
% Text layout.
\ifthenelse{\boolean{paperafour}}{
    \RequirePackage[width=5.75in, a4paper]{geometry}
}{}

\ifthenelse{\boolean{paperletter}}{
    \RequirePackage[width=5.75in,letterpaper]{geometry}    
}{}
%************************************%
\usepackage{ragged2e}
\RaggedRight
\RequirePackage{graphicx}
\usepackage{fixltx2e}
\parindent 12pt
\RequirePackage{lettrine}
\RequirePackage{setspace}
\RequirePackage{verbatim}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants