«

南开大学毕业论文模板LaTeX工作坊(20220205)

时间:2022-2-4 23:30     作者:JourinTown     分类: 计算机技术


附件下载链接

当前版本:230430

NKThesis最新版 NKBeamer最新版 NKThesis 211214 Mac预配置版
NKThesis下载 NKBeamer下载 NKThesis Mac包 下载

注意!!!

使用说明

历史版本

已知且无法修复的问题:

  1. 如果页面中浮动体过多导致的段间距问题,该问题由于CJK包中优先匹配上下对齐再满足行间距和段间距,目前临时的方案可以直接用vskip或者parskip强制把异常换行修正。
  2. 参考文献标题左对齐。
  3. 标题中无法加入带参的指令,如\bar{x},该问题是由于LaTeX传参限制,即使在expendafter后也无法传递带参数的指令,如\bar{x},但是可以传递不带参数的指令,如\alpha。对于此目前没有特别好的解决方案,临时方法是直接替换对应cfg文件中需要修改的字符串。

课件

录播(电脑端点击图片即可跳转)

百度网盘地址

2020年11月基础老课件

Installation


  1. Windows
    1. CTEX
    2. WinEdt with MikTeX
  2. Mac OS
    1. TeXPad
  3. Linux
    1. Gummi
    2. vim
  4. Across platform
    1. VSCode
    2. 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

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}
\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

版权所有:《豪言亂語
文章标题:《南开大学毕业论文模板LaTeX工作坊(20220205)
除非注明,文章均为 《豪言亂語》 原创
转载请注明本文短网址:https://article.benhaotang.cn/pc/26.html  [生成短网址]
评论:
avatar
同学 2022-05-10 22:19
作者您好,请问在使用beamer的时候,每一页的最下方仍然保持着作者(学院)以及beamer模板是什么原因?我应如何处理?十分感谢!
commentator
不知名人士 2022-05-16 17:26
@同学:\title\author\institution处设置
commentator
不知名人士 2022-05-16 17:27
@同学:\title\author\institution处设置
avatar
路人1 2022-05-10 22:18
作者您好,请问在使用beamer的时候,每一页的最下方仍然保持着作者(学院)以及beamer模板是什么原因?我应如何处理?十分感谢!
avatar
路人 2022-03-05 14:38
您好,我发现模版里段落间距并不统一,有的段落间距是正常的,有的却是分开很大(很违和),不知道是什么原因https://tva3.sinaimg.cn/large/006T9etDly1gzyzz5kjm4j30y80phgy5.jpg
commentator
JourinTown 2022-03-06 18:15
@路人:事实上如果您看原本孙老师的格式文件中全篇已经设置了统一的段落间距,但是由于中文的包天生自带一个弹性行距的设置,并且没有办法禁用,所以你看到的这一页间距太宽的问题可能就是这两个设置冲突造成的(因为这一页有大量的浮动体使得纵向没有铺满),目前没有比较好的办法,您可以直接用vskip或者parskip强制把这样的换行改了。
commentator
路人 2022-03-10 12:09
@JourinTown:感谢回复,方案可行
avatar
盒子 2022-02-05 15:30
您好!以前录播部分的链接好像失效了,可以再发一次吗?
commentator
JourinTown 2022-02-05 15:48
@盒子:经过多人测试似乎没有这个问题,您要不重新点一下图片或者换个浏览器试试?