Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LaTeX] Add citation to symbol/reference index #4137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions LaTeX/Reference List - Citation.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>constant.other.citation.latex</string>
<key>settings</key>
<dict>
<key>showInIndexedReferenceList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
14 changes: 14 additions & 0 deletions LaTeX/Symbol List - Citation.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>entity.name.type.entry-key.bibtex</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
6 changes: 6 additions & 0 deletions LaTeX/tests/syntax_test_bibtex.bib
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ @string{mar
% ^^^^^^^^^^^^^^^ meta.declaration.arguments.bibtex meta.braces.bibtex
% ^ punctuation.section.braces.begin.bibtex
% ^^^ entity.name.constant.bibtex
% @@@ definition
% ^ keyword.operator.assignment.bibtex
% ^^^^^^^ meta.string.bibtex string.quoted.double.bibtex
% ^ punctuation.section.braces.end.bibtex
Expand All @@ -16,6 +17,7 @@ @string(aw
% ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.arguments.bibtex meta.parens.bibtex
% ^ punctuation.section.parens.begin.bibtex
% ^^ entity.name.constant.bibtex
% @@ definition
% ^ keyword.operator.assignment.bibtex
% ^ punctuation.definition.string.begin.bibtex
% ^^^^^^^^^^^^^^^^^^ meta.string.bibtex string.quoted.other.bibtex
Expand Down Expand Up @@ -49,13 +51,15 @@ @book(paren)
% ^^^^^^^ meta.entry.arguments.bibtex meta.parens.bibtex
% ^ punctuation.section.parens.begin.bibtex
% ^^^^^ entity.name.type.entry-key.bibtex
% @@@@@ definition
% ^ punctuation.section.parens.end.bibtex
% ^ - meta.entry

@book(paren, author="Nobody")
% <- meta.entry.bibtex keyword.declaration.entry.bibtex punctuation.definition.keyword.bibtex
%^^^^ meta.entry.bibtex keyword.declaration.entry.bibtex
% ^^^^^^ meta.entry.arguments.bibtex meta.parens.bibtex - meta.mapping
% @@@@@ definition
% ^^^^^^^^^^^^^^^^^ meta.entry.arguments.bibtex meta.parens.bibtex meta.mapping - meta.mapping meta.mapping
% ^^^^^^ meta.mapping.key.bibtex string.unquoted.key.bibtex
% ^ meta.mapping.bibtex punctuation.separator.key-value.bibtex
Expand All @@ -68,6 +72,7 @@ @book{knuth97
% ^^^^^^^^^ meta.entry.arguments.bibtex
% ^ punctuation.section.braces.begin.bibtex
% ^^^^^^^ entity.name.type.entry-key.bibtex
% @@@@@@@ definition
% ^ punctuation.section.braces.end.bibtex
% ^ - meta.entry

Expand All @@ -79,6 +84,7 @@ @book{knuth97
%^^^^ keyword.declaration.entry.bibtex
% ^ punctuation.section.braces.begin.bibtex
% ^^^^^^^ entity.name.type.entry-key.bibtex
% @@@@@@@ definition
% ^ punctuation.separator.sequence.bibtex
author = {Donald E. Knuth},
% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.entry.arguments.bibtex meta.braces.bibtex - meta.mapping meta.mapping
Expand Down
14 changes: 8 additions & 6 deletions LaTeX/tests/syntax_test_latex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,14 @@ \subsubsection{name}
% ^ meta.group.bracket.latex
% ^ constant.other.citation.latex

\Citeauthor*[]{ref}
% ^ meta.function.citation.latex
% ^ support.function.cite.latex
% ^ support.function.cite.latex
% ^ meta.group.bracket.latex
% ^ constant.other.citation.latex
\Citeauthor*[]{knuth97} % Hit F12 to go to definition in syntax_test_bibtex.bib
%^^^^^^^^^^^^^^^^^^^^^^ meta.function.citation.latex
%^^^^^^^^^^^ support.function.cite.latex keyword.other.cite.latex
% ^^ meta.group.bracket.latex
% ^^^^^^^^^ meta.group.brace.tex
% ^ punctuation.definition.group.brace.begin.tex
% ^^^^^^^ constant.other.citation.latex
% ^ punctuation.definition.group.brace.end.tex


% URL COMMAND
Expand Down
16 changes: 16 additions & 0 deletions LaTeX/tests/syntax_test_symbol.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
% SYNTAX TEST "Packages/LaTeX/LaTeX.sublime-syntax"

\cite{knuth97}
% @@@@@@@ reference

\citeauthor{knuth97}
% @@@@@@@ reference

\citetitle{knuth97}
% @@@@@@@ reference

\citeurl{knuth97}
% @@@@@@@ reference

\citeyear{knuth97}
% @@@@@@@ reference
Loading