美文网首页LaTeX科研写作
Latex 页面布局以及内容布局

Latex 页面布局以及内容布局

作者: Hiper | 来源:发表于2019-07-18 17:18 被阅读21次

使用ctexart模板

\documentclass{ctexart}

页面大小以及页边距

\usepackage{geometry}
\geometry{a4paper,left=2cm,right=2cm,top=2cm,bottom=2cm}

表示页面大小为A4纸,上下左右空出来的距离都是2cm.


页码

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\lhead{这里的内容会在左上角显示} 
\chead{} 
\rhead{这里的内容会在右上角显示} 
\lfoot{}  %没有内容可以留空
\cfoot{}
\rfoot{\thepage}  %\thepage 显示当前页数

官方在线文档:http://www.ctex.org/documents/packages/layout/fancyhdr.htm


摘要
两种方式:如果只要求一种语言的摘要,那么用

\begin{abstract}
        我是摘要
        
        \centering  %使得关键字居中
        \textbf{关键词:}我是关键词
\end{abstract}

直接就完事了.
两种语言的话得重定义一下,如下

\newcommand{\enabstractname}{Abstract}
\newcommand{\cnabstractname}{摘要}
\newenvironment{cnabstract}{%
    \par\small
    \noindent\mbox{}\hfill{\bfseries \cnabstractname}\hfill\mbox{}\par
    \vskip 2.5ex}{\par\vskip 2.5ex}

\newenvironment{enabstract}{%
    \par\small
    \noindent\mbox{}\hfill{\bfseries \enabstractname}\hfill\mbox{}\par
    \vskip 1.5ex}{\par\vskip 2.5ex} 

上边定义放在导言区里,接下来在正文区里使用

\begin{cnabstract}
    我是中文摘要
    
    \centering  %使得关键字居中
    \textbf{关键词:}我是关键词
\end{cnabstract}
\begin{enabstract}
    我是英文摘要
    
    \centering  %使得关键字居中
    \textbf{关键词:}我是关键词
\end{enabstract}

内容框架

\section{一级标题}
\subsection{二级标题}
\subsubsection{三级标题}
\paragraph{段落标题}

定理环境
最讨厌定理用一个标号,定义用另一个标号,往回翻时乱七八糟的,所以我在这里把所有的定理,定义,命题啥的都统一一个标号递增啦.

\usepackage{amsthm}         %定理环境
\newtheorem{definition}{{定义}}[subsection]
\newtheorem{theorem}[definition]{{定理}}
\newtheorem{lemma}[definition]{{引理}}
\newtheorem{proposition}[definition]{{命题}}

放导言区,接下来是怎么使用

\begin{definition}\label{我是标签}
我是定义
\end{definition}

\begin{theorem}\label{我是标签}
我是定理
\end{theorem}
\begin{proof}[\textbf{证明}]  %在引理,定理,命题后可加证明环境
我是证明内容  
\end{proof}

\begin{lemma}\label{我是标签}
我是引理
\end{lemma}

\begin{proposition}\label{我是标签}
我是命题
\end{proposition}

数学公式

\begin{equation}\label{我是标签}
我是需要标号的数学公式
\end{equation}

\begin{equation*}
我是不需要标号的数学公式
\end{equation*}

参考文献
首先先整理你的参考文献参考链接,例如


新建一个文本文档,和你的tex文档放在同一目录下,把你的所有参考文献都放进去,最后重命名为ref.bib
\bibliographystyle{plain}
\nocite{*}
\bibliography{ref}  %如果你的参考文献都在ref.bib文件里放着,那么这里就是ref

在正文区写入上述代码,使用

  \usepackage{cite}

就可以引用了,引用示例

\cite{2005线性算子的谱分析}

相关文章

网友评论

    本文标题:Latex 页面布局以及内容布局

    本文链接:https://www.haomeiwen.com/subject/ybwllctx.html