Skip to content

Commit

Permalink
Add more BibLaTeX citation commands
Browse files Browse the repository at this point in the history
  • Loading branch information
valentjn committed May 31, 2020
1 parent bad636d commit 9937d78
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ private enum Mode {
new LatexCommandSignature("\\captionsetup[]{}"),
new LatexCommandSignature("\\cite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\cite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\cite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Cite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Cite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Cite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\cite*{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\cite*[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\cite*[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\citealp{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\citealp[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\citealp*{}", LatexCommandSignature.Action.DUMMY),
Expand All @@ -63,6 +68,46 @@ private enum Mode {
new LatexCommandSignature("\\citep[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\citep*{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\citep*[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\cites{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites{}{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites()()[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites()()[][]{}[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites()()[][]{}[][]{}[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites()()[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\cites()()[][]{}[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites{}{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites()()[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites()()[][]{}[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites()()[][]{}[][]{}[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites()()[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Cites()()[][]{}[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\citet{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\citet[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\citet*{}", LatexCommandSignature.Action.DUMMY),
Expand Down Expand Up @@ -104,6 +149,12 @@ private enum Mode {
new LatexCommandSignature("\\etocsettocstyle{}{}"),
new LatexCommandSignature("\\floatname{}{}"),
new LatexCommandSignature("\\floatstyle{}"),
new LatexCommandSignature("\\footcite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\footcite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\footcite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\footcitetext{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\footcitetext[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\footcitetext[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\footnote{}"),
new LatexCommandSignature("\\footnote[]{}"),
new LatexCommandSignature("\\foreignlanguage{}{}", LatexCommandSignature.Action.DUMMY),
Expand Down Expand Up @@ -160,6 +211,15 @@ private enum Mode {
new LatexCommandSignature("\\pageref{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\pageref*{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\pagestyle{}"),
new LatexCommandSignature("\\parencite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\parencite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\parencite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\parencite*{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\parencite*[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\parencite*[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Parencite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Parencite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Parencite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\pdfbookmark{}{}"),
new LatexCommandSignature("\\pdfbookmark[]{}{}"),
new LatexCommandSignature("\\pgfdeclaredecoration{}{}{}"),
Expand Down Expand Up @@ -206,11 +266,64 @@ private enum Mode {
new LatexCommandSignature("\\@setplength{}{}"),
new LatexCommandSignature("\\setstretch{}"),
new LatexCommandSignature("\\sisetup{}"),
new LatexCommandSignature("\\smartcite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\smartcite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\smartcite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Smartcite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Smartcite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Smartcite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\stepcounter{}"),
new LatexCommandSignature("\\supercite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\SweaveInput{}"),
new LatexCommandSignature("\\SweaveOpts{}"),
new LatexCommandSignature("\\SweaveSyntax{}"),
new LatexCommandSignature("\\TeX", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\textcite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\textcite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\textcite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Textcite{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Textcite[]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\Textcite[][]{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\textcites{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites{}{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites()()[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites()()[][]{}[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites()()[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites()()[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcites()()[][]{}[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites{}{}{}{}{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites()()[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites()()[][]{}[][]{}", LatexCommandSignature.Action.DUMMY,
DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites()()[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites()()[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\Textcites()()[][]{}[][]{}[][]{}[][]{}[][]{}",
LatexCommandSignature.Action.DUMMY, DummyGenerator.getDefault(true)),
new LatexCommandSignature("\\textcolor{}"),
new LatexCommandSignature("\\textproc{}", LatexCommandSignature.Action.DUMMY),
new LatexCommandSignature("\\thispagestyle{}"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ public void testTextMode() {
"\\subsection{This is another heading.}\n" +
"This is another test.\n",
"Heading. This is a test. This is another heading. This is another test. ");
assertPlainText(
"This is a test: \\cite{test1}, \\cite[a]{test2}, \\cite[a][b]{test3}.\n" +
"\\textcites{test1}{test2}{test3} shows that this should be plural.\n" +
"\\textcites(a)(b)[c][]{test1}[][d]{test2}[e][f]{test3} proves another error.\n",
"This is a test: Dummy0, Dummy1, Dummy2. " +
"Dummies shows that this should be plural. " +
"Dummies proves another error. ");

{
AnnotatedText annotatedText = buildAnnotatedText("\\cite{Kubota}*{Theorem 3.7}\n");
Expand Down

0 comments on commit 9937d78

Please sign in to comment.