我无法提供最小的例子,但我得到了这个错误
* 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.
我的一些包裹
\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}
括号似乎有些问题,但我看不到任何单独的括号。我认为问题可能出在 unicode-math 上,但我不明白为什么。
什么可能导致这个问题?
答案1
%\usepackage{unicode-math}
由于第 11 行,取消注释并取消注释,因此无法编译
%%%%%%%%%%%%%%% BRACES %%%%%%%%%%%%%%%%
%\setmathfont[BoldFont={latinmodern-math.otf}]{latinmodern-math.otf}
%\setmathfont[range=\mathscr,Scale=MatchUppercase]{Asana-Math.otf}
我对这个包裹一无所知。也许这里有人能帮你?
使用 OSX Texpad 1.4.7 进行代码编译 - 这应该是最新版本,因此与您的相同
\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}
答案2
老问题,但这个答案可能对某些人有帮助:
回答标题中的问题,您的错误“unicode-math 警告:”mathtools-colon“”只是由于 mathtools 和 unicode-math 尝试使用相同的名称。这只是来自 unicode-math 的警告,因为软件包不是 100% 兼容,但可以忽略。如果您愿意,可以使用以下选项来抑制它:
\usepackage[warnings-off={mathtools-colon}]{unicode-math}
就是这样。关于您遇到的其他错误,似乎存在 hyperref 问题,但我没有发现您加载包时存在任何问题,所以我猜这仍然是与 unicode-math 和其他包的兼容性问题,因此要修复这些问题:
首先,您应该在 unicode-math 之后加载 mathtools,因为已知在某些情况下以相反的方式加载它们会导致问题。
接下来,您还将混合使用 pdflatex 和 xelatex/lualatex 包。由于您希望使用 unicode-math,因此您必须使用 xelatex 或 lualatex(如果不是,这是它无法编译的原因之一)。假设如此,那么您不应该使用 fontenc,而应该使用 fontspec。
接下来,amsmath 由 mathtools 调用,因此是不必要的,如果使用 unicode-math,amsfonts 就是多余的,amssymb 也是如此;这些包最多不再需要,因为它们在 pdflatex 中添加的功能现在可以通过其他更好的方式实现,但它们也不太可能很好地协同工作。
最后,对于任何其他问题,我会检查其他软件包以确保它们都与您选择的引擎和彼此兼容,并尝试更改任何出现错误的软件包的加载顺序(如 hyperref)。如果失败,请更新您的软件包,并在删除所有辅助文件后重新编译。通常,这可以解决此类问题。