Build a comfortable LaTeX environment using Ubuntu of Windows Subsystem for Linux (WSL) and VS Code.
environment Windows 10
If you know, please proceed to the next. LaTeX is one of the document processing systems.
It seems to be troublesome to write while marking the text like HTML, but in reality it does ** paragraph processing and font setting ** arbitrarily, ** many in scientific papers and reports It has been adopted **, and unlike Word, it is ** text-based **, so even if you write a lot, the operation is light. After all, it's good to be able to ** easily write beautiful formulas **.
I recently learned in a college class, ** I wish I could use it sooner so I didn't have to struggle with Word to enter formulas! **I tought. If you are in science, it will be ** essential skills **.
For more information, click here [https://texwiki.texjp.org/%E3%81%AF%E3%81%98%E3%82%81%E3%81%A6%E3%81% Please take a look at AE% E6% 96% B9% E3% 81% B8).
To use WSL, you need to enable WSL first. There are many articles in Quita, so please refer to them as appropriate. https://www.atmarkit.co.jp/ait/articles/1903/18/news031.html https://qiita.com/rubytomato@github/items/fdfc0a76e848442f374e
This time, I will assume that the contents of the above two articles have been completed. As a preparation, run the following in sequence on the Ubuntu command line:
Terminal
sudo apt install texlive-full
sudo cpan Log::Log4perl Log::Dispatch
Please install VS Code on ** Windows side **. ** Please note that it is not on the WSL side. ** **
And as an extension With Remort-WSL Install LaTeX Workshop.
Please install LaTeX Workshop on WSL. (It's complicated) I wonder if it's okay if the install button is "Install on WSL".
From here on, I like it, I want to feel the operation of Vim, so Vim and Monokai with an easy-to-read color scheme. /items?itemName=monokai.theme-monokai-pro-vscode) is installed. This time it is not required, so please find out how to do it yourself.
From here is the production.
Press Ctrl + Shift + P
to launch the command palette and enter open setting,
Basic settings: Open Settings (JSON)
please choose.
Since the json file is displayed,
settings.json
{
//If from the beginning{}If anything is written in, from here ↓
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.tools": [
{
"name": "platex",
"command": "wsl.exe",
"args": [
"platex",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-kanji=utf8",
"-guess-input-enc",
"%DOCFILE%.tex"
]
},
{
"name": "dvipdfmx",
"command": "wsl.exe",
"args": [
"dvipdfmx",
"-f",
"yu-win10.map",
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "platex",
"tools": [
"platex",
"platex",
"dvipdfmx"
]
}
],
"editor.formatOnSave": true,
//Copy up to here{}Add to
}
Then click the gear button at the bottom left, select "User Spenit" and select latex.
latex.json
{
"report": {
"prefix": "report",
"body": [
"\\documentclass[${1:a4paper,11pt}]{${2:jsarticle}}",
"\\usepackage{amsmath,amsfonts}",
"\\usepackage{bm}",
"\\usepackage[dvipdfmx]{graphicx}",
"${3}",
"\\begin{document}",
"",
"\\title{${4}}",
"\\author{${5}}",
"\\date{${6:\\today}}",
"\\maketitle",
"",
"$0",
"",
"\\end{document}"
],
"description": "set report template"
},
"Figure": {
"prefix": "figure",
"body": [
"\\begin{figure}[${1:hbp}]",
"\\centering",
"\\includegraphics[${2:width=\\linewidth}]{$3 \\label{fig:$4}}",
"\\caption{$5}",
"\\end{figure}"
],
"description": "set figure"
},
"Table": {
"prefix": "table",
"body": [
"\\begin{table}[${1:hbp}]",
"\\centering",
"\\caption{$2}",
"\\label{tabl:$3}}",
"\\begin{tabular}{$4}\\hline",
"$5",
"\\end{tabular}\\end{table}"
],
"description": "set table"
},
}
Please change the content appropriately so that it is easy for you to use.
Now that we're ready, let's write it down.
Start Ubuntu and start with code. It's up to you to start VS Code and click> <on the far left to start it in WSL: New Window.
I will omit how to write the LaTeX source. (Because this time is the main environment maintenance ...) It's quite deep, so if you don't understand anything, please study carefully. When you save it, it will be automatically typeset and a PDF file will be created.
You don't even need a viewer like evince to see what you typeset.
After all, you can start the viewer with Ctrl + Alt + V
in VS Code and check it on the spot.
(If you explain how to avoid using shortcut keys, you can see it by clicking the icon with a magnifying glass on the file icon in the upper right.)
Recommended Posts