[Tex/LaTex] What does this error mean in Mathtools-colon

errorsmacmathtoolswarningsxetex

I have not been able to produce the minimal example, but I get this error

* LaTeX warning: "xparse/redefine-command"
*
* Redefining document command \oldstylenums with arg. spec. 'm' on line 128.
*************************************************
* unicode-math warning: "mathtools-colon"
* 
* I'm going to overwrite the following commands from the `mathtools' package:
* 
*     \dblcolon, \coloneqq, \Coloneqq, \eqqcolon.
* 
* Note that since I won't overwrite the other colon-like commands, using them
* will lead to inconsistencies.
*************************************************

./summary_patology.tex:168: Missing \endcsname inserted.
<to be read again> 
                   \relax 
l.168 \begin{document}

./summary_patology.tex:168: Missing \endcsname inserted.
<to be read again> 
                   \relax 
l.168 \begin{document}

./summary_patology.tex:168: Missing \endcsname inserted.
<to be read again> 
                   \def 
l.168 \begin{document}

./summary_patology.tex:168: Undefined control sequence.
\Hy@temp ...unrestored@protected@xdef \@thefnmark 
                                                  {\ref {#1}}\endgroup \@foo...
l.168 \begin{document}

./summary_patology.tex:168: Use of \@BOOKMARK doesn't match its definition.
\new@ifnextchar ...served@d = #1\def \reserved@a {
                                                  #2}\def \reserved@b {#3}\f...
l.168 \begin{document}

./summary_patology.tex:168: Use of \@BOOKMARK doesn't match its definition.
<argument> \def \reserved@a *
                             {\@refstar }\reserved@a 
l.168 \begin{document}

./summary_patology.tex:168: Argument of \@refstar has an extra }.
<inserted text> 
                \par 
l.168 \begin{document}

Runaway argument?
./summary_patology.tex:168: Paragraph ended before \@refstar was complete.
<to be read again> 
                   \par 
l.168 \begin{document}


(That makes 100 errors; please try again.)
No pages of output.

Some packages of mine

\documentclass{article}
\usepackage{rotating}
\usepackage{pdfpages}
% \usepackage{background}
\usepackage[log-declarations=false]{xparse}
\usepackage{verbatim}
\usepackage{amsmath, amsfonts, amssymb, textcomp, mathtools, xparse}
\usepackage[T4, OT1]{fontenc}
\graphicspath{ {/Users/masi/Dropbox/Patology_and_Biopsy/images/} }
\usepackage{newunicodechar}
\usepackage{unicode-math}
\usepackage{multirow}
\newcommand{\Int}{\int\limits}
\newunicodechar{ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m f}}
\newunicodechar{Ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m F}}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\newcommand{\eqbreak}[1][2]{\\&\hskip#1em}
\usepackage{color}
\usepackage{hyperref}
\usepackage{Tabbing}
\usepackage{doi, natbib}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=blue,
allcolors=blue
}
\usepackage{enumerate} % alpha numerical ordering
\usepackage{titling} % Two titles in one document
\usepackage[normalem]{ulem} % underline by \uline{lorem}
\usepackage[affil-it]{authblk}
\usepackage{import}
\usepackage[version=3]{mhchem} % To have chemical symbols like \ce{O2^{.-}}
\usepackage{xcolor,colortbl} % rowcolor for tables
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\definecolor{colori}{RGB}{0,0,0}
\definecolor{colorii}{RGB}{0,0,0}
\NewDocumentCommand\MyArrow{O{0pt}mmmO{out=150,in=210}}
{%
\begin{tikzpicture}[overlay, remember picture]
  \draw [->,thick,line width=4pt,#4]
    ( $ ({pic cs:#3}|-{pic cs:#2}) + (-#1,1.3ex) $ ) to[#5]  
    ( $ (pic cs:#3) + (-#1,0) $ );
\end{tikzpicture}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%% Question and Answer %%%%%%%%%%%%%%%%%
\usepackage[framemethod=tikz]{mdframed}
\newtheorem{question}{Question}
\mdfdefinestyle{que}{
%   font = \normalfont,
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{question}

% Unicode-math bug fix
% http://tex.stackexchange.com/questions/161809/why-is-unicode-math-not-working-with-tikz
\newtheorem{question}{Question}
\let\masiquestion\question
\AtBeginDocument{%
  \let\umquestion\question
  \let\question\masiquestion
}


\newtheorem{answer_original}{Answer}
\mdfdefinestyle{ans}{
  font = \normalfont,
  linecolor=cyan,
  backgroundcolor=yellow!20
}
\surroundwithmdframed[style=ans]{answer_original}

\makeatletter
\newsavebox{\@my@box}
\newenvironment{answer}%
{%
    \noindent
    \begin{lrbox}{\@my@box}%
    \begin{minipage}[t]{\linewidth}
    \begin{answer_original}
}%
{%
    \end{answer_original}%
    \end{minipage}%
    \end{lrbox}%
    \rotatebox{0}{\usebox{\@my@box}}
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%% Smaller things

\newtheorem{sidenote}{Sidenote}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{sidenote}


\newtheorem{case}{Case logic}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{case}

\newtheorem{citation}{Citation}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=yellow!20,
}
\surroundwithmdframed[style=que]{citation}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%% BRACES %%%%%%%%%%%%%%%%
\setmathfont[BoldFont={latinmodern-math.otf}]{latinmodern-math.otf}
\setmathfont[range=\mathscr,Scale=MatchUppercase]{Asana-Math.otf}
\usepackage{tikz}
\usetikzlibrary{tikzmark,decorations.pathreplacing,calc}
\newcommand\MyText[4][0pt]{%
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={brace},decorate,thick]
   ( $ ({pic cs:#3}|-{pic cs:#2}) + (#1,1.3ex) $ ) --  
    node[anchor=west,xshift=5pt,text width=5cm] {#4} 
  ( $ (pic cs:#3) + (#1,0) $ );
\end{tikzpicture}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%% Counter Section %%%%%%%%%%%%%%%%%%%%%%
\makeatletter
  \def\@part[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}%
    \fi
    \addcontentsline{toc}{part}{#1}%
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \LARGE \bfseries #2%
     \markboth{}{}\par}%
    \nobreak
    \vskip 3ex
    \@afterheading}
\@addtoreset{section}{part}    
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%
%

\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}] \emph}{\end{trivlist}}
\providecommand{\keywords}[1]{\textbf{Keywords:} #1}




\begin{document} % The error refers here!

\title{Introduction to General Pathology Notes} 

Lorem
\end{document}

There seems to some problem with braces but I cannot see any alone brace.
I think the problem is probably with unicode-math, but I do not understand why.

What may cause this problem?

Best Answer

It does not compile because of the line 11, uncomment %\usepackage{unicode-math} and uncomment

%%%%%%%%%%%%%%% BRACES %%%%%%%%%%%%%%%%
%\setmathfont[BoldFont={latinmodern-math.otf}]{latinmodern-math.otf}
%\setmathfont[range=\mathscr,Scale=MatchUppercase]{Asana-Math.otf}

where I don't know anything about the package. Perhaps someone here able to help with it you?

Code Compiling with OSX Texpad 1.4.7 -- this should be the newest so the same as yours

\documentclass{article}
\usepackage{rotating}
\usepackage{pdfpages}
% \usepackage{background}
\usepackage[log-declarations=false]{xparse}
\usepackage{verbatim}
\usepackage{amsmath, amsfonts, amssymb, textcomp, mathtools, xparse}
\usepackage[T4, OT1]{fontenc}
\graphicspath{ {/Users/masi/Dropbox/Patology_and_Biopsy/images/} }
\usepackage{newunicodechar}
%\usepackage{unicode-math}
\usepackage{multirow}
\newcommand{\Int}{\int\limits}
\newunicodechar{ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m f}}
\newunicodechar{Ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m F}}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\newcommand{\eqbreak}[1][2]{\\&\hskip#1em}
\usepackage{color}
\usepackage{hyperref}
\usepackage{Tabbing}
\usepackage{doi, natbib}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=blue,
allcolors=blue
}
\usepackage{enumerate} % alpha numerical ordering
\usepackage{titling} % Two titles in one document
\usepackage[normalem]{ulem} % underline by \uline{lorem}
\usepackage[affil-it]{authblk}
\usepackage{import}
\usepackage[version=3]{mhchem} % To have chemical symbols like \ce{O2^{.-}}
\usepackage{xcolor,colortbl} % rowcolor for tables
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\definecolor{colori}{RGB}{0,0,0}
\definecolor{colorii}{RGB}{0,0,0}
\NewDocumentCommand\MyArrow{O{0pt}mmmO{out=150,in=210}}
{%
\begin{tikzpicture}[overlay, remember picture]
  \draw [->,thick,line width=4pt,#4]
    ( $ ({pic cs:#3}|-{pic cs:#2}) + (-#1,1.3ex) $ ) to[#5]  
    ( $ (pic cs:#3) + (-#1,0) $ );
\end{tikzpicture}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%% Question and Answer %%%%%%%%%%%%%%%%%
\usepackage[framemethod=tikz]{mdframed}
\newtheorem{question}{Question}
\mdfdefinestyle{que}{
%   font = \normalfont,
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{question}

% Unicode-math bug fix
% http://tex.stackexchange.com/questions/161809/why-is-unicode-math-not-working-with-tikz
\newtheorem{question}{Question}
\let\masiquestion\question
\AtBeginDocument{%
  \let\umquestion\question
  \let\question\masiquestion
}


\newtheorem{answer_original}{Answer}
\mdfdefinestyle{ans}{
  font = \normalfont,
  linecolor=cyan,
  backgroundcolor=yellow!20
}
\surroundwithmdframed[style=ans]{answer_original}

\makeatletter
\newsavebox{\@my@box}
\newenvironment{answer}%
{%
    \noindent
    \begin{lrbox}{\@my@box}%
    \begin{minipage}[t]{\linewidth}
    \begin{answer_original}
}%
{%
    \end{answer_original}%
    \end{minipage}%
    \end{lrbox}%
    \rotatebox{0}{\usebox{\@my@box}}
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%% Smaller things

\newtheorem{sidenote}{Sidenote}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{sidenote}


\newtheorem{case}{Case logic}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{case}

\newtheorem{citation}{Citation}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=yellow!20,
}
\surroundwithmdframed[style=que]{citation}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%% BRACES %%%%%%%%%%%%%%%%
%\setmathfont[BoldFont={latinmodern-math.otf}]{latinmodern-math.otf}
%\setmathfont[range=\mathscr,Scale=MatchUppercase]{Asana-Math.otf}
\usepackage{tikz}
\usetikzlibrary{tikzmark,decorations.pathreplacing,calc}
\newcommand\MyText[4][0pt]{%
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={brace},decorate,thick]
   ( $ ({pic cs:#3}|-{pic cs:#2}) + (#1,1.3ex) $ ) --  
    node[anchor=west,xshift=5pt,text width=5cm] {#4} 
  ( $ (pic cs:#3) + (#1,0) $ );
\end{tikzpicture}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%% Counter Section %%%%%%%%%%%%%%%%%%%%%%
\makeatletter
  \def\@part[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}%
    \fi
    \addcontentsline{toc}{part}{#1}%
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \LARGE \bfseries #2%
     \markboth{}{}\par}%
    \nobreak
    \vskip 3ex
    \@afterheading}
\@addtoreset{section}{part}    
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%
%

\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}] \emph}{\end{trivlist}}
\providecommand{\keywords}[1]{\textbf{Keywords:} #1}




\begin{document} % The error refers here!

\title{Introduction to General Pathology Notes} 

Lorem
\end{document}
Related Question