Skip to content

A .Net library for working with bibtex files. Contains custom parser for reading bibtex files.

License

Notifications You must be signed in to change notification settings

MaikelH/BibtexLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BibtexLibrary

A .Net library for working with bibtex files. Contains custom parser for reading bibtex files.

Prerequisites

  • .NET framework 4 or higher

Build status

master: Build status

release:Build status

Usage

Currently only loading from a string is supported.

BibtexFile file = BibtexLibrary.BibtexImporter.FromString(@"@book{ aaker:1981a,
                                                                      author = {David A. Aaker},
                                                                      title = {Multivariate Analysis in Marketing},
                                                                      edition = {2},
                                                                      publisher = {The Scientific Press},
                                                                      year = {1981},
                                                                      address = {Palo Alto},
                                                                      topic = {multivariate-statistics;market-research;}
                                                                     }");

foreach (BibtexEntry entry in file.Entries)
{
    Console.WriteLine(entry.Tags["author"]);
}

The above code will print:

David A. Aaker

Grammar

The grammar that is used by the parser is as follows. It is not in perfect EBNF, but it should be usable.

BibtexFile 		= 	{ ([junk] @ (stringDef|entry) }
entry 			=	type openingbrace key comma {(tag[comma])} closingbrace
stringDef       =   [S|s]tring openingbrace tag closingbrace
tag				= 	text "=" (valuestart text valuestop) | text


type			=	text
key				= 	text

valuestart      =   openingbrace | valuequote
valuestop       =   closingbrace | valuequote

comma 			=	","
openingbrace	=	"{"
closingbrace	=	"}"
valuequote      =   """
text			= 	{ ([~'A-z0-9:.\s-()/\?&\\] | Comma) }
junk			=   .*

About

A .Net library for working with bibtex files. Contains custom parser for reading bibtex files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published