【写作】Texlive和Texmaker学习
前言
最近要看一些論文做一下筆記,所以準(zhǔn)備使用一下比較流行的Texlive和Texmaker寫一下。其實(shí)CSDN的Markdown也是不錯滴。
首先國際慣例,貼幾個地址:
Texlive鏡像下載地址:http://mirror.lzu.edu.cn/CTAN/systems/texlive/Images/
Texlive云盤下載地址:鏈接:http://pan.baidu.com/s/1c2l2JUK 密碼:u849
texmaker官方地址:http://www.xm1math.net/texmaker/
texmaker云盤地址:鏈接:http://pan.baidu.com/s/1mhZHhoO 密碼:1v0e
貼吧下載的學(xué)習(xí)文檔:鏈接:http://pan.baidu.com/s/1qXFqmVa 密碼:a2ar
【強(qiáng)烈推薦】比較好的簡短的教程:http://liam0205.me/2014/09/08/latex-introduction/
安裝
兩個軟件的安裝順序隨意,路徑隨意,我一般安裝的軟件就是默認(rèn)C盤了o(╯□╰)o
本人首先安裝了Texmaker,一直下一步就行了
然后安裝Texlive
①解壓iso鏡像文件,然后雙擊install-tl-advanced.bat
②修改一下倒數(shù)第二項(xiàng)為否,因?yàn)槲覀兗磳⑹褂玫木庉嬈魇荰exmaker而非自帶的TeXworks前端
然后安裝吧,安裝完成的標(biāo)志是:
安裝完畢以后點(diǎn)擊完成并關(guān)閉cmd窗口。
接下來就是關(guān)聯(lián)兩個軟件:
打開TexMaker->選項(xiàng)->配置TexMaker->命令,配置前兩項(xiàng)如下:
【PS】如果你的安裝路徑是默認(rèn)的,其實(shí)這個地方已經(jīng)自動關(guān)聯(lián)了,無需修改。如果更改了安裝路徑,那最好還是修改一下吧。
基本使用
添加注釋的時候使用"%" 即可,和C語言或者C++里面的 "//" 一樣
還有就是usepackage的代碼都在\documentclass下面寫
文件->新建,鍵入以下代碼
\documentclass{article} \begin{document} Hello world \end{document}然后保存,如果不保存直接點(diǎn)擊快速構(gòu)建會出現(xiàn)
正確保存以后再快速構(gòu)建就會出現(xiàn)正確結(jié)果
中文輸入
之前安裝的是Miktex,但是CJK語言包實(shí)在是安裝不上,鏈接一直中斷,無法下載。所以無奈之下才選擇了Texlive。
很簡單,修改documentclass的類型就行了,如下:
\documentclass[UTF8]{ctexart} \begin{document} Hello Wrold!! 你好 世界!! \end{document}
簡單框架
一般文檔都包含基本的幾個部分:①標(biāo)題 ②作者 ③摘要 ④目錄 ⑤正文:章節(jié)、段落、參考文獻(xiàn)
關(guān)于參考文獻(xiàn)以后再說,先說說前面的基本組成部分。
【PS】這一部分需要仔細(xì)研讀,有很多符號的作用可以通過刪除此符號和添加此符號去看效果。比如\indent的作用
\documentclass[UTF8]{ctexart} %文檔類型,可鍵入中文 \title{測試\\換行\(zhòng)& 與符號}%文檔標(biāo)題 \author{白菜}%作者 \begin{document}%開始文章書寫 \maketitle%將封面打印出來,也就是上面的標(biāo)題作者 \tableofcontents %自動目錄 %摘要 \vspace{8pt} %字號大小 \renewcommand{\abstractname}{\huge 摘\quad 要} \begin{abstract} %開始寫摘要 \normalsize \noindent 這個是摘要啦 \end{abstract} \section{第一個章節(jié)} \paragraph{主要內(nèi)容}~{} \newline \indent 換一行寫正文,兩個縮進(jìn) \subparagraph{子段}本次匯報主要總結(jié)最近精看的幾篇深度學(xué)習(xí)文章以及關(guān)于卷積RBM在運(yùn)動捕捉數(shù)據(jù)中的實(shí)驗(yàn)結(jié)果和進(jìn)一步將展開的工作。深度學(xué)習(xí)文章主要有四篇,分別介紹了CNN在運(yùn)動捕捉數(shù)據(jù)建模中的應(yīng)用,以及卷積RBM最開始的提出和在Audio分類中的應(yīng)用。另外一篇論文介紹了運(yùn)動拼接的一種方法。\section{第二個章節(jié)} \paragraph{} 寫什么好呢 \subsection{來個子章節(jié)}可以可以\section{第三個章節(jié)} \paragraph{}寫一個段落 \subparagraph{}再來一個字段落 \end{document}運(yùn)行以后發(fā)現(xiàn)第一頁挺正常,但是第二頁多了一個頁眉
解決辦法,在\begin{document}下一行加一句話\pagestyle{empty}
\documentclass[UTF8]{ctexart} %文檔類型,可鍵入中文 \title{測試\\換行\(zhòng)& 與符號}%文檔標(biāo)題 \author{白菜}%作者 \begin{document}%開始文章書寫 \pagestyle{empty} \maketitle%將封面打印出來,也就是上面的標(biāo)題作者 \tableofcontents %自動目錄 %后面我就不貼了添加公式
我在上面的第二個章節(jié)添加了公式,只貼第二章的代碼
<pre code_snippet_id="1922972" snippet_file_name="blog_20161011_5_2376271" name="code" class="cpp">\section{第二個章節(jié)} \paragraph{} 寫什么好呢 \subsection{來個子章節(jié)}可以可以 隨便來個行內(nèi)公式$E=mc^2$或者來一個不帶序號行間公式\[ E=mc^2\]也可以這樣表示行間帶序號的公式 \begin{equation} E=mc^2 \end{equation} 來個上下標(biāo)累加和的 \begin{equation} a=\sum_{i=1}^{i=N} a_i^{frame} \end{equation}此外還有很多符號,比如分式、累乘、開根號等以及很多的符號比如α、β、η等,都可以去此百度頁面找到更多的比如矩陣、公式組、分段函數(shù)等,在文章開頭的強(qiáng)烈推薦的網(wǎng)址中有介紹,我這里貼一下代碼,有興趣的自己運(yùn)行看看,依舊還是第二章節(jié):
\section{第二個章節(jié)} \paragraph{} 寫什么好呢 \subsection{來個子章節(jié)}可以可以 隨便來個行內(nèi)公式$E=mc^2$或者來一個不帶序號行間公式\[ E=mc^2\]也可以這樣表示行間帶序號的公式 \begin{equation} E=mc^2 \end{equation} 來個上下標(biāo)累加和的 \begin{equation} a=\sum_{i=1}^{i=N} a_i^{frame} \end{equation} \newline 來一堆符號 \[ \pm\; \times \; \div\; \cdot\; \cap\; \cup\;\geq\; \leq\; \neq\; \approx \; \equiv \] \newline 來一堆加和累乘的 $ \sum_{i=1}^n i$\\ $\prod_{i=1}^n $\\ $ \sum\limits _{i=1}^n i$\\ $ \prod\limits _{i=1}^n $\\ \newline 求極限,求積分什么的,還有一個多重積分 \[ \lim_{x\to0}x^2 \quad \int_a^b x^2 dx \] \[ \lim\nolimits _{x\to0}x^2\quad \int\nolimits_a^b x^2 dx \] \[ \iint\quad \iiint\quad \iiiint\quad \idotsint \] \newline 大括號 \[ \Bigg(\bigg(\Big(\big((x)\big)\Big)\bigg)\Bigg) \] \[ \Bigg[\bigg[\Big[\big[[x]\big]\Big]\bigg]\Bigg] \] \[ \Bigg \{\bigg \{\Big \{\big \{\{x\}\big \}\Big \}\bigg \}\Bigg\} \] \[ \Bigg\langle\bigg\langle\Big\langle\big\langle\langle x \rangle\big\rangle\Big\rangle\bigg\rangle\Bigg\rangle \] \[ \Bigg\lvert\bigg\lvert\Big\lvert\big\lvert\lvert x \rvert\big\rvert\Big\rvert\bigg\rvert\Bigg\rvert \] \[ \Bigg\lVert\bigg\lVert\Big\lVert\big\lVert\lVert x \rVert\big\rVert\Big\rVert\bigg\rVert\Bigg\rVert \] \newline 根式和分式 $\sqrt{x}$, $\frac{1}{2}$. \[ \sqrt{x}, \] \[ \frac{1}{2}. \] \newline 省略號 \[ x_1,x_2,\dots ,x_n\quad 1,2,\cdots ,n\quad \vdots\quad \ddots \] \newline 矩陣 \[ \begin{pmatrix} a&b\\c&d \end{pmatrix} \quad \begin{bmatrix} a&b\\c&d \end{bmatrix} \quad \begin{Bmatrix} a&b\\c&d \end{Bmatrix} \quad \begin{vmatrix} a&b\\c&d \end{vmatrix} \quad \begin{Vmatrix} a&b\\c&d \end{Vmatrix} \] \newline 來一個行內(nèi)小矩陣 Marry has a little matrix$(\begin{smallmatrix}a&b\\c&d\end{smallmatrix})$ \newline 無需對齊的長公式 \begin{multline}%不需要編號的時候使用multline* x=a+b+c+{}\\ d+e+f \end{multline} \newline 需要對齊的公式 \[\begin{aligned} x={}& a+b+c+{} \\ &d+e+f+g \end{aligned}\] \newline 公式組 \begin{gather} a=b+c+d\\ x=y+z \end{gather} \begin{align} a&=b+c+d\\ x&=y+z \end{align} \newline 分段函數(shù) \[ y= \begin{cases} -x,\quad x\leq 0\\ x,\quad x>0 \end{cases}\] \section{第三個章節(jié)} \paragraph{}寫一個段落 \subparagraph{}再來一個字段落 \graphicspath{{RGBnumber/}}%外層大括號可寫多個路徑 \newline 插入一張圖片\newline \includegraphics[width=0.1\textwidth]{0.png} 插入一張圖片\newline \begin{figure}[!h]%!h是不讓圖片直接顯示在頁面頂部 \centering%居中顯示 \includegraphics[width=0.1\textwidth ,height=1in]{1.png}%width和height設(shè)置長寬 \end{figure} \begin{figure}[!h] \centering \subfigure[數(shù)字2]%子圖1 {\includegraphics{2.png}} \subfigure[數(shù)字3]%子圖2 {\includegraphics{3.png}} \caption{子圖數(shù)字展示} \label{figure1} \end{figure}
插入圖片
以我前面制作的手寫數(shù)字的圖片為例
云盤下載地址:鏈接:http://pan.baidu.com/s/1o7NySMu 密碼:bead
首先在頂部添加一個引用包
\usepackage{graphicx}然后再第三章中添加圖片,先加入圖片路徑
\graphicspath{{RGBnumber/}}%外層大括號可寫多個路徑
①可以用最簡單的插入圖片方法,但是圖片會位于左邊頂格
\newline 插入一張圖片\newline \includegraphics[width=0.1\textwidth]{0.png}
效果如下:
插入一張圖片\newline \begin{figure}[!h]%!h是不讓圖片直接顯示在頁面頂部 \centering%居中顯示 \includegraphics[width=0.1\textwidth ,height=1in]{1.png}%width和height設(shè)置長寬 \end{figure}
效果如下:
有時候需要圖片能夠并列編號,就像matlab的subplot一樣
\begin{figure}[!h] \centering \subfigure[數(shù)字2]%子圖1 {\includegraphics{2.png}} \subfigure[數(shù)字3]%子圖2 {\includegraphics{3.png}} \caption{子圖數(shù)字展示} \label{figure1} \end{figure}效果如下:
貼一下第三章的代碼:
\section{第三個章節(jié)} \paragraph{}寫一個段落 \subparagraph{}再來一個字段落 \graphicspath{{RGBnumber/}}%外層大括號可寫多個路徑 \newline 插入一張圖片\newline \includegraphics[width=0.1\textwidth]{0.png} 插入一張圖片\newline \begin{figure}[!h]%!h是不讓圖片直接顯示在頁面頂部 \centering%居中顯示 \includegraphics[width=0.1\textwidth ,height=1in]{1.png}%width和height設(shè)置長寬 \end{figure} \begin{figure}[!h] \centering \subfigure[數(shù)字2]%子圖1 {\includegraphics{2.png}} \subfigure[數(shù)字3]%子圖2 {\includegraphics{3.png}} \caption{子圖數(shù)字展示} \label{figure1} \end{figure}
插入表格
介紹兩種方法:
①推薦博客使用的比較簡單的tabular方法,使用hline表示橫線,用 | 表示豎線,用&分列,用\\換行,用l、c、r分別表示居左,居中、居右
\section{畫表格} 畫一張簡單的表格 \begin{table}[!htb]%不加!htb會自動置頂 \caption{操作系統(tǒng)} \centering \begin{tabular}{|l|c|r|} \hline 操作系統(tǒng)& 發(fā)行版& 編輯器\\ \hline Windows & MikTeX & TexMakerX \\ \hline Unix/Linux & teTeX & Kile \\ \hline Mac OS & MacTeX & TeXShop \\ \hline 通用& TeX Live & TeXworks \\ \hline \end{tabular} \end{table}
②如果是長表格,就用longtable,加上另外一個用于旋轉(zhuǎn)的包和跨行包,跟設(shè)計網(wǎng)頁的表格有點(diǎn)類似
\usepackage{longtable} \usepackage{multirow} \usepackage{rotating}使用長表格部分的代碼為:
使用長表格 \newpage \begin{longtable}{| c | c | c | c | c | c |}\hline& \multicolumn{5}{| c |}{ } \\& \multicolumn{5}{| c |}{\textbf{\large 處理(卷積核大小5*3,DBN單元數(shù)$600->400->200->50->2$)}} \\& \multicolumn{5}{| c |}{ } \\\hline& & & & & \\\multicolumn{1}{|c|}{\textbf{}}& \multicolumn{1}{|c|}{\textbf{}}& \multicolumn{1}{c|}{\textbf{關(guān)節(jié)位置}}& \multicolumn{1}{c|}{\textbf{歐拉角}}& \multicolumn{1}{c|}{\textbf{做差diff}}& \multicolumn{1}{c|}{\textbf{無diff}} \\& & & & & \\\cline{2-6}& & & & & \\\multirow{5}{*}{\begin{sideways}{\textbf{\large 實(shí)驗(yàn)}}\end{sideways}}& \textbf{實(shí)驗(yàn)一} & √ & & × & \\& & & & & \\\cline{2-6}& & & & & \\& \textbf{實(shí)驗(yàn)二} & √ & & & × \\& & & & & \\\cline{2-6}& & & & & \\& \textbf{實(shí)驗(yàn)三} & & √ & × & \\& & & & & \\\cline{2-6}& & & & & \\& \textbf{實(shí)驗(yàn)四} & & √ & & × \\& & & & & \\\hline\end{longtable}效果如下:
頁眉頁腳
直接在begin{document}后面寫頁眉代碼即可,剛開始在簡單框架中,我們設(shè)置了頁眉為空,是為了防止每頁頂部自動添加文章標(biāo)題,在這里我們注釋掉取消頁眉的那一行,添加如下代碼
%\pagestyle{empty} \lhead{\author{白菜}} \chead{\date \today} \rhead{123456789} \lfoot{} \cfoot{\thepage} \rfoot{} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\headwidth}{\textwidth} \renewcommand{\footrulewidth}{0pt}效果如下:
在句子前加標(biāo)注
(1)下面這種效果
可以用代碼如下:
\section{句子表示} \paragraph{} 怎么表示呢? \begin{enumerate} \item 額 \item 好 \item 什么鬼 \end{enumerate}(2)如果想添加小黑點(diǎn)
這樣的話,需要先添加一個包(這里我貼一下目前所用的所有包,第二個包就是本例使用的包)
\documentclass[UTF8]{ctexart} %文檔類型,可鍵入中文 \usepackage{enumitem} \usepackage{amsmath} \usepackage{graphicx} \usepackage{subfigure} \usepackage{longtable} \usepackage{multirow} \usepackage{rotating} \usepackage{fancyhdr} \pagestyle{fancy}然后再第四章中加入:
\paragraph{}加個小黑點(diǎn) \begin{itemize} \item 可以么 \item 試試唄 \end{itemize}
參考文獻(xiàn)
最好去谷歌學(xué)術(shù)上查找相應(yīng)的參考文獻(xiàn),在百度學(xué)術(shù)上導(dǎo)出的可能遇到部分問題。
舉個例子,對比一下《Verbs and adverbs: Multidimensional motion interpolation》這篇文章分別在谷歌學(xué)術(shù)和百度學(xué)術(shù)上的bibtex導(dǎo)入鏈接
谷歌學(xué)術(shù)上為:
@article{rose1998verbs,title={Verbs and adverbs: Multidimensional motion interpolation},author={Rose, Charles and Cohen, Michael F and Bodenheimer, Bobby},journal={IEEE Computer Graphics and Applications},volume={18},number={5},pages={32--40},year={1998},publisher={IEEE} }百度學(xué)術(shù)上為: @article{Rose1998Verbs,title={Verbs and Adverbs: Multidimensional Motion Interpolation},author={Rose, Charles and Cohen, Michael F. and Bodenheimer, Bobby},journal={IEEE Computer Graphics & Applications},volume={18},number={5},pages={32-40},year={1998}, }可以看到,谷歌學(xué)術(shù)上會多一行,從下面的實(shí)驗(yàn)中可以看出來多一行和少一行的區(qū)別。參考文獻(xiàn)添加步驟:
①新建一個bib文件,我這里稱為test.bib,里面放入從百度學(xué)術(shù)復(fù)制的一篇文章的bibtex
@article{Rose1998Verbs,title={Verbs and Adverbs: Multidimensional Motion Interpolation},author={Rose, Charles and Cohen, Michael F. and Bodenheimer, Bobby},journal={IEEE Computer Graphics & Applications},volume={18},number={5},pages={32-40},year={1998}, }②在你的正文文檔,也就是書寫內(nèi)容的tex文檔中的 \begin{document}%開始文章書寫之后引用 \bibliographystyle{plain}然后在需要引用參考文獻(xiàn)的地方使用: \cite{Rose1998Verbs}接下來在 \end{document}之前顯示所有被引用的參考文獻(xiàn) \bibliography{test.bib}③點(diǎn)擊快速構(gòu)建
可能會出現(xiàn)如下情況,如果沒出現(xiàn)那就繼續(xù)進(jìn)行下一步,不用管它
這就是剛開始說的,多一行與少一行的差別
因此,我們采用谷歌學(xué)術(shù)的方法去復(fù)制導(dǎo)入bibtex,再點(diǎn)擊快速構(gòu)建,然后點(diǎn)擊工具欄->工具->BibTex或者直接按F11,最后再快速構(gòu)建兩次,即可成功
開頭:
\begin{document}%開始文章書寫 \bibliographystyle{plain} %\pagestyle{empty} \lhead{\author{白菜}}結(jié)尾參考文獻(xiàn)\cite{Rose1998Verbs} 能不能打印出來 \bibliography{test.bib} \end{document}效果:
————————————————后續(xù)遇到問題會持續(xù)更新此博客——————————————
總結(jié)
以上是生活随笔為你收集整理的【写作】Texlive和Texmaker学习的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 平安随享金多久到账?没到账怎么办?
- 下一篇: 《Neural Networks for