0

When citing within the text, the citation appears within lines like so: |1| instead of within brackets like so: [1]. Within the bibliography, the citations appear correct. I have a hunch that there is a problem with the display, making the citations look like it's between lines because the serifs aren't displaying properly, but I can't figure out the problem.

Here is the preamble:

\documentclass[12pt,a4paper,bibtotoc]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{blindtext}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage{siunitx}
\usepackage[onehalfspacing]{setspace} %1,5-facher Zeilenabstand
\usepackage{colortbl}
\usepackage{xcolor}
\restylefloat{table}
\graphicspath{{Bilder/}}
\usepackage[backend=biber,style=numeric]{biblatex}
\addbibresource{LiteraturBericht3.bib}
\newcommand{\chapterref}[1]{Kapitel~\ref{#1}}
\newcommand{\sectionref}[1]{Abschnitt~\ref{#1}}
\newcommand{\subsectionref}[1]{Unterabschnitt~\ref{#1}}
\newcommand{\equationref}[1]{Gl.~(\ref{#1})}
\newcommand{\figureref}[1]{Figur~\ref{#1}}
\newcommand{\tableref}[1]{Tabelle~\ref{#1}}
\def\SymbReg{\textsuperscript{\textregistered}}

\usepackage[breaklinks,pdfpagelabels,pdfstartview = FitH,bookmarksopen = true,bookmarksnumbered = true, colorlinks = false, urlbordercolor = {white}, linkbordercolor = {white}, citebordercolor = {white}, plainpages = false, hypertexnames = false, citecolor = black] {hyperref}

\usepackage[automark, headsepline, autooneside=false]{scrlayer-scrpage}
\pagestyle{scrheadings}
\automark{chapter}
\ihead{\headmark}
\ohead[\pagemark]{\pagemark}
\chead{}
\cfoot[]{}
\renewcommand*\chapterpagestyle{scrheadings}

And here are pictures of what I mean: The citation within the text: enter image description here The citation within the bibliography, how I also would prefer them within the text, with square brackets: enter image description here

1
  • Welcome to TeX.SE.
    – Mico
    Dec 4, 2020 at 23:40

1 Answer 1

0

The same effect can be reproduced in the following smaller document.

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

\usepackage[backend=biber,style=numeric]{biblatex}

\usepackage{xcolor}

\usepackage[
  urlbordercolor = {white},
  linkbordercolor = {white},
  citebordercolor = {white},
  citecolor = black
]{hyperref}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}

\printbibliography
\end{document}

weird looking square brackets around citation

The problem is your hyperref setup, which adds a white border around clickable links. Since the citation is a link, you get a white borer around the number, which overlaps the surrounding square brackets (on screen).

The effect is visible more clearly if you just load hyperref as

\usepackage{hyperref}

where you get a green link border overlapping the square bracket

green link border overlapping the square brackets

If you do not want to visually distinguish clickable links from other bits of the text, you may want to use the hidelinks option

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

\usepackage[backend=biber,style=numeric]{biblatex}

\usepackage[
  hidelinks
]{hyperref}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}

\printbibliography
\end{document}

nicely printed square brackets


In your larger document, you could replace

\usepackage[breaklinks,pdfpagelabels,pdfstartview = FitH,bookmarksopen = true,bookmarksnumbered = true, colorlinks = false, urlbordercolor = {white}, linkbordercolor = {white}, citebordercolor = {white}, plainpages = false, hypertexnames = false, citecolor = black] {hyperref}

with

\usepackage[
  hidelinks,
  pdfstartview = FitH,
  bookmarksopen = true, bookmarksnumbered = true,
  hypertexnames = false,
]{hyperref}

(where we replaced the white borders with the hidelinks option and dropped options that are the default to make things slightly easier to digest).

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.