focus / latexer Goto Github PK
View Code? Open in Web Editor NEWAdds LaTex autocompletion to Atom.io
Home Page: https://atom.io/packages/latexer
License: MIT License
Adds LaTex autocompletion to Atom.io
Home Page: https://atom.io/packages/latexer
License: MIT License
[Enter steps to reproduce:]
Atom: 1.20.1 x64
Electron: 1.6.11
OS: "Arch Linux"
Thrown From: latexer package 0.3.0
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)
-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)
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
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.
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}
Example:
\begin{something}
\begin{something}%cursor here and press enter
\end{something}
this will not autocomplete. First reported in #12
If an environment is closed in a comment, it is not autoclosed.
\begin{env}
% \end{env}
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!
The \cite{} command triggers the search window but no results are seen when multiple bibliography files are included within \bibliography{}. Using one at a time works flawlessly though.
You should enable the auto-complete for \autoref, with the same behaviour of \ref.
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 !
\begin{env}\begin{env}
is only closed once
\begin{env}\begin{env}
\end{env}
[Enter steps to reproduce:]
Atom: 1.36.0 x64
Electron: 2.0.18
OS: Unknown Windows version
Thrown From: latexer package 0.3.0
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)
latex 0.50.2
latextools 0.8.5
pdf-view 0.71.0
language-latex 1.2.0
latexer 0.3.0
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.
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
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
-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)
{
"core": {
"disabledPackages": [
"vim-mode"
]
}
}
# 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
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.
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
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,
which expands to
\cite{jabref-meta:databaseType:bibtex;}
I know this is not a huge problem, but I thought I let you know :-)
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.
\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.
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
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}
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.
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.
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:
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
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!
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:
Line 19 in 1f08eeb
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!
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!:
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: (...)โฆ}
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
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)
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*{ ?
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?
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
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
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
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.
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.
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 ;)
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}
[Enter steps to reproduce below:]
Atom Version: 0.187.0
System: linux 3.13.0-46-generic
Thrown From: latexer package, v0.2.2
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
-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)
{
"core": {
"themes": [
"atom-light-ui",
"one-light-syntax"
]
}
}
# 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
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.
I love this tool so much, would be great if it can support auto complete for glossary as well.
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:
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
If a document start with \begin{env}
, this is not autoclosed.
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.
When I use Ond Dark UI and after I change the UI font size, the popout window will have a very big border.
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.
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.
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).
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...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.