2

This is my main.tex:

    \documentclass[a4paper,12pt,parskip=full]{scrreprt}
    \usepackage[utf8x]{inputenc}
    % Paper layout
    \usepackage[a4paper,top=2.5cm,right=2.5cm,bottom=2.5cm,left=2.5cm]{geometry}
    \usepackage{graphicx}
    \usepackage{caption}
    \usepackage{subcaption}
    % use links for table of contents, citations, ...
    \usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = black]{hyperref}
    \usepackage{harvard}
    \let\harvardleftorig\harvardleft
    \newcommand\citevgl
      {\def\harvardleft{(vgl.\ \global\let\harvardleft\harvardleftorig}%
       \cite
      }
    \setcounter{secnumdepth}{5}
    \setcounter{tocdepth}{5}

    \begin{document}
    \chapter[some title]{some title}
some text \citevgl{NT}
      \renewcommand{\thepage}{}
      \listoffigures
      \bibliography{literatur}
      \bibliographystyle{alpha}
    \end{document}

This is my literatur.bib:

@Article{NT,
title = {Management-Team},
year = {Abgerufen am 22 Juni 2018},
url = {https://www.exapmle.com}
}

and my problem

My question is: how I have to solve this problem?

  • Did you run LaTeX/BibTeX/LaTeX/LaTeX? – Joseph Wright Aug 24 '18 at 08:14
  • 1
    Normally the problem is just that you forgot to run BibTeX: Question mark or bold citation key instead of citation number. But it could also be a more specific reason. You may want to check out the .log and .blg files for errors and warnings. – moewe Aug 24 '18 at 08:17
  • In configure Texmaker I selected the PdfLaTeX + Bib(la)tex + PdfLaTeX(x2) + View Pdf @JosephWright –  Aug 24 '18 at 08:17
  • what setup are you using? also, could you turn your example into a full MWE. I don't have the files, you're including. – naphaneal Aug 24 '18 at 08:19
  • The .blg message suggests that a file called literatur.bib was found (that is good), but that it does not contain the entries listed there. In particular NT can't be found. Do you have several files called literatur.bib? Maybe BibTeX finds the wrong file. Try renaming the file to something more descriptive and try again. – moewe Aug 24 '18 at 08:22
  • there is only one file that named literatur.bib @moewe –  Aug 24 '18 at 08:26
  • @moewe yes it contains NT –  Aug 24 '18 at 08:32
  • 2
    You've not show us the full source (including the citations) or the .bib file: as others have said, it looks like one or other is wrong. – Joseph Wright Aug 24 '18 at 08:34
  • @moewe Now I am getting this error when I am trying to mwe: i couldn't open database file literatur.bib ---line 25 of file main.aux: \bibdata{literatur: } I am skipping whatever remains of this command –  Aug 24 '18 at 08:49
  • Did you write \bibliography{literatur:} instead of \bibliography{literatur}? – moewe Aug 24 '18 at 08:52
  • 1
    The harvard cite package is not compatible \bibliographystyle{alpha}. – moewe Aug 24 '18 at 09:06
  • @moewe was that the problem all the time :D What should I use for bibstyle? –  Aug 24 '18 at 09:07
  • If you insist on using the harvard package use one of its styles: agsm, dcu, kluwer: https://ctan.org/pkg/harvard. Or just don't use harvard. – moewe Aug 24 '18 at 09:08
  • Normally you should not need \usepackage[utf8x]{inputenc} it can do more harm than good in some situations. Just use \usepackage[utf8]{inputenc} that should be enough for most intents and purposes (especially in German texts). – moewe Aug 24 '18 at 09:10

1 Answers1

2

If you want to use harvard, you also have to specify a compatible bibliography style. Here I use agsm which seems to be the most generic one.

Also, @article is not the right type for the item and @misc seems better; as Harvard styles need an author, you should either specify author or, like here, key (choose a meaningful name rather than SOMETHING).

In the code I use filecontents* just not to clobber my files; you can employ your .bib file.

\begin{filecontents*}{\jobname.bib}
@misc{NT,
key = {SOMETHING},
title = {Management-Team},
year = {Abgerufen am 22 Juni 2018},
url = {https://www.example.com}
}
\end{filecontents*}

\documentclass[a4paper,12pt,parskip=full]{scrreprt}
\usepackage[utf8]{inputenc}
% Paper layout
\usepackage[a4paper,top=2.5cm,right=2.5cm,bottom=2.5cm,left=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
% use links for table of contents, citations, ...
\usepackage{harvard}
\usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = black]{hyperref}

\let\harvardleftorig\harvardleft
\newcommand\citevgl
  {\def\harvardleft{(vgl.\ \global\let\harvardleft\harvardleftorig}%
   \cite
  }
% packages and theorems go here
%\input{packages}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\citationstyle{abbr}

\begin{document}
\chapter{Einführung}
some text \citevgl{NT}

%\listoffigures
\bibliographystyle{agsm}
\bibliography{\jobname}

\end{document}

A couple of points:

  1. hyperref should go last even after your packages (only a few packages must be loaded after it)
  2. \include{packages} is wrong, use \input (but be careful about the previous warning)
  3. utf8x is largely obsolete and unmaintained; prefer utf8 (by the way, with recent versions of LaTeX, after 2018-04-01, \usepackage[utf8]{inputenc} is not even needed)

enter image description here

egreg
  • 1,121,712