5

As shown below, the summation is visible in sublime text. enter image description here

The code for the equation is

  \begin{equation}\label{cepl}
     L = \frac{ \displaystyle \sum\limits_{x=1}^N {T_{d}^{x} - {T_{i}^{x} }} } {N} 
  \end{equation}

However, in the actual file, it's not.

enter image description here

The output is same irrespective of \displaystyle. What am I doing wrong?

The contents of my packages file are

\documentclass[letterpaper,12pt,titlepage,final]{report}

\usepackage{amsmath} % for eqautions
\newcommand{\bmmax}{0}  
\newcommand{\hmmax}{0} 
\renewcommand{\baselinestretch}{1.5} % this is the default line space setting
\usepackage{xcolor}
\usepackage[norelsize, linesnumbered, ruled, lined, boxed, commentsnumbered,algochapter]{algorithm2e}
% \newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{blue}{#1}}
\newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{carmine}{#1}}
\SetCommentSty{mycommfont}
\SetKwComment{Comment}{$\triangleright$\ }{}
\usepackage{listings}
\usepackage{blindtext}
\usepackage{float}
\usepackage{titlesec}
\usepackage{newtxmath}
\usepackage{bm}
\usepackage{blindtext}
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\SetKwRepeat{Do}{do}{while}%
\usepackage[skip=3pt]{caption} % example skip set to 2pt
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{algorithmic}
\usepackage{titlesec}
\usepackage[symbols,nogroupskip]{glossaries-extra}
\usepackage{nomencl}
\makenomenclature

\renewcommand{\glsnamefont}[1]{\textbf{#1}}

\newglossarystyle{modsuper}{%
  \glossarystyle{super}%
  \renewcommand{\glsgroupskip}{}
}

% \titlespacing*{<command>}{<left>}{<before-sep>}{<after-sep>}    --this is for managign title spacing 
\titleformat{\chapter}[display]
   {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{1pt}{10pt}
\titlespacing*{\section}{0pt}{3pt}{3pt}
\titlespacing*{\subsection}{0pt}{3pt}{3pt}

\newcommand{\package}[1]{\textbf{#1}} % package names in bold text
\newcommand{\cmmd}[1]{\textbackslash\texttt{#1}} % command name in tt font 
\newcommand{\href}[1]{#1} % does nothing, but defines the command so the


\usepackage[toc,page]{appendix} 
\usepackage{amsmath,amssymb,amstext} % Lots of math symbols and environments
\usepackage[pdftex]{graphicx} % For including graphics N.B. pdftex graphics driver 


 \usepackage[export]{adjustbox}

% only for \lipsum blind text
\usepackage{lipsum}

\usepackage[pdftex,pagebackref=false]{hyperref} % with basic options
\definecolor{carmine}{rgb}{0.59, 0.0, 0.09}
\definecolor{gren}{rgb}{34, 139, 34}


\hypersetup{
    plainpages=false,       % needed if Roman numbers in frontpages
    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        % show Acrobat’s toolbar?
    pdfmenubar=true,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
    pdftitle={Carleton\ LaTeX\ Thesis\ Template},    % title: CHANGE THIS TEXT!
    pdfauthor={Amarjit Singh},    % author: CHANGE THIS TEXT! and uncomment this 
    pdfnewwindow=true,      % links in new window
    colorlinks=true,        % false: boxed links; true: colored links
    % linkcolor=carmine,         % color of internal links
    linkcolor=black,         % color of internal links
    citecolor=black,        % color of links to bibliography
    filecolor=black,         % color of file links
    urlcolor=black           % color of external links
}

    % filecolor=magenta,      % color of file links


\setlength{\marginparwidth}{0pt}
\setlength{\marginparsep}{0pt} % width of space between body text and margin notes
\setlength{\evensidemargin}{0.1in} 
\setlength{\oddsidemargin}{0.1in} 
\setlength{\textwidth}{6.5in} 
\raggedbottom

\usepackage[noabbrev,nameinlink, capitalise]{cleveref}
\usepackage{makecell} % for giving center align to headings
\usepackage{array}
\usepackage{textcomp} % used for Apostophe
\usepackage{wrapfig}
\usepackage{subfig}
\usepackage{blindtext}% for list of publication , for not to move biblo in new page
\usepackage{etoolbox}%
\usepackage[utf8]{inputenc}
\usepackage{amsmath,tabularx}
\usepackage{siunitx}
\usepackage{lmodern}
\RequirePackage{fix-cm}
\usepackage{silence}

% removing the paragraph indentation  - tell it to jazz as well
\newlength\tindent
\setlength{\tindent}{\parindent}
\setlength{\parindent}{0pt}
\renewcommand{\indent}{\hspace*{\tindent}}

\usepackage{caption}
\urlstyle{same} %for same url instead fo monospace
\newcommand*\rot{\rotatebox{90}} % for rotating the text in table

\usepackage{xcolor,pifont}
\newcommand*\colourcheck[1]{%
  \expandafter\newcommand\csname #1check\endcsname{\textcolor{#1}{\ding{51}}}%
}
\colourcheck{blue}
\colourcheck{green}
\colourcheck{gren}


\usepackage{xcolor,pifont}
\newcommand*\colourmark[1]{%
  \expandafter\newcommand\csname #1mark\endcsname{\textcolor{#1}{\ding{55}}}%
}
\colourmark{red}
\colourmark{green}


% \newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%


\usepackage{notoccite} %makes sure that the refs in caption are not cited at first, means the order is maintained.
\usepackage{color}
\usepackage{eso-pic}
\definecolor{lightgray}{gray}{.80}
\usepackage{wallpaper}
\usepackage[export]{adjustbox} % for set image baseline to its center
\usepackage{booktabs}


%  it si used for coading type formatting
\lstset{basicstyle=\rmfamily,
  showstringspaces=false,
  commentstyle=\color{red},
  keywordstyle=\color{blue}
}

%  used for math bold
\usepackage{amsmath}
\usepackage{bm}

% This makes all te math to bold in subsection.
 \makeatletter
\g@addto@macro\bfseries{\boldmath}
\makeatother


%  for coloring tables
\usepackage{xcolor,colortbl}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\newcolumntype{x}{>{\columncolor{Gray}}l}
\newcolumntype{y}{>{\columncolor{Gray}}c}
\newcolumntype{z}{>{\columncolor{Gray}}r}

\usepackage{enumitem} % used to put a,b,c in enumerate 
\usepackage{fancyhdr}

\renewcommand{\headrulewidth}{0pt}


% --- this is to desplay only name of chapter on top---
% \renewcommand{\chaptermark}[1]{\markboth{#1}{}}

\fancyhf{}
\fancyhead[RO]{\thepage}
\fancyhead[LO]{\nouppercase{\leftmark}}
\usepackage[export]{adjustbox}
\usepackage{tabularx,booktabs,caption,makecell}
\usepackage{mathpazo}

Please let me know if something else is required?

Mico
  • 506,678
  • 1
    Without a full minimal example, hard to tell. When there is no full code we can copy and test, there is nothing we can do. And we certainly cannot use a picture of code to anything useful – daleif Jul 01 '18 at 07:27
  • @daleif : Please see the edited question – Amarjit Dhillon Jul 01 '18 at 07:52
  • 7
    This is not minimal, most of the packages and settings you use are not related to this. My guess is the fact that you are mixing fonts, you're using both newtxmath and lmodern, this may lead to strange results. Also there is no reason to pass pdftex as an option to any package, modern latex package can automatically defect pdftex – daleif Jul 01 '18 at 07:57
  • 5
    Please don't take the following comment personally: The preamble of your document is a mess. Several packages are loaded more than once, other packages are loaded at the wrong time (e.g., hyperref and cleveref must be loaded last), and some packages are loaded incorrectly (e.g., do replace \usepackage{xcolor,colortbl} with \usepackage[table]{xcolor}). And some packages are in unresolvable conflict with each other. E.g., why do you load both mathpazo (a Palatino clone) and newtxmath (a Times Roman clone)? BTW, since you load newtxmath, why don't you also load newtxtext? – Mico Jul 01 '18 at 08:09
  • 2
    Also, it shouldn't be necessary to specify the option pdftex while loading graphicx and hyperref. – Mico Jul 01 '18 at 08:13
  • 1
    @Mico: thanks for your comment. I am a newbie to latex. Using it the first time, learned by myself, a little bit. However, the issue has been solved by removing newtxmath. You can write it as an answer. Much thanks. – Amarjit Dhillon Jul 01 '18 at 08:14
  • @AmarjitSingh - Done. :-) – Mico Jul 01 '18 at 08:25
  • 3
    Some packages are loaded not once, not twice, and not three times; instead, they are loaded four times [!!]. See, e.g., the amsmath package. Loading packages more than once is not always innocuous... – Mico Jul 01 '18 at 08:47

3 Answers3

16

The immediate problem, i.e., the missing summation symbol, can be rectified by not loading the newtxmath package. The newtxmath package is in serious conflict with the subsequently-loaded mathpazo package.

If you don't know what you're doing in terms of text and math fonts and, in particular, if you don't have to use a Palatino-type font, you could skip loading the mathpazo package (and the newtxmath package too!). That leaves the instruction \usepackage{lmodern} in your preamble. This instruction loads the Latin Modern text and math font family. Use it unless you really need to use some other font family. (If you were to omit the \usepackage{lmodern} instruction as well, you'd get the default font family, which is Computer Modern. Unless a document contains a lot of accented characters, most people would be hard-pressed to tell the difference between Computer Modern and Latin Modern.)

If you do need to use a Palatino clone, don't load the lmodern package. And, do yourself a favor and don't load the nearly-obsolete mathpazo package. Instead, load the newpxtext and newpxmath packages.

As I noted in my earlier comments, there are a whole host of other, nearly equally serious, deficiencies with the preamble of your document. Sooner or later -- probably sooner! -- these deficiencies are going to cause further problems. Do fix these deficiencies, and do take the time to learn the basics of LaTeX and to figure out what various packages actually do. Loading a jumble of packages (maybe in the vain hope of "covering all the bases"?) is not innocuous. Instead, it's asking for trouble and, at the very least, lots of wasted time while you track down the causes of various cryptic error messages.

Mico
  • 506,678
7

Be careful when loading several font related package, they may affect each other negatively. In this case you should decide whether to use newtxmath, mathpazo or lmodern.

Also you should clean up your preamble, hyperref and cleveref should be loaded last, and pdftex should not be given as an option

daleif
  • 54,450
4

It looks as if you’re pasting bits and pieces of other people’s LaTeX documents into your own preamble. I would recommend against that. My advice would be to start with something minimal, and add only the packages you need. Avoid copying-and-pasting lines from someone else’s preamble unless you’re getting errors without them.

Here’s a commented template, updated to work with Unicode and OpenType, that keeps just about everything useful from the preamble you posted. It requires either XeLaTeX or LuaLaTeX.

\documentclass[letterpaper, 12pt, titlepage, final]{report}

\usepackage{mathtools} % Math environments and commands.
% It includes amsmath, so don’t include that separately.
\usepackage{unicode-math} % Supports OpenType fonts, defines all standard
% symbols present in Unicode, including every symbol from every package
% you previously loaded.  It includes fontspec.
\usepackage{polyglossia} % Necessary for multilingual documents.  If your
% document is in English, all this does is slightly change the hyphenation.
\usepackage[HTML, hyperref, svgnames, table]{xcolor} % Color commands.  These
% options enable all the standard color names for SVG/CSS, as well as HTML
% color codes by default.  It also loads the colortbl package (replacing
% table) and turns on hyperref support.

%% Load other packages here, before hyperref.  Remember, other packages
%% have already loaded amsmath, fontspec and colortbl (table).

\usepackage[ unicode,
             colorlinks,
             allcolors = blue
           ]{hyperref} % Hypertext links.  See:
% http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.html

%% Choose (at most) one of the following font options:
%%
%% The default, based on Computer Modern, corresponding to lmodern:
%\setmainfont{Latin Modern Roman}
%\defaultfontfeatures{Scale=MatchUppercase}
%\setmathfont{Latin Modern Math}

%% Fonts based on Palatino, corresponding to mathpazo or newpxmath:
%\setmainfont{TeX Gyre Pagella}
%\defaultfontfeatures{Scale=MatchUppercase}
%\setmathfont{Asana Math}

%% Fonts based on Times, corresponding to newtxtext and newtxmath:
%\setmainfont{TeX Gyre Termes}
%\defaultfontfeatures{Scale=MatchUppercase}
%\setmathfont{TeX Gyre Termes Math}

%% If you want to \setsansfont or \setmonofont, do that here.

%% Language set-up, via Polyglossia:
\setdefaultlanguage{english}
%% \setotherlanguage, fonts such as \newfontfamily\cyrillicfont{...}, etc. go
%% here.

%% Optional PDF information, via hyperref.  You can probably delete this:
\hypersetup{
  pdfinfo={
    Title={Underwater Basket-Weaving},
    Author={Smeagol},
    Subject={Jewelry},
    Keywords={Precious}
  }
}

\begin{document}

\chapter{Introduction}\label{chap:intro}

\begin{equation}\label{cepl}
   L = \frac{
     \displaystyle\sum\limits_{x=1}^N {T_{d}^{x} - {T_{i}^{x} }} }
     {N} 
\end{equation}

\section{Recapitulation}\label{sec:recap}

Review \autoref{cepl}.

\end{document}

Sample document

You can add packages to it on a case-by-case basis, so long as they’re compatible with the ones you already loaded.

If you need a separate bold-math style in your headers, that’s a little trickier with this set-up, but can be done.

If you need a bibliography, natbib is the package compatible with hyperref. You should not normally need to load any other font or symbol packages with unicode-math, except in very special cases. If you want a different font, check out this community wiki list. If you’re just looking for nice packages you can add, maybe start with microtype.

Davislor
  • 44,045