# set “In:” in front of journaltitle

sorry for all the questions, your help was amazing so far!

I have yet another question. I want journal titles in articles to be preceded by

In:

just like in collections (example of incollection below)

current article: In front of the Asahi should be an

In:

I am a bit at a loss how to achieve this. Thank you in advance and have a nice evening! :)

new issue of inconsistent (Hg.)

-- Edit: I hope that's an okay example :) The parts after Hg now lack some spaces for some reason :<

\documentclass{scrreprt}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
%----------------------------------------------------------------------------
%   BIB
%----------------------------------------------------------------------------
\usepackage[
backend=biber,
style=authoryear,
sorting=nyvt
]{biblatex}
\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}

% sets Hg
\renewbibmacro*{in:}{%
\printtext{%
\bibstring{in}\intitlepunct}%
\ifentrytype{incollection}
{\DeclareNameAlias{editor}{last-first}%
\ifnameundef{editor}
{}
{\printnames{editor}%
\setunit{\printunit{editortypedelim}}%
\usebibmacro{editorstrg}%
\usebibmacro{maintitle+booktitle}%
\clearfield{maintitle}%
\clearfield{booktitle}%
\clearfield{volume}%
\clearfield{part}%
\clearname{editor}}
{}}

% Use Hg. in parentheses after editor
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DefineBibliographyStrings{german}{%
andothers = {et\ al\adddot}, %et al. statt u.a.
editor = {{Hg\adddot}}, %Hg. statt Hrsg.
editors = {{Hgg\adddot}}, %Hgg. plural
}

\begin{filecontents*}{\jobname.bib}
@book{CommissionontheHumanities.1980,
editor = {{Commission on the Humanities}},
year = {1980},
title = {The Humanities in American Life},
keywords = {Humanities},
publisher = {{University of California Press}},
isbn* = {0520041836},
subtitle = {Report of the Commission on the Humanities},
location = {Berkeley and London},
abstract = {},
organization = {{Commission on the Humanities}}
}

@incollection{Gotoda.1990,
author = {Got{\^o}da, Masaharu},
year = {1990},
title = {Shin no minshu shugi o mezashite},
titleaddon = {Eine wirkliche Demokratie anstreben},
publisher = {Seibund{\^o}},
maintitle = {Shishunki no seiji},
maintitleaddon = {Politik in der Pubert{\"a}t},
pagetotal = {34--59},
location = {T{\^o}ky{\^o}},
abstract = {},
editor = {Yasuoka, Okiharu},
}
\end{filecontents*}
%----------------------------------------------------------------------------
%   MAIN
%----------------------------------------------------------------------------
\begin{document}
\nocite{*}

\end{document}

• Please, do not include the code by means of links to other sites. First, it may well be no longer there when others come later to see this question. Second, it is really unfair of you to request we look at your full code to fix a particular problem. So, you should provide a minimal working example (MWE) / minimal working example with bibliography (MWEB). – gusbrs Nov 7 '18 at 19:48
• A similar in: redefinition can be found in tex.stackexchange.com/q/404201/35864 and seems to originate from tex.stackexchange.com/a/173653/35864. Audrey used a similar strategy before tex.stackexchange.com/q/122218/35864 – moewe Nov 7 '18 at 19:56
• hey @gusbrs I completely understand. I just used it as it was suggested during another question :) and I only shared the minimal example - I can also delete other bib entries, however they were affected by the approach as well, so it might still be helpful to have the full list :) – user168390 Nov 7 '18 at 20:01
• Because I didn't have the time to say it yesterday: This is a very good MWE. Thank you for taking the time to add it. It would be great if future questions would include MWEs like this from the start and not only after requests in the comments. That makes it much easier for both sides to get a good answer quickly. – moewe Nov 8 '18 at 7:31
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – user36296 Mar 28 at 19:58

You have a redefinition of the in: bibmacro in your code. (For the benefit of future readers of this Q&A: The original redefinition of the in: bibmacro is not the one shown in the MWE in the question. The original code was only posted as link to Overleaf which may or may not be accessible in the future. The MWE in the question already contains the result of a first – and almost successful, but ultimately buggy – attempt to resolve the original problem – see also the edit history of this answer, if you are interested in embarrassing typos on my part.)

You probably want that redefinition to be slightly different to make sure that the "in" is printed at all times and not just for @incollection: Simply move the bit of code that prints the "in" outside the conditional. I also fixed a few possible spurious spaces and tries to modernise the entire thing, that way it plays nicely with your other definitions (namely the editortype format).

\documentclass{scrreprt}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}

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

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

\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}

\renewbibmacro*{in:}{%
\printtext{%
\bibstring{in}\intitlepunct}%
\ifentrytype{incollection}
{\DeclareNameAlias{editor}{family-given}%
\ifnameundef{editor}
{}
{\printnames{editor}%
\setunit{\printdelim{editortypedelim}}%
\usebibmacro{editorstrg}%
\usebibmacro{maintitle+booktitle}%
\clearfield{maintitle}%
\clearfield{booktitle}%
\clearfield{volume}%
\clearfield{part}%
\clearname{editor}}
{}}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DefineBibliographyStrings{german}{%
andothers = {et\ al\adddot}, %et al. statt u.a.
editor    = {{Hg\adddot}}, %Hg. statt Hrsg.
editors   = {{Hgg\adddot}}, %Hgg. plural
}

\begin{filecontents*}{\jobname.bib}
@book{CommissionontheHumanities.1980,
editor       = {{Commission on the Humanities}},
year         = {1980},
title        = {The Humanities in {American} Life},
keywords     = {Humanities},
publisher    = {University of California Press},
isbn         = {0520041836},
subtitle     = {Report of the Commission on the Humanities},
location     = {Berkeley and London},
organization = {Commission on the Humanities}
}

@incollection{Gotoda.1990,
author         = {Got{\^o}da, Masaharu},
year           = {1990},
title          = {Shin no minshu shugi o mezashite},
titleaddon     = {Eine wirkliche Demokratie anstreben},
publisher      = {Seibund{\^o}},
maintitle      = {Shishunki no seiji},
maintitleaddon = {Politik in der Pubert{\"a}t},
pagetotal      = {34--59},
location       = {T{\^o}ky{\^o}},
editor         = {Yasuoka, Okiharu},
}
\end{filecontents*}

\begin{document}
\nocite{*}

I personally would not recommend this approach to print the editors of an @incollection before the booktitle. Instead I would use biblatex-ext's innamebeforetitle option, but then I'm obviously biased...
• @user168390 Definitely add the necessary code as a minimal working example directly to your question in the future. Make sure that the code you post is a small as possible (i.e. does not consist of several files with \input and \include, does not reference files we don't have etc) and compilable only by copying and pasting the example. I know this means quite some work for you, but it is the only way that is really sustainable for the people trying to help you and benefit from your questions in the long term. – moewe Nov 7 '18 at 20:09
• @moewe, a small detail, but one I'm aware you care about: How about \DeclareNameAlias{editor}{family-given}? – gusbrs Nov 7 '18 at 21:03
• @gusbrs overleaf.com/blog/435-tex-live-upgrade-november-2016n is quite interesting. Not sure if they still have the "same TeX live as current Ubuntu" goal, but I think at least Overleaf v2 has TeX live 2017 with biblatex 3.10, so that could be close to 18.04's TeX. That said, I really like the idea of yearly TeX live versions that people can choose. Have the current TeX live be the default for new projects (I'd probably opt for not updating it via tlmgr), old projects remain on their versions and let people change the version as they like. But of course that needs lots of resources. – moewe Nov 8 '18 at 10:37