0

I am struggling finding the reason why setting

\documentclass[final,13pt]{phdimt}

and

\setlength\parskip{1em}

is not working in my document. As I am writing a thesis, I am using a lot of packages. Here is the full list of them. Maybe, am I using something in the wrong way? The pdf compiler actually compiles:

\documentclass[final,13pt]{phdimt}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

%%PAPER 1

\usepackage{graphicx}
\hyphenation{Ma-te-ma-ti-ca I-sti-tu-to}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{adjustbox}
\usepackage{graphicx} 
\usepackage{bm}
\usepackage{changepage}
\usepackage{epstopdf}
\usepackage{subfigure}
\usepackage{caption} 
\captionsetup[table]{skip=15pt}
\usepackage{chemformula}
\let\ce\ch
\allowdisplaybreaks

\definecolor{Gray}{gray}{0.85}


\usepackage{amssymb,amsmath,latexsym,mathrsfs}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{subfigure}
\usepackage{mathtools}
\usepackage[active]{srcltx}
\usepackage{verbatim}
\usepackage{enumerate}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{pbox}

\let\accentvec\vec
\let\vect\accentvec

\usepackage{amssymb}
\setcounter{tocdepth}{3}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{rotating}
\usepackage{epsfig}
\usepackage{pdfpages}
\usepackage{amsbsy}
\usepackage{multirow}
\usepackage{color}
\usepackage{verbatim}
\usepackage{url}
\usepackage{bm}

\newcommand{\bbR}{{\mathbb{R}}}
\newcommand{\bbN}{{\mathbb{N}}}

\newcommand{\bop}{{\bf Proof.\,\,}}

\def\eop{\hfill $\blacksquare$ \vspace{0.2 true cm}}

\def\CalA{{\cal A}}
\def\CalB{{\cal B}}
\def\CalC{{\cal C}}
\def\CalD{{\cal D}}
\def\CalE{{\cal E}}
\def\CalF{{\cal F}}
\def\CalG{{\cal G}}
\def\CalH{{\cal H}}
\def\CalI{{\cal I}}
\def\CalL{{\cal L}}
\def\CalM{{\cal M}}
\def\CalN{{\cal N}}
\def\CalO{{\cal O}}
\def\CalP{{\cal P}}
\def\CalQ{{\cal Q}}
\def\CalR{{\cal R}}
\def\CalS{{\cal S}}
\def\CalT{{\cal T}}
\def\CalU{{\cal U}}
\def\CalV{{\cal V}}
\def\CalW{{\cal W}}
\def\CalX{{\cal X}}
\def\CalY{{\cal Y}}
\def\CalZ{{\cal Z}}

\def\ONES{\mbox{\unboldmath $1$}}

\allowdisplaybreaks

% PAPER 2

\usepackage{graphicx}
\usepackage{multirow} 
\usepackage{enumitem}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{adjustbox}
\usepackage{graphicx} 
\usepackage{bm}
\usepackage{changepage}
\newcommand{\vertdots}{\underset{\big{\overset{\cdot}{\cdot}}}{\cdot}} 
\newcommand{\diagdots}{_{^{\big\cdot}\cdot _{\big\cdot}}}
\usepackage{epstopdf}
\usepackage[makeroom]{cancel}


\usepackage{subfigure}
\usepackage{caption} 
\captionsetup[table]{skip=15pt}
\usepackage{chemformula}
\let\ce\ch
\allowdisplaybreaks

\definecolor{Gray}{gray}{0.85}
\usepackage{geometry}
\usepackage{url}
\geometry{
 a4paper,
 total={174mm,230mm},
 left=18mm,
 top=30mm,
 }
 
%% PAPER 3
\usepackage{afterpage}

\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}


\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx} 
\usepackage{bm}
\usepackage{epstopdf}
\usepackage{subfigure}
\allowdisplaybreaks

\definecolor{Gray}{gray}{0.85}
\usepackage{graphicx}
\usepackage{amssymb}
\let\oldemptyset\emptyset
\let\emptyset\varnothing
\usepackage{comment}
\usepackage{mwe}
\usepackage{amsmath}
\usepackage{amssymb,amsmath,amsthm}

\newtheorem{thm}{Theorem}
\newtheorem{pr}[thm]{Proposition}
\newtheorem{co}[thm]{Corollary}
\newtheorem{re}[thm]{Remark}
\newtheorem{remark}[thm]{Remark}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{lm}[thm]{Lemma}
\newtheorem{de}[thm]{Definition}
\newtheorem{assumption}{Assumption}[section]

\DeclareMathOperator*{\argminA}{arg\,min} % Jan Hlavacek
\DeclareMathOperator*{\argminB}{argmin}   % Jan Hlavacek
\DeclareMathOperator*{\argminC}{\arg\min}   % rbp

\newcommand{\argminD}{\arg\!\min} % AlfC

\newcommand{\argminE}{\mathop{\mathrm{argmin}}}          % ASdeL
\newcommand{\argminF}{\mathop{\mathrm{argmin}}\limits}   % ASdeL

% limits on side
\DeclareMathOperator{\argminG}{arg\,min} % Jan Hlavacek
\DeclareMathOperator{\argminH}{argmin}   % Jan Hlavacek
\newcommand{\argminI}{\mathop{\mathrm{argmin}}\nolimits} % ASdeL

\newcommand{\cs}[1]{\texttt{\symbol{`\\}#1}}
\usepackage{pbox}
\usepackage{float}
\usepackage{placeins}
\usepackage{bm}
\usepackage{subcaption}
\usepackage{cases}
\usepackage{url}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage[ruled,vlined]{algorithm2e}
\providecommand{\SetAlgoLined}{\SetLine}
\SetKwInput{KwData}{Input}
\SetKwInput{KwResult}{Output}

% PAPER 4
\usepackage{times}
\usepackage{geometry}
\geometry{letterpaper, portrait, margin=1in}
\usepackage{enumitem,amssymb}
\usepackage{float}
\usepackage{longtable}
\usepackage[toc,page]{appendix}
\usepackage{url}
\usepackage{hyperref}
\usepackage[export]{adjustbox}
\usepackage{booktabs,caption}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage[showframe=true]{geometry}
\usepackage{ragged2e}
\usepackage{pdfpages}
\usepackage{ltablex}
\usepackage{booktabs,tabularx,ragged2e,dcolumn,caption} 
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
% handy shortcut macros
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}
\newcommand\MC[1]{\multicolumn{1}{C}{#1}}
\usepackage{booktabs,caption}
\usepackage[flushleft]{threeparttable}
\usepackage{dcolumn}
\usepackage{booktabs}
\usepackage{subcaption}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{lscape} 
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{float}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{blindtext}
\usepackage{siunitx}
\usepackage{csvsimple}
\usepackage{pdfpages}
\usepackage{amssymb}
\usepackage{array}
\usepackage{authblk}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage[bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm]{geometry}
\usepackage{subfig}
\newlist{thematic}{itemize}{8}
\setlist[thematic]{label=$\square$}
\usepackage{pifont}


\usepackage{dcolumn,booktabs,rotating}
\usepackage{xcolor}
\usepackage[table,xcdraw]{xcolor}
\usepackage[dvipsnames]{xcolor}
\usepackage{xcolor,colortbl}
\renewcommand{\baselinestretch}{2}
\setlength\parskip{1em}

% list here the bibfiles you want to use
% note that you have to add the extension since the template uses
% biblatex and biber to compile the references
\addbibresource{references.bib}
\addbibresource{mainmatter/2/methods_and_methods.bib}

Thank you for your advices.

3
  • That's a really long list of packages. Please try to reduce it to a MWE (tex.meta.stackexchange.com/q/228/237192), so that there is a document with a minimal number of packages and a minimal amount of code, but which reproduces the unwanted behaviour. Jul 23 at 7:51
  • Thank you for the reply. The problem is that I really don't know if one of the packages is disturbing. So if I clear some of them the risk is that I delete the important ones that cause the crush... Jul 23 at 8:42
  • 1
    I know it takes a lot of time but for the sake of finding the problem you could remove one package by one until the problem is solved. Then you know which it was. Jul 23 at 9:11
3

Never, and I mean it, take preambles from distinct documents and paste them without further intervention.

You're ending up with loading conflicting packages and several inconsistencies. For instance, you're loading

  • twice fontenc with the T1 option
  • four times xcolor with different options (leading to errors)
  • four times amsfonts and six times amssymb (that also loads the former)
  • three times adjustbox (with errors due to conflicting options)
  • nine times amsmath and five times bm
  • seven times booktabs and caption
  • four times color
  • twice dcolumn
  • twice enumitem, but also enumerate (they conflict)
  • three times epstopdf, which is useless
  • three times float
  • four times geometry, with different options; you also call \geometry twice
  • nine times graphicx
  • subfig (once), subcaption (twice) and subfigure (four times): the first two fight each other, the third one is deprecated (and fights against the first two)
  • you give conflicting sets of parameters to \geometry

Last, but not least, srcltx should not be used: it's obsolete and has nasty effects on pagination and line breaking.

Also you do several times \let\ce\ch and \allowdisplaybreaks. Quite interesting are the lines

\DeclareMathOperator*{\argminA}{arg\,min} % Jan Hlavacek
\DeclareMathOperator*{\argminB}{argmin}   % Jan Hlavacek
\DeclareMathOperator*{\argminC}{\arg\min}   % rbp

\newcommand{\argminD}{\arg\!\min} % AlfC

\newcommand{\argminE}{\mathop{\mathrm{argmin}}}          % ASdeL
\newcommand{\argminF}{\mathop{\mathrm{argmin}}\limits}   % ASdeL

% limits on side
\DeclareMathOperator{\argminG}{arg\,min} % Jan Hlavacek
\DeclareMathOperator{\argminH}{argmin}   % Jan Hlavacek
\newcommand{\argminI}{\mathop{\mathrm{argmin}}\nolimits} % ASdeL

where you define nine ways to represent one and the same operator.

Maybe you cannot make a definitive choice about it, but you should use \argmin in the document and maybe have this in your preamble

\DeclareMathOperator*{\argmin}{arg\,min} % this is how I do for the moment
%\DeclareMathOperator*{\argmin}{argmin} % no space

The other seven possibilities are either duplicate or wrong.

The lines \def\CalA{{\cal A}} are wrong for two reasons: they use \def, which is not recommended, and \cal, which has been deprecated for 30 years: the correct way is to do

\newcommand{\CalA}{\mathcal{A}}

As you see, the code is unmaintainable as is. Maybe you really need almost all of those packages, but you should try hard to make the preamble consistent.

As far as your problem is concerned, you should realize that, if you are required to use the phdimt class,

  1. the class loads the deprecated subfigure package, so loading subfig or subcaption will clash
  2. the class imposes its own geometry parameters and you should not overwrite them
  3. the class uses Palatino as main font and you should not overwrite this; but you can do \usepackage{newpxtext,newpxmath} to get better coverage for math symbols
  4. you should not tamper with \baselinestretch and \parskip.

Otherwise don't use the class and define the formatting as you wish.

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.