南开大学毕业论文模板LaTeX工作坊(20220205)
时间:2022-2-4 23:30 作者:JourinTown 分类: 计算机技术
附件下载链接
当前版本:230430
NKThesis最新版 | NKBeamer最新版 | NKThesis 211214 Mac预配置版 |
---|---|---|
NKThesis下载 | NKBeamer下载 | NKThesis Mac包 下载 |
注意!!!
- 到20230430止,本项目将不再维护!
- 无创更新方法:利用用新版中的NKThesis.cfg、NKThesisbenke.cfg、main.tex和NKThesis.sty共四个文件覆盖原本的版本即可!
- 请不要使用CTeX编译,请卸载本地CTeX后安装最新版TeXLivehttps://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/,TeXLive是对CTeX向下兼容的!
使用说明
- 从220316版本开始,如果您需要版本编译非本科论文,请去掉documentclass方括号中的benke字段!
- 从220323版本开始,在documentclass添加benke和shuangxuewei字段可以激活本科双学位模式。
- 从230430版本开始,支持TexLive2022及以上,如果使用texstudio等编辑器编译失败,可以尝试用compile.bat手动一键编译。
历史版本
- NKT230430
- [fix] 修正latex3编译中的兼容性问题(感谢@2019物院李想同学)
- [add] 加入一键编译脚本(compile.bat)
- NKT220518
- [fix] 修正诸如关键词,字号,参考文献等诸多小问题并完成答辩。这是本项目的最后一版。
- NKT220329
- [fix] 修正数学字符找不到的问题,如$\hbar$
- NKT220325
- [fix] 修正本科生论文脚注格式
- [add] 追加附录
- NKT220323
- [fix] 修正本科生论文章节标题的字号、项目符号等要求,追加支援双学位格式
- NKT220317
- [fix] 修正本科模板中英文题目太长不能换行的问题
- NKT220316
- [fix] 修正本科模板为2022年最新标准
- [alert] 无创更新方法:利用用新版中的NKThesis.cfg、NKThesisbenke.cfg、main.tex和NKThesis.sty共四个文件覆盖原本的版本即可!
- NKT211214
- [add] 追加GBT7714/2015的引用支持
- [fix] 修正$varphi$和$\phi$显示异常的问题
- [fix] 修正硕士博士模板符合新的要求
已知且无法修复的问题:
- 如果页面中浮动体过多导致的段间距问题,该问题由于CJK包中优先匹配上下对齐再满足行间距和段间距,目前临时的方案可以直接用vskip或者parskip强制把异常换行修正。
- 参考文献标题左对齐。
- 标题中无法加入带参的指令,如\bar{x},该问题是由于LaTeX传参限制,即使在expendafter后也无法传递带参数的指令,如\bar{x},但是可以传递不带参数的指令,如\alpha。对于此目前没有特别好的解决方案,临时方法是直接替换对应cfg文件中需要修改的字符串。
课件
录播(电脑端点击图片即可跳转)
2020年11月基础老课件
Installation
- Windows
- CTEX
- WinEdt with MikTeX
- Mac OS
- TeXPad
- Linux
- Gummi
- vim
- Across platform
- VSCode
- TeXStudio
First Things First
\documentclass{article}
\usepackage{xxx}
\usepackage{xxx}
\begin{document}
...
\end{document}
type = ctexart article report book beamer standalone
ctexart must be interpreted in pdflatex
article with ctexcap must be interpreted in xelatex
Recipe
- PDFLaTeX
- XeLaTeX
- Lyx
Magic Comment
% !TEX program = xelatex
Use Chinese!
- 我們是——
- 中國人!
- 我們需要——
- 中文!!!!中文!!!!
so how do we use Chinese in $\LaTeX$?
\documentclass{ctexart}
\begin{document}
...
\end{document}
\documentclass{article}
\usepackage{ctexcap}
\begin{document}
...
\end{document}
\documentclass{article}
\usepackage{CJK}
\begin{document}
...
\end{document}
Chapter and Sections
\section{}
\subsection{}
\subsubsection{}
paragraph
xxxxxx\par
or
xxxxxx
xxxxxx
Symols in $\LaTeX$
Symbol | Meaning |
---|---|
% | Annotation |
\ | Escape Character |
$ | Math Mode |
# | Parameter |
{ | Start of chunk |
} | End of chunk |
a^b | superscript($a^b$) |
a_b | subscript($a_b$) |
& | Separator in Table Chunk |
Symols in $\LaTeX$
Symbol | Representation |
---|---|
$\frac{\Box}{\Box}$ | \frac{}{} |
$\Box^{\Box}$ | ^{} |
$\Box_{\Box}$ | _{} |
$\Alpha\alpha$ | \Alpha\alpha |
$\Sigma^{\Box}_{\Box} \Box$ | \Sigma^{}_{} |
$\int^{\Box}_{\Box} \Box$ | \int^{}_{} |
$\oint^{\Box}_{\Box} \Box$ | \oint^{}_{} |
$\sqrt{\Box}$ | \sqrt{\Box} |
$\rightarrow$ | \rightarrow |
Complex Symols in $\LaTeX$
\left[ \begin{matrix}
\Box& \Box& \Box\\
\Box& \Box& \Box\\
\Box& \Box& \Box\\
\end{matrix} \right]
$$\left[ \begin{matrix}\Box&\Box&\Box\\ \Box&\Box&\Box\\ \Box&\Box&\Box\\ \end{matrix} \right]$$
\begin{cases}
\Box\\
\Box\\
\Box\\
\end{cases}
---
\left\{ \begin{array}{c}
\Box\\
\Box\\
\Box\\
\end{array} \right.
$$\left\{ \begin{array}{c}\Box\\ \Box\\ \Box\\ \end{array} \right.$$
setting equation number
$$y=k\times x+b \tag{1}$$
\usepackage{amsmath}
\numberwithin{equation}{section}
$$y=k\times x+b \tag{1.1}$$
Tables in $\LaTeX$
\begin{table}[htbp]
\centering
\caption{demo}
\begin{tabular}{ccc}
\hline
A & A & A \\ \hline
A & A & A \\ \hline
\end{tabular}
\label{tab:haha}
\end{table}
A | A | A |
A | A | A |
If the table is too large, use \resizebox
in package "graphicx"
Insert Pictures in $\LaTeX$
\includegraphics[scale=xxx]{xxx.jpeg}
- we usually represent it in:
\begin{center}
\includegraphics[scale=xxx]{figxxx.jpg}
\mfcaption{xxx}
\label{fig:xxx}
\end{center}
Insert References in $\LaTeX$
Reference Books
xxxxxx\cite{book} xxxxxxxxxxxxx
\begin{thebibliography}{99}
\bibitem{book}趙凱華,光學,高等教育出版社(2001)
\bibitem{book2}Eugene Hecht,Optics 5th Edition,Pearson (2017)
\end{thebibliography}
Footnotes
xxxxxxxxxxxx \footnote{Pierre Simon de Laplace, 1749-1827} xxxxxxxxxxxx
Refs on pictures and tables
xxxxxxxxxxxx \ref{tab:haha} xxxxxxxxxxxx
Theorem and Proofs
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{proof}{Proof}[section]
\begin{theorem}[xxx]
xxx
\end{theorem}
Drawing with Tikz
\begin{tikzpicture}
\draw
\fill
\node
\end{tikzpicture}
\documentclass{article}
\usepackage{ctexcap}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\fill[red] (0,0) rectangle (7.5,5);
\node[star,fill=yellow, minimum size=1.8cm, star point ratio=2.617,inner sep=0pt] at (1.3,3.6) {};
\node[star,fill=yellow, minimum size=.5cm, rotate=30, star point ratio=2.617,inner sep=0pt] at (2.5,4.5) {};
\node[star,fill=yellow, minimum size=.5cm, rotate=15, star point ratio=2.617,inner sep=0pt] at (3,3.9) {};
\node[star,fill=yellow, minimum size=.5cm, rotate=0, star point ratio=2.617,inner sep=0pt] at (3,3.1) {};
\node[star,fill=yellow, minimum size=.5cm, rotate=-15, star point ratio=2.617,inner sep=0pt] at (2.5,2.5) {};
\end{tikzpicture}
\caption{中國國旗}\label{fig:flag}
\end{figure}
\end{document}
\begin{center}
\begin{tikzpicture}[scale=1.2]
%點光源係列
\fill (0,-.6) circle (1pt);
\fill (0,-.3) circle (1pt);
\fill (0,0) circle (1pt);
\fill (0,.3) circle (1pt);
\fill (0,.6) circle (1pt);
%帶小孔的擋闆
\draw (1,-.8)--(1,-.1);
\draw (1,.1)--(1,.8);
%像
\draw (3,-1.6)--(3,1.6);
%光線
\draw (0,.3)--(3,-.9);
\draw (0,.3)--(3,-.3);
\draw (0,-.3)--(3,.9);
\draw (0,-.3)--(3,.3);
\draw (0,0)--(3,.3);
\draw (0,0)--(3,-.3);
\draw (0,.6)--(3,-.9);
\draw (0,.6)--(3,-1.5);
\draw (0,-.6)--(3,.9);
\draw (0,-.6)--(3,1.5);
%物距,像距
\draw (0,-1.7)--(0,-2);
\draw (1,-1.7)--(1,-2);
\draw (3,-1.7)--(3,-2);
\draw[latex-latex] (0,-1.85)--(1,-1.85) node at (0.5,-2) {$u$};
\draw[latex-latex] (1,-1.85)--(3,-1.85) node at (2,-2) {$v$};
%點光源/光斑間距
\draw (-.2,.3)--(-.5,.3);
\draw (-.2,0)--(-.5,0);
\draw[latex-latex] (-.35,0)--(-.35,.3) node at (-.5,.15) {$\delta$};
\draw (3.2,-.3)--(3.5,-.3);
\draw (3.2,-.9)--(3.5,-.9);
\draw[latex-latex] (3.35,-.3)--(3.35,-.9) node at (3.5,-.6) {$D$};
\end{tikzpicture}
\mfcaption{相距$\delta$的點光源所成像}
\label{fig4}
\end{center}
using optics package
\begin{center}
\begin{tikzpicture}[black,scale=1.2,use optics]
\coordinate (S1) at (-1,0.5);
\coordinate (S2) at (-1,-0.5);
\coordinate (S3) at (3,-1.9);
\coordinate (S4) at (3,1.9);
\coordinate (S5) at (3,-1.1);
\coordinate (S6) at (3,1.1);
\coordinate (S7) at (3,-1.5);
\coordinate (S8) at (3,1.5);
\node[slit,slit height=0.1,line width=2pt](L) at (0,0) {};
\draw[put arrow={at=0.8},put arrow={at=0.2}] (S1)--(S3);
\draw[put arrow={at=0.8},put arrow={at=0.2}] (S2)--(S4);
\draw[put arrow={at=0.8},put arrow={at=0.2}] (S1)--(S5);
\draw[put arrow={at=0.8},put arrow={at=0.2}] (S2)--(S6);
\draw[dashed] (S1)--(S7);
\draw[dashed] (S2)--(S8);
% image
\draw[->,line width=1.4pt] (S1) -- (S2);
\draw[->,line width=1.4pt] (S7) -- (S8);
\draw[dashed] (S7)--(S3);
\draw[dashed] (S8)--(S4);
% label
\draw[<->] (0,-2.1) -- (3,-2.1) node[below,midway] {$v$};
\draw[<->] (-1,-2.1) -- (0,-2.1) node[below,midway] {$u$};
\draw (0,-2)--(0,-2.2);
\draw (-1,-2)--(-1,-2.2);
\draw (3,-2)--(3,-2.2);
\end{tikzpicture}
\mfcaption{小孔成像理論圖}
\label{fig:attract}
\end{center}
use optics package in tikz
\documentclass{standalone}
\usepackage{tikz}
\usepackage{graphicx}
\begin{document}
\scalebox{2}[1]{
\begin{tikzpicture}
\draw [black,domain=0:0.5,line width=1.1pt] plot(\x,\x*\x);
\draw [black,domain=0.5:2,line width=1.1pt] plot(\x,-0.25*\x^-1+0.75) ;
\draw [violet,domain=0:2] plot(\x,\x*\x) ;
\draw [blue,domain=0.5:2] plot(\x,\x*\x-0.25) ;
\draw [<->] (0,4.5) - - (0,0) - - (2.5,0) ;
\end{tikzpicture}
}
\end{document}
%--coding: UTF-8 --
% !TEX program = xelatex
\documentclass{article}
\usepackage{ctexcap}
\usepackage{amsmath}
\usepackage{authblk}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{multicol}
\usepackage{multicap}
\usepackage{tikz}
\usetikzlibrary {optics}
One of the templates
\fancyhf{}
\setlength{\textwidth}{474pt}
\setlength{\oddsidemargin}{-7pt}
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{--\ \thepage\ --}\rfoot{}
\pagestyle{plain}
\renewenvironment{abstract}{
\textbf{Abstract}:
}{\par}
\newenvironment{keyword}{
\textbf{Keyword}:
}{}
\title{\vspace{-30mm}\Huge\heiti XXX}
\author[1]{xxx}
\affil[1]{xxx}
\renewcommand*{\Affilfont}{\small\it}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
\end{abstract}
\begin{keyword}
\end{keyword}
\begin{multicols}{2}
正文
\end{multicols}
\end{document}
标签: LaTeX
评论:
不知名人士 2022-05-16 17:26
@同学:\title\author\institution处设置
不知名人士 2022-05-16 17:27
@同学:\title\author\institution处设置
路人1 2022-05-10 22:18
作者您好,请问在使用beamer的时候,每一页的最下方仍然保持着作者(学院)以及beamer模板是什么原因?我应如何处理?十分感谢!
路人 2022-03-05 14:38
您好,我发现模版里段落间距并不统一,有的段落间距是正常的,有的却是分开很大(很违和),不知道是什么原因https://tva3.sinaimg.cn/large/006T9etDly1gzyzz5kjm4j30y80phgy5.jpg
JourinTown 2022-03-06 18:15
@路人:事实上如果您看原本孙老师的格式文件中全篇已经设置了统一的段落间距,但是由于中文的包天生自带一个弹性行距的设置,并且没有办法禁用,所以你看到的这一页间距太宽的问题可能就是这两个设置冲突造成的(因为这一页有大量的浮动体使得纵向没有铺满),目前没有比较好的办法,您可以直接用vskip或者parskip强制把这样的换行改了。
路人 2022-03-10 12:09
@JourinTown:感谢回复,方案可行
盒子 2022-02-05 15:30
您好!以前录播部分的链接好像失效了,可以再发一次吗?