asciidoctor-bibliography 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +23 -4
- data/asciidoctor-bibliography.gemspec +8 -8
- data/lib/asciidoctor-bibliography.rb +6 -0
- data/lib/asciidoctor-bibliography/asciidoctor/bibliographer_preprocessor.rb +35 -23
- data/lib/asciidoctor-bibliography/bibliographer.rb +0 -15
- data/lib/asciidoctor-bibliography/citation.rb +29 -22
- data/lib/asciidoctor-bibliography/databases/bibtex.rb +4 -1
- data/lib/asciidoctor-bibliography/formatter.rb +28 -0
- data/lib/asciidoctor-bibliography/index.rb +24 -16
- data/lib/asciidoctor-bibliography/options.rb +65 -32
- data/lib/asciidoctor-bibliography/version.rb +1 -1
- data/lib/citeproc/ruby/formats/adoc.rb +36 -0
- data/lib/csl/styles/tex-citealp-authoryear.csl +117 -0
- data/lib/csl/styles/tex-citealp-numeric.csl +116 -0
- data/lib/csl/styles/tex-citealps-authoryear.csl +117 -0
- data/lib/csl/styles/tex-citealps-numeric.csl +116 -0
- data/lib/csl/styles/tex-citealt-authoryear.csl +119 -0
- data/lib/csl/styles/tex-citealt-numeric.csl +119 -0
- data/lib/csl/styles/tex-citealts-authoryear.csl +119 -0
- data/lib/csl/styles/tex-citealts-numeric.csl +119 -0
- data/lib/csl/styles/tex-citeauthor-authoryear.csl +116 -0
- data/lib/csl/styles/tex-citeauthor-numeric.csl +116 -0
- data/lib/csl/styles/tex-citeauthors-authoryear.csl +116 -0
- data/lib/csl/styles/tex-citeauthors-numeric.csl +116 -0
- data/lib/csl/styles/tex-citep-authoryear.csl +117 -0
- data/lib/csl/styles/tex-citep-numeric.csl +116 -0
- data/lib/csl/styles/tex-citeps-authoryear.csl +117 -0
- data/lib/csl/styles/tex-citeps-numeric.csl +116 -0
- data/lib/csl/styles/tex-citet-authoryear.csl +119 -0
- data/lib/csl/styles/tex-citet-numeric.csl +119 -0
- data/lib/csl/styles/tex-citets-authoryear.csl +119 -0
- data/lib/csl/styles/tex-citets-numeric.csl +119 -0
- data/lib/csl/styles/tex-citeyear-authoryear.csl +116 -0
- data/lib/csl/styles/tex-citeyear-numeric.csl +116 -0
- data/lib/csl/styles/tex-citeyearpar-authoryear.csl +116 -0
- data/lib/csl/styles/tex-citeyearpar-numeric.csl +116 -0
- data/samples/tex/sample-numbers.adoc +1 -1
- data/samples/tex/sample-sort.adoc +1 -1
- data/spec/citation_helper.rb +46 -0
- data/spec/citation_item_spec.rb +0 -2
- data/spec/csl/styles/tex_citealp_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citealp_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citealps_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citealps_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citealt_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citealt_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citealts_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citealts_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citeauthor_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citeauthor_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citeauthors_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citeauthors_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citep_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citep_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citeps_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citeps_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citet_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citet_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citets_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citets_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citeyear_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citeyear_numeric_spec.rb +42 -0
- data/spec/csl/styles/tex_citeyearpar_authoryear_spec.rb +42 -0
- data/spec/csl/styles/tex_citeyearpar_numeric_spec.rb +42 -0
- data/spec/database_spec.rb +20 -1
- data/spec/macros_spec.rb +21 -0
- data/spec/options_spec.rb +105 -1
- metadata +72 -24
- data/lib/asciidoctor-bibliography/formatters/csl.rb +0 -28
- data/lib/asciidoctor-bibliography/formatters/tex.rb +0 -187
- data/lib/asciidoctor-bibliography/helpers.rb +0 -41
- data/spec/helpers_spec.rb +0 -73
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citealt* macro with authoryear style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "authoryear" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citealt*:[Erdos65]", options: options)).
|
10
|
+
to eq "Erdős, Heyting, and Brouwer 1965"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citealt*:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "Erdős, Heyting, and Brouwer 1965; Einstein, Podolsky, and Rosen 1935"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citealt*:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "Erdős, Heyting, and Brouwer see 1965"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citealt*:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "Erdős, Heyting, and Brouwer 1965, new edition"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citealt*:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "Erdős, Heyting, and Brouwer see 1965, new edition"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citealt*:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "Erdős, Heyting, and Brouwer 1965, pp. 41-43"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citealt*:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "Erdős, Heyting, and Brouwer 1965, somewhere"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citealt* macro with numeric style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "numeric" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citealt*:[Erdos65]", options: options)).
|
10
|
+
to eq "Erdős, Heyting, and Brouwer 1"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citealt*:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "Erdős, Heyting, and Brouwer 1, Einstein, Podolsky, and Rosen 2"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citealt*:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "Erdős, Heyting, and Brouwer see 1"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citealt*:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "Erdős, Heyting, and Brouwer 1, new edition"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citealt*:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "Erdős, Heyting, and Brouwer see 1, new edition"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citealt*:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "Erdős, Heyting, and Brouwer 1, pp. 41-43"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citealt*:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "Erdős, Heyting, and Brouwer 1, somewhere"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citeauthor macro with authoryear style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "authoryear" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citeauthor:[Erdos65]", options: options)).
|
10
|
+
to eq "Erdős et al."
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citeauthor:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "Erdős et al.; Einstein et al."
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citeauthor:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "see Erdős et al."
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citeauthor:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "Erdős et al., new edition"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citeauthor:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "see Erdős et al., new edition"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citeauthor:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "Erdős et al., pp. 41-43"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citeauthor:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "Erdős et al., somewhere"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citeauthor macro with numeric style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "numeric" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citeauthor:[Erdos65]", options: options)).
|
10
|
+
to eq "Erdős et al."
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citeauthor:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "Erdős et al., Einstein et al."
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citeauthor:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "see Erdős et al."
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citeauthor:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "Erdős et al., new edition"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citeauthor:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "see Erdős et al., new edition"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citeauthor:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "Erdős et al., pp. 41-43"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citeauthor:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "Erdős et al., somewhere"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citeauthor* macro with authoryear style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "authoryear" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citeauthor*:[Erdos65]", options: options)).
|
10
|
+
to eq "Erdős, Heyting, and Brouwer"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citeauthor*:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "Erdős, Heyting, and Brouwer; Einstein, Podolsky, and Rosen"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citeauthor*:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "see Erdős, Heyting, and Brouwer"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citeauthor*:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "Erdős, Heyting, and Brouwer, new edition"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citeauthor*:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "see Erdős, Heyting, and Brouwer, new edition"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citeauthor*:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "Erdős, Heyting, and Brouwer, pp. 41-43"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citeauthor*:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "Erdős, Heyting, and Brouwer, somewhere"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citeauthor* macro with numeric style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "numeric" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citeauthor*:[Erdos65]", options: options)).
|
10
|
+
to eq "Erdős, Heyting, and Brouwer"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citeauthor*:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "Erdős, Heyting, and Brouwer, Einstein, Podolsky, and Rosen"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citeauthor*:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "see Erdős, Heyting, and Brouwer"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citeauthor*:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "Erdős, Heyting, and Brouwer, new edition"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citeauthor*:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "see Erdős, Heyting, and Brouwer, new edition"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citeauthor*:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "Erdős, Heyting, and Brouwer, pp. 41-43"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citeauthor*:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "Erdős, Heyting, and Brouwer, somewhere"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citep macro with authoryear style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "authoryear" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citep:[Erdos65]", options: options)).
|
10
|
+
to eq "(Erdős et al., 1965)"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citep:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "(Erdős et al., 1965; Einstein et al., 1935)"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citep:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "(see Erdős et al., 1965)"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citep:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "(Erdős et al., 1965, new edition)"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citep:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "(see Erdős et al., 1965, new edition)"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citep:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "(Erdős et al., 1965, pp. 41-43)"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citep:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "(Erdős et al., 1965, somewhere)"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citep macro with numeric style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "numeric" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citep:[Erdos65]", options: options)).
|
10
|
+
to eq "[1]"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citep:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "[1, 2]"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citep:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "[see 1]"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citep:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "[1, new edition]"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citep:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "[see 1, new edition]"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citep:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "[1, pp. 41-43]"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citep:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "[1, somewhere]"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citep* macro with authoryear style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "authoryear" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citep*:[Erdos65]", options: options)).
|
10
|
+
to eq "(Erdős, Heyting, and Brouwer, 1965)"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citep*:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "(Erdős, Heyting, and Brouwer, 1965; Einstein, Podolsky, and Rosen, 1935)"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citep*:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "(see Erdős, Heyting, and Brouwer, 1965)"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citep*:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "(Erdős, Heyting, and Brouwer, 1965, new edition)"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citep*:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "(see Erdős, Heyting, and Brouwer, 1965, new edition)"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citep*:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "(Erdős, Heyting, and Brouwer, 1965, pp. 41-43)"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citep*:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "(Erdős, Heyting, and Brouwer, 1965, somewhere)"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citep* macro with numeric style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "numeric" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citep*:[Erdos65]", options: options)).
|
10
|
+
to eq "[1]"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citep*:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "[1, 2]"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citep*:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "[see 1]"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citep*:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "[1, new edition]"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citep*:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "[see 1, new edition]"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citep*:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "[1, pp. 41-43]"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citep*:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "[1, somewhere]"
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require_relative "../../citation_helper"
|
4
|
+
|
5
|
+
describe "citet macro with authoryear style" do
|
6
|
+
let(:options) { { "bibliography-tex-style" => "authoryear" } }
|
7
|
+
|
8
|
+
it "formats a single citation" do
|
9
|
+
expect(formatted_citation("citet:[Erdos65]", options: options)).
|
10
|
+
to eq "Erdős et al. (1965)"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "formats a grouped citation" do
|
14
|
+
expect(formatted_citation("citet:[Erdos65]+[Einstein35]", options: options)).
|
15
|
+
to eq "Erdős et al. (1965); Einstein et al. (1935)"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "formats a single citation with a prefix" do
|
19
|
+
expect(formatted_citation("citet:[Erdos65, prefix=see]", options: options)).
|
20
|
+
to eq "Erdős et al. (see 1965)"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "formats a single citation with a suffix" do
|
24
|
+
expect(formatted_citation("citet:[Erdos65, suffix=new edition]", options: options)).
|
25
|
+
to eq "Erdős et al. (1965, new edition)"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "formats a single citation with both a prefix and a suffix" do
|
29
|
+
expect(formatted_citation("citet:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
+
to eq "Erdős et al. (see 1965, new edition)"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "formats a single citation with a standard locator" do
|
34
|
+
expect(formatted_citation("citet:[Erdos65, page=41-43]", options: options)).
|
35
|
+
to eq "Erdős et al. (1965, pp. 41-43)"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "formats a single citation with a custom locator" do
|
39
|
+
expect(formatted_citation("citet:[Erdos65, locator=somewhere]", options: options)).
|
40
|
+
to eq "Erdős et al. (1965, somewhere)"
|
41
|
+
end
|
42
|
+
end
|