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 need a special Bibliography-Style, as prescribed for my thesis.

FOR BOOKS:
[1] Surname, Forename. (Year of publication). Title(italic). Publishing-place: Publisher.

FOR NEWSPAPERS:
[1] Surname, Forename. (Year of publication, publication-date). Title. Name of the Newspaper(italic), Page.

FOR WEBSITES:
[1] Surname, Forename. (Year of publication). Title(italic). URL, Today's Date.

I haven't found any template, so I think I have to create my own. I already created a custom bibliography-style with custom-bib. Now I have the file myoutput.bst. I've copied it in many places like ~/texmf/bibtex/bst/ or even /usr/share/texlive/texmf-dist/myoutput. But TeXmaker says: ! Package biblatex Error: Style 'myoutput' not found.

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[babel,german=swiss]{csquotes}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lmodern}
\title{title}
\usepackage[bibstyle=myoutput,backend=bibtex]{biblatex}
\bibliography{literaturverzeichnis}
\begin{document}
\include{kapitel/vorwort}

\section{Einleitung}


\printbibliography

\end{document}

I hope somebody can help me!


OK. moewe's post was very helpful, but here are some more problems:

  1. (important) The author name is like: "Firstname Surname". But it should be "Surname, Firstname".

SOLVED:

\AtBeginBibliography{%
  \DeclareNameAlias{default}{last-first}%
  }
  1. (less important) How do I get rid of that "URL:" ?

SOLVED:

\DeclareFieldFormat{url}{\space\url{#1}} 
  1. The Edition or in german "Auflage", is shortened to "Aufl." (like Ed. or something). How can I get the full word "Auflage"?

SOLVED:

\DefineBibliographyStrings{ngerman}{%
  edition = {Auflage}
}
  1. (important): After "Auflage" or "Aufl" (or in english Edition) I need a comma.

SOLVED:

\DeclareFieldFormat{edition}{#1\adddot\space\bibstring{edition}\addcomma\space}
  1. (important): Also I need to change the "besucht am 24.02.2006) to URL, 24.02.2006.

(SOLVED): (better/nicer inputs?)

\DeclareFieldFormat{urldate}{\addcomma\space#1}

thanks,


OK. It looks like I solved those problems by my own, still I don't know if this is the nicest solution. Any suggestions to optimize it?

Where does these commands come in, when I don't want them in my Master.tex? (I mean bibtex.cfg, etc.) At the moment, I have them in a seperate tex file, which I include with \include{bib_mod}

One last question: How can I split up multiple authors in commas and only the last one has a "and" Lastname, Surname, Lastname2, Surname2 and Lastname3, Surname3 [...] For better understanding: If there is only one author, display normally:

Lastname, Surname

If there are two authors, just use a comma no "and":

Lastname, Surname, Lastname2, Surname2

If there are more than three authors, use "and" only at the last position:

Lastname, Surname, Lastname2, Surname2 and Lastname3, Surname3

thanks,

share|improve this question
7  
Welcome to TeX.SX! You cannot use .bst files created by custom-bib (or in any other way, for that matter) in biblatex; biblatex works with .bbx, .cbx and .lbx files, so you will have to modify these. –  moewe Oct 8 '13 at 20:09
1  
As to where to put these modifications: if you put them in biblatex.cfg in your working directory they will only influence bibliographies/citations constructed in that directory, which is probably what you want. If you want to intervene in all files you personally build (which is probably not the case, since you are likely to need to use different styles from time to time), you can put them in a 'user-level' location, such as (on GNU/Linux, e.g.) ~/texmf/tex/latex/biblatex/. –  jon Oct 9 '13 at 14:59
1  
Also: nowadays it is better to use \addbibresource{literaturverzeichnis.bib} instead of \bibliography{literaturverzeichnis} (because biber+biblatex have the potential to use other data models now). –  jon Oct 9 '13 at 15:01
    
The modifications can be put in a local biblatex.cfg as suggested by jon (I also agree that a global redefinition via the shared biblatex.cfg is probably not the best option). Your idea of putting the modifications in a separate file and \including said file if needed seems quite smart as well. –  moewe Oct 9 '13 at 18:19
    
I used the command \input{bib_mod} instead of \include{bib_mod}. I read somewhere about the difference, I hope that's alright. –  Severin Oct 10 '13 at 10:04

2 Answers 2

use

[...]
\title{title}
%\usepackage[bibstyle=myoutput,backend=bibtex]{biblatex}
%\bibliography{literaturverzeichnis}
\begin{document}
\include{kapitel/vorwort}

\section{Einleitung}

%\printbibliography
\bibliographystyle{myoutput}
\bibliography{literaturverzeichnis}

\end{document}

and run bibtex as usual. For a first test put the .bst file into the documents directory

share|improve this answer
    
Thank you for your answer. Unfortunately biber isnt't working correctly with my installation. I've no clue why. It just shows no output. When I set "backend=bibtex" it works. The .bst file is in the documents directory and it's still not working. But I think moewe gave a pretty good input. –  Severin Oct 9 '13 at 13:07
    
with biber you cannot use the .bst file because biber works only with biblatex which has its own style files. So using bibtex or better bibtex8 is the correct way when you want to use a .bst style file –  Herbert Oct 9 '13 at 13:34
    
@Severin What exactly is not working with Biber? Do you have Biber installed on your system? How do you compile your documents (if you use some automated way, you might not even call Biber)? –  moewe Oct 9 '13 at 18:15
    
If I user backend=biber, no Bibliography will be generated. But I think now it's pretty clear - I think I haven't installed biber :). I'm using Fedora 19 and I thought it's included in the texlive package (it's not avaible from the official repos at all), but I can't run biber from the commandline. But at the moment everything runs fine, so I'll stick to biblatex. –  Severin Oct 10 '13 at 20:50

biblatex does not work with .bst files, but with .bbx (bibliography style), .cbx (citation style), .dbx (data model) and .lbx (localisation) files. Modifying these files is very easy as the syntax is slightly more intuitive than that of the .bst files (in my opinion at least). On the downside, you cannot use .bst files created by custom-bib or any other source.

In case you want to stick with biblatex, call biblatex via \usepackage[backend=biber, style=numeric]{biblatex} or \usepackage[backend=bibtex, style=numeric]{biblatex} and put the following modifications into your preamble.

They are largely borrowed from authoryear.bbx, but, in our case, extend numeric.bbx. The dates are displayed as with mergedate=compact (for more on mergedate have a look at the authoryear style example).

% this is from bbx@opt@mergedate@compact
\renewbibmacro*{date+extrayear}{%
  \iffieldundef{year}%<--- no labelyear, just plain year
    {}
    {\printtext[parens]{\printdate}}}%<--- so no extra stuff here
\renewbibmacro*{date}{}%
\renewbibmacro*{issue+date}{%
  \iffieldundef{issue}
    {}
    {\printtext[parens]{\printfield{issue}}}%
  \newunit}%

% this is from authoryear.bbx ...
% ... but all hash/dash fun has been removed and the entry is finished by `\newunit` (normally a dot) not a space  
\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\printnames{author}%
     \iffieldundef{authortype}
      {\newunit}
      {\setunit{\addcomma\space}}%
       \iffieldundef{authortype}
         {}
         {\usebibmacro{authorstrg}%
          \newunit}}%
    {\usebibmacro{labeltitle}%
     \newunit*}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{editor}{%
  \usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
  \usebibmacro{bbx:editor}{editor+othersstrg}}
\newbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{#1}%
     \clearname{editor}%
     \newunit}%
    {\usebibmacro{labeltitle}%
     \newunit*}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{translator}{%
  \usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
  \usebibmacro{bbx:translator}{translator+othersstrg}}
\newbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }
    {\printnames{translator}%
     \setunit{\addcomma\space}%
     \usebibmacro{translator+othersstrg}%
     \clearname{translator}%
     \newunit}%
    {\usebibmacro{labeltitle}%
     \newunit*}%
  \usebibmacro{date+extrayear}}

\newbibmacro*{labeltitle}{%
  \iffieldundef{label}
    {\iffieldundef{shorttitle}
       {\printfield{title}%
        \clearfield{title}}
       {\printfield[title]{shorttitle}}}
    {\printfield{label}}}

Your additional redefinitions look good to me though I would use the following

\DeclareNameAlias{default}{last-first}
\DeclareFieldFormat{url}{\url{#1}}
\DefineBibliographyStrings{ngerman}{%
  edition = {Auflage}
}
\DeclareFieldFormat{edition}{%
  \ifinteger{#1}
    {\mkbibordedition{#1}~\bibstring{edition}}
    {#1\isdot}
    \addcomma\space}
\DeclareFieldFormat{urldate}{\addcomma\space#1}
  • With a numeric citation style there is no need for \AtBeginBibliography to change name formats, in my opinion - indeed I think it is never a good idea to change the name format for the bibliography only and leave a different format for citations.
  • Your url field format contained a superfluous \space (I don't think it did any harm, but biblatex can take care of spacing on its own).
  • When redefining edition (quite a clever way to get what you want, I might add; no fiddling around with any \setunits) it might be beneficial to copy the original definition and just append \addcomma\space.

As to your last question: With ngerman I do get the behaviour you want (see [4] in the example below); if you always want to see all authors in the bibliography (by default biblatex truncates list of more than three authors such as Irst, Ferdinand and Cond, Stuart E. and Hird, Timothy and Ourth, Fiona to Irst, Ferdinand et al., compare [5] in the MWE), maxbibnames=999 (or any ludicrously large value) might be for you.

A short MWE

\documentclass[ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex, style=numeric]{biblatex}
\usepackage{hyperref}

\addbibresource{biblatex-examples.bib}

\renewbibmacro*{date+extrayear}{%
  \iffieldundef{year}
    {}
    {\printtext[parens]{\printdate}}}%
\renewbibmacro*{date}{}%
\renewbibmacro*{issue+date}{%
  \iffieldundef{issue}
    {}
    {\printtext[parens]{\printfield{issue}}}%
  \newunit}%

\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\printnames{author}%
     \iffieldundef{authortype}
      {\newunit}
      {\setunit{\addcomma\space}}%
       \iffieldundef{authortype}
         {}
         {\usebibmacro{authorstrg}%
          \newunit}}%
    {\usebibmacro{labeltitle}%
     \newunit*}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{editor}{%
  \usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
  \usebibmacro{bbx:editor}{editor+othersstrg}}
\newbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{#1}%
     \clearname{editor}%
     \newunit}%
    {\usebibmacro{labeltitle}%
     \newunit*}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{translator}{%
  \usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
  \usebibmacro{bbx:translator}{translator+othersstrg}}
\newbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }
    {\printnames{translator}%
     \setunit{\addcomma\space}%
     \usebibmacro{translator+othersstrg}%
     \clearname{translator}%
     \newunit}%
    {\usebibmacro{labeltitle}%
     \newunit*}%
  \usebibmacro{date+extrayear}}

\newbibmacro*{labeltitle}{%
  \iffieldundef{label}
    {\iffieldundef{shorttitle}
       {\printfield{title}%
        \clearfield{title}}
       {\printfield[title]{shorttitle}}}
    {\printfield{label}}}

\DeclareNameAlias{default}{last-first}
\DeclareFieldFormat{url}{\url{#1}}
\DefineBibliographyStrings{ngerman}{%
  edition = {Auflage}
}
\DeclareFieldFormat{edition}{%
  \ifinteger{#1}
    {\mkbibordedition{#1}~\bibstring{edition}}
    {#1\isdot}
    \addcomma\space}
\DeclareFieldFormat{urldate}{\addcomma\space#1}

\begin{document}
  \cite{vangennep,piccato,wilde,angenendt,baez/article,baez/online,iliad,vizedom:related,herrmann,markey,yoon,companion}

  \printbibliography
\end{document}

gives us enter image description here

share|improve this answer
    
Thank you! Looks like it's working pretty well. But I got some "problems", I'm trying to solve. 1. (important) The author name is like: "Firstname Surname". But it should be "Surname, Firstname". 2. (less important) How do I get rid of that "URL:" ? 3. The Edition or in german "Auflage", is shortened to "Aufl." (like Ed. or something). How can I get the full word "Auflage"? –  Severin Oct 9 '13 at 13:01
    
4. (important): After "Auflage" or "Aufl" (or in english Edition) I need a comma. –  Severin Oct 9 '13 at 13:13
    
5. (important): Also I need to change the "besucht am 24.02.2006) to URL, 24.02.2006. –  Severin Oct 9 '13 at 13:18
    
@Severin You might want to have a look at the edited version of my answer. –  moewe Oct 9 '13 at 18:13
    
Thank you very much for your optimization! It works like a charm :) –  Severin Oct 10 '13 at 10:02

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.