Skip to content

mattia-marini/moontex.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moontex

  1. Overview/features
  2. Usage
    1. Installation
    2. Config
    3. Workspace folder
  3. Non-fetures

Overview/features

Moontex is a Neovim plugin that provides basic features to work with LaTex files. This is a personal project and does NOT aim to be a complete and feature-rich plugin. You should use this only if you need a basic latex plugin that integrates with other lua plugins (TreeSitter, LSP, LuaSnips). Most users should definetely opt for Vimtex instead

Features

Moontex provides basic features such as

  1. Continuous compilation using latexmk
  2. Forward/inverse search with skim
  3. Treesitter based conceal and hilighting
  4. Support for multi-file projects
  5. Treesitter based context detection (for context specific snippets with LuaSnips or UltiSnips)

Usage

Installation

In order for compilation to work, latexmk should be installed. It very likely comes by default with your latex distribution. Check if it's installed by running:

latexmk -version

Install with any plugin manager, e.g. Packer:

use 'mattia-marini/MoonTex'

Note that the context detection and conceal features relie on Treesitter, hence you should install it togheter with a latex parser

Config

Not much to do here. Configure like any other plugin. Below are listed the default settings:

require("MoonTex").config({
  workspace_folder_name = "latex_workspace",
  mainfile_name = "main.tex",
  max_search_depth = 5,
  server_name = "tex_server"
})
  • workspace_folder_name: when trying to detect the main file, moontex searches in the partent folders of the current buffer. When a folder matches this name though, it stops.
  • mainfile_name: simplest way to efficiently detect the main file is to explicitly set its name. Other ways of detecting the mainfile will be implemented in the near future
  • max_search_depth: the max number of recursions to do in order to set the main file path.
  • server_name: the name of moontex's socket. The socket is created in the same directory as the main file

Inverse serach cofiguration

By far, document syncing is supported only on Skim. Forward search should work out of the box, whereas you should setup skim in order for backward search to work properly.

  1. Open a .tex file with moontex installed and run MTPrintSkimCommand
  2. Open skim -> Preferences -> Sync and paste the otput of the previous command in the corresponding sections. Your command should look something like this:
command: nvim
args: --headless --noplugin -u /Users/<your-name>/.local/share/nvim/site/pack/packer/start/MoonTex/lua/MoonTex/search.lua -c "InverseSearch \"%file\" %line"

Optimal workspace folder

In order for moontex to work properly, your workspace folder should look something like this:

latex_workspace
├── project1
│  ├── images
│  │  ├── image1.jpg
│  │  └── image2.pdf
│  ├── main.tex
│  └── sections
│     ├── sec1.tex
│     └── sec2.tex
└── project2
   ├── images
   │  ├── image1.jpg
   │  └── image2.pdf
   ├── main.tex
   └── sections
      ├── sec1.tex
      └── sec2.tex

Non-features

  • Navigation (Table of Contents/labels)
  • Forward/inverse search in pdf viewers other that skim
  • Support for fallback main-file detection methods

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published