In latex, the integral symbol '\int' displays as '\Delta' in the compiled pdf, why? - latex

This happens in some (but not all) documents, where '$\int$' in an equation displays as '$\Delta$' in the compiled pdf. For those documents, I tried both Winedt and Overleaf and the same things just happen.
The problem can be replicated by using the following codes in the main.tex file:
\documentclass[a4paper,10pt]{autart}
\pagestyle{plain}
\date{\today}
\usepackage{esint}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\setlength {\marginparwidth }{2cm}
\begin{document}
\begin{frontmatter}
\title{Generalized $t$-Distribution Noise Model\thanksref{footnoteinfo}}
\thanks[footnoteinfo]{Acknowledgement...}
\author[AuthorCategory1]{Author 1}\ead{author1#somewhere}
\author[AuthorCategory2]{Author 2}\ead{author2#somewhere}
\address[AuthorCategory1]{Address 1}
\address[AuthorCategory2]{Address 2}
\begin{abstract}
---
\end{abstract}
\end{frontmatter}
\section{This is a section}
\begin{eqnarray}
\int \nonumber
\end{eqnarray}
\end{document}
The autart.cls can be found online, for example at https://hal.archives-ouvertes.fr/file/index/docid/514508/filename/autart.cls
You will get a result like this:
And from my own exploration, the problem can be solved surprisingly if changing the title from
\title{Generalized $t$-Distribution Noise Model\thanksref{footnoteinfo}}
to
\title{Title\thanksref{footnoteinfo}}
And you will get the correct integral symbol as follows:
It seems that you can also solve the problem by removing the "esint" package, or change the document class from autart to article. I guess there is some conflicts defined in these class/packages, maybe, and result in this funny phenomenon.
Is there a way to solve the problem without changing the title, while using autart document class and esint package?
Thanks.

Ironically, the problem is in the \no#harm macro your class defines, which redefines \protect. You can work around the problem by removing this defintion like this:
\documentclass{autart}
\pagestyle{plain}
\date{\today}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\no#harm}{\def\protect{\noexpand\protect\noexpand}}{}{\typeout{patch ok}}{\typeout{patch fail}}
\makeatother
\usepackage{esint}
\setlength {\marginparwidth }{2cm}
\begin{document}
\begin{frontmatter}
\title{Generalized $t$-Distribution Noise Model\thanksref{footnoteinfo}}
\thanks[footnoteinfo]{Acknowledgement...}
\author[AuthorCategory1]{Author 1}\ead{author1#somewhere}
\author[AuthorCategory2]{Author 2}\ead{author2#somewhere}
\address[AuthorCategory1]{Address 1}
\address[AuthorCategory2]{Address 2}
\begin{abstract}
---
\end{abstract}
\end{frontmatter}
\section{This is a section}
\begin{eqnarray}
\int \nonumber
\end{eqnarray}
\end{document}

Related

No control sequence/no counter subfigure#save defined

I am new to overleaf. I am getting first 'No control sequence' on \subfloat. Then I included \usepackage{subfig} which is causing this new error 'no counter subfigure#save defined' on the same line. Along with that after including this package I am also getting 'Undefined control sequence' on \begin{document}. Any idea how can I tackle this? I want to insert multiple figures and I read that \subfigures is outdated and I should include subfloat instead. I would really really appreciate any possible help. Thank you
screenshoot of error
These are the packages that are included :
\documentclass[a4paper, 12pt, oneside]{Thesis} % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn
\usepackage{subfig}
\usepackage{graphicx}
%\usepackage[dvipsnames]{xcolor}
\graphicspath{ {images/} }
\usepackage{amsmath}
% Include any extra LaTeX packages required
\usepackage[square, numbers, comma, sort&compress]{natbib} % Use the "Natbib" style for the references in the Bibliography
\usepackage{verbatim} % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector} % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
\hypersetup{urlcolor=red, colorlinks=false} % Colours hyperlinks in blue, but this can be distracting if there are many links.
\usepackage{longtable}
\usepackage[table]{xcolor}
\usepackage[textsize=tiny]{todonotes}
\newcommand{\dara}{\textsf{da\textbar ra}}
\usepackage{csquotes}
\usepackage{ctable}
\usepackage{titlesec}
\usepackage[most]{tcolorbox}
\usepackage{tikz-er2}
\usepackage{url}
\usepackage{paralist}
\usepackage{pifont}
\usepackage{adjustbox}
\usepackage[T1]{fontenc}
\usepackage[scaled=0.85]{beramono}
\usepackage{listings}
\usepackage{tikz}
\usepackage{3dplot}
\usepackage{framed}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{todonotes}
\usepackage{comment}
\usepackage{pifont}
\usepackage{amssymb}
\setcounter{tocdepth}{3}
\usepackage{multirow}
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algorithmic}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepackage{eurosym} %<-- For EURO symbol
\usepackage{filecontents}
\usepackage{minted}
\usemintedstyle{monokai}
\usepackage{array}
% \usepackage{forest}
\usepackage[table]{xcolor}

Why Figure is not displayed in the latex file and text is shown instead of it

I am newbie in latex and trying to add figure into the latex file as follows:
\documentclass{bmcart}
%%% Load packages
\usepackage{amsthm,amsmath}
\usepackage[utf8]{inputenc} %unicode support
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{graphicx}
\def\includegraphic{}
\def\includegraphics{}
\startlocaldefs
\endlocaldefs
\begin{document}
\begin{figure}[h!]
\includegraphics{figures/GBMfigure3.jpg}
\caption{show the results of the different settings for the parameters of the penalty model for solving the problem \ref{q11}.}
\end{figure}
\end{document}
But, the figure is not displayed and the text itself is displayed instead of the figure, for example the resulted file is as below:
So, what's the solution of that issue please.
With \def\includegraphics{} you redefine the command to do nothing. If you want it to include your image, don't do such a redefinition.
\documentclass{bmcart}
%%% Load packages
\usepackage{amsthm,amsmath}
\usepackage[utf8]{inputenc} %unicode support
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{graphicx}
%\def\includegraphic{}
%\def\includegraphics{}
\startlocaldefs
\endlocaldefs
\begin{document}
\begin{figure}[h!]
\includegraphics{example-image-duck}
\caption{show the results of the different settings for the parameters of the penalty model for solving the problem \ref{q11}.}
\end{figure}
\end{document}

How to fix "Underfull \hbox (badness 10000)" warning?

I have this small .tex file.
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}
\author{vladgovor77771}
\title{Some article}
\begin{document}
\maketitle
\textbf{Task 1} \newline
Task description: \newline
\end{document}
When compiling, it warns about line
\textbf{Task 1} \newline
With the following message:
"Underfull \hbox (badness 10000)".
How do I fix this?
I had a similar issue, I solved it by removing any \newline or \\ at the and of every sentence that had nothing textual below.
For instance, two examples that causes that problem:
An example. \\
This is well used. \\
This line will cause the error. \\
(I'm a new paragraph) \\
Because there's nothing directly underneath.\\
The last line does NOT require a "newline".
This is a thid paragraph. \\
:D
The same is true for figures or similar
This is a line.
Putting a "newline", as here, before a \begin will cause the error. \\
\begin{figure}[h]
....
\end{figure}
A quick and nice solution is to use package parskip, and instead of using \newline or \\ for line breaks, simply insert an empty line
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{parskip} %% <-- added
\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}
\author{vladgovor77771}
\title{Some article}
\begin{document}
\maketitle
\textbf{Task 1}
Task description:
\end{document}
The warning will be gone.
By the way, to know why it happened, refer to this question on TeX Stack Exchange.
Instead of forcing an underfull box with \newline, you could simply leave an empty line to start a new paragraph:
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}
\author{vladgovor77771}
\title{Some article}
\begin{document}
\maketitle
\textbf{Task 1}
Task description:
blabla
\end{document}

Latex chapter refrencing giving the last chapter last section reference

I have a problem referencing a chapter. I used a label bellow each title however, it is not giving the right reference. I tried some fixes but it did not work (nameref, varioref, cleveref)
my latex code is as follows
\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[french,arabic,english]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage{float}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{arabtex}
\usepackage{multirow}
\usepackage{threeparttable}
\usepackage{utf8}
\usepackage{longtable}
\usepackage{url}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{breakcites}
\usepackage{hhline}
\usepackage{xcolor}
\usepackage{colortbl}
%\usepackage{asect}
\usepackage{tocbibind}
\usepackage{tocloft}
\usepackage{acro}
\input{annexes/abreviations}
\usepackage[colorlinks]{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan,
citecolor=violet
}
% ref packages
\usepackage{nameref}
% folowing must be in this order
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\input{chapters/chap1.tex}
\input{chapters/chap2.tex}
\input{chapters/chap3.tex}
\input{chapters/chap4.tex}
\bibliographystyle{apalike}
\bibliography{bibliography}
\end{document}
in chapter 1
\chapter{title1}
\label{chap1}
here is defined the label{chap1}
\section{section1}
this is section1
\section{section1}
this is section1
\section{section1}
this is section1
in chapter 3
\chapter{title3}
\label{chap3}
text reference Chapter \ref{chap1}
However, the reference shows the last section of chapter 1
I am using texmaker quick build to compile the code. Here is the complete example on overleaf https://www.overleaf.com/read/rxkmhxcbcgqc
we can also notice that referencing the first chapter does not work.
A minimal non-working example would be
\documentclass{book}
\usepackage[arabic,english]{babel}
\begin{document}
\chapter{title}\label{key}
test \ref{key}
\end{document}
You can work around this problem using the approach from https://tex.stackexchange.com/a/238442/36296
\documentclass{book}
\usepackage[arabic,english]{babel}
\makeatletter
\def\#part[#1]#2{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV##part[\textRL{#1}]{\textRL{#2}}%
\else\SAV##part[\textLR{#1}]{\textLR{#2}}%
\fi}
\def\#spart#1{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV#spart{\textRL{#1}}%
\else\SAV#spart{\textLR{#1}}%
\fi}
\def\#chapter[#1]#2{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV##chapter[\textRL{#1}]{\textRL{#2}}%
\else\SAV##chapter[\textLR{#1}]{\textLR{#2}}%
\fi}
\def\#schapter#1{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV#schapter{\textRL{#1}}%
\else\SAV#schapter{\textLR{#1}}%
\fi}
\makeatother
\begin{document}
\chapter{title}\label{key}
test \ref{key}
\end{document}

Getting error in latex while creating report

I am writing a report in latex but getting the following error. Following is my code......
\documentclass[a4paper,10pt]{report}
\usepackage{enumerate}
\usepackage{devanagari}
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{tipa}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{tipa}
\usepackage{framed}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{subscript}
\usepackage{epsfig}
\usepackage{anysize}
\usepackage{gensymb}
\usepackage{amssymb}
\usepackage[utf8x]{inputenc}
\usepackage{longtable}
\usepackage{url}
\usepackage{plain}
\usepackage{listings}
\usepackage[plainpages=false]{hyperref}
\lhead{}
% Title Page
\title{}
\author{}
\begin{document}
\maketitle
\begin{abstract}
\end{abstract}
\end{document}
But I am getting the following error
If anyone know the answer, please tell me.
The problem is caused by the interaction of the devanagari and hyperref packages. Leave one of them out and it works.
You need to update devangari to at least version 2.15. That should fix it.
BTW, you've included several packages two times in the code above. And you're using both graphics and graphicx; you should choose one. Probably graphicx, since you also want to use epsfig.
In general, questions like these are better suited for tex.stackexchange.com.

Resources