5

I just scraped the web a lot but I could not find an answer.

This is what my bibliography looks like right now. As you can see it displays 'In:' even when this information is not given. enter image description here

So basically, how can I remove the 'In:'?

This is my LaTeX header: (I have no idea whats relevant of all that.)

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage[backend=biber, natbib=true, style=authoryear-icomp]{biblatex}
\addbibresource{~/res/library.bib}  %% point at your bib file
4
  • 2
    Sure you can do this, but wouldn't it be better to use the right entry types and add the fields when thy exist? e.g., if I go to the DOI location of your first entry it even gives me a bibtex entry for an @inproceedings entry type (which is a little broken, but could be fixed). The third entry should probably be @online, not @article. The second entry is in Chinese, so I'm not sure what kind of entry it should be and what fields it ought to have, but I'm sure that if you use the right entry type and include the right fields it will format fine. Commented Aug 3, 2019 at 11:51
  • Thanks for your suggestions! Really helpful. I updated the journal (I don't know about those proceedings neither, but it still sounds somehow like a reasonable journal), I added the correct reference for the book and changed the entry types. Now it is looking like this: (next comment)
    – tbrodbeck
    Commented Aug 3, 2019 at 14:01
  • ok look at my answer post
    – tbrodbeck
    Commented Aug 3, 2019 at 14:02
  • 1
    +1 for zathura :D
    – c.p.
    Commented Aug 30, 2022 at 10:08

1 Answer 1

6

You can do this by redefining the in: bibmacro to print nothing if there is no journaltitle field:

\renewbibmacro*{in:}{%
  \iffieldundef{journaltitle}
    {}
    {\printtext{\bibstring{in}\intitlepunct}}}

But consider whether you wouldn't be better off using a different entry type (e.g., @online), or including the correct fields for your entry.

MWE

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Author2019,
  author = {Author, An},
  title = {Some Title},
  date = {2019},
  url = {http://www.example.com/a}
}
@online{Author2018,
  author = {Author, Another},
  title = {Some Other Title},
  date = {2018},
  url = {http://www.example.com/b}
}
\end{filecontents}
\usepackage[style=authoryear-icomp]{biblatex}
\addbibresource{\jobname.bib}
\renewbibmacro*{in:}{%
  \iffieldundef{journaltitle}
    {}
    {\printtext{\bibstring{in}\intitlepunct}}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

MWE output

1
  • This works! Thanks, but I found out I should rather fix and update my bibliography instead of filtering out the words
    – tbrodbeck
    Commented Aug 3, 2019 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .