0

I am using a latex template, and for some reason it is A4 intead of letter. I have tried setting the documentclass[] to letter, letterpaper, \special{papersize=215.9mm,279.4mm}, and

\usepackage{geometry}
\geometry{letterpaper, landscape}

, but none helped.

What and where could be the problem?

Here is my hole .tex file. How can I turn this into letter, because currently it is A4. I am writing the document on overleaf.

EDIT: if I add \geometry{letterpaper} just before the document starts, I get letter size, but everything is distorted. So I suppose one on the packages uses a4...

% \documentclass[letterpaper,12pt,TexShade,oneside]{book} 
\documentclass[letterpaper,pagesize,12pt,TexShade,oneside]{book} 
\special{papersize=215.9mm,279.4mm}
\RequirePackage{fix-cm}
\usepackage{etex}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{etex}
\usepackage{epsfig}
\usepackage{amsmath}
%\usepackage{subfigure}
\usepackage[landscape]{geometry}
\usepackage{lscape}
\usepackage[pdfa,colorlinks=true,urlcolor=black]{hyperref}
\usepackage{tabularx}
\usepackage{mathabx}
\usepackage{multirow}
\usepackage{moreverb}
\usepackage{multicol}
\usepackage{alltt}
\usepackage{setspace}
\usepackage{multirow}
\usepackage{lscape}
\usepackage[all]{xy}
\usepackage{color}
\usepackage{makeidx}
\usepackage{fancyvrb}
\usepackage{inputenc}
\usepackage{dsfont}
\usepackage{moreverb}
\usepackage{array}
\usepackage{supertabular}
\usepackage{hhline}
\usepackage{rotating}
\hypersetup{colorlinks=true, linkcolor=Brown, citecolor=Brown, filecolor=Brown, urlcolor=Brown}
\usepackage{epsfig}
\usepackage{calc}
\usepackage{listings}
\usepackage[T1]{fontenc}
\usepackage{bm}
% \usepackage{amsthm}
\usepackage{theorem}
\usepackage{times,epsfig}
\usepackage{calc}
\usepackage{moresize}
%\usepackage[ruled]{algorithm2e}
\usepackage[caption=false]{subfig}
\usepackage{url}
\usepackage{multirow}
\usepackage[bf,rm,medium,compact]{titlesec}
\usepackage{times}  
\usepackage{pifont}     % to include symbols from different fonts (e.g.  \rtm)
\usepackage{eurosym}    % for the euro symbol, package by Henrik Theiling
\usepackage{amstext}    % AMS for e.g. \text{}
\usepackage{graphicx}
\usepackage{booktabs}   % tables as required by journals
\usepackage{fancyhdr}                % fancy page headers/footers
\usepackage{vmargin}    % for \setmarginsrb                                      
\usepackage{xspace}
\usepackage{xcolor}
\usepackage{algorithm2e}
\usepackage{latex-pkg/postscript} % HV's elaboration of epsf
\usepackage[nolineno]{latex-pkg/lgrind}     % for typesetting MSL, Gentle, C, C++, ... code
\usepackage[grey]{latex-pkg/quotchap}
\usepackage{latex-pkg/TexShade}
%\usepackage[ruled]{algorithm2e}
\usepackage[caption=false]{subfig}
\usepackage{url}
\usepackage{multirow}
\usepackage[bf,rm,medium,compact]{titlesec} % nice section titles
\usepackage{pifont}     % to include symbols from different fonts (e.g.  \rtm)
\usepackage{eurosym}    % for the euro symbol, package by Henrik Theiling
\usepackage{amstext}    % AMS for e.g. \text{}
\usepackage{booktabs}   % tables as required by journals
\usepackage{fancyhdr}                % fancy page headers/footers
\usepackage{vmargin}    % for \setmarginsrb                                      
\usepackage{latex-pkg/postscript} % HV's elaboration of epsf
\usepackage[nolineno]{latex-pkg/lgrind}     % for typesetting MSL, Gentle, C, C++, ... code
\usepackage[grey]{latex-pkg/quotchap}
\usepackage{latex-pkg/TexShade}
\usepackage{longtable}
\usepackage{ltcaption}

\usepackage[toc,page]{appendix}
\usepackage[pagewise]{lineno} % line numbering per page

\usepackage{textcomp} % registered and copyright symbol

% The ltcaption package supports \CaptionLabelFont & \CaptionTextFont
% introduced by the NTG document classes
\renewcommand\CaptionLabelFont{\normalsize}
\renewcommand\CaptionTextFont{\normalsize}

%
%  Brown  Maroon  NavyBlue  MidnightBlue  
%

% INCLUDE HVs CUSTOMIZATIONS
\input{latex-pkg/defaultcustom.tex}
% INCLUDE LATEX PACKAGES

\makeatletter
\newcommand\arraybslash{\let\\\@arraycr}
%\@addtoreset{chapter}{part}
\makeatother



\lstset{basicstyle=\normalsize\ttfamily,breaklines=true}
\lstset{framextopmargin=5pt,frame=bottomline}


%[latin1]
% INCLUDE LATEX PREAMBLE
% SETTINGS FOR listings PACKAGE
\lstset{
    numberstyle=\tiny,
    numbers=left,
    stepnumber=1,
    numbersep=5pt,
    tabsize=2,
    showstringspaces=false,
    aboveskip=\smallskipamount,
    belowskip=\smallskipamount,
    lineskip=-2pt
}

% PAGE COLOR and SETTINGSx
\pagecolor{white}

% \setlength{\headheight}{2cm}
% \setlength{\marginparwidth}{1.9cm}
% MAKE INDEX
\makeindex

% CUSTOM COMMANDS
\newcommand{\linka}[1]{{\tt\htmladdnormallink{#1}{#1}}}
\newcommand{\linkb}[2]{{\tt\htmladdnormallink{#1}{#2}}}
\newcommand{\parcomment}[1]{\marginpar{\scriptsize{\textcolor{blue}{#1}}}}
\newcommand{\defn}[2]{{\begin{minipage}{\textwidth}\vspace{2pt}\emph{\textbf{#1}}:\vspace{1pt}\begin{center}\fbox{\begin{minipage}{5.5in}#2\end{minipage}}\end{center}\vspace{2pt}\end{minipage}}}

% lgrind FONTS
\def\BGfont{\small\tt}
\def\CMfont{\small\tt}
\def\NOfont{\small\tt}
\def\KWfont{\small\tt}
\def\STfont{\small\tt}
\def\TTfont{\small\tt}
\def\VRfont{\small\tt}

% KZ definitions
\input{content/thesisparams.tex}

% DOCUMENT BEGINS
\begin{document}


\pagestyle{empty} %defines the general contents of the headers and footers (e.g. where the page number will be printed)

%%%%%%%%%%%%%%%%%%%
%
% TITLE PAGE
%
%%%%%%%%%%%%%%%%%%%
\begin{onehalfspacing}
\input{content/FirstPage.tex}
\cleardoublepage
\end{onehalfspacing}


%%%%%%%%%%%%%%%%%%%
%
% SPACING
%
%%%%%%%%%%%%%%%%%%%
%
% \singlespacing
% \doublespacing
% \onehalfspacing 
%
% \setstretch{1.8}
%

\onehalfspacing 

% \doublespacing

% ROMAN PAGE NUMBERING
\pagenumbering{roman}
\pagestyle{plain}

\begin{Large}
\end{Large}

%%%%%%%%%%%%%%%%%%%
%
% ABSTRACT
%
%%%%%%%%%%%%%%%%%%%

\input{content/en_Absract.tex}
\clearpage

%\bigskip \bigskip

\input{content/fr_Absract.tex}
\cleardoublepage

%%%%%%%%%%%%%%%%%%%
%
% ACKNOWLEDGEMENT
%
%%%%%%%%%%%%%%%%%%%
\input{content/contributions.tex}

\input{content/Acknowledgements.tex}
\cleardoublepage

%%%%%%%%%%%%%%%%%%%
%
%  Table Of Content
%  List Of Figures
%  List Of Tables
%
%%%%%%%%%%%%%%%%%%%

%\setstretch{0.0}
% \begin{singlespacing}
% \begin{spacing}{0.5}
% KZ WORKING BEFORE AUG 11 \setstretch{0.5}

\setstretch{0.7}

\tableofcontents
% \end{spacing}
\listoffigures
% \end{singlespacing}

\begin{onehalfspacing}

\listoftables

%\listofalgorithms

\end{onehalfspacing}

\cleardoublepage

%%%%%%%%%%%%%%%%%%%%
%
%  ABBREVIATIONS
%
%%%%%%%%%%%%%%%%%%%%
% \nomenclature{RC}{Read Committed}
% \nomenclature{SI}{Snapshot Isolation}
% \nomenclature{JOCC}{JPA Optimistic Concurrency Control}
% \nomenclature{\textsc{colAgent}}{Collector Agent}

% ARABIC PAGE NUMBERING
\pagenumbering{arabic}
\pagestyle{fancyplain}

% INCLUDE HVs DEFAULT FORMATTING
\input{latex-pkg/latexformat.tex}

\interfootnotelinepenalty=10000 %priority, to make sure the footnote is not dvided between pages.

\doublespacing


% ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% BEGIN_Chapters
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%
% MTT
%%%%%%%%%%%%%%%%%%%%

\graphicspath{{img/}}


\begin{linenumbers}
    \chapter{\rm\bfseries Introduction}
    \label{ch:introduction}
    \input{base/intro/intro.tex}
    \chapter{Literature Review}
    \label{ch:chapterLitReview}
    \input{base/chapter/literatureReview.tex}
    \chapter{Background}
    \label{ch:background}
    \input{base/chapter/background.tex}
    \chapter{Body 1}
    \label{ch:body}
    \input{base/chapter/body.tex}
    \chapter{Body 2}
    \label{ch:system_architecture}
    \input{base/chapter/body2.tex}
    \chapter{Findings}
    \label{part:findings}
    \input{base/chapter/findings.tex}
    \chapter{Conclusion}
    \label{part:conclusion}
    \input{base/chapter/summary.tex}
\end{linenumbers}


\newpage

%%%%%%%%%%%%%%%%%%%
%
% BIBLIOGRAPHY
%
%%%%%%%%%%%%%%%%%%%


%\chapter*{\rm\bfseries Bibliography}
\chaptermark{{\rm\bfseries Bibliography}}
\addcontentsline{toc}{chapter}{Bibliography}

\bibliographystyle{IEEEtran}
%\bibliographystyle{alpha}
\bibliography{Thesis}

%\addcontentsline{toc}{chapter}{\numberline{}\rm\bfseries{Bibliography}}

\normalsize
\printindex

%%%%%%%%%%%%%%%%%%%
%
% APPENDICES
%
%%%%%%%%%%%%%%%%%%%

%\begin{appendix}
%\chapter{Tutorial, manual, and help}
%\label{part:tutorials}
%\input{base/chapter/appendix_tutorials.tex}
%\end{appendix}

% \input{content/ConsADExamples.tex}

\end{document}
  • 4
    Your package list is a large mess. Throw the template away. Such templates can only be handled with quite good latex skills (but people which such skills wouldn't use it). – Ulrike Fischer Oct 15 '18 at 16:38
  • no current documentshould load fixltx2e or etex (you have that twice) or epsfig (you have that twice) don't use \special{papersize=215.9mm,279.4mm} (it will do nothing other than generate warnings with pdflatex) – David Carlisle Oct 15 '18 at 17:08
  • @UlrikeFischer Yes, It is a mess. I am going to use another template then. I hoped I can quickly fix it though. Thanks – Snowman Oct 15 '18 at 17:29
5

Your template is a mess, with many packages that are most likely useless.

However, the problem is loading both geometry and vmargin, which fight each other in trying to set the pagination parameters.

The latter, that is vmargin, is buggy and should not be used.

  • I just came up to add my answer after finding it out, but yours answers it in general. :) In my specific case, the solution was to add \setpapersize{USletter} just before the document begins. – Snowman Oct 15 '18 at 22:50
  • l2tabu, at least the English version, actually recommends vmargin (p. 4: "use geometry.sty, or vmargin.sty because these packages provide reasonable proportions in setting page margins") Is there a more up-to-date list of obsolete packages than l2tabu? (2007) – dedded Oct 16 '18 at 1:52
  • @dedded I don't think that l2tabu is always right. In this case it is very wrong. Try using vmargin along with pdfpages or also TikZ. – egreg Oct 16 '18 at 7:48
  • @egred, I wasn't clear. I wasn't disputing you but rather pointing out that l2tabu is itself out-of-date. – dedded Oct 16 '18 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.