LaTex下载与安装,同时配置VsCode;

写在前面:

提示:这篇文章只是个人学习记录,把自己找到的方法记录下来;并不是一篇教学文章。同时我会把我查到的资料来源标注出来,基本上都是网上的资料,因为我曾经安装过,但是我忘记了;并且从头查找资料又麻烦,所以我干脆自己整理一下
文章参考: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.

即可完成配置
在这里插入图片描述
本博客只作为个人学习记录,不具有教程意义;如果可以帮助大家,实乃有幸。如果有问题,在评论区留言即可。 本次博客的内容来源均在文章中标出,如果有其它问题,请在评论中给出。我将修改文章。

<think>好的,用户想了解如何在VSCode下载安装配置Maven。我需要先整理相关步骤,确保覆盖所有关键点。首先,下载安装Maven,这部分需要包括不同操作系统的步骤,比如Windows、Ubuntu。然后配置环境变量,这样系统才能识别Maven命令。接下来是VSCode配置,比如安装必要的扩展,修改settings.json文件,添加Maven路径和用户设置。还要指导如何创建Maven项目,可能涉及命令行操作和在VSCode中使用扩展。用户提供的引用中有几个关键点需要整合,比如配置文件的路径、阿里源的设置,以及创建项目的步骤。需要检查引用中的信息是否准确,比如引用2提到的settings.json配置,引用3的pom.xml配置Java版本,引用4的阿里源配置同时,确保步骤清晰,用户能一步步跟随操作,避免遗漏任何细节。另外,生成相关问题时要围绕Maven的安装配置、优化和使用场景,帮助用户深入理解。最后,确认所有LaTeX格式正确,行内公式用$...$,独立公式用$$...$$,但可能在这篇回答中用到的数学内容不多,但如果有的话要正确应用。使用中文回答,结构要分步骤,用标题和子标题组织内容,代码块用正确的语法高亮。注意引用标识要自然地放在相关内容的末尾,如引用配置步骤时加上[^2]、[^4]等。完成后检查流程是否连贯,是否覆盖用户的所有需求。</think>### Maven下载安装VSCode配置指南 #### 一、Maven下载安装 1. **下载Maven** 访问[Apache Maven官网](https://maven.apache.org/download.cgi),选择对应操作系统的二进制包(例如`apache-maven-3.8.6-bin.zip`)。 2. **安装步骤** - **Windows** 解压压缩包至目标目录(如`D:\tools\apache-maven-3.8.6`)。 - **Ubuntu** 通过终端执行以下命令: ```bash sudo apt update && sudo apt install maven # 通过官方源安装 ``` 3. **配置环境变量** - **Windows** 添加系统变量`MAVEN_HOME`指向Maven根目录,并在`Path`中添加`%MAVEN_HOME%\bin`。 - **Ubuntu** 编辑`~/.bashrc`文件,添加: ```bash export MAVEN_HOME=/usr/share/maven export PATH=$MAVEN_HOME/bin:$PATH ``` 4. **验证安装** 终端输入`mvn -v`,若显示版本信息(如`Apache Maven 3.8.6`),则安装成功[^1]。 --- #### 二、VSCode配置Maven 1. **安装扩展** 在VSCode中搜索并安装以下扩展: - *Extension Pack for Java*(包含Maven支持) - *Maven for Java* 2. **配置Maven路径** 修改VSCode的`settings.json`文件(`Ctrl + ,`打开设置,右上角图标进入JSON编辑),添加: ```json { "maven.executable.path": "D:\\tools\\apache-maven-3.8.6\\bin\\mvn.cmd", // Windows路径示例[^2] "java.configuration.maven.userSettings": "D:/tools/apache-maven-3.8.6/conf/settings.xml" // 指定配置文件 } ``` 3. **配置阿里云镜像源(加速依赖下载)** 修改Maven的`settings.xml`文件,在`<mirrors>`标签内添加: ```xml <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云镜像</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> ``` 此步骤适用于Ubuntu及Windows系统[^4]。 --- #### 三、创建Maven项目 1. **通过命令行创建** 执行以下命令生成基础项目: ```bash mvn archetype:generate -DgroupId=com.example -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false ``` 2. **在VSCode中操作** - 按`Ctrl + Shift + P`打开命令面板,输入`Maven: Create Maven Project`。 - 选择`maven-archetype-quickstart`模板,按提示输入`GroupId`和`ArtifactId`[^3]。 3. **配置Java版本** 在项目的`pom.xml`中添加: ```xml <properties> <maven.compiler.source>11</maven.compiler.source> <!-- JDK源码版本[^3] --> <maven.compiler.target>11</maven.compiler.target> </properties> ``` --- #### 四、运行测试 1. **编译项目** 终端中执行: ```bash mvn compile ``` 2. **运行JUnit测试** VSCode会自动检测测试类,点击代码行旁的`Run Test`按钮,或执行: ```bash mvn test ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值