sharelatex新手教程

可实现显示中文、插入图、表、公式(自动标号)、参考文献、索引上标、段落、设置字体等功能。

 

%头文件包
\documentclass[twocolumn,12pt]{report}%设置页面为双栏,字号大小默认为12pt
\usepackage[utf8]{inputenc} %input子文档包
                        
\usepackage{graphicx}%插图包


\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}%定义纸张大小和页边距

\usepackage[style=alphabetic]{biblatex}%添加参考文献包
\addbibresource{references.bib}%导入参考文献


\usepackage{caption}
\usepackage{subcaption}%定义二级标题,用于subcaption

\usepackage{fancyhdr}%自定义页面设置



\pagestyle{fancy}
\fancyhead{}%清空当前的页眉
\fancyhead[RO,LE]{Thesis Title}%设置新的页眉
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}%设置页数自动标号的位置,如果不设置会有自动的页脚下标
\fancyfoot[LO,CE]{Chapter\thechapter}%进行章节的计数,如果没有chapter*的星号才能够正确显示
\fancyfoot[CO,RE]{Author Name}



\usepackage{indentfirst}%设置首行缩进两个字符的包
\setlength{\parindent}{2em}

\usepackage{CJKutf8}%显示中日韩文包,默认的简体宋体和开题gbsn gkai其他字体需要自行下载不方便
\usepackage{amsmath}%使用函数的分行显示split的包

%定义新的命令和环境
\renewcommand{\myfontsize}{\fontsize{12pt}}%重新定义现有的命令
\newcommand{\upcite}[1]{\textsuperscript{\textsuperscript{\cite{#1}}}}%设置上标
\renewcommand{\headrulewidth}{0.4pt}%宏定义
\renewcommand{\footrulewidth}{0.4pt}
%导言区
%\title{{thesis}\\
       % {\large institution name}\\
       % {\includegraphics{images/universe}}
       % {\heiti 崔巍魏 }}
%\author{\kaishu 崔巍魏 }

%\date{November 2018}
%正文
\begin{document}
\begin{CJK*}{UTF8}{gkai}%还能换成gbsn
%\maketitle%导入准备阶段的首页作者的基本信息
%\input{titlepage.tex}%自定义一个首页
%\input{abstract.tex}

\chapter*{Abstact}%加*不会显示chapter1
good is not enough
真好卡门
god says that $a+b=c$\\%换行,$$之间插入公式
\\
a\qquad \quad 插入多个空格
\begin{spacing}{1.0}%插入空行
\end{spacing}

\begin{equation}%公式自动添加标号,若多个公式使用qunarray,*为不显示标号,split为多个公式只显示一个标号
\centering%居中,如果段落,则使用begin{center} end{center}放在公式begin{equation}的前外一层
\sum_{i=a}^{b}x^{a}=1000%公式使用https://private.codecogs.com/latex/eqneditor.php进行转换
\end{equation}

\begin{equation}
\centering
\large%字号改变
\sum_{i=a}^{b}y^{a}=1000
\end{equation}

\begin{eqnarray}
\begin{split}%多行公式array,一个公式标号split
\sum_{i=a}^{b}x^{a}=1000\\
\sum_{i=a}^{b}x^{a}=1000
\end{split}
\end{eqnarray}



\begin{eqnarray}%将多个公式分行显示,只添加一个标号
\begin{split}
x^n+y^n & = & z^n \\
x
\end{split}
\end{eqnarray}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%这个方法简便
\begin{align}%将多个公式分行显示,按照等号对齐,只添加一个标号
\begin{split}
 f(x) &= (x+a)(x+b) \\
 &= x^2 + (a+b)x + ab\\
 g&=a+b
\end{split}
\end{align}

\chapter*{Dedication}
best
\textbf{崔巍魏}%加粗

\tableofcontents%生成目录
\listoffigures%生成图表目录
\listoftables%生成表格目录

\chapter{Chapter1}
\input{images/chapter1}%导入写好的段落


\chapter{Int2}
\pagestyle{fancy}
\input{images/chapter2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%画图
\begin{figure}[!hbt]
\centering
\includegraphics[scale=1.5]{images/universe.jpg}
\caption{an example}
\label{fig:x cubed graph}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%画多张图并列
\begin{figure}[!hbt]
    \centering
    \begin{subfigure}[b]{0.15\textwidth}
        \centering
        \includegraphics[width=\textwidth]{images/universe.jpg}
        \caption{$y=x$}
        \label{fig:y=x}
    \end{subfigure}
    \hfill
    \begin{subfigure}[b]{0.15\textwidth}
        \centering
        \includegraphics[width=\textwidth]{images/universe.jpg}
        \caption{$y=4x$}
        \label{fig:y=x}
    \end{subfigure}
    \hfill
    \begin{subfigure}[b]{0.15\textwidth}
        \centering
        \includegraphics[width=\textwidth]{images/universe.jpg}
        \caption{$y=x$}
        \label{fig:y=x}
    \end{subfigure}
    \caption{three plot}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%画表
\begin{table}[h]
\centering
\begin{tabular}{l|l|l}
A&B&C\\
\hline
1&2&3\\
4&5&6
\end{tabular}
\caption{basic table}
\label{basic table}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%画多个表并列
\begin{table}[!hbt]
    \centering
    \begin{subtable}[h]{0.45\textwidth}
        \centering
        \begin{tabular}{l|l|l}% c:居中 l:左对齐 r:右对齐
            day&month&year\\
            \hline
            mon&1&2\\
            mon&1&2\\
            mon&1&2\\
        \end{tabular}
        \caption{table1}
        \label{tab:week1}
    \end{subtable}
    \hfill
    \begin{subtable}[h]{0.45\textwidth}
        \centering
        \begin{tabular}{l|l|l}
          day&month&year\\
          \hline\hline
            mon&1&2\\
            mon&1&2\\
            mon&1&2\\
        \end{tabular}
        \caption{table2}
        \label{tab:week2}
    \end{subtable}
    \caption{week}
    \label{tab:weel}
\end{table}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%插入文章段落,或者input a.tex
the collective performance resources of the pool rather than for single database
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%添加下标和正常文献标注
performance.\parencite[compare][]{adams1995hitchhiker}\upcite{adams}
I want to stay in lab alone\cite[see][p10]{adam}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%添加层级标题
\section{Conclusion}
``I always thought something was fundamentally wrong with the universe'' 
\section{LaTeX的使用方法section}
section下面的文字
\subsection{LaTeX的使用方法subsection}
subsection下面的文字
\subsubsection{LaTeX的使用方法subsubsection}
subsubsection下面的文字




\printbibliography%放置导入的bib 文献
\end{CJK*}
\end{document}%大功告成
%references.bib
@book{adams1995hitchhiker,
  title={The Hitchhiker's Guide to the Galaxy},
  author={Adams, D.},
  isbn={9781417642595},
  url={http://books.google.com/books?id=W-xMPgAACAAJ},
  year={1995},
  publisher={San Val}
}
@book{adam,
  title={The Hitchhiker's Guide to the Galaxy},
  author={Adams, D.},
  isbn={9781417642595},
  url={http://books.google.com/books?id=W-xMPgAACAAJ},
  year={1995},
  publisher={San Val}
}
@book{adams,
  title={The Hitchhiker's Guide to the Galaxy},
  author={Adams, D.},
  isbn={9781417642595},
  url={http://books.google.com/books?id=W-xMPgAACAAJ},
  year={1995},
  publisher={San Val}
}

 

你可能感兴趣的:(sharelatex新手教程)