-
Notifications
You must be signed in to change notification settings - Fork 47
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
Added support for all natbib and BibLaTeX citation commands #183
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all natbib commands and biblatex commands for citations. *natbib commands list from https://gking.harvard.edu/files/natnotes2.pdf *biblatex commands list from http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/biblatex/ doc/biblatex.pdf Citations commands that wasn't capturing before includes: %==========================================================% %| Natbib Commands |% %==========================================================% \citenum{foo_bar} \citetext{foo_bar} %==========================================================% %| BibLaTeX Commands |% %==========================================================% % Standard Commands \Parencite{foo_bar} \footcitetext{foo_bar} % Style-specific Commands \smartcite{foo_bar} \Smartcite{foo_bar} \supercite{foo_bar} % Qualified Citation Lists \Parencites{foo_bar} \footcitetexts{foo_bar} \smartcites{foo_bar} \Smartcites{foo_bar} \Textcite{aabide} \supercites{aabide} % Style-independent Commands \Autocite{foo_bar} \Autocite*{foo_bar} \Autocites{foo_bar} \citedate{foo_bar} \citedate*{foo_bar} \citeurl{foo_bar} \parentext{foo_bar} \brackettext{foo_bar} % Special Commands \volcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \Volcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \volcites[hprenotei]{hvolumei}[hpagei]{foo_bar} \Volcites[hprenotei]{hvolumei}[hpagei]{foo_bar} \pvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \Pvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \pvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \Pvolcites[hprenotei]{hvolumei} \fvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \ftvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \fvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \Fvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \svolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \Svolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \svolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \Svolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \tvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \Tvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \tvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \Tvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \avolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \Avolcite[hprenotei]{hvolumei}[hpagei]{foo_bar} \avolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \Avolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei} [hpagei]{foo_bar} \notecite{foo_bar} \Notecite{foo_bar} \pnotecite{foo_bar} \Pnotecite{foo_bar} \fnotecite{foo_bar} % Low-level Commands \citename{foo_bar}[hformati]{hname listi} \citelist{foo_bar}[hformati]{hliteral listi} \citefield{foo_bar}[hformati]{hfieldi}
soraxas
changed the title
Modified the Regex for citation syntax, now it is able to capture
Added support for all natbib and BibLaTeX citation commands
May 8, 2018
The full list of citations commands used to validate the syntax highlighting: %==========================================================%
%| |%
%| Natbib Commands |%
%| |%
%==========================================================%
\citet{foo_bar}
\citep{foo_bar}
\citealt{foo_bar}
\citealt*{foo_bar}
\citealp{foo_bar}
\citealp*{foo_bar}
\citenum{foo_bar}
\citetext{foo_bar}
\citeauthor{foo_bar}
\citeauthor*{foo_bar}
\citeyear{foo_bar}
\citeyearpar{foo_bar}
\Citet{foo_bar}
\Citep{foo_bar}
\Citealt{foo_bar}
\Citealp{foo_bar}
\Citeauthor{foo_bar}
%==========================================================%
%| |%
%| BibLaTeX Commands |%
%| |%
%==========================================================%
%----------------------------------------------------------%
% Standard Commands %
%----------------------------------------------------------%
\cite{foo_bar}
\Cite{foo_bar}
\parencite{foo_bar}
\Parencite{foo_bar}
\footcite{foo_bar}
\footcitetext{foo_bar}
%----------------------------------------------------------%
% Style-specific Commands %
%----------------------------------------------------------%
\smartcite{foo_bar}
\Smartcite{foo_bar}
\cite*{foo_bar}
\parencite*{foo_bar}
\supercite{foo_bar}
%----------------------------------------------------------%
% Qualified Citation Lists %
%----------------------------------------------------------%
\cites{foo_bar}
\Cites{foo_bar}
\parencites{foo_bar}
\Parencites{foo_bar}
\footcites{foo_bar}
\footcitetexts{foo_bar}
\smartcites{foo_bar}
\Smartcites{foo_bar}
\textcite{foo_bar}
\Textcite{aabide}
\supercites{aabide}
%----------------------------------------------------------%
% Style-independent Commands %
%----------------------------------------------------------%
\autocite{foo_bar}
\Autocite{foo_bar}
\autocite*{foo_bar}
\Autocite*{foo_bar}
\autocites{foo_bar}
\Autocites{foo_bar}
\citeauthor{foo_bar}
\citeauthor*{foo_bar}
\Citeauthor{foo_bar}
\Citeauthor*{foo_bar}
\citetitle{foo_bar}
\citetitle*{foo_bar}
\citeyear{foo_bar}
\citeyear*{foo_bar}
\citedate{foo_bar}
\citedate*{foo_bar}
\citeurl{foo_bar}
\parentext{foo_bar}
\brackettext{foo_bar}
%----------------------------------------------------------%
% Special Commands %
%----------------------------------------------------------%
\nocite{foo_bar}
\nocite{*}
\fullcite{foo_bar}
\footfullcite{foo_bar}
\volcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Volcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\volcites[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Volcites[hprenotei]{hvolumei}[hpagei]{foo_bar}
\pvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Pvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\pvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Pvolcites[hprenotei]{hvolumei}
\fvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\ftvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\fvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Fvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\svolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Svolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\svolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Svolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\tvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Tvolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\tvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Tvolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\avolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Avolcite[hprenotei]{hvolumei}[hpagei]{foo_bar}
\avolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\Avolcites[hprenotei]{hvolumei}[hpagei]{foo_bar}[hprenotei]{hvolumei}[hpagei]{foo_bar}
\notecite{foo_bar}
\Notecite{foo_bar}
\pnotecite{foo_bar}
\Pnotecite{foo_bar}
\fnotecite{foo_bar}
%----------------------------------------------------------%
% Low-level Commands %
%----------------------------------------------------------%
\citename{foo_bar}[hformati]{hname listi}
\citelist{foo_bar}[hformati]{hliteral listi}
\citefield{foo_bar}[hformati]{hfieldi}
|
Can't see anything wrong with it. The lenient |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modified the Regex for citation syntax, now it is able to capture all natbib commands and biblatex commands for citations.
natbib commands list
from https://gking.harvard.edu/files/natnotes2.pdf
biblatex commands list
from http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf
Citations commands that wasn't capturing before includes: