14

I'm using LaTeX with BibTeX to display the literature of my thesis. We have to adapt our work to several custom 'styles' from the university. That's why I want to somehow define my own styles: For each entry type the given style can be different and further, the displaying in the bibliography and in a cite is different. I don't know if it's quite 'easy' to define my own styles in BibTeX so that I could 'invent' new entry types, let's say

entryTypeA
entryTypeB
entryTypeC

and than define the style of each how to display it in the bibliography and how when citing it with \cite{} and how when citing it with \footcite{}, etc.? Something like

entryTypeA:
bibliography="@Autor, @Title in year @Year, @Publisher"
cite="@Autor, @Year"

entryTypeB:
bibliography="@Autor, @Year, @Title, @Address"
cite="@Autor: @Title"

etc. (just examples).

6
  • 2
    Are you using biblatex (as the tag indicates?). If so, then you should define your own cite style or bibliography style using DeclareCiteCommand and DeclareBibliographyDriver directly in latex (as opposed to messing around with *.bst files). Commented Aug 5, 2011 at 21:27
  • 2
    And if you are not using biblatex, consider switching to it. It allows to define bibliography styles inside of LaTeX. Section 4.2 and 4.3 of the manual describe how this is done.
    – Caramdir
    Commented Aug 6, 2011 at 4:25
  • Okay thanks, I'll look into it. I think I use it, but I dunno exactly right now Oo
    – tim
    Commented Aug 6, 2011 at 10:28
  • Okay I currently use \usepackage[style=authortitle-dw]{biblatex} [...] \bibliography{mybib} [...] \printbibliography. How to it best with the Declare commands? Do you want to post a full comment about this and describe how to fully adapt it? Thanks!
    – tim
    Commented Aug 6, 2011 at 14:01
  • What determines if it should be rendered as A, B or C type? Do you mean entry type as in actual type (book, article, manual, homepage..)? If not, what determines which type an entry is? Commented Aug 6, 2011 at 14:40

3 Answers 3

6

The type of implementation that the OP is looking for closely matches that of the new Bibulous project. With Bibulous, customized styles are implemented with templates, so that for book and manual entry types, one can define bibliography styles with, for example,

book = <author>, \enquote{<title>,} in <year>, <publisher>.
manual = <author>, <year>, \enquote{<title,}[, <address>].

where I've tried to match the style to the OP's suggestion. Each field in the database file is referenced with the <.> notation inside the template. Then, if one wishes to create customized citation labels, one can use

citelabel = <author>, <year>

or

citelabel = <author>: <title>

These definitions are placed into Bibulous' style template (BST) file. Many other customizations are available, as listed in the project documentation.

10

I'm not sure if I understand your problem, but maybe my question/answer Guidelines for customizing biblatex styles is helpful for starters. There are a number of users at tex.sx who'll be glad to answer focussed questions about biblatex.

2
  • +1 Bibliography drivers are already type-specific and that would have been obvious to anyone following Caramdir's advice. Maybe he was looking for something like \ifentrytype for defining citation commands? Hard to say without a concrete example, though.
    – Audrey
    Commented Sep 4, 2011 at 18:44
  • 1
    @Audrey: I'd rather answer good questions than delve into guessing games. :-)
    – lockstep
    Commented Sep 4, 2011 at 18:45
5

You'd probably have to create your own .bst. This PracTeX article contains links to a few resources describing the postfix stack language bst files are written in, including btxhak (available on CTAN) and Tame the BeaST.

The document "Tame the BeaST" is available on TeX Live by texdoc tamethebeast or at TeXdoc.net

2
  • And how about another approach in latex itself: Is there any latex command to only fetch a single information for a bibliography entry, like author, year, title or something? If so, than I could write my own cite command which displays the cite depending on the entryType, which I could write into the address-field of bibtex (which I never use anyway) -> Some simple if statements... only the bibliography wouldn't adapt with this approach...!? what do you think? dunno how hard it is to write my own .bst files :( but will check your links now, thanks!
    – tim
    Commented Aug 5, 2011 at 21:12
  • @Marc: No, AFAIK there is no such command. The harvard package does something like that, but by defining a command that saves this information in the aux file, IIRC. This is done partly by the bst file. If you need extra fields, it's probably better to extend the bst file than use one of the existing fields in a hacky way.
    – You
    Commented Aug 5, 2011 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .