2

I have problems customizing my own biblatex style. It should look like that:

screenshot of desired output, a proper description follows below

I tried it over the weekend after reading manual and post. I thought that it would be easier to customize an already existing style (in my example the authortitle style) but maybe it would be easier to create a new one. But I only get errors and I'm quite under time pressure with the deadline so I hope someone can help me out.

EDIT: Things that need to be changed:

Generally:

  1. date format: dd.mm.yyyy.

Article:

  1. remove "In:"
  2. title of journal, year, issue number, (all in italics) page number.

Oral(Interview):

  1. show interviewer
  2. add before interviewer's name: Interview: [interviewer's name]
  3. date, address.

Electronic:

  1. title in quotations mark and not in italics
  2. Remove "URL:"
  3. Remove brackets around "last visited at"
  4. show institution

I add a MWE and one of my many approaches to customize the authortitle style (the approach will be quite useless).

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[style=authortitle]{biblatex}
\usepackage[ngerman]{babel}

\usepackage{filecontents}

\begin{filecontents}{test.bib}
@article{article,
    author  = {Peter Adams}, 
    title   = {The title of the work},
    journal = {The name of the journal},
    year    = 1993,
    number  = 2,
    pages   = {201-213},
}

@book{book,
    author    = {Peter Babington}, 
    title     = {The title of the work},
    address = {Berlin},
    year      = 1993,
}

@Oral{dean,
  author      = {Dean Rusk},
  interviewer = {David O'Brian},
  date        = {21.08.1970},
  year        = {1970},
  address     = {Boston},
}

@Electronic{pan,
  author      = Phlip Pan
  institution = {The New York Times},
  date        = {118.11.2018},
  year        = {2016},
  title       = {The West was sure the Chinese approach would not work. It 
   just had to wait. It's still waiting.},
  url         = 
  {https://www.nytimes.com/interactive/2018/11/18/world/asia/china- 
  rules.html},
  urldate     = {18.11.2018},
}
\end{filecontents}

\addbibresource{test.bib}

\begin{document}
Some famous linguists wrote a couple of books  \cite{article} \cite{book} 


\printbibliography
\end{document}
  • 1
    Welcome to TeX SX! I think to it's easier to customise an existing style. What are the differences with the authortitle style? – Bernard Nov 18 '18 at 16:08
  • 1
    Also, please consider asking several questions each about a particular aspect of your style. Writing a complete style can be a huge task and is generally too much to ask for in one question (that does not mean you won't get an answer, though). Can you at least list the required changes for your style that need to be applied assuming we start from a standard style=authortitle? – moewe Nov 18 '18 at 16:27
  • I hope now it's clearer what I mean. – glp Nov 18 '18 at 17:08
  • Thank you for editing your question. I still think that your chances of getting useful help quickly would increase if you were to split your question into several sub-questions, each about one particular issue. People sometimes feel that they should not be asking too many questions, but questions are free. And if you do a bit of research you may find the answer to one or two of the items already. Also please make sure that your MWE actually has the .bib entries to reproduce the screenshot. There is currently no @online and no interview entry. – moewe Nov 18 '18 at 17:18
  • 1
    I wrote about why it makes sense to split questions up into several smaller ones in tex.meta.stackexchange.com/q/7425/35864. You do have a lot of questions, so it makes sense to chunk them a bit (I'm not sure if there is a question limit, especially if many questions turn out to be duplicates), but one question which practically just says: Please write this style is hard to answer and less useful for future visitors. – moewe Nov 18 '18 at 17:25
1

Questions asking to implement an entire style are always a bit hard to answer and take a lot of time, it is usually a much better idea to ask about specific features of the style. The compartmentalised nature of biblatex styles usually allows for an easy combination of answers (and should that not be the case it is always possible to ask a new follow-up question about combining two answers). In the last couple of days there was a series of questions that seemed to work towards building the style shown here, so I thought I'd collect the answers here to make sure this question has an answer.

Firstly, there are a few syntax errors in your .bib file. Dates in date fields must be given in ISO 8601/EDTF format (yyyy-mm-dd), so urldate = {18.11.2018}, is wrong, it should be urldate = {2018-11-18}, instead. That should immediately solve the date issue. Though you may want to use the option dateabbrev=false.

Furthermore, there was an issue with the author field in pan, it must be author = {Phlip Pan},.

You should also not give both a year and a date field. date alone should be enough.

We end up with

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{article,
  author  = {Peter Adams}, 
  title   = {The title of the work},
  journal = {The name of the journal},
  year    = 1993,
  number  = 2,
  pages   = {201-213},
}
@book{book,
  author    = {Peter Babington}, 
  title     = {The title of the work},
  address   = {Berlin},
  year      = 1993,
}
@interview{dean,
  interviewee = {Dean Rusk},
  interviewer = {David O'Brian},
  date        = {1970-08-21},
  address     = {Boston},
}
@online{pan,
  author       = {Phlip Pan},
  organization = {The New York Times},
  date         = {2018-11-18},
  title        = {The West was sure the Chinese approach would not work.
                  It just had to wait. It's still waiting.},
  url          = {https://www.nytimes.com/interactive/2018/11/18/world/asia/china-rules.html},
  urldate      = {2018-11-18},
}
\end{filecontents}
\begin{filecontents}{interview.dbx}
\DeclareDatamodelEntrytypes{interview}
\DeclareDatamodelFields[type=list,datatype=name]{
  interviewer,
  interviewee,
}

\DeclareDatamodelEntryfields[interview]{
  addendum,
  doi,
  eprint,
  eprintclass,
  eprinttype,
  interviewer,
  interviewee,
  location,
  note,
  pubstate,
}
\end{filecontents}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[german=swiss]{csquotes}
\usepackage[backend=biber, datamodel=interview, style=authortitle, dateabbrev=false]{biblatex}

% https://tex.stackexchange.com/q/10682/35864
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

\DeclareFieldFormat[article,periodical]{date}{\mkbibemph{#1}}
\DeclareFieldFormat[article,periodical]{volume}{\mkbibemph{#1}}
\DeclareFieldFormat[article,periodical]{number}{\mkbibemph{#1}}
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addcomma\space}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addcomma\space}}%
  \usebibmacro{date}%
  \setunit{\addcomma\space}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

\DeclareFieldFormat[article,periodical]{pages}{#1}

% https://tex.stackexchange.com/q/464756/35864
\NewBibliographyString{interview}
\DefineBibliographyStrings{german}{%
  interview   = {Interview},
}

\DeclareNameAlias{interviewee}{author}

\DeclareBibliographyDriver{interview}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \printnames{interviewee}%
  \newunit\newblock
  \bibstring{interview}%
  \setunit{\addspace}%
  \printnames{interviewer}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{location+date}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\DeclareSortingTemplate{nty}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{interviewee}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{sortyear}
    \field{year}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}

\DeclareLabelname{%
  \field{shortauthor}
  \field{author}
  \field{shorteditor}
  \field{editor}
  \field{translator}
  \field{interviewee}
}

\renewbibmacro*{cite:title}{%
  \printtext[bibhyperref]{%
    \ifentrytype{interview}
      {\bibstring{interview}%
       \setunit{\addspace}%
       \printnames[family]{interviewer}}
      {\printfield[citetitle]{labeltitle}}}}


% https://tex.stackexchange.com/q/464205/35864
\DefineBibliographyStrings{english}{
  urlseen = {visited at} 
} 



\DeclareFieldFormat[online]{title}{\mkbibquote{#1\isdot}}
\DeclareListWrapperFormat{organization}{\mkbibemph{#1}}

\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}

% https://tex.stackexchange.com/q/464383/35864
\renewbibmacro*{url+urldate}{%
  \usebibmacro{url}%
  \iffieldundef{urlyear}
    {}
    {\setunit*{\newunitpunct}%
     \usebibmacro{urldate}}}

\DeclareBibliographyDriver{online}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \newunit\newblock
  \printlist{organization}%
  \newunit\newblock
  \usebibmacro{date}%
  \newunit\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit
  \printfield{note}%
  \newunit\newblock
  \iftoggle{bbx:eprint}
    {\usebibmacro{eprint}}
    {}%
  \newunit\newblock
  \usebibmacro{url+urldate}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}




\addbibresource{\jobname.bib}

\begin{document}
Lorem  \cite{article} ipsum \cite{book,dean,pan} 
\printbibliography
\end{document}

Adams, Peter. «The title of the work». The name of the journal, 1993, 2, 201–213.//Babington, Peter. The title of the work. Berlin, 1993.//Pan, Phlip. The New York Times. 18. November 2018. «The West was sure the Chinese approach would not work. It just had to wait. It’s still waiting.» https://www.nytimes.com/interactive/2018/11/18/world/asia/china-rules.html. Besucht am 18.11.2018.//Rusk, Dean. Interview David O’Brian. Boston, 21. August 1970.

A few details may be missing, but this should capture the overall feel of the style.

  • Generous old moewe! I hope Santa takes that into account this year. :-) – gusbrs Dec 15 '18 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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