1

So I've been using the \widetilde notation in one of my papers, and it worked perfectly fine, but recently I had to change the format I've been using on the paper, the majority of the tags still work just fine, but for some reason, the wide tilde not only places a tilde over my variable name, it also duplicates whatever I placed inside the parentheses outside as well.

So if I use \widetilde{x}, I would get an x without a tilde followed by one with a tilde in the document.

Any idea about troubleshooting this hiccup?

For the record, I'm using the following packages:

\documentclass[12pt, a4paper, oneside]{book}
\usepackage{listings}
\usepackage{float}
\usepackage{graphicx}
\usepackage{color,soul}
\usepackage[overlay,absolute]{textpos}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{relsize}
\usepackage{breqn}
\usepackage{ragged2e}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}



\usepackage{bm,amsmath,amssymb,color,subfigure}
\usepackage{fancyhdr, ifpdf}
\pagestyle{fancyplain}

%\renewcommand{\baselinestretch}{1.7}

%% some redefination of the headers and footers
\renewcommand{\chaptermark}[1]%
             {\markboth{#1}{}}
\renewcommand{\sectionmark}[1]%
             {\markright{\thesection\ #1}}
\lhead[\fancyplain{}{\thepage}]%
      {\fancyplain{}{\rightmark}}
\rhead[\fancyplain{}{\leftmark}]%
      {\fancyplain{}{\thepage}}
\cfoot{}
\sloppy

\ifpdf
   \usepackage[pdftex]{graphicx}
   \pdfinfo{
      /Title (Title)
      /Subject (Subject)
      /Author (Ali Al-Shaikh, Tomoaki Ohtsuki)
      /Keywords (Q-Learning,Superposed Multicarrier Transmission)
   }
\else
   \usepackage{graphicx}
\fi
Jagath
  • 4,287
Viredae
  • 13
  • (1) welcome, (2) as always please post full minimal examples. – daleif Jul 31 '16 at 05:24
  • (i) in snipped of your preamble you have lot of duplication of used package. Please, remove all duplicate. (ii) the most of package in it haven't anything with math. For constructing MWE remove them too. (iii) corect is \widetilde{x} not /widetilde. Considering this you will get `\documentclass{book}\usepackage{amsmath}\usepackage{breqn}

    \begin{document} [ \widetilde{x} ] \end{document}` which not reproduce your problem.

    – Zarko Jul 31 '16 at 06:14
  • It's irrelevant to the problem, but avoid \usepackage[pdftex]{graphicx}; just \usepackage{graphicx} is better. – egreg Jul 31 '16 at 08:09

1 Answers1

3

The package breqn is causing the problem here. See the MWE in which I have commented out the package breqn:

\documentclass[12pt, a4paper, oneside]{book}
\usepackage{listings}
\usepackage{float}
\usepackage{graphicx}
\usepackage{color,soul}
\usepackage[overlay,absolute]{textpos}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{relsize}
%\usepackage{breqn}
\usepackage{ragged2e}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}



\usepackage{bm,amsmath,amssymb,color,subfigure}
\usepackage{fancyhdr, ifpdf}
\pagestyle{fancyplain}

%\renewcommand{\baselinestretch}{1.7}

%% some redefination of the headers and footers
\renewcommand{\chaptermark}[1]%
             {\markboth{#1}{}}
\renewcommand{\sectionmark}[1]%
             {\markright{\thesection\ #1}}
\lhead[\fancyplain{}{\thepage}]%
      {\fancyplain{}{\rightmark}}
\rhead[\fancyplain{}{\leftmark}]%
      {\fancyplain{}{\thepage}}
\cfoot{}
\sloppy

\ifpdf
%   \usepackage[pdftex]{graphicx}
   \pdfinfo{
      /Title (Title)
      /Subject (Subject)
      /Author (Ali Al-Shaikh, Tomoaki Ohtsuki)
      /Keywords (Q-Learning,Superposed Multicarrier Transmission)
   }
%\else
%   \usepackage{graphicx}
\fi

\begin{document}

$\widetilde{x}$

\end{document}

So, how to fix this problem with the package breqn? Answer is simple, if you are loading the package amssymb along with breqn, then load the package breqn after loading amssymb.

Hence, the fixed MWE is:

\documentclass[12pt, a4paper, oneside]{book}
\usepackage{listings}
\usepackage{float}
\usepackage{graphicx}
\usepackage{color,soul}
\usepackage[overlay,absolute]{textpos}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{relsize}
\usepackage{ragged2e}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

\usepackage{bm,amsmath,amssymb,color,subfigure}
\usepackage{breqn}  % <------ added here
\usepackage{fancyhdr, ifpdf}
\pagestyle{fancyplain}

%\renewcommand{\baselinestretch}{1.7}

%% some redefination of the headers and footers
\renewcommand{\chaptermark}[1]%
             {\markboth{#1}{}}
\renewcommand{\sectionmark}[1]%
             {\markright{\thesection\ #1}}
\lhead[\fancyplain{}{\thepage}]%
      {\fancyplain{}{\rightmark}}
\rhead[\fancyplain{}{\leftmark}]%
      {\fancyplain{}{\thepage}}
\cfoot{}
\sloppy

\ifpdf
%   \usepackage[pdftex]{graphicx}
   \pdfinfo{
      /Title (Title)
      /Subject (Subject)
      /Author (Ali Al-Shaikh, Tomoaki Ohtsuki)
      /Keywords (Q-Learning,Superposed Multicarrier Transmission)
   }
%\else
%   \usepackage{graphicx}
\fi

\begin{document}

$\widetilde{x}$

\end{document}

You will also see that I have commented the following also, as there is an option clash error:

\ifpdf
%   \usepackage[pdftex]{graphicx}
   \pdfinfo{
      /Title (Title)
      /Subject (Subject)
      /Author (Ali Al-Shaikh, Tomoaki Ohtsuki)
      /Keywords (Q-Learning,Superposed Multicarrier Transmission)
   }
%\else
%   \usepackage{graphicx}
\fi
Jagath
  • 4,287