{"id":25938139,"url":"https://github.com/vinograd0v/sublimetex","last_synced_at":"2025-03-04T03:33:26.074Z","repository":{"id":148851965,"uuid":"618830292","full_name":"vinograd0v/SublimeTeX","owner":"vinograd0v","description":"This is a LaTeX setup guide for Sublime Text with LaTeXTools. In this repository, you will find solutions to all the problems that usually arise when installing this package, as well as SNIPPETS and a customization guide.","archived":false,"fork":false,"pushed_at":"2024-11-09T18:36:32.000Z","size":2618,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-09T19:32:03.734Z","etag":null,"topics":["code","latex","snippets","sublime-text"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinograd0v.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-25T13:33:01.000Z","updated_at":"2024-11-09T18:36:36.000Z","dependencies_parsed_at":"2023-05-27T16:45:23.315Z","dependency_job_id":null,"html_url":"https://github.com/vinograd0v/SublimeTeX","commit_stats":null,"previous_names":["vinograd0v/sublimetex"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinograd0v%2FSublimeTeX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinograd0v%2FSublimeTeX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinograd0v%2FSublimeTeX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinograd0v%2FSublimeTeX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinograd0v","download_url":"https://codeload.github.com/vinograd0v/SublimeTeX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241778818,"owners_count":20019055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code","latex","snippets","sublime-text"],"created_at":"2025-03-04T03:33:25.533Z","updated_at":"2025-03-04T03:33:26.064Z","avatar_url":"https://github.com/vinograd0v.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SublimeTeX\n\n![GitHub all releases](https://img.shields.io/github/downloads/mmanosalva/SublimeTeX/total)\n![GitHub contributors](https://img.shields.io/github/contributors/mmanosalva/SublimeTeX)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/mmanosalva/SublimeTeX)\n![GitHub repo size](https://img.shields.io/github/repo-size/mmanosalva/SublimeTeX)\n![GitHub](https://img.shields.io/github/license/mmanosalva/SublimeTeX)\n\n\nThis is a LaTeX setup guide for Sublime Text with LaTeXTools. In this repository, you will find solutions to all the problems that usually arise when installing this package, as well as a customization guide and now we have SNIPPETS:\n\n # Result\n\n\n  ![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Workstation.png)\n## Snippet example:\n\n  ![](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/template.gif)\n\n\n# Instructions\n\n\u003cdetails\u003e \n  \u003csummary style=\"font-size: 2.5em; font-weight: bold;\"\u003eDownload\u003c/summary\u003e\n  \n  \n - [Sublime text here.]( https://www.sublimetext.com/)\n- [MiKTeX here.](https://miktex.org/download)\n- [Sumatra PDF here.](https://www.sumatrapdfreader.org/download-free-pdf-viewer)\n- [ImageMagick here.](https://imagemagick.org/script/download.php#windows)  \n\u003c/details\u003e\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-size: 2.5em; font-weight: bold;\"\u003eInstall\u003c/summary\u003e\n  \n- Install Sumatra first and then MiKTeX and then ImageMagick. Finally install Sublime Text. Make sure that ImageMagick is added to the Windows Path during installation. The option should be checked during installation. Additionally, SumatraPDF must also be added to the Path. However, you must do this manually by finding the installation folder of SumatraPDF and adding it to the Path.\n  \n  ![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Path.png)\n\n If you don't see ImageMagick in the Windows Path, add it manually by copying the path and pasting it, just like with Sumatra.\n\n  Before we proceed, it may be necessary to install some LaTeX packages from MiKTeX. To do this, we need to open the MiKTeX console.\n\n  * Go to Packages and install \"preview\" and \"mathtools\" as below:\n  \n   ![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Miktex.png)\n\n   * You should type the names of the packages in the selected part.\n   * Now install:\n\n ![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Preview.png)\n\n Once both packages are installed, proceed with the installation, remember that in the future compiling one of your projects may require a package that you may have to install from this console.\n\nAlso, it may be recommended to enable automatic package installation: Go to Setting\n\n ![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Conf.png)\n\nNow i'm using that Repository, its working good for me so you can try to use it going to change and selecting it, but if one day you have problems with the repository you can change it, i had problems using the default repository (SSL issue code), thats why i change mine.  \n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-size: 2.5em; font-weight: bold;\"\u003eSublime Configs\u003c/summary\u003e\n  \n- Open the Command Palette : Press `Ctrl+Shift+P`\n\n- Type ‘install’ in the Command Palette input box, which should autocomplete to ‘Install Package Control.’ Press Enter to select it.\n\n- Sublime Text 3 will start installing Package Control. This may take a short while. Once installed, a pop-up will display the message: Package Control was successfully installed.\n\n- Go to `Preferences  → Package Settings  →  Package Control  → Settings` and paste the following\n\n  ```json\n  {\n\t\"bootstrapped\": true,\n\t\"in_process_packages\":\n\t[\n\t],\n\t\"installed_packages\":\n\t[\n\t\t\"A File Icon\",\n\t\t\"Agila Theme\",\n\t\t\"AutoPEP8\",\n\t\t\"ayu\",\n\t\t\"DistractionFreeWindow\",\n\t\t\"Dracula Color Scheme\",\n\t\t\"Fold Comments\",\n\t\t\"gruvbox\",\n\t\t\"ImageMagick\",\n\t\t\"Language - Spanish\",\n\t\t\"LaTeX Word Count\",\n\t\t\"LaTeX-cwl\",\n\t\t\"LaTeXTab\",\n\t\t\"LaTeXTools\",\n\t\t\"LaTeXYZ\",\n\t\t\"Non Text Files\",\n\t\t\"Package Control\",\n\t\t\"Python 3\",\n\t\t\"SideBarEnhancements\",\n\t\t\"Theme - Gravity\",\n\t],\n  }\n  ```\n\n- Save the file. This will automatically install all the packages necessary for the setup.  Wait for 5-10 mins for the installation to complete (be sure the installation complete).\n\n- Next open `Preferences  → Settings`  and paste the following there.\n\n  ```json\n  {\n    \"auto_complete_triggers\":\n    [\n        {\n            \"characters\": \".\",\n            \"selector\": \"source.python - string - comment - constant.numeric\",\n        },\n        {\n            \"characters\": \"\\\\\",\n            \"selector\": \"text.tex.latex\",\n        }\n    ],\n    \"color_scheme\": \"Packages/ayu/ayu-dark.sublime-color-scheme\",\n    \"default_line_ending\": \"unix\",\n    \"font_size\": 11,\n    \"ignored_packages\":\n    [\n        \"Vintage\",\n    ],\n    \"open_externally_patterns\":\n    [\n        \"*.jpg\",\n        \"*.jpeg\",\n        \"*.png\",\n        \"*.gif\",\n        \"*.zip\",\n        \"*.pdf\"\n    ],\n    \"rulers\":\n    [\n        100\n    ],\n    \"tab_size\": 4,\n    \"theme\": \"ayu-dark.sublime-theme\",\n    \"translate_tabs_to_spaces\": true\n  }\n  ```\n\n- Go to `Preferences→Key Bindings` and paste the following \n\n  ```json\n  [\n      { \"keys\": [\"f1\"], \"command\": \"toggle_side_bar\" },\n      { \"keys\": [\"f2\"], \"command\": \"distraction_free_window\" },\n      { \"keys\": [\"f3\"], \"command\": \"fold\" },\n      { \"keys\": [\"f4\"], \"command\": \"unfold\" },\n  ]\n  ```\n\n- Now finally go to `Preferences→Package settings→Latex tools→Check system` to check whether everything is fine or not.\n  \n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-size: 2.5em; font-weight: bold;\"\u003eDark Mode\u003c/summary\u003e\n  \nIn Sumatra PDF go to `Settings→Advanced Options`. The settings will open in a new text document. Change the `MainWindowBackground = #11141b` and replace the code in `FixedPageUI` with the following\n\n```\nFixedPageUI [\n\t# Light Mode\n\t# TextColor = #000000\n\t# BackgroundColor = #ffffff\n\n\t# Dark Mode\n\tTextColor = #ffffff\n\tBackgroundColor = #11141b\n\tSelectionColor = #f5fc0c\n\tWindowMargin = 2 4 2 4\n\tPageSpacing = 4 4\n]\n```\n\nThis will activate dark mode in Sumatra. To revert back to light mode just un-comment the lines under `Light Mode` and comment the lines under `Dark Mode`.\n\n```\nFixedPageUI [\n\t# Light Mode\n\tTextColor = #000000\n\tBackgroundColor = #ffffff\n\n\t# Dark Mode\n\t# TextColor = #ffffff\n\t# BackgroundColor = #11141b\n\tSelectionColor = #f5fc0c\n\tWindowMargin = 2 4 2 4\n\tPageSpacing = 4 4\n]\n```\n\n Noticed that by changing the Backgroundcolor and MainWindowBackground lines in the Sumatra configuration, we can make our PDF appear in any color we want. If we want to customize Sumatra to match the colors of our Sublime theme, we just need to know the Hex code of the color associated with the theme (i.e. the background color of Sublime). To do this, we can take a screenshot of an area of the screen where the color we want to use is visible, save the image, and use a tool that detects the color in the image ([You can use this](https://imagecolorpicker.com/)).\n\nThe color i'm using is for Ayu-Dark.\n  \n\u003c/details\u003e\n\n\n# Build\n\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-size: 2.5em; font-weight: bold;\"\u003eBuild\u003c/summary\u003e\n  \nTo build your LaTeX project, press `Ctrl+Shift+B` and select PDFLaTeX or LuaLaTeX or XeLaTeX depending on which compiler your project requires.\n\n ![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Compilers.png)\n\n If you don't use those you can maybe have problems with biblatex.\n\nAfter the first compilation, you should be able to compile simply by using `Ctrl+B`\n\nTo compile the project, you need to do it from the main file of the project (for example, main.tex). However, if you want to work on a large project with different .tex files and you don't want to switch to main.tex every time you compile, you can add the following line of code to the file from which you want to compile\n\n```\n%!TEX root = main.tex\n```\n\nFor example: This project\n\n![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Project.png)\n\nIf you're working on the 2.5.tex file and want to compile the entire project from there, you need to add %!TEX root = main.tex to the first line, as shown below:\n\n![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Example.png)\n\nThe first line of code doesn't affect our project as it is a comment. What it does is tell LatexTools to compile the main.tex file instead of the 2.5.tex file. If your main file isn't named main, you can edit the line of code with the name of your file.  \n\u003c/details\u003e\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-size: 2.5em; font-weight: bold;\"\u003eSome issues\u003c/summary\u003e\n  \nWhen you start using the interface, you'll notice that when you compile a document, a new Sublime Text window opens. This can be quite annoying, and there may be errors such as auto-completion failures and deleted characters. Here, we will provide solutions to these issues.\n\n* Go to `Preferences -\u003e Package Settings -\u003e LaTeXTools-\u003e Settings-User` and in the line:\n\n```json\n\"keep_focus\": true\n```\nChange true for false and that will fix the first issue.\n\nNow for auto-completion failures:\n\n* Press `Ctrl+Shift+P` and write `Browse Packages`.\n\n* Open LaTeXTools/latex_cwl_completion.py\n* Delete or comment out lines 308–312\n\n```python\nif is_prefixed:\n    completions = [\n        (c[0], c[1][1:]) if c[1].startswith(\"\\\\\") else c\n        for c in completions\n    ]\n```\n\nDeleting or commenting out these lines of code will solve all the problems.\n\n## Biblatex:\n\nThere is an issue that occurs when using biblatex and not making any citation in the entire document, basically it does not print the bibliography and the \"\\nocite{*}\" command does not work. Once we make at least one citation in the entire document, the \"\\nocite{ * }\" command works and the problem is fixed. However, if we do not want to make any citation in the entire document, a quick solution for this is to make a phantom citation, that is, one that does not affect the final document but solves the problem. To do this, we implement the following in our .tex file:\n\n```tex\n\\newcommand{\\phantomcite}[1]{\n    \\phantom{\\cite{#1}}\n    \\nocite{*}\n}\n```\n\nSo at the end of our document, before using \"\\printbibliography\", we put the command \"\\phantomcite{\"here put any citation from your references\"}\" and that will solve the problem. This command executes a phantom citation and is followed by the \"\\nocite{*}\" command, so it will no longer be necessary to use it.\n\n* Example:\n  \n```tex\n\\documentclass{article}\n\n\\usepackage{biblatex}\n\n\\newcommand{\\phantomcite}[1]{\n    \\phantom{\\cite{#1}}\n    \\nocite{*}\n}\n\n\n\\addbibresource{sample.bib}\n\n\\begin{document}\n\nTest. \n\n\\phantomcite{dirac}\n\n\\printbibliography\n\\end{document}\n```\n\nAnother way to fix the problem is before using \"\\nocite{*}\" put \"nocite{\"some of your reference\"}\":\n\n```tex\n\\documentclass{article}\n\n\\usepackage{biblatex}\n\n\\addbibresource{sample.bib}\n\n\\begin{document}\n\nTest. \n\n\\nocite{dirac}\n\\nocite{*}\n\n\\printbibliography\n\\end{document}\n```\n\nAs mentioned earlier, the problem is related to \"\\nocite{*}\". In this solution, it is not necessary to add the \"\\phantomcite\" from the previous solution.\n\n* IMPORTANT: If you compile your project and it generates the bibliography and you make changes to it, you may need to delete the generated files and compile again. Otherwise, the bibliography may not change. The corresponding file is the one with the extension .bbl in our files folder.\n\n\n  \n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-size: 2.5em; font-weight: bold;\"\u003eSpanish config\u003c/summary\u003e\n  \nTo add the Spanish language to Sublime Text and the spell checker, you need to download the \"Language - Spanish\" folder from the repository and put it in the folder that opens when you run \"Browse Packages\". Once the language folder is located there, go to Sublime Text `View -\u003e Dictionary -\u003e Language - Spanish -\u003e Spanish`. When you select this, Sublime Text will implement Spanish language correction.\n\nThe procedure is similar for autocorrection in English, however, you will need to search for the dictionaries as I do not have them available.\n\t\n\u003c/details\u003e\n\n\n\n# ImageMagick Preview:\n\nWith this project you will be able to see your equations without compile:\n\n![Alt text](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/Previeww.png)\n\nIf you see the resolution of the preview is too low go to: `Preferences -\u003e Package Settings -\u003e LaTeXTools-\u003e Settings-User` and then search for the line \"preview_math_density\", you can change values and prove some resolutions and pixeles density if you want, this is my config for my screen (2160x1440p):\n\n```json\n\t// The density of the preview image. The higher the density the bigger the phantom.\n\t\"preview_math_density\": 300,\n\t// If the image is not sharp enough increase this scale to get a better resolution.\n\t// However also change the density by the same factor to keep the size.\n\t\"preview_math_scale_quotient\": 3,\n\t// If this is true, the image will be rendered at a higher resolution and\n\t// then scaled down. This generally results in a clearer image.\n\t\"preview_math_hires\": true,\n```\n\n\n# Snippets\n\nThe following work is inspired by that of Gilles Castel (casteldev), many of these snippets are adaptations and improvements of his wonderful work in LaTeX in Vim.\n\nThe purpose of this work is to save as much time as possible when working with LaTeX, but also to help those who are not very proficient in it, especially with libraries such as TikZ, PSTricks, etc. Over time, and especially with your help, I hope that these snippets will improve. All kinds of suggestions or collaborations are welcome.\n\nTo install these snippets, you need to download the \"SublimeTeX\" folder from the repository and paste it into the LatexTools folder that you can access from \"Browse Packages\", as we have been doing. After this, you are ready to use them, so I will leave some gifs of some of them so that you can appreciate their usefulness and how to use them, followed by a list of commands to use them. To use the snippets you have to write the snippet name and push tab.\n\n* plot: \n\n![](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/plot.gif)\n\n* template:\n\n![](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/template.gif)\n\n* matriz:(this snippet works for 2x2,3x3,...9x9, if you want a matriz just use pmat)\n\n![](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/matriz.gif)\n\n* some snippets:\n\n![](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/some.gif)\n\n* preview:\n\n![](https://github.com/mmanosalva/SublimeTeX/blob/main/Images/preview.gif)\n\nREMEMBER: TO USE THE SNIPPETS YOU JUST HAVE TO KNOW THEIR NAMES, WRITE THEM AND PUSH TAB.\n\nThere are a lot of snippets and i will upload more, here you will find a list with all their names in the file \"snippets.md\"\n\nWhat I recommend is to use all of them to understand well what they do, and then decide which ones are useful for you. If you can, please suggest some of them.\n\n# Contact\n\nIf you have any issues with the solutions presented here, feel free to ask me:\n\n* mmanosalva@unal.edu.co\n* matemano6@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinograd0v%2Fsublimetex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinograd0v%2Fsublimetex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinograd0v%2Fsublimetex/lists"}