Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm not a very experienced LaTeX used.

What I Created:

  • a .tex file using LyX
  • a .bib bibliography using JabRef
  • also my own suitable .bst style for BibTeX using custom-bib's makebst

pdflatex's Output:

(the .pdf file produced by pdflatex file.tex - converted to plain text)

Meine QuellenangabeLundberg vgl. 2003, 3, direkt vor dem restlichen
Text.

Literatur                           # German for bibilography
    Lundberg, Ulla-Lena (2003). Selbstporträt mit Flügeln. Stuttgart: Klett-
    Cotta.

My Problem:

The bibliography is perfect this way, but the citations in the text aren't acceptable:

Text beforeLundberg vgl. 2003, 3 text after

But I'd like the citations to be like:

Text before (vgl. Lundberg 2003: 3) text after

That's the way my .bst file styles citations. But it seems like my .bst file is applied just on the bibliography, but not on the citations in the text.

[Update]

Using \citep instead of \citealt, my citation \citep[vgl.][3]{Lundberg} now look like this:

Text before (vgl. Lundberg, 2003, 3) text after

How can I replace the , before the page number by colon and space (:)? (To like like this:)

Text before (vgl. Lundberg, 2003: 3) text after

My Question:

How can I get LaTeX to style the citations in the text as described above? - I want my .bst style to get applied on my citations too.

Thanks for your ideas, for your answers. - If my question isn't clear this way, please write a comment to inform me about that.

The Sources:

% file.tex
\documentclass[12pt,ngerman]{article}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[authoryear]{natbib}

\makeatletter
\@ifundefined{date}{}{\date{}}
\makeatother

\usepackage{babel}
\begin{document}
\bibliographystyle{file}
Meine Quellenangabe\citealt[vgl.][3]{Lundberg}, direkt vor dem restlichen Text.
\bibliography{file}

\end{document}


% file.bib
@BOOK{Lundberg,
  title = {Selbstporträt mit Flügeln},
  publisher = {Stuttgart: Klett-Cotta},
  year = {2003},
  author = {Ulla-Lena Lundberg},
  timestamp = {2013.01.07}
}


% file.bbl
\begin{thebibliography}{1}
\providecommand{\natexlab}[1]{#1}
{\catcode`\|=0\catcode`\#=12\catcode`\@=11\catcode`\\=12
|immediate|write|@auxout{\expandafter\ifx\csname
  natexlab\endcsname\relax\gdef\natexlab#1{#1}\fi}}

\harvarditem{Lundberg}{2003}{Lundberg}
Lundberg, Ulla-Lena \harvardyearleft 2003\harvardyearright{}.
\newblock Selbstporträt mit Flügeln.
\newblock Stuttgart: Klett-Cotta.

\end{thebibliography}
share|improve this question
1  
Welcome to TeX.sx! You should use the command \citep for these citations (and make sure you have a space before this command). \citealt is \citet without the parentheses. –  Andrew Swann Jan 8 '13 at 12:23
    
@AndrewSwann Thanks, that helped me a lot. - But there's still one problem concerning the punctuation, I wrote more about that in the [Update] section of my question text. Any idea concerning that? –  fdj815 Jan 8 '13 at 14:55

1 Answer 1

up vote 1 down vote accepted

Firstly, the .bst file does not control the formatting of citations in the text, it only deals with the formatting of the bibliography.

Now natbib provides various citation commands and ways to customise them. To get citations with brackets use \citep. To adjust the punctuation before the post note from a comma to a colon, you can use the \setcitestyle command to adjust the notesep via

\setcitestyle{notesep={: }}

Putting this together your .tex file becomes (using plainnat instead of your unposted .bst file):

\documentclass[12pt,ngerman]{article}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[authoryear]{natbib}

\makeatletter
\@ifundefined{date}{}{\date{}}
\makeatother

\setcitestyle{notesep={: }}
\usepackage{babel}
\begin{document}
\bibliographystyle{plainnat}
Meine Quellenangabe \citep[vgl.][3]{Lundberg}, direkt vor dem restlichen Text.
\bibliography{file}

\end{document}

producing

Sample output

share|improve this answer
    
Thanks for your help. –  fdj815 Jan 8 '13 at 20:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.