2

I'm totally new to TeX but I've gone more or less through the http://en.wikibooks.org/wiki/LaTeX/ Wiki but I didn't find anything beside \quote and \quotation.

How can I quote inline with the quote index? for example

He said "Bla blah"$^{[14]}$

And how can I link this to a reference in the end?

Is there a tutorial or example for this? Or any other quotation system like the harvard referencing system would be also OK.

1

1 Answer 1

3

You can do it the usual way:

\documentclass{article}
\usepackage[square,sort&compress,super]{natbib}
\usepackage{filecontents}
\begin{filecontents*}{mybib.bib}
  @article{shell2002use,
    title={{How to Use the IEEEtran \LaTeX{} Class}},
    author={Shell, Michael},
    journal={Journal of \LaTeX{} Class Files},
    volume={1},
    number={11},
    pages={10--20},
    year={2002}
}
\end{filecontents*}

\begin{document}
  He said ``Bla blah''~\cite{shell2002use}
  \bibliographystyle{unsrtnat}
  \bibliography{mybib}
\end{document}

enter image description here

Or using the powerful csquotes package. If you want links to be hyper links, add \usepackage{hyperref}:

\documentclass{article}
\usepackage[square,sort&compress,super]{natbib}
\usepackage{filecontents}
\begin{filecontents*}{mybib.bib}
  @article{shell2002use,
    title={{How to Use the IEEEtran \LaTeX{} Class}},
    author={Shell, Michael},
    journal={Journal of \LaTeX{} Class Files},
    volume={1},
    number={11},
    pages={10--20},
    year={2002}
}
\end{filecontents*}
\usepackage{csquotes}
\usepackage[colorlinks]{hyperref}

\begin{document}
  He said \enquote{Bla blah}~\cite{shell2002use}
  \bibliographystyle{unsrtnat}
  \bibliography{mybib}
\end{document}

enter image description here

Compile the above codes with pdflatexbibtexpdflatexpdflatex sequence.

natbib is used mainly to get the citation numbers in super script notation.

5
  • Thanks for the effort writing this sample. It also works but one problem: The program tells me that the citations are undefined and therefore in the pdf the index is just a '?' and there also are no references in the end. Any idea whats wrong? Jan 15, 2014 at 13:33
  • 1
    @Michael See the compile sequence above in the answer. Complete the sequence :-)
    – user11232
    Jan 15, 2014 at 13:34
  • I've read it, but I didn't knew what to do with it but now I've got it. Thanks :) It works perfect! Jan 15, 2014 at 13:37
  • 1
    @Michael Glad you got it. :-)
    – user11232
    Jan 15, 2014 at 13:43
  • Note, csquotes has a dedicated command for this situation: textquote. It can be customized to support different quotation styles etc. See the documentation for details, especially §9.2 gives detailed instructions with examples on how to use and customize textquote.
    – Arne L.
    Apr 1, 2015 at 8:54

You must log in to answer this question.

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