Sign up ×
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

3 Answers 3

up vote 2 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

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

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

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.
http://tex.stackexchange.com/questions/25007/bibtex-defining-own-styles?answertab=oldest
tex.stackexchange.com
crawl=CC-MAIN-2015-40
91486
application/http; msgtype=response
sha1:7HZD22K6BJORFPXWIRHWB7LMS3Z3DZ4X
<urn:uuid:51bf3153-d4e6-4978-ac61-1a1fe48ec286>
2015-10-05T08:49:54Z
104.16.13.128
sha1:MGJWIHI726PSTYC7SSF6AEGOMCYDL2WU
<urn:uuid:a9e1cffa-7baa-4e3b-bc82-f3253a4bcd57>
http://tex.stackexchange.com/questions/25007/bibtex-defining-own-styles?answertab=oldest
length
response
<urn:uuid:fa37ea2b-5442-47ff-8309-92e3d0e84251>
robots: classic
hostname: ip-10-137-6-227.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2015-40
operator: CommonCrawl Admin
description: Wide crawl of the web for September 2015
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf