Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#### Upcoming
Proposed:
* Added support for \autocite command from biblatex
* Added support for file inclusion via the subimport package (\subimport command)
* Relaxed requirements of %TEX root magic (additional spaces allowed, case insensitive)
* Removed additional brace characters from citation view

* Expanded autocomplete support to include [pandoc-style citations](http://pandoc.org/MANUAL.html#citations) when you're writing in [Markdown](https://guides.github.com/features/mastering-markdown/#syntax) (`.md`) or [Rmarkdown](http://rmarkdown.rstudio.com/) (`.Rmd`).
* Added support for specifying your bibfile (for citation autocompletion) as part of a [YAML Metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block)
* UPDATED README with an example of pandoc citation autocompletion


#### 0.3.0
* Options to switch off autocompletion
* Added Atom commands
Expand Down
2 changes: 1 addition & 1 deletion lib/citation.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ class Citation
termInd = content.lastIndexOf(term)
continue if termInd < 0
content = content.substring(0, termInd)
content = content.replace(/\s+/g," ")
content = content.replace(/\s+/g," ").replace(/{/g,"").replace(/}/g,"")
@properties.push({name: name, content: content})
2 changes: 1 addition & 1 deletion lib/cite-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CiteView extends SelectListView
basePath = basePath.substring 0, basePath.lastIndexOf(pathModule.sep)
bibFiles = @getBibFileFromText(@editor.getText())
if bibFiles == null or bibFiles.length == 0
texRootRex = /%(\s+)?!TEX root(\s+)?=(\s+)?(.+)/g
texRootRex = /%(\s+)?!TEX root(\s+)?=(\s+)?(.+)/gi
while(match = texRootRex.exec(@editor.getText()))
absolutFilePath =
FindLabels.getAbsolutePath(activePaneItemPath,match[4])
Expand Down
4 changes: 4 additions & 0 deletions lib/find-labels.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ FindLabels =
while (match = inputRex.exec(text))
matches = matches.concat(
@getLabels(@getAbsolutePath(baseFile, match[2]), baseFile))
inputRex = /\\(subimport){([^}]+)}{([^}]+)}/g
while (match = inputRex.exec(text))
matches = matches.concat(@getLabels(
@getAbsolutePath(baseFile, match[2]+match[3]), baseFile))
matches

getLabels: (file, baseFile) ->
Expand Down
4 changes: 2 additions & 2 deletions lib/label-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class LabelView extends SelectListView
@editor = editor
file = editor?.buffer?.file
basePath = file?.path
texRootRex = /%!TEX root = (.+)/g
texRootRex = /%(\s+)?!TEX root(\s+)?=(\s+)?(.+)/gi
while(match = texRootRex.exec(@editor.getText()))
absolutFilePath = FindLabels.getAbsolutePath(basePath,match[1])
absolutFilePath = FindLabels.getAbsolutePath(basePath,match[4])
try
text = fs.readFileSync(absolutFilePath).toString()
labels = FindLabels.getLabelsByText(text, absolutFilePath)
Expand Down
2 changes: 1 addition & 1 deletion lib/latexer-hook.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports =
beginRex: /\\begin{([^}]+)}/
mathRex: /(\\+)\[/
refRex: /\\(\w*ref({|{[^}]+,)|[cC](page)?refrange({[^,}]*})?{)$/
citeRex: /\\\w*(cite|citet|citep|citet\*|citep\*)(\[[^\]]+\])?({|{[^}]+,)$/
citeRex: /\\\w*(cite|autocite|citet|citep|citet\*|citep\*)(\[[^\]]+\])?({|{[^}]+,)$/
constructor: (@editor) ->
@disposables = new CompositeDisposable
@disposables.add @editor.onDidChangeTitle => @subscribeBuffer()
Expand Down