Cloud LaTeX Extension for Visual Studio Code
*** Write locally and compile on cloud service.
This is an extension for Visual Studio Code to write tex locally with Cloud LaTeX.
日本語
Features
- Tex files you edit with VSCode can be compiled without installing texlive on your PC
- Cloud LaTeX official plugin
- Automatic synchronization between files in your PC and the Cloud LaTeX server
- Offline support (auto-sync on return to online)
Installation
Install from VSCode Marketplace, or run ext install cloudlatex
in VS Code Quick Open (ctrl/cmd + P
).
Preparation
- If you do not have an account, create your account from Cloud LaTeX.
- Click on the user name in the upper right corner at Projects and select the third button from the top labeled 'Extension'. A token generation dialog appears and enter your account information and record the generated client ID and token.
- Create your project from Projects.
- Record the project ID from the URL (e.g.,
/projects/123/edit
-> project ID is 123
)
Setting
Create an empty VSCode project.
Click the CL
icon on the Activity Bar and two buttins are appeared on the Side Bar.
Click Set account
and enter email
, client
and token
.
You can also set your account by cloud LaTeX: Set account
command on the Command Pallete (mac: Cmd+Shift+P
, win: Ctrl+Shift+P
).
Click Project setting
and set Cloudlatex.projectID
and check Clodulatex.Enabled
.
* Make sure to set in Workspace
tab (not User
tab).
You can also set settings.json
under the project.
{
"cloudlatex.projectId": 123,
"cloudlatex.enabled": true,
"cloudlatex.outDir": "./.workspace",
}
With LaTeX Workshop, you can use pdf review and command completion.
In this case, it is recommended to add the following settings (match latex-workshop.latex.outDir
with cloudlatex.outDir
).
{
"latex-workshop.latex.autoCompile.run": "never",
"latex-workshop.latex.outDir": "./.workspace",
"[latex]": {
"editor.formatOnSave": false,
}
}
When you change the configuration file, a dialog box asks you to restart VSCode.
After the restart, the project files are downloaded.
If the download is successful, a dialog box will appear indicating that the files have been successfully synchronized.
* When you try to re-synchronize project, please be careful not to delete any local files when the extension is enabled (this will cause deletion of the server files). Also, when you try to change the project in the same local directory, please be careful not that local files are overwritten unexpectedly (when you change projectId
, original local files will be overwritten. ).
* If the project files have not been downloaded, click the reload
button or close and reopen VSCode.
Setting key |
Description |
Default |
Type |
cloudlatex.enabled |
Set true to enable cloudlatex plugin in this project |
false |
boolean |
cloudlatex.projectId |
ProjectId. *Do not mistake this value, otherwise your files might be overwritten |
0 |
number |
cloudlatex.outDir |
Directory to output compile result |
"" |
string |
cloudlatex.autoCompile |
Set true to automatically compile when any files are saved |
true |
boolean |
cloudlatex.supressIcon |
Set true to hide cloudlatex icon on the activity bar in the unactivated project |
false |
boolean |
cloudlatex.ignoredFiles |
Files to be ignored from file synchronization |
See the next section |
Array<string> |
Specifying files not to be synchronized
Files matching the glob pattern specified in cloudlatex.ignoredFiles
are ignored from the file synchronization process. The glob patterns are matched against the absolute file pattern.
Patterns are compatible with anymatch.
Examples
- Do not synchoronize files named 'README.md' :
**/README.md
- Do not synchoronize files with 'bin' extension:
**/*.bin
- Do not synchoronize files under 'test' directory:
**/test/**
By default, file names starting with .
except for .latexmkrc
and extensions related to LaTeX compiled artifacts are set.
For performance reasons, .git
and node_modules
are also ignored from the file synchronization process, regardless of cloudlatex.ignoredFiles
.
Default value of cloudlatex.ignoredFiles
[
"**/*.aux",
"**/*.bbl",
"**/*.bcf",
"**/*.blg",
"**/*.idx",
"**/*.ind",
"**/*.lof",
"**/*.lot",
"**/*.out",
"**/*.toc",
"**/*.acn",
"**/*.acr",
"**/*.alg",
"**/*.glg",
"**/*.glo",
"**/*.gls",
"**/*.ist",
"**/*.fls",
"**/*.log",
"**/*.nav",
"**/*.snm",
"**/*.fdb_latexmk",
"**/*.synctex.gz",
"**/*.synctex\\(busy\\)",
"**/*.synctex.gz\\(busy\\)",
"**/*.run.xml",
"**/.vscode/**",
"**/.!(latexmkrc)"
]
Change compile target
Current compile target is shown as T
in the explorer.
Compile target can be changed from Set As LaTeX Compile Target
in the context menu.
Source Code
https://github.com/cloudlatex-team/cloudlatex-vscode-extension/tree/main
License
Apache License 2.0
Development
See development