Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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).

share|improve this question
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). –  Mikael Öhman Aug 5 '11 at 21:27
1  
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 Aug 6 '11 at 4:25
    
Okay thanks, I'll look into it. I think I use it, but I dunno exactly right now Oo –  tim Aug 6 '11 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 Aug 6 '11 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? –  Mikael Öhman Aug 6 '11 at 14:40
show 1 more comment

3 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
    
+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 Sep 4 '11 at 18:44
1  
@Audrey: I'd rather answer good questions than delve into guessing games. :-) –  lockstep Sep 4 '11 at 18:45
add comment

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

share|improve this answer
    
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 Aug 5 '11 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 Aug 5 '11 at 21:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.