Coder Social home page Coder Social logo

latexer's Introduction

latexer

Latexer is a package to help you with your every day LaTeX needs. It does reference, citation and environment autocompletion on the fly or at the touch of a keystroke.

Build Status

Features

Reference autocompletion

Autocompletion of references Triggers:

  • Typing in \ref{, \eqref{ or any control sequences that ends in ref{
  • Deleting anything so that the left of the cursor reads \ref{, \eqref{, and the like. E.g. deleting the word 'something' from \pageref{something}

Bibliography and citation autocompletion

Latexer finds your bibfiles

Latexer will automatically scan your document to find your bibfiles. For example, if your document contains the command \bibliography{mybib1.bib, mybib2}, latexer will find and then scan through the files named mybib1.bib and mymbib2.bib to get the citations. Additionally, Latexer will look for BibTeX files given in the current file of the form \addbibresource and \addglobalbib.

You can also specify bibfiles using a YAML metadata block at the top of your document. If you choose to write in Markdown on RMarkdown, Latexer will automatically look for the bibliography key in your YAML and scan any files specified for citations.

Latexer can autocomplete your LaTeX citations

Autocompletion of bibliography

LaTeX Triggers
  • Typing in \cite{, \textcite{, \citet{, \citet*{, \citep{ or \citep*{. You can also write something in square brackets before, e.g. \cite[Theorem 1]{.
  • Deleting anything so that the left of the cursor reads \cite{, \textcite{, \citet{, \citet*{, \citep{ or \citep*{, e.g. deleting the word 'something' from \cite{something}
  • Typing [@ or [-@ to begin a pandoc-style citation
  • Typing @ or -@ after semicolon-delimited references in a pandoc-style citation, for example: [@ref1; @ and [@ref3; also see @ref4; @

You can edit from the preferences window which parameters you would like to search the bibliographies by. The default is title,author, but you can specify whichever search fields you like. For example, key,year will search for an entry entries by its key, i.e. @key{...} and the year it was published.

Environment autocompletion

Autocompletion of environments Triggers:

  • Having an unmatched \begin{env_name} or \[ in the line above.

Multifile support

For multifile support, from the child files use %!TEX root = mainfile.tex to point to the root file.

Options

You can switch off any of the autocompletions in the settings menu. If you prefer a manual approach you can bind keys as follows. First go to Atom>Open Your Keymap and then paste the following, choosing whatever key binding you find convenient:

'atom-text-editor':
  'cmd-alt-o': 'latexer:omnicomplete'
  'cmd-alt-r': 'latexer:insert-reference'
  'cmd-alt-c': 'latexer:insert-citation'

LaTeX on Atom

This package only provides autocompletion. If you want the full LaTeX experience then I would recommend getting the language-latex package for syntax highlighting, and the latex or the latex-plus package for compiling LaTeX documents. You can also view pdf documents from within Atom by installing the pdf-view package.

latexer's People

Contributors

314eter avatar andrewning avatar balu- avatar basnijholt avatar briandk avatar cuiao avatar diracdeltafunk avatar focus avatar harmsk avatar jpgoldberg avatar mp4096 avatar pafalium avatar quantumentangledandy avatar tthmok avatar vitasiku avatar yoshum avatar yudai-nkt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

latexer's Issues

Support for natbib citing functions

This is an awesome package, and I really enjoy the \cite autocompletion. Is it possible to extend this a bit, so it also triggers when I use natbib citing functions.

These are \citet, \citep, \citet*, \citep*.

To make it a bit more complicated, this also takes optional commands in square brackets.

Uncaught TypeError: Cannot read property 'getBufferPosition' of undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.187.0
System: linux 3.13.0-46-generic
Thrown From: latexer package, v0.2.2

Stack Trace

Uncaught TypeError: Cannot read property 'getBufferPosition' of undefined

At /usr/share/atom/resources/app/src/text-editor.js:1378

TypeError: Cannot read property 'getBufferPosition' of undefined
    at TextEditor.module.exports.TextEditor.getCursorBufferPosition (/usr/share/atom/resources/app/src/text-editor.js:1378:34)
    at /home/alexey/.atom/packages/latexer/lib/latexer.coffee:33:32
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
    at /usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1151:25

Commands

     -1:50.7 core:save (atom-text-editor.editor.is-focused)
     -1:32.7 core:backspace (atom-text-editor.editor)
     -1:31.6 core:save (atom-text-editor.editor)
  3x -1:05.7 pdf-view:zoom-out (div.pdf-view)
     -1:02.4 pdf-view:zoom-in (div.pdf-view)
     -0:57.0 core:undo (atom-text-editor.editor.is-focused)
  2x -0:54.8 core:backspace (atom-text-editor.editor.is-focused)
     -0:51.2 core:save (atom-text-editor.editor.is-focused)
     -0:39.6 pdf-view:zoom-out (div.pdf-view)
     -0:38.4 pdf-view:zoom-in (div.pdf-view)
  4x -0:33.5 editor:move-to-beginning-of-word (atom-text-editor.editor.is-focused)
  2x -0:32.4 core:move-left (atom-text-editor.editor.is-focused)
  8x -0:31.5 core:backspace (atom-text-editor.editor.is-focused)
     -0:19.0 core:save (atom-text-editor.editor.is-focused)
     -0:02.5 editor:newline (atom-text-editor.editor.is-focused)
     -0:00.9 core:backspace (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-light-ui",
      "one-light-syntax"
    ]
  }
}

Installed Packages

# User
autocomplete-bibtex, v0.5.4
autocomplete-clang, v0.6.2
autocomplete-plus, v2.6.0
language-latex, v0.4.1
latex, v0.20.0
latexer, v0.2.2
pdf-view, v0.17.0

# Dev
No dev packages

Support list autocontinuation

Maybe this is more work than it's worth, but I really like markdown-writer's list autocontinuation.

E.g. pressing Enter when the cursor is at the end of the \item First line continues the list on the following line:

\begin{itemize}
  \item First|
\end{itemize}

(Enter)

\begin{itemize}
  \item First
  \item |
\end{itemize}

Object.TextEditor is deprecated.

The TextEditor constructor is no longer public.

To construct a text editor, use atom.workspace.buildTextEditor().
To check if an object is a text editor, use atom.workspace.isTextEditor(object).

Object.TextEditor (/Applications/Atom.app/Contents/Resources/app.asar/exports/atom.js:38:14)
Object.<anonymous> (/Users/martin/github/latexer/lib/latexer.coffee:10:44)
Object.<anonymous> (/Users/martin/github/latexer/lib/latexer.coffee:37:4)
Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
Object..coffee (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
Module.load (module.js:355:32)

TEX Root command to static

Some editors automatically set the TEX Root command with a space, e.g.,
% !TEX root = ../paper.tex instead of %!TEX root = ../paper.tex. It would be great, if latexer were capable of interpreting this slightly different syntax.

I guess this is cause by this line:

texRootRex = /%!TEX root = (.+)/g

Manually edit the list of triggers

Hi,

this is a great package!
Would it be possible to manually edit the list of triggers in the package preferences?
I'd like to also trigger the reference autocompletion on a custom command I wrote, for instance

\newcommand{\sect}[1]{section~\ref{#1}}
\sect{sec:mysection}

Thanks and cheers

Feature request: Adding support for Acronym

First of all, many thanks for creating such a useful Atom package
The old days of using TexStudio are long gone ๐Ÿ˜

It would be great if Latexer could support acronyms as well, at least the Acronym package

After selecting ref/cite from a list, not able to get back cursor.

Whenever I trigger \ref{ or \cite{ command, it pops-up the list of references or citations. Works well. But I have a small bug that really annoys me. Doesn't matter you choose ref/cite, after selecting the appropriate item, cursor just disappears. I can not move my cursor even after pressing any button. I can operate commands like save/quit, but I just can not move cursor so that I can use comma to add more citations. I have to use trackpad/mouse to get back the cursor.

Is it a known bug? I have tried it on Mac and 2 Windows PC's same issues.

Feature Request: display the content of bibtex citation items

Desired feature:

When you move the cursor or the mouse to an cited item, like \cite{abc98}, a small window pop up on the side displaying the title, the authors etc. of that item.

Reasoning

This would help a lot in writing. Citation keys don't mean anything to us humans (and it shouldn't be). But when we are revising our paper we'd need to recheck the citations and move them around. But going back and forth to figure out which paper is which is a huge pain.

Adding multiple citations

I really like your plugin, and perhaps this is a beginner's problem and is already solved, but I often add multiple citations with one \cite{} command. The problem is that as soon as I add the first citation, the auto-complete window is closed.

I would suggest re-opening the window if a comma is added within a \cite environment. Alternatively add a command for Ctrl-Shift-p to reopen the citation window.

Thanks!

Dropdown menu not showing up in Atom 1.17

Thanks for this great package. I use it all the time (writing my thesis...).

Unfortunately the dropdown menu does not show up anymore when I write \cite{}. At least not fully. The text field shows up, and I can write in it, hit Return and a citation key will appear in \cite{}, but I'm unable to see which citation key will be selected before hitting return.

Can you reproduce this in Atom 1.17?

Ignores \addbibresource{bibresource.bib} in main file

Using the newer package "biblatex" for citing, the use of \bibliiography{mybib.bib} is strongly discouraged. Instead the newer \addbibresource{mybib.bib} should be used. This command can be called several times to add multiple resources, which can then be used by \cite{} etc.

I'm also not sure if latexer looks only in the same file for the .bib file, or also respects subdirs/subfiles wich are included into one huge project using \include{}.

Maybe it would be the best, to make the path of the .bib files configurable via config.cson.
Please integrate that into latexer, as the completion of cites is very usefull! Thanks for you work on this!:

We should use a persistent datastore for speed improvements

Currently, I think any time the user triggers a citation pattern, the package re-reads and parses the entire set of bibfiles. If your bibliography happens to be large (~10,000 records), it takes several seconds just to show the autocomplete bar. During that time, the system is entirely unresponsive. And because data doesn't persist, every time a user with a large bibfile triggers a reference autocompletion it grinds the program to a halt.

I think a way around this might be to do an initial read of the bibfiles into a lightweight database like SQLite. Then, for any subsequent lookup we check whether the database is out of date. If it's not, we do the lookup right on the database, which should be very fast. And on the off chance the user has modified a bibfile during their session, then and only then would we need to rebuild the database.

@Focus Does this idea sound good to you? If so, I'm happy to start working on a pull request. Might take me a bit as I'm new to SQLite, but I think the performance benefits will make it orders of magnitude faster for citation lookups.

Failed to load the latexer package

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.36.0 x64
Electron: 2.0.18
OS: Unknown Windows version
Thrown From: latexer package 0.3.0

Stack Trace

Failed to load the latexer package

At Cannot find module 'atom-space-pen-views'

Error: Cannot find module 'atom-space-pen-views'
    at Module._resolveFilename (module.js:543:15)
    at Module._resolveFilename (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:154765)
    at Module.require (/app.asar/static/index.js:40:43)
    at require (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:146072)
    at /packages/latexer/lib/label-view.coffee:1:22)
    at /packages/latexer/lib/label-view.coffee:1:1)
    at /packages/latexer/lib/label-view.coffee:1:1)
    at Module.get_Module._compile (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:146782)
    at Object.value [as .coffee] (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:150329)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:146072)
    at /packages/latexer/lib/latexer.coffee:1:13)
    at /packages/latexer/lib/latexer.coffee:1:1)
    at /packages/latexer/lib/latexer.coffee:1:1)
    at Module.get_Module._compile (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:146782)
    at Object.value [as .coffee] (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:150329)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (internal/module.js:11:18)
    at customRequire (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:1:674943)
    at Package.requireMainModule (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:3186680)
    at measure (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:3173391)
    at Package.measure (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:3172223)
    at Package.load (C:/Users/MyPC/AppData/Local/atom/app-1.36.0/resources/app/static/<embedded>:11:3172964)

Commands

Non-Core Packages

latex 0.50.2 
latextools 0.8.5 
pdf-view 0.71.0 
language-latex 1.2.0 
latexer 0.3.0 

Useless \end{}s are added in some cases

\documentclass{article}
\usepackage{tabularx}

\begin{document}

\begin{table}[htbp]
\centering
\begin{tabularx}{\textwidth}{XXX}
\hline
Alpha & Beta & Gamma \ \hline
0 & 2 & 4 \ \hline
1 & 3 & 5 \ \hline
\end{tabularx}
\end{table}
\end{document}

When editing the {XXX} part I get plenty of completely undesired \end{tabularx}, which makes editing those values simply impossible.

False trigger for equation autocompletion

Following code triggers equation autocompletion:

hello\\[4 pt]

world

Although \[ in the code above is not an equation opening tag, it is still matched to the regex in line 52 of latexer-hook.coffee

latexer didn't provide list of citations

latexer fails to find .bib files:

C:\Users\user\.atom\packages\latexer\lib\cite-view.coffee:154
Error: ENOENT: no such file or directory, open 'C:\Users\user\AppData\Local\atom\app-1.0.9\paper.bib' {errno: -4058, code: "ENOENT", syscall: "open", path: "C:\Users\user\AppData\Local\atom\app-1.0.9\paper.bib", stack: (...)โ€ฆ}

C:\Users\user\.atom\packages\latexer\lib\cite-view.coffee:154
Error: ENOENT: no such file or directory, open 'C:\Users\user\AppData\Local\atom\app-1.0.9\library.bib' {errno: -4058, code: "ENOENT", syscall: "open", path: "C:\Users\user\AppData\Local\atom\app-1.0.9\library.bib", stack: (...)โ€ฆ}

Modal Panel broken with theme

The modal showing the citations when using \cite is broken when using some themes, e.g. atom-material-ui (it looks like this atom-material/atom-material-ui#414).

I found that this is caused by the two classes overlay and from-top used for the select-list div. Since these clsases are already used in the parent atom-panel, it seems that they are not needed in this div. Without these classes the modal works fine with every theme.

I'm not sure if/when they changed this behaviour and if this is the right way to fix it. While it is broken in some themes, it works with others. So it could be an issue with the theme but this at least fixes it...

It is not possible to search entries by their identifier when the \cite keyword is used.

In the search window that opens when the \cite keyword is detected it is not possible to search for biblatex entries by their identifier. This can be helpful when the same sources are cited often just to check if the identifier is "spelled" correctly.

I tested adding "id, ID, identifier" as options in the package's settings, which does not resolve this issue.

I have no idea if other users would find this feature useful. If you are under the impression the feature is not necessary, please close the issue.

Cloned latexer package cannot find module atom-space-pen-views

I just forked this repository and cloned the forked one to submit a pull request. I encountered an error from latexer package.

$ apm uninstall latexer
$ cd ~/work/atom
$ git clone [email protected]:yudai-nkt/latexer.git
$ cd latexer
$ apm link .
$ atom . --dev

yield the error saying "Failed to activate the latexer package" with the following log.

At Cannot find module 'atom-space-pen-views'

Error: Cannot find module 'atom-space-pen-views'
    at Module._resolveFilename (module.js:338:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/yudai-nkt/.atom/packages/latexer/lib/label-view.coffee:1:22)
    at Object.<anonymous> (/Users/yudai-nkt/.atom/packages/latexer/lib/label-view.coffee:1:1)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/yudai-nkt/work/atom/latexer/lib/latexer.coffee:1:13)
    at Object.<anonymous> (/Users/yudai-nkt/work/atom/latexer/lib/latexer.coffee:1:1)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:715:27)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:173:16)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:156:32
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:149:26
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:146:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:538:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:519:29
    at Config.module.exports.Config.transactAsync (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:337:18)

I couldn't understand this error because both apm-installed latexer and the latest one on GitHub have the same dependencies written in package.json:

"dependencies": {
  "atom-space-pen-views": "^2.0.0",
  "fs-plus": "^2.0.0"
}

Could you tell me how to handle this error?

My environment is:

  • OS: OS X El Capitan 10.11.4
  • Atom: Version 1.8.0
  • latexer: 37b02cb

Environment auto-completion is overzealous and creates \end{} when one already exists

Useful Info

  • latexer 0.3.0
  • Beamer presentation

Expected Behaviour

Beginning with:

\begin{columns}
    \begin{column}{0.5\textwidth}

    \end{column}
\end{columns}

Paste the following :

\begin{block}{A vs. B \citep{cite-example}}
    \begin{itemize}
              \item View volumes instead of slices
              \item Enhanced comprehension of the anatomy
    \end{itemize}
\end{block}

Expect the following :

\begin{columns}
    \begin{column}{0.5\textwidth}
    \begin{block}{A vs. B \citep{cite-example}}
    \begin{itemize}
              \item View volumes instead of slices
              \item Enhanced comprehension of the anatomy
    \end{itemize}
    \end{block}
    \end{column}
\end{columns}

Actual Behaviour

Get the following :

\begin{columns}
    \begin{column}{0.5\textwidth}
    \end{column}    \begin{block}{A vs. B \citep{cite-example}}
    \begin{itemize}
              \item View volumes instead of slices
              \item Enhanced comprehension of the anatomy
    \end{itemize}
    \end{block}
    \end{column}
\end{columns}

Notice the extra \end{column} that pops up right before the \begin{block}{A vs. B \citep{cite-example}} at the top, even though there exists an \end{column} already.

Wrong project path

I am using latexer under Windows 10 64-bit. When trying to use a multifile environment by writing "%!TEX root = thesis.tex" I get the following error message:

"could not load content of C:\Users\Johannes\AppData\Local\atom\app-1.0.5\thesis.tex"

Where C:\Users\Johannes\AppData\Local\atom\app-1.0.5 is the directory of atom's binary and not the project folder.

Also, in the root file itself, neither ref nor cite autocompletion works. It looks like the path you get by invoking @editor.getPath() is not correct. As far as I have seen, this function is deprecated and should be replaced by getPaths() anyway. Apart from that, maybe replace it by a completely different function, which directly resolves the path of the current file and use the folder in that path instead?

Edit: If I open the file by right-click, it works. If I open the complete folder by right-click->Open with atom, it doesn't. Neither does it when I open Atom using the start menu and then open the file within Atom.

Creating too many ends of environments (when activating autocomplete environments)

Hi there,
I would like to use the latexer for easier typing of TeX. However there seems to be a bug with Atom 1.18.0 and latexer 0.3.0.

When I begin an unnumbered math equation environment
\[ and type enter I would expect and autocompletion like

\[

\]

But I get the following

\[

\]
\]
\]
\]
\]
\]
\]
\]
\]

which is quite annoying, since it also happens, when you have the scenario from the first block code (so an existing empty or even nonempty math environment) and place the cursor at the equation line within at the second character (where you would end up after pressing enter).

edit: The error dissappears when disabling autocomplete environments but of course then environments are not autocompleted ;)

Feature request: autocomplete for bib and refs from separate directory

Hi, if I have...

mainfile.tex

which references sections in a subdirectory 'sections' e.g.:

sections/section1.tex
sections/section2.tex
sections/section3.tex
...

...then when editing any of the sections, latexer is not capable of finding the bib file in the root directory, and cannot complete \ref{} commands that check other sections and the mainfile.tex for ref tags. My cheat is to add a \bibliography{} command to the section files, and an extra copy of the bibliography in the sections folder, but this is less than adequate since for one thing it causes problems compiling having the \bibliography command repeated inside the section files.

Would it be possible to add an option that designates a project directory and then latexer scans all .tex files for the required info?

This would make a major improvement to already great functionality!

Thanks.

Feature request: addbibresource remote support + better suffix handling

Thanks for the project! It helps out a lot when writing papers.

In biblatex, \addbibresource more powerful than its \bibliography bibtex counterpart. It allows multiple formats for bibliographies, as well as the option of remote resources. Here's a
cheat sheet.

I'd like to request support for remote repositories, as well as arbitrary suffixes. This is especially useful when combining latexer with PULL requests from better-bibtex, a pretty spiffy Zotero extension.

To aid in remote testing, please feel free to use the following

\addbibresource[location=remote]{http://www.cs.toronto.edu/~sdrobert/info/publications/robertson2019}

I've also scoured GitHub for a remote bibliography that wasn't my own, ending in the suffix .bib. Suffice to say latexer did not work when I found one.

I understand if this is too much of an ask, and thank you for reading either way.

Regards,
Sean

ref is not consistent with multiple files

Hi,
I have encountered an issue with the autocompletion of ref and eqref.

suppose I have the following structure:
sections/
| section1.tex
| section2.tex
main.tex

section1.tex

% !TEX root = ../main.tex

\begin{equation}
  \label{eq:1}
  a=b
\end{equation}

% place1

section2.tex

% !TEX root = ../main.tex

\begin{equation}
  \label{eq:2}
  a=b
\end{equation}

% place2

main.tex

\section{Section1}
\label{sec:section1}
\import{sections/}{section1.tex}

\section{Section2}
\label{sec:section2}
\import{sections/}{section2.tex}

% place3

in this layout:
\ref{ at place1 and 2 just suggest the equations of their files, \ref{ at place3 suggests only the section labels.

Funny thing is:
When changing
% !TEX root = ../main.tex
to
%!TEX root = ../main.tex
place1 and 2 suggestions are just the sections, without even the eq: from the own file.

I think this is supposed to be a bug. Expected behaviour from my side would be that the space on the latex magic comments does not matter and everything from all files is included.

I don't know how its handled internally, but you could just parse the aux file of the main.tex for the newlables. There should be the complete list. (Caveat: does not work live, only after compilation)

Thanks in advance,
Flo

Edit:
similar Issues:
#11 , this would explaine the issue with the space if references are handled the same way, but I don't understand enough to explain the rest.

Edit2:
Atom: 1.6.1
Latexer: 0.3.0

Invoke bibliography autocompleter after comma

I often use commas in \cite to do multiple citations at once, e.g. \cite{Einstein.1912, Einstein.1923}. Latexer only invokes the autocompletion for the first citation, all the others need to be inserted manually. Hence, it would be nice if a comma in \cite{...} would also invoke the bibliography autocompleter.

Wrong autocompletion in multi-select mode

Using the multiselction mode, the autocompletion with the "begin-end" section will become a little bit weird.
Example code:
\begin{align*
\end{align_}}
\begin{align_
\end{align*}}

I guess the main problem is the code does not auto complete the brackets in the multi-selection mode.
Everything else is pretty good!

Wrapping math and macros

After the Atom latextools package seems abandoned, I found the latexer package together with the latex package a more than apt replacement. A few things than are missing and that seem like a nice feature addition to latexer:

  • math wrapping: when selecting some text and hitting '$', the selected text should be surrounded by '$'
  • macro wrapping: when selecting some text there should be a shortcut to generate a macro that takes this text as an argument (so selecting 'foo' and hitting the shortcut would result in '\{foo}' with the cursor immediately after the '\', so that one can just enter the macro name
  • specific-macro wrapping: shortcuts for some standard macro wrappers (e,g., emph)
  • environment wrapping: a similar feature to wrap selected text in an environment

Wrong autocompletion if \begin{...} and \end{...} are in the same line

The package does not seem to check if for a \begin{..} there is a matching \end{...} in the same line. Instead, it overeagerly inserts the matching \end{...} when a new line is inserted.

In order to replicate, consider an example:

\begin{equation}
  \begin{pmatrix} v1\\ v2 \end{pmatrix}
\end{equation}

If you then insert a new line after \end{pmatrix}, an additional \end{pmatrix} will be inserted below it:

\begin{equation}
  \begin{pmatrix} v1\\ v2 \end{pmatrix}
    % cursor moved to the new line
  \end{pmatrix} % <-- this statement was autocompleted
\end{equation}

latexer does not find citations when tex directive has a space in it

I use BibLaTeX with the biber backend to do citations. If I enter the \cite-keyword the latexer citation dialog pops up, but it is empty. I suspect that has something to do with the fact, that I do have a space after the percent sign in the tex directive: % !TEX root = 000_main.tex

As far as I understand the space is required for other TeX processing programs. There seem to be quite some issues with that. See http://tex.stackexchange.com/questions/78101/when-and-why-should-i-use-tex-ts-program-and-tex-encoding and search in the text for space. Some of the commenters suggest a bit of flexibility in the detection of the directive, which sounds good to me.

Failed to activate the latexer package

[Enter steps to reproduce:]

  1. install the package

Atom: 1.20.1 x64
Electron: 1.6.11
OS: "Arch Linux"
Thrown From: latexer package 0.3.0

Stack Trace

Failed to activate the latexer package

At Cannot read property 'parentNode' of undefined

TypeError: Cannot read property 'parentNode' of undefined
    at MenuUpdater.cleanUp (/packages/title-bar-replacer/lib/menu-updater.js:229:6)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:171:21)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.traverseTemplate (/packages/title-bar-replacer/lib/menu-updater.js:176:35)
    at MenuUpdater.run (/packages/title-bar-replacer/lib/menu-updater.js:42:13)
    at TitleBarReplacerView.updateMenu (/packages/title-bar-replacer/lib/title-bar-replacer-view.js:393:20)
    at /packages/title-bar-replacer/lib/title-bar-replacer.js:49:48)
    at Package.module.exports.Package.activateKeymaps (/usr/lib/atom/src/package.js:374:24)
    at Package.module.exports.Package.activateResources (/usr/lib/atom/src/package.js:339:14)
    at /usr/lib/atom/src/package.js:219:23
    at Package.module.exports.Package.measure (/usr/lib/atom/src/package.js:97:15)
    at /usr/lib/atom/src/package.js:216:26
    at Package.module.exports.Package.activate (/usr/lib/atom/src/package.js:213:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/usr/lib/atom/src/package-manager.js:635:34)
    at /usr/lib/atom/node_modules/settings-view/lib/package-manager.js:521:29
    at exit (/usr/lib/atom/node_modules/settings-view/lib/package-manager.js:114:16)
    at triggerExitCallback (/usr/lib/atom/src/buffered-process.js:322:11)
    at /usr/lib/atom/src/buffered-process.js:343:11
    at Socket.<anonymous> (/usr/lib/atom/src/buffered-process.js:204:9)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)

Commands

     -3:05.2.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -2:51.6.0 core:confirm (input.hidden-input)

Non-Core Packages

ask-stack 2.2.0 
atom-beautify 0.30.5 
atom-latex 0.8.2 
autocomplete-bash-builtins 0.3.5 
autocomplete-bibtex 0.7.0 
busy-signal 1.4.3 
docker 0.8.0 
intellij-idea-keymap 0.2.3 
intentions 1.1.5 
language-docker 1.1.8 
language-htaccess 0.1.1 
latex 0.48.0 
latexer 0.3.0 
linter 2.2.0 
linter-chktex 1.3.1 
linter-docker 0.2.1 
linter-ui-default 1.6.8 
rsync-save 0.9.7 
title-bar-replacer 1.4.1 

Bibliography autocompletion enhancement

This package normally pops out the citation select menu triggered by typing in \cite{, \textcite{, \citet{, \citet*{, \citep{ or \citep*{. However users may define custom citation commands which can not trigger the autocompletion.

How about enhance this just like the reference autocompletion triggered by typing in any control sequences that ends in cite{, citet{, citet*{, citep{ or citep*{ ?

Not automatically adding .bib at the end of bibliography files

Assuming ref.bib exists, latex handles both the following cases fine while this plugin does not check if the file exists and then try the .bib as well.

\bibliography{ref}
\bibliography{ref.bib}

It's not a big issue but it worths being in the to-do list. I might send a pull request soon if that would be alright?

Atom Version: 0.189.0
System: Mac OS X 10.10.2
Thrown From: latexer package, v0.2.2

Stack Trace

Uncaught Error: ENOENT: no such file or directory, open '[...hidden...]/ref'

At fs.js:519

Error: ENOENT: no such file or directory, open '[...hidden...]/ref'
  at Error (native)
  at Object.fs.openSync (fs.js:544:18)
  at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:118:20)
  at Object.fs.readFileSync (fs.js:396:15)
  at Object.fs.readFileSync (ATOM_SHELL_ASAR.js:369:29)
  at CiteView.module.exports.CiteView.getCitationsFromPath (/Users/vlad/.atom/packages/latexer/lib/cite-view.coffee:55:15)
  at CiteView.module.exports.CiteView.getCitations (/Users/vlad/.atom/packages/latexer/lib/cite-view.coffee:50:29)
  at CiteView.module.exports.CiteView.show (/Users/vlad/.atom/packages/latexer/lib/cite-view.coffee:18:14)
  at /Users/vlad/.atom/packages/latexer/lib/latexer.coffee:26:14
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1162:25

Commands

     -0:15.0 core:confirm (atom-text-editor.editor.mini)
     -0:12.9 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:12.9 core:cancel (atom-text-editor.editor.mini)
     -0:11.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:09.3 core:save (atom-text-editor.editor.is-focused)
     -0:08.9 core:move-up (atom-text-editor.editor.is-focused)
     -0:06.2 core:move-down (atom-text-editor.editor.is-focused)
  4x -0:05.8 core:backspace (atom-text-editor.editor.is-focused)
     -0:05.1 find-and-replace:show (atom-text-editor.editor.is-focused)
     -0:04.3 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:04.3 core:cancel (atom-text-editor.editor.mini)
  2x -0:03.9 autocomplete-plus:select-previous (atom-text-editor.editor.is-focused)
     -0:03.2 autocomplete-plus:cancel (atom-text-editor.editor.is-focused)
  2x -0:02.7 core:move-up (atom-text-editor.editor.is-focused)
  2x -0:02.1 editor:newline (atom-text-editor.editor.is-focused)
     -0:01.8 core:move-up (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "vim-mode"
    ]
  }
}

Installed Packages

# User
autocomplete-plus, v2.7.1
autocomplete-snippets, v1.2.0
gofmt, v0.2.0
language-latex, v0.4.1
latex, v0.20.0
latexer, v0.2.2

# Dev
No dev packages

Wrong environment autocompletion

When starting a new paragraph with extra space, autocompletion thinks this is an environment, and tries to close it.

first paragaph \\[12pt]
second paragraph

becomes

first paragaph \\[12pt]

\]
second paragraph

Autocomplete never triggers

The install from the package manager worked fine but typing either "\cite{" or "\begin{equation}" in a *.tex file does not trigger the autocompletion. The file contains a \bibliography{thesisbib}.

Atom version: 0.194.0
latexer version 0.2.2

Other packages installed:
language-latex
vim-mode
project-manager
autocomplete-plus
minimap

I tried disabling the other packages to no avail. Please advise how I can debug this further. Can I somehow tell if the package is "running"?. I am fairly new to atom/javascript but I am willing to learn :). Thanks

Support for multi file documents

I'm editing a larger document that is spread throughout multiple .tex files, e.g.,

main.tex
part_a.tex
...
part_z.tex

and main.tex includes part_a.tex to part_z.tex via \input and also includes the .bib file. Latexer does not find any citations when I'm working inside one of part_a.tex to part_z.tex.

Spontaneous ideas to overcome this situation:

Also a good idea could be to separate the three different autocompletion features (reference, bibliography and environment) of latexer in individual plugins so people can choose freely between plugins that partially overlap in functionality (see last point in the list above).

Citation assistance for parencite

Wanted to request whether citation features can be provided for \parencite as well. Currently the citation pop-up of Bibtex keys appear only for \cite and others. Since parencite is also often used, it will be nice if you can add this.

Thanks!

Bibliography files found only in same LaTeX file

It is certainly possible (and prudent, at times) to include e.g. \addbibresource{...} in a separate file, shared among multiple documents. Then, the main file contains something like \input{other.tex}. latexer should look into files thus linked and search for bib files.

The other way around is also possible (and combinations, of course): while editing chapter1.tex we would expect bib data linked in mytesis.tex (which would contain \input{chapter1.tex}) to be used for completion.

Wrong autocompletion of begin keyword

Hi ! When I type \begin Atom gives me the option to autocomplete, and then it completes as:

\\begin{env}
\end{env}

Note that the begin keyword has an extra "", and it should be:

\begin{env}
\end{env}

Atom version is: 0.211.0
Latexer version is: 0.2.3
OS is: Ubuntu 14.04

Bibliography autocompletion does not like @Comment comments

I am using http://www.jabref.org/ to manage my bibliography. JabRef puts the following line at the end of my .bib-file:

@Comment{jabref-meta: databaseType:bibtex;}

(As far as I know, in .bib-file everything which is not a valid declaration is a comment, and the line is not a valid declaration.)

The bibliography autocompletion now offers me an null null entry,
null
which expands to

\cite{jabref-meta:databaseType:bibtex;}

I know this is not a huge problem, but I thought I let you know :-)

Feature request : use texmf directory to find the bib file

I am used to mention my bibliography just by : \bibliography{bib}
LaTeX find by itself I'm referring to the ~/texmf/bibtex/bib/bib.bib file, in the texmf directory.

Would it be possible for latexer to use the texmf directory, either by default or through an option ?

Thanks a lot for the project !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.