Recent Changes · Search:

# Use Cases

Some of these use cases related to easy cite have been “moved” to

This describes various situations in which bibliographies may arise. In all cases, the markup is for illustration; the actual markup and implementation mechanism chosen may vary. While the cases refer to database pages, these could be implemented as a bibliography group, with a page per citation.

### 1.  Generate a bibliography for a single page

Case 1. Single page example. Initially, I suspect that I’d simply use this as a convenient way of adding a bibliography at the end of the current page. In this case, the same page will contain (:cite:), the bibliography database as well as the actual bibliography.

```PageWithSimpleBib - everything in one page:
Bla bla bla (:cite key-1 :) bla bla
bla bla bla
<more text>

(:if false:)
@Misc{key-1, URI = {http://...} }
(:ifend:)

(:bibliographystyle unsrt :)
(:bibliography :)
```

Note that I assume the following default behaviour of the (:bibliography:) directive:

• it results in a bibliography, i.e. a list of citations
• it uses the current page as a bibliographic database

Another option would be to specify “style=unsrt” as an option in the (:bibliography:) directive.

### 2.  All pages share a single bibliography

Case 2. Shared bibliography database. Eventually I get a lot of citations and wish to keep most of the bibliographic data in a single page instead of spread out. So in this case I am using the page Site.BibliographyDatabase (or SomeGroup.BibliographyDatabase) for this purpose. However, I also want to be able to add a few citations (i.e. the details of the source) to the current page because right now I don’t feel like adding them to Site.BibliographyDatabase. So I’d end up with:

```PageWithAlmostSimpleBib - shared bibliography database:
Bla bla bla (:cite key-1 :) bla bla (:cite key-2 :)
bla bla bla (:cite unusual-key :)
<more text>

(:if false:)
@Misc{unusual-key, URI = {http://...} }
(:ifend:)

(:bibliographystyle unsrt :)
(:bibliography {\$Name} Site.BibliographyDatabase:)

Site.BibliographyDatabase - home of most of the bibliography database:
@Misc{key-1, URI = {http://...} }
@Misc{key-2, URI = {http://...} }
```

Note that I’m not sure if (:bibliography:) by default always should look in the current page for BIBTEX data, so I explicitly name both the current page and the page Site.BibliographyDatabase.

### 3.  Display and print the bibliography database page

Case 3. Rendering the bibliography database. As I get more and more useful citations in the bibliography database, I probably want to be able to see the entire bibliography database. That could simply be done like this inserting a few commands in the page with the database:

```Site.BibliographyDatabase:
(:nocite *:)

(:if false:)
@Misc{key-1, URI = {http://...} }
@Misc{key-2, URI = {http://...} }
(:ifend:)

(:bibliographystyle unsrt :)
(:bibliography {\$Name} :)
```

Note the (:nocite *:) which pulls all the citations from the database into the bibliography. For consistency with Case 1, {\$Name} may be omitted.

### 4.  Define a shared bibliography for a group of pages

Case 4: Shared bibliography between pages in a group. This example is based on the idea that all the pages in a group together comprise an article or perhaps even a book. For this reason, we want to let all the pages in the group have a common bibliography (as well as the bibliography database). Let’s say that the pages with actual text are called Page1, Page2, … PageN. We could pretend that PageX corresponds to section X. In addition, let’s say we have a trail page called Pages that list the pages comprising the book. The bibliography should be shown on a page called Bibliography (or References). These will be the important pages:

```* Pages - the trail page
* Page1 - 1st page
* Page2 - 2nd page
* ...
* PageN - Nth page
* Bibliography - page with the bibliography
* Site.BibliographyDatabase - bibliography database (in another group,
although for a book it might make more sense to keep it here)
* GroupHeader - used to insert directives that are common
```

Note that sharing a bibliography means that “[1]” should refer to the same source regardless of which page “[1]” appears on. In other words, the number within the brackets may depend not only on the current page, but also on the other pages that share the bibliography. In case it’s unclear, let me give an example: Let us assume we are using an unsorted bibliography style, i.e. references should be numbered in the order that they appear. However, this assumes that pages are ordered… In this example it makes sense that the first reference on Page1 will be [1], the second will be [2]. And if the last reference on Page1 is [n], then the first reference on Page2 should be [n+1]. It should now be obvious that if someone adds a reference to Page1, the first reference on Page2 might get a new number.

On the other hand, if we have a different version of the book that consists of PageA followed by Page2, the first reference on Page2 would be [m+1] where [m] is the last reference of PageA.

OK, moving along to the possible content on the pages… Let’s use the group header to define things common to all the pages, where I pretend that the option “BibPage=Bibliography” keeps (:bibliography:) from displaying itself as a bibliography. Instead, this will let the (:cite:)-directives know where to find the bibliography and the bibliography database.

```GroupHeader:
(:bibliographystyle unsrt:)
(:bibliography Site.BibliographyDatabase BibPage=Bibliography :)

Pages:
Below is a list of related pages:
* [[Page 1]]
* [[Page 1]]
...
* [[Page N]]
```

I use the page “Pages” to define the pages that are kept together in this collection. This page will referred to by the page with the bibliography.

```Page1:
Bla bla bla  (:cite key-1 :) and ... (:cite key-2 :)

Page2:
Bla bla bla bal (:cite key-2 :) and ... (:cite key-1 :)

PageN:
...

Bibliography:
(:bibliographystyle unsrt :)
(:bibliography Site.BibliographyDatabase trail=Pages :)

Site.BibliographyDatabase:
(:if false:)
@Misc{key-1, ... }
@Misc{key-2, ... }
(:ifend:)
```

This case should also be implemented in a way that’s consistent with the (:typeset:) directive for publishing a trail, including its bibliography. The “trail=pages” option may then not be required and the bibliography-generating information can be defined on the trail page.

I don’t think I’ve got a good markup solution for this last case, nor am I sure all the pages have all the information the directives need.

For instance, maybe it would be better to use an indirect scheme like this instead:

### 5.  Bibliography database specified outside trail

Case 5: Shared bibliography between pages in a group, indirect definition of bibliography database. This is a modified version of user case 4 (see above).

I will pretend as before that the option “BibPage=Bibliography” to the directive (:bibliography:) keeps the bibliography from being shown. The purpose of (:bibliography:) is just to let the (:cite:)-directives know where to find the bibliography. In addition, I now assume that the (:cite:)-directives will go and “ask” the bibliography (i.e. the page Bibliography in this case) about where to find the bibliography database. Also note that the (:cite:)-directives need to ask not only about the bibliography database, but also what the link text should be… and this requires knowing what references have been used on the “previous” pages.

Or, the reference numbers get assigned dynamically, depending on the context of the current view: as a single page or as part of one or more page collections.

```GroupHeader:
(:bibliographystyle unsrt:)
(:bibliography BibPage=Bibliography :)

Pages:
Below is a list of related pages:
* [[Page 1]]
* [[Page 1]]
...
* [[Page N]]

Page1:
Bla bla bla  (:cite key-1 :) and ... (:cite key-2 :)

Page2:
Bla bla bla bal (:cite key-2 :) and ... (:cite key-1 :)

PageN:
...

Bibliography:
(:bibliographystyle unsrt :)
(:bibliography Site.BibliographyDatabase trail=Pages :)

Site.BibliographyDatabase:
(:if false:)
@Misc{key-1, ... }
@Misc{key-2, ... }
(:ifend:)
```

### 6.  Generate a bibliography from several wiki pages

I was thinking of a situation like this where I’ve got a collection of pages about cars:

• We have pages about cars (Volvo, Saab, Koenigsegg etc) and in these pages you refer to other sources for more information. There is not a bibliography at the end of each page.
• A page with a common bibliography for all the car pages (Bibliography)
• A page containing the bibliography database (BibliographyDb)

When the page Bibliography is rendered, it needs to know that it should check the car pages (Volvo, Saab, Koenigsegg) for the (:cite:)-markup in order to generate a suitable bibliography based on the information in the page BibliographyDb.

Here’s how the directives appear in the different pages (I’ve modified the syntax for (:bibliography:) for clarity):

```  Volvo:
(:cite VolvoURI :)

BibliographyDb:
@Misc{VolvoURI,
name = {Volvo},
URI = {http://volvo.se},
annote = {The URI for Volvo's main website}
}

Bibliography:
(:bibliographystyle unsrt:)
(:bibliography database=BibliographyDb page=Volvo page=Saab page=Koenigsseg :)
```

So here I’ve explicitly told (:bibliography:) where to find the database and which pages to scan. I guess using a trail is much more convenient, i.e. the page Bibliography could look like this:

```  Bibliography:
Bibliography for the following pages:
* [[Volvo]]
* [[Saab]]
* [[Koenigsegg]]

(:bibliographystyle unsrt:)
(:bibliography database=BibliographyDb trail={\$Name} :)
```

As an aside, maybe what we really want isn’t (:bibliography:), but something like (:bibliography-for-pages :) that accepts any parameters that (:pagelist:) does, and uses these to find the pages that should be included in the bibliography.

### 7.  Display of a citation

```  ... index.php?n=Group.BibTeXPage?ref=id?action=cite