0

''' Command \iint already defined. ...d{\iint}{\DOTSI\protect\MultiIntegral{2}} ''' enter image description here

The main errors are asamath.sty, ctex.sty, ctexbook.sty

enter link description here Since I am using Chinese, there may be some trouble in reading. I hope you can bear with me.

%%% !Mode:: "TeX:UTF-8"
%%% !TEX encoding = UTF-8 Unicode
\documentclass[12pt,a4paper,openany,twoside]{ctexbook}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{{image/}}
\usepackage{hologo}
\usepackage[bookmarks=true, colorlinks, citecolor=black, linkcolor=black]{hyperref}
\usepackage{lipsum, graphicx, tabularx}
\usepackage[svgnames]{xcolor}
\usepackage[explicit]{titlesec}
\usepackage[percent]{overpic}
\usepackage{fix-cm}
\usepackage{lipsum}
\titleformat{\chapter}[block]
{\bfseries\Huge\sffamily}
{\rlap{\hspace*{\dimexpr\linewidth+\marginparsep}%
        \parbox{\marginparwidth}{\centering\color{Gainsboro}\scalebox{4}{\thechapter}\\[-0.5ex]% \raisebox{-0.3\height}[0pt][0pt]
            \rule{10pt}{10pt}\hspace{10pt}\rule{10pt}{10pt}\hspace{10pt}\rule{10pt}{10pt}}}}
{0pt}
{\color{gray!75}\begin{tabularx}{\linewidth}{@{}>{\raggedright\arraybackslash}X>{\raggedleft\arraybackslash}p{2cm}@{}}
        & \makebox[0pt]{\LARGE\chaptername}\\[2.5ex] #1
\end{tabularx}}
[\vspace{1ex}\titlerule\vspace{16pt}]
\titlespacing{\chapter}{0pt}{-5ex}{10ex}
\usepackage{currfile}
\usepackage{shorttoc}
\usepackage{tocbibind}
\usepackage{listings}
\usepackage{wrapfig}
\usepackage{currfile}
\usepackage{float}%浮动体
\usepackage {xeCJK}
\newcommand{\fontpath}{../font/}
\xeCJKsetup{AutoFakeBold=true, AutoFakeSlant=0.6} 
\setCJKmainfont{SimSun}
\setmainfont{Times New Roman}
\setCJKsansfont{SimHei} % 设置无衬线字体
\setCJKmonofont{SimHei} % 设置等宽字体
\usepackage{unicode}
\usepackage{fontspec}
\setromanfont{Times New Roman} 
\setsansfont{Arial}            
\setmonofont{Consolas}        
% \setCJKsansfont[Path=\fontpath]{SourceHanSerifCN-Bold.otf}%设置字体族,\textsf{这样就显示微软雅黑}
% \setsansfont[Path=\fontpath]{SourceHanSerifCN-Bold.otf}
% \setCJKmonofont[Path=\fontpath]{YaheiConsolasHybrid.ttf}
% \setmonofont[Path=\fontpath]{YaheiConsolasHybrid.ttf}
\usepackage{xeCJKfntef}
\usepackage{amsmath}
\usepackage{amsfonts}
\mathbb{A}
\usepackage{amssymb}%罗马数字
\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother
%在正文中需要插入罗马数字时,插入以下代码即可:
%小写罗马数字 : \rmnum{数字}
%大写罗马数字 : \Rmnum{数字}
%\usepackage{BOONDOX-cal}
%\usepackage{BOONDOX-calo}
\usepackage{dutchcal}
\usepackage[left=1.25in,right=1.25in,top=1in,bottom=1in]{geometry}
\setlength{\parindent}{2em}
\linespread{1.5}
\setlength{\parskip}{0.5em}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{3}          
\usepackage{tabularx,makecell,multirow}
\usepackage{tablefootnote}
\usepackage{tabulary}
\usepackage{array}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{diagbox} 
\renewcommand\arraystretch{1.5}
\usepackage{xcolor}

\begin{document} \author{翻译与整理:SimonZhou} \title{\Huge \LaTeX 导读手册} \date{2021年6月24日——\today} \frontmatter % \renewcommand{\thepage}{\arabic{page}} \maketitle \tableofcontents \pagenumbering{Roman}
\setcounter{page}{1}
\renewcommand\contentsname{目\qquad 录} \mainmatter \include{files/preface} %\include{files/chapter2} %\include{files/chapter3} %\include{files/chapter4} %\include{files/chapter5} %\include{files/chapter6} %\include{files/chapter7} %\include{files/chapterappend} \end{document}

  • 1
    You are probably loading two packages both defining the same symbol, however there is no way to tell without seeing the code. Please provide a full minimal working example which reproduces the issue, starting with \documentclass{...} and ending with \end{document}. In this way we can copy-paste the code and look at the problem without resorting to wild guesses about what you are doing. (And please don't post code as snapshot, but rather as text.) – campa Jul 02 '21 at 15:02
  • Thank you for your answer! I want give you a MWE,but this book have many context. I don't know what went wrong, this song problem appeared after I updated TeXLive yesterday.So,if you give me a E-mail,I will sent a ZIP to you so that you can build and watch it. – superlazyZhou Jul 02 '21 at 15:35
  • 1
    Please try first to reduce your present code. The problem almost surely arises in the preamble, so make a copy of your main file and delete everything between \begin{document} and \end{document}. Is the problem still there? Good, if the preamble isn't too long you can post that here. – campa Jul 02 '21 at 15:43
  • I found a suitable place to put the code, and now the platform is about to be reviewed. I hope you can take the time to have a look. Thank you very much. It's 0:12 Beijing time, so I'm going to bed first. – superlazyZhou Jul 02 '21 at 16:13
  • please don't use external links: make a small self contained example and add it as text to your question. As the error is in the preamble the example can be very small and does not need any text. – David Carlisle Jul 02 '21 at 20:44
  • Aside from the answer provided by @DavidCarlisle I recommend simplifying your preamble by not trying to load the same package twice, and removing any packages that you don't actually need. Also, check the loading order for hyperref; it should usually be last, though there are a few exceptions. – Ian Thompson Jul 03 '21 at 12:43
  • Do you mean that hyperref needs to be put at the end? – superlazyZhou Jul 03 '21 at 15:55

1 Answers1

2

Your example can be cut down to

\documentclass[12pt,a4paper,openany,twoside]{ctexbook} % fontsize,papersize,book template
\usepackage{unicode}

\usepackage{amsmath}%

\begin{document}

\end{document}

as unicode and amsmath both define \iint simply delete unicode package loading it is not intended to be used with latex at all.

Note that you should not use inputenc package or fix-cm package with xetex.

David Carlisle
  • 757,742
  • Thanks for your answer.I commented out %\usepackage{fix-cm} ,%\usepackage[utf8]{inputenc} as you said, but still an error was reported. – superlazyZhou Jul 03 '21 at 02:05
  • @超级懒的小周 Did you commented unicode? – muzimuzhi Z Jul 03 '21 at 03:21
  • as @muzimuzhiZ says you need to remove the unicode package – David Carlisle Jul 03 '21 at 09:17
  • Indeed, thank you very much for your guidance and help. But I want to know why this macro package cannot be used. – superlazyZhou Jul 03 '21 at 15:11
  • Because "unicode and amsmath both define \iint (and other commands that triggered the already-defined errors)". Actually the question here is, why you need unicode here. – muzimuzhi Z Jul 03 '21 at 15:22
  • @超级懒的小周 why did you add it at all, the package was written last century to go with the xmltex system it was written before xetex even existed and breaks it completely. I is not intended for use with latex at all. Note it is not even in the latex input tree it is /usr/local/texlive/2021/texmf-dist/tex/xmltex/passivetex/unicode.sty so only found because latex tries searching the whole tree if it does not find a file in the latex area. – David Carlisle Jul 03 '21 at 15:26
  • Because it was written by imitating other people's documents, it seems that many documents I have come into contact with have imported this macro package. I'm not too familiar with this, so I put it directly in my document. – superlazyZhou Jul 03 '21 at 15:47
  • 1
    @超级懒的小周 it is a really bad idea to add random packages. always start from an empty preamble and only add a package if you really need it. I am really surprised that you have ever seen any document using unicode.sty I wrote it with Sebastian decades ago I had totally forgotten it existed. – David Carlisle Jul 03 '21 at 16:30
  • I feel that many of the documents I have come into contact with are still using unicode. – superlazyZhou Jul 04 '21 at 03:58
  • Thank you for your answer, and I will inform my familiar friends of this question. – superlazyZhou Jul 04 '21 at 03:58