# Bib Formatting Question

so I've been trying to build a framework for my bibliography, for later use. However I fail at formatting internet sources.

Here is what they should look like:

This is what it does look like:

So basically the following elements are wrong: - title must not be italic (probably because titles in the source "book" are supposed to be italic and online and article titles shouldn't (it does work for articles, meaning article titles are already shown as plain and not italic, but it does not work for online sources.)

• institution/organisation must be in small caps
• website title must be italic (is not shown at all in my case)
• the URL should not precede with "URL:"
• instead of saying "besucht am" it should state "letzter Abruf:"

Furthermore I figured, that in one case the online source entry is not formatted correctly at all and crossing the page borders.

Retry:

    \documentclass[12pt,a4paper,headings=standardclasses,numbers=noenddot]{scrreprt}
\usepackage{showframe}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}

\usepackage[
backend=biber,
style=authoryear,
sorting=nyvt
]{biblatex}
\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\usepackage{url}
\urlstyle{same}

\begin{document}
\end{document}

• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Also the bibtex entry would be useful. – albert Oct 30 '18 at 18:51
• thank you! I was indeed to hasty here and forgot to attach details :) – user168390 Oct 30 '18 at 18:54
• It would really help if you could show us a short example document with a few example entries that reproduces your screenshot (or something similar), the example you just added contains too much code and too many references to files we don't have to be useful. The URL in the example runs into the margin because LaTeX can find no good way to break the URL, have a look at tex.stackexchange.com/q/134191/35864, tex.stackexchange.com/q/3033/35864 and tex.stackexchange.com/q/442308/35864 for help with URL and line breaks in the bibliography in general. – moewe Oct 30 '18 at 18:58
• sorry, I was not aware what might be helpful information. tried to reduce the example :) – user168390 Oct 30 '18 at 19:05
• Since you are using Overleaf: A good way to test if your code example in the question is useful is to open a new project with only the files in the question. If it compiles and shows the issue it is on the way to being useful. If it does not compile because files are missing or does not show the issue, the example is not optimal yet and should be improved. (I see you shortened your example a bit. If you try to run that in a new project you will see that you cut out just a tiny bit too much.) – moewe Oct 30 '18 at 19:07

As discussed in Omit Vol and Issue/No? we are following the guidelines of the IOA Bonn https://www.ioa.uni-bonn.de/de/studium/materialien/formalregeln_ioa.pdf.

The guidelines for @online sources can be found in §10.2.12 Artikel aus dem Internet. There is an inconsistency between the explanatory text and the example: The page numbers (which I would say are not needed anyway: the exact location will be pinpointed in the citation) are shown before editor and page title in the example, but the explanatory text places them after that...

By default biblatex does not support a overall website/webpage title for @online, but we can use maintitle for that. If we then tweak the output of the "editor" a bit, we can get

\documentclass[ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[
backend=biber,
style=authoryear,
sorting=nyvt
]{biblatex}

\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}

\DeclareFieldFormat[online]{title}{#1}

\urlstyle{same}
\DeclareFieldFormat{url}{\url{#1}}
\DefineBibliographyStrings{german}{
urlseen = {letzter Abruf},
}

\newbibmacro{online:editor+maintitle}{%
\printnames{editor}%
\usebibmacro{maintitle}%
}

\usepackage{xpatch}

\xpatchbibdriver{online}
{\usebibmacro{byeditor+others}}
{\usebibmacro{online:editor+maintitle}}
{}{}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{fluechter,
author    = {Flüchter, Winfried},
date      = {1997},
title     = {Tokyo  quo  vadis?  Chancen  und  Grenzen  (?)  metropolitanen Wachstums},
pages     = {1-39},
editor    = {{Universität Duisburg-Essen}},
maintitle = {DuEPublico},
url       = {https://duepublico.uni-duisburg-essen.de/servlets/DerivateServlet/Derivate-5290/dao1598.pdf},
urldate   = {2018-10-23},
}
\end{filecontents}

\begin{document}
\cite{fluechter}
\printbibliography
\end{document}


In the question you also complained about the URLs running into the margin. URLs are a huge challenge for LaTeX because they don't behave like normal words (which the hyphenation algorithm can deal with), so line breaks in URLs are complicated beasts. By default only breaks after certain "punctuation" characters like ., /, : are allowed. There are approaches to solve these issues, but since line breaking is such a delicate task it could well be that answers that worked great for other people don't seem to work for you.

As already explained, LaTeX allows breaks in URLs only after a small set of characters. You can tell it to allow breaks after other characters (like letters or numbers) as well. See Line breaks of long URLs in biblatex bibliography? for example. Keep in mind, however, that LaTeX does not break the URLs at morpheme boundaries or hyphenation points of the words a human can make out in the URL, it will just blindly break the URL where it makes sense for the line length. So you may well end up with

https://www.eas-
tasiaonline.com


or other unfortunate break points if you allow line breaks after all letters.

Similar approaches are explained in Forcing linebreaks in \url, but Line breaks of long URLs in biblatex bibliography? offers a finer control over things and was written specifically for biblatex.

It may turn out that it is just too hard to properly break the URL in a reference and in that case you can look at How to adjust the breaking in the bibliography? for different approaches to improve line breaks in the bibliography. Since the bibliography does not contain running prose, finding good hyphenation and break points is a challenge and you may bail out of that by telling LaTeX to set the bibliography left aligned (ragged right) instead of fully justified (aligned on both margins).

As mentioned in the comments, we can only offer concrete help for a URL breaking problem if we get to see code that reproduces the exact issue. Otherwise we have to point to the generic solutions I outlined here.

• Thanks everyone, I finally managed to reduce the size of the example and it can be found and edited here :) overleaf.com/1938584783fqdhfcjzkqst – user168390 Nov 5 '18 at 20:18
• @user168390 That page asks for a login (which I don't have), so I can't access the example. If the example is small I suggest you include it in your question. – moewe Nov 5 '18 at 20:20
• I might have sent a wrong a url - sorry! this one should work overleaf.com/read/dvtrpzgfqghn – user168390 Nov 6 '18 at 17:10
• @user168390 Ah yes, that one works. I lost track of the issues a bit, sorry. What exactly am I looking for? – moewe Nov 6 '18 at 17:20
• thank you! i just figured there was a new comment, which fixed my issues. thank you for your help! – user168390 Nov 6 '18 at 18:53