Working with Bibliography

Working with Bibliography

Working with Bibliography

Word’s citation and bibliography feature stores its source data separately from the fields that render it. Aspose.Words FOSS for .NET models that source data through the Aspose.Words.Bibliography namespace – Source, Contributor, Person, and Corporate – reachable from Document.Bibliography. This page covers building and reading that data; the CITATION and BIBLIOGRAPHY fields that render it are covered in the links and references guide.


The Bibliography Data Model

Document.Bibliography is a Bibliography instance with BibliographyStyle – the citation style name (for example APA or MLA) that should be applied when a BIBLIOGRAPHY field is updated – and Sources, an IList<Source> holding every source record available to the document.


Source Records

Source is constructed with Source(tag, sourceType), where Tag is the short identifier that FieldCitation.SourceTag and FieldBibliography.SourceTag match against, and SourceType is an enum identifying the kind of source – values include Book, BookSection, JournalArticle, ArticleInAPeriodical, ConferenceProceedings, Report, Patent, Case, InternetSite, DocumentFromInternetSite, Interview, Film, SoundRecording, Performance, Art, Electronic, and Misc. Source.Type separately holds the source type as a plain string. Beyond Title and ShortTitle, Source exposes dozens of category-specific fields as needed for the chosen SourceType – book fields (BookTitle, Edition, NumberVolumes, Volume, Pages, ChapterNumber), periodical fields (JournalName, PeriodicalTitle, PublicationTitle, Issue), web fields (InternetSiteTitle, Url, DayAccessed, MonthAccessed, YearAccessed), legal fields (CaseNumber, AbbreviatedCaseNumber, Court, Reporter), recording and broadcast fields (AlbumTitle, Broadcaster, BroadcastTitle, RecordingNumber, Medium, ProductionCompany, Distributor, Station, Theater), PatentNumber, StandardNumber, thesis fields (ThesisType, Institution, Department), and general fields (Publisher, City, StateOrProvince, CountryOrRegion, Year, Month, Day, Comments, Guid, Doi, Version, RefOrder, Lcid).


Contributors

Source.Contributors is a ContributorCollection with one property per contributor role – Author, Editor, Translator, Compiler, Composer, Conductor, Counsel, Director, Interviewee, Interviewer, Inventor, Performer, Producer, Writer, Artist, and BookAuthor – each typed as Contributor, the common base for the two kinds of contributor described below.


Individual vs. Corporate Contributors

Contributor is implemented by two classes: Person (First, Middle, Last) for a single individual, and Corporate (Name) for an organization. PersonCollection also derives from Contributor and implements IEnumerable<Person> (Add, Remove, RemoveAt, Clear, Contains, Count), so a contributor role that has multiple individual authors can be assigned a PersonCollection just as readily as a role with a single author is assigned a Person – both, along with Corporate, satisfy the same Contributor-typed role property.


Rendering Bibliography Content

Source records only supply data – they do not render citation or bibliography text themselves. That happens through FieldCitation and FieldBibliography, which look up a Source by matching SourceTag against Source.Tag. See the links and references guide for those field classes.


Tips and Best Practices

  • Give every Source a unique Tag – it’s the only value FieldCitation.SourceTag and FieldBibliography.SourceTag use to find the right record.
  • Populate only the Source fields relevant to its SourceType – a Book source has no use for Broadcaster or CaseNumber, for example, but the class does not enforce this for you.
  • Use Person for a single named contributor, PersonCollection for multiple individuals in the same role, and Corporate when the contributor is an organization rather than a person – assign whichever fits to the matching ContributorCollection role property.
  • Bibliography.BibliographyStyle records which citation style name to apply; keep it consistent with how your FieldCitation fields expect their output formatted.
  • Add every Source to Document.Bibliography.Sources before updating CITATION or BIBLIOGRAPHY fields that reference it – a missing source means the referencing field has nothing to resolve to.

Common Issues

IssueCauseFix
CITATION or BIBLIOGRAPHY field doesn’t resolveThe Source.Tag doesn’t exactly match the field’s SourceTagConfirm the tags match, and that the Source was added to Document.Bibliography.Sources
Wrong contributor type assigned to a roleA Person was assigned where multiple contributors exist, or vice versaUse PersonCollection for multiple individuals in one role, Person for a single individual, Corporate for an organization
Source fields look inconsistent for its typeFields for a different SourceType were populated (for example web fields on a Book source)Populate only the fields relevant to the chosen SourceType

FAQ

How do I add a book source with a single author?

Create a Source with SourceType.Book, set BookTitle, Publisher, Year, and related fields, then assign a Person to Source.Contributors.Author.

How do I add a source with multiple authors?

Assign a PersonCollection (populated with Person instances via Add()) to the relevant ContributorCollection role property, such as Author.

How do I cite an organization instead of an individual?

Assign a Corporate instance (constructed with the organization’s Name) to the ContributorCollection role property instead of a Person or PersonCollection.

Where do Source records actually appear in the rendered document?

They don’t render on their own – FieldCitation and FieldBibliography fields render content built from them, matched by SourceTag. See the links and references guide.


API Reference Summary

Class / EnumDescription
BibliographyBibliography data root, via Document.Bibliography; BibliographyStyle, Sources
SourceAn individual citation source; dozens of category-specific fields plus Contributors
SourceTypeEnum of source kinds: Book, JournalArticle, InternetSite, Patent, Case, and more
ContributorCollectionPer-role contributor properties (Author, Editor, Translator, and others) on a Source
ContributorCommon base for Person, PersonCollection, and Corporate
Person / PersonCollectionA single individual contributor, or a collection of them
CorporateAn organization acting as a contributor

See Also