写在前面:
提示:这篇文章只是个人学习记录,把自己找到的方法记录下来;并不是一篇教学文章。同时我会把我查到的资料来源标注出来,基本上都是网上的资料,因为我曾经安装过,但是我忘记了;并且从头查找资料又麻烦,所以我干脆自己整理一下
文章参考:http://t.csdnimg.cn/74Cee和http://t.csdnimg.cn/bdYQu
Texlive和TexStudio下载:
Texlive下载:打开清华镜像:https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/
TexStudio下载:进入清华园镜像:https://mirrors.tuna.tsinghua.edu.cn/github-release/texstudio-org/texstudio/LatestRelease/
上面的也可以去官网下载。
texlive的安装:
双击打开刚刚下载的texlive2024.iso:打开下面标注的install-tl-windows.bat;
会以此弹出两个窗口;如果没弹出看下面的任务栏有没有。
修改安装位置,点击确定后安装即可。
安装过程很慢,等一个小时左右即可。
下面就是安装好了;然后关闭即可,之后命令窗口也会自动关闭的。
下面我们去验证是否安装成功;windows+R;cmd;进入命令行窗口;输入
latex -v
当出现版本信息是表示安装成功
TexStudio安装:
这个可以不安装的;用VsCode就可以。我主要是想记录一下
双击下载好的.exe可执行文件;更改安装路径直接安装即可。
安装完成后如果出现问题查阅下面的文章
http://t.csdnimg.cn/74Cee
打开TexStudio;编写一个文档就可以了。
输入下面的代码到TexStudio验证即可
% This is a small sample LaTeX input file (Version of 10 April 1994)
%
% Use this file as a model for making your own LaTeX input file.
% Everything to the right of a % is a remark to you and is ignored by LaTeX.
% The Local Guide tells how to run LaTeX.
% WARNING! Do not type any of the following 10 characters except as directed:
% & $ # % _ { } ^ ~ \
\documentclass{article} % Your input file must contain these two lines
\begin{document} % plus the \end{document} command at the end.
\section{Simple Text} % This command makes a section title.
Words are separated by one or more spaces. Paragraphs are separated by
one or more blank lines. The output is not affected by adding extra
spaces or extra blank lines to the input file.
Double quotes are typed like this: ``quoted text''.
Single quotes are typed like this: `single-quoted text'.
Long dashes are typed as three dash characters---like this.
Emphasized text is typed like this: \emph{this is emphasized}.
Bold text is typed like this: \textbf{this is bold}.
\subsection{A Warning or Two} % This command makes a subsection title.
If you get too much space after a mid-sentence period---abbreviations
like etc.\ are the common culprits)---then type a backslash followed by
a space after the period, as in this sentence.
Remember, don't type the 10 special characters (such as dollar sign and
backslash) except as directed! The following seven are printed by
typing a backslash in front of them: \$ \& \# \% \_ \{ and \}.
The manual tells how to make other symbols.
\end{document} % The input file ends with this command.
VsCode配置:
官网下载好软件后;打开旁边的插件管理;搜索:LaTeX Workshop;安装第一个插件就可以。
打开设置,打开Setting;进入GUI设置页面
打开右上角的新建按钮;配置json文件
复制下面的代码:
{
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.showContextMenu": true,
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "XeLaTeX",
"tools": [
"xelatex"
]
},
{
"name": "PDFLaTeX",
"tools": [
"pdflatex"
]
},
{
"name": "BibTeX",
"tools": [
"bibtex"
]
},
{
"name": "LaTeXmk",
"tools": [
"latexmk"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
],
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
"latex-workshop.latex.autoClean.run": "onFailed",
"latex-workshop.latex.recipe.default": "lastUsed",
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click"
}
如果以后加入其他代码;需要在上面代码后面加上
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
这个,是因为:根据 json 文件编写规则,每个代码语句(除了代码块儿最后一句)都需要加上英文状态下的,,否则就会报错;而每个代码块儿的最后一句是不需要加上,的。从上文整个代码块儿可以看出此规则。
更为详细的如下:
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
......
其中…………为自己添加的代码。
至于代码解读请看博客:http://t.csdnimg.cn/bdYQu
新建一个tex文件输入下面的代码
% This is a small sample LaTeX input file (Version of 10 April 1994)
%
% Use this file as a model for making your own LaTeX input file.
% Everything to the right of a % is a remark to you and is ignored by LaTeX.
% The Local Guide tells how to run LaTeX.
% WARNING! Do not type any of the following 10 characters except as directed:
% & $ # % _ { } ^ ~ \
\documentclass{article} % Your input file must contain these two lines
\begin{document} % plus the \end{document} command at the end.
\section{Simple Text} % This command makes a section title.
Words are separated by one or more spaces. Paragraphs are separated by
one or more blank lines. The output is not affected by adding extra
spaces or extra blank lines to the input file.
Double quotes are typed like this: ``quoted text''.
Single quotes are typed like this: `single-quoted text'.
Long dashes are typed as three dash characters---like this.
Emphasized text is typed like this: \emph{this is emphasized}.
Bold text is typed like this: \textbf{this is bold}.
\subsection{A Warning or Two} % This command makes a subsection title.
If you get too much space after a mid-sentence period---abbreviations
like etc.\ are the common culprits)---then type a backslash followed by
a space after the period, as in this sentence.
Remember, don't type the 10 special characters (such as dollar sign and
backslash) except as directed! The following seven are printed by
typing a backslash in front of them: \$ \& \# \% \_ \{ and \}.
The manual tells how to make other symbols.
\end{document} % The input file ends with this command.
即可完成配置
本博客只作为个人学习记录,不具有教程意义;如果可以帮助大家,实乃有幸。如果有问题,在评论区留言即可。 本次博客的内容来源均在文章中标出,如果有其它问题,请在评论中给出。我将修改文章。