%%
%% This is file `mcmthesis-demo.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mcmthesis.dtx (with options: `demo')
%%
%% -----------------------------------
%% This is a generated file.
%%
%% Copyright (C) 2010 -- 2015 by latexstudio
%% 2014 -- 2019 by Liam Huang
%% 2019 -- present by latexstudio.net
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% The Current Maintainer of this work is latexstudio.net.
%%
%% !Mode:: "TeX:UTF-8"
documentclass{mcmthesis}
%documentclass[CTeX = true]{mcmthesis} % 当使用 CTeX 套装时请注释上一行使用该行的设置
mcmsetup{tstyle=color{red}bfseries,%修改题号,队号的颜色和加粗显示,黑色可以修改为 black
tcn = 0000, problem = A, %修改队号,参赛题号
sheet = true, titleinsheet = true, keywordsinsheet = true,
titlepage = false, abstract = true}
%四款字体可以选择
%usepackage{times}
%usepackage{newtxtext}
%usepackage{palatino}
usepackage{txfonts}
usepackage{indentfirst} %首行缩进,注释掉,首行就不再缩进。
usepackage{lipsum}
usepackage{amsmath} %数学公式
usepackage{array,tabularx} %表格排版
usepackage{booktabs} %三线表
usepackage{subfigure} %用于排版多张图片
usepackage{float} %用于排版图片位置
usepackage{amssymb} %部分数学符号切换字体
usepackage{url} %用于排版网址
usepackage{listings} %用于代码排版
usepackage{xcolor} %设置文字和背景的颜色
usepackage{url} %用于排版网址
usepackage[backref]{hyperref}
hypersetup{
hidelinks
} %用于实现引用 cite 的超链接跳转,并去掉绿色方框
title{The LaTeX{} Template for MCM Version MCMversion}
author{small href{https://www.latexstudio.net/}
{\includegraphics[width=7cm]{mcmthesis-logo}}}
date{today}
begin{document}
\begin{abstract}
\par Use this template to begin typing the first page (summary page) of your electronic report. This template uses a 12-point Times New Roman font. Submit your paper as an Adobe PDF electronic file (e.g. 1111111.pdf), typed in English, with a readable font of at least 12-point type.
Do not include the name of your school, advisor, or team members on this or any page.
Papers must be within the 25 page limit.
Be sure to change the control number and problem choice above.
You may delete these instructions as you begin to type your report here.
Follow us @COMAPMath on Twitter or COMAPCHINAOFFICIAL on Weibo for the most up to date contest information.
\begin{keywords}
keyword1; keyword2
\end{keywords}
\end{abstract}
\maketitle
%% Generate the Table of Contents, if it's needed.
\tableofcontents
\newpage
%%
%% Generate the Memorandum, if it's needed.
%% \memoto{\LaTeX{}studio}
%% \memofrom{Liam Huang}
%% \memosubject{Happy \TeX{}ing!}
%% \memodate{\today}
%% \memologo{\LARGE I'm pretending to be a LOGO!}
%% \begin{memo}[Memorandum]
%% \lipsum[1-3]
%% \end{memo}
%%
\section{Introduction}
\subsection{What's this all about? What's \LaTeX?}
\LaTeX\ is a document preparation system which uses the \TeX\
typesetting program. It enables you to produce
publication-quality documents with great accuracy and
consistency. \LaTeX\ works on any computer and produces
industry-standard PDF. It is available both in free (open-source)
and commercial implementations. \LaTeX\ can be used for any kind
of document, but it is especially suited to those with complex
structures, repetitive formatting, or notations like
mathematics. Install the software from
\url{www.tug.org/texlive/}.
\subsection{Creating and typesetting your document}
Follow our WeChat official account for more LaTeX materials and information.
\subsection{Syntax (how to type \LaTeX\ commands --- these
are the rules)}
\lipsum[3]
\begin{itemize}
\item the angular velocity of the bat,
\item the velocity of the ball, and
\item the position of impact along the bat.
\end{itemize}
\lipsum[4]
\emph{center of percussion} [Brody 1986], \lipsum[5]
\begin{Theorem} \label{thm:latex}
\LaTeX
\end{Theorem}
\begin{Lemma} \label{thm:tex}
\TeX .
\end{Lemma}
\begin{proof}
The proof of theorem.
\end{proof}
\subsection{Other Assumptions}
\lipsum[6]
\begin{itemize}
\item
\item
\item
\item
\end{itemize}
\lipsum[7]
\section{Analysis of the Problem}
\begin{figure}[h]
\small
\centering
\includegraphics[width=8cm]{example-image-a}
\caption{The name of figure} \label{fig:aa}
\end{figure}
\lipsum[8] \eqref{aa}
\begin{equation}
a^2 \label{aa}
\end{equation}
\[
\begin{pmatrix}{*{20}c}
{a_{11} } & {a_{12} } & {a_{13} } \\
{a_{21} } & {a_{22} } & {a_{23} } \\
{a_{31} } & {a_{32} } & {a_{33} } \\
\end{pmatrix}
= \frac{{Opposite}}{{Hypotenuse}}\cos ^{ - 1} \theta \arcsin \theta
\]
\lipsum[9]
\[
p_{j}=\begin{cases} 0,&\text{if $j$ is odd}\\
r!\,(-1)^{j/2},&\text{if $j$ is even}
\end{cases}
\]
\lipsum[10]
\[
\arcsin \theta =
\mathop{{\int\!\!\!\!\!\int\!\!\!\!\!\int}} \limits_\varphi
{\mathop {\lim }\limits_{x \to \infty } \frac{{n!}}{{r!\left( {n - r}
\right)!}}} \eqno (1)
\]
\section{Calculating and Simplifying the Model }
\lipsum[11]
\section{The Model Results}
\lipsum[6]
\section{Validating the Model}
\lipsum[9]
\section{Conclusions}
\lipsum[6]
\section{A Summary}
\lipsum[6]
\section{Evaluate of the Mode}
\section{Strengths and weaknesses}
\lipsum[12]
\subsection{Strengths}
\begin{itemize}
\item \textbf{Applies widely}\\
This system can be used for many types of airplanes, and it also
solves the interference during the procedure of the boarding
airplane,as described above we can get to the optimization
boarding time.We also know that all the service is automate.
\item \textbf{Improve the quality of the airport service}\\
Balancing the cost of the cost and the benefit, it will bring in
more convenient for airport and passengers.It also saves many
human resources for the airline.
\end{itemize}
\subsection{How to cite?}
bibliography cite use \cite{1,2,3}
AI cite use \AIcite{AI1,AI2,AI3}
\begin{thebibliography}{99}
\bibitem{1} D.~E. KNUTH The \TeX{}book the American
Mathematical Society and Addison-Wesley
Publishing Company , 1984-1986.
\bibitem{2}Lamport, Leslie, \LaTeX{}: `` A Document Preparation System '',
Addison-Wesley Publishing Company, 1986.
\bibitem{3}\url{https://www.latexstudio.net/}
\end{thebibliography}
\begin{appendices}
\section{First appendix}
In addition, your report must include a letter to the Chief Financial Officer (CFO) of the Goodgrant Foundation, Mr. Alpha Chiang, that describes the optimal investment strategy, your modeling approach and major results, and a brief discussion of your proposed concept of a return-on-investment (ROI). This letter should be no more than two pages in length.
\begin{letter}{Dear, Mr. Alpha Chiang}
\lipsum[1-2]
\vspace{\parskip}
Sincerely yours,
Your friends
\end{letter}
Here are simulation programmes we used in our model as follow.\\
\textbf{\textcolor[rgb]{0.98,0.00,0.00}{Input matlab source:}}
\section{Second appendix}
some more text \textcolor[rgb]{0.98,0.00,0.00}{\textbf{Input C++ source:}}
\end{appendices}
\AImatter
\begin{ReportAiUse}{9}
\bibitem{AI1}
Bing AI\\
Query1: write a sort algorithm\\
Output: Sure, I can help you with that. Here is a simple implementation of the selection sort algorithm in Python:
\begin{lstlisting}[language=python]
def selection_sort(arr):
for i in range(len(arr)):
min_idx = i
for j in range(i + 1, len(arr)):
if arr[min_idx] > arr[j]:
min_idx = j
arr[i], arr[min_idx] = arr[min_idx], arr[i]
return arr
\end{lstlisting}
This algorithm sorts an array by repeatedly finding the minimum element from the unsorted part of the array and putting it at the beginning. \href{https://www.geeksforgeeks.org/sorting-algorithms/}{The time complexity of this algorithm is O($n^2$)}.
There are many other sorting algorithms available such as bubble sort, insertion sort, merge sort, quick sort, heap sort, and more. Each of these algorithms has its own advantages and disadvantages. You can learn more about them on GeeksforGeeks and Programiz.
I hope this helps!
\bibitem{AI2}
OpenAl Enie (Nov 5, 2023 version, Ernie 4.0)\\
Query1: <insert the exact wording of any subsequent input into the Al tool>\\
Output: <insert the complete output from the second query>
\bibitem{AI3}
Github CoPilot (Feb 3, 2024 version)\\
Query1: <insert the exact wording you input into the Al tool>\\
Output: <insert the complete output fron the Al tool>
\bibitem{AI4}
Google Bard (Feb 2,2024 version)\\
Query: <insert the exact wording of your query>\\
Output: <irsert the complete output from the Al tool>
\bibitem{AI5}
Bing AI\\
Query: write a FFT algorithm\\
Output: Sure, here is a Python implementation of the Fast Fourier Transform (FFT) algorithm:
\begin{lstlisting}[language=python]
import numpy as np
def fft(x):
n = len(x)
if n == 1:
return x
even = fft(x[0::2])
odd = fft(x[1::2])
T = [np.exp(-2j * np.pi * k / n) * odd[k] for k in range(n // 2)]
return [even[k] + T[k] for k in range(n // 2)] + [even[k] - T[k] for k in range(n // 2)]
\end{lstlisting}
The FFT is a widely used algorithm for computing the \textbf{Discrete Fourier Transform (DFT)} of a sequence. It reduces the number of computations needed from O(n$^2$) to O(n log n) 12. The basic idea of the FFT is to apply divide and conquer. We divide the coefficient vector of the polynomial into two vectors, recursively compute the DFT for each of them, and combine the results to compute the DFT of the complete polynomial 3.
I hope this helps!
\end{ReportAiUse}
end{document}
%%
%% This work consists of these files mcmthesis.dtx,
%% figures/ and
%% code/,
%% and the derived files mcmthesis.cls,
%% mcmthesis-demo.tex,
%% README,
%% LICENSE,
%% mcmthesis.pdf and
%% mcmthesis-demo.pdf.
%%
%% End of file `mcmthesis-demo.tex'.
一般这个情况出现在你多次调用hyperref
宏包的时候。
同时要注意,hyperref
应该放在所有\usepackage{}
的最后。
把代码给全,并放在围栏式代码块中,不给完整代码让人怎么回答。
至于你的问题,由于在mcmthesis
这个TeXlive2024自带的宏包类的.cls
文件中已经对hyperref
进行了定义,所以在你的宏包定义结束的时候,不可以(也不需要)再显式调用\usepackage[backref]{hyperref}
,而应该只用\hypersetup{backref,hidelinks}
进行设置即可。
如下面的例子:
\documentclass{mcmthesis}
\mcmsetup{
tstyle=color{red}bfseries,%修改题号,队号的颜色和加粗显示,黑色可以修改为 black
tcn = 0000, problem = A, %修改队号,参赛题号
sheet = true, titleinsheet = true, keywordsinsheet = true,
titlepage = false, abstract = true
}
\usepackage{txfonts}
\usepackage{indentfirst}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{array,tabularx}
\usepackage{booktabs}
\usepackage{subfigure}
\usepackage{float}
\usepackage{amssymb}
%\usepackage{url}% 这里不要调用两次 url 容易出风险
\usepackage{listings}
\usepackage{xcolor}
\usepackage{url}
% \usepackage[backref]{hyperref} %不要再次调用 hyperref
\hypersetup{backref,hidelinks}% 我改了这里,把backref和hidelinks都用\hypersetup设置即可
\title{The \LaTeX{} Template for MCM Version MCMversion}
\author{small \href{https://www.latexstudio.net/}{\includegraphics[width=7cm]{mcmthesis-logo}}}
\date{today}
\begin{document}
%% The rest of your code...
另外我有一个疑问,这个backref
的选项你是为什么要使用?其介绍如下:
以及你的这个模板是否出自最新版的20240122
的mcmthesis
官方模板链接?在这一官方模板的demo.tex
中,并不需要重复做下面这些宏包的定义:
\usepackage{amsmath}
\usepackage{array,tabularx}
\usepackage{booktabs}
\usepackage{subfigure}
\usepackage{float}
\usepackage{amssymb}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{url}
不要在网上随便找代码粘贴进模板中,同时请使用最新版的官方模板。
感谢!我尝试调换了一下顺序,还是相同的报错,十分感谢!
@u135417 请你再仔细查看一下上面的围栏式代码块的链接,同时再看下这个,为了更好的观感,建议再次修改代码块的高亮。 我已经更新了回答的内容。
十分感谢!我调整一下!
似乎没法再追加调整问题了,我下次注意!再次感谢!
@u135417 采纳之后该问题会被
closed
,小问题,如果后续提问代码过长,可以使用上传文件功能,会更加方便。