-1

There I go with my first post. I am using Texmaker, Windows 2010, and MiKTeX. I am using natbib, bibliographystyle apalike. If I write this entry:

@book{jones2008,
title={Feast: why humans share food},
author={Jones, Martin},
publisher={Oxford University Press},
year={2008}
}
@book{sanmartiysantacana2005,
title={Els ibers del nord},
author={Sanmartí,­ Joan y Santacana, Joan},
publisher={Editorial Dalmau},
year={2005}
}

the bibliography reference is perfect, with the Spanish accents and evrything, but in the text only appears the first author, like Sanmarti2005. Anyone knows a solution for this? I have seem similar topics, so not sure if using apacite would be a solution.


MWE:

\usepackage[spanish]{babel}
\usepackage[round]{natbib}
\usepackage{cite}
Begin{document}
\bibliographystyle{apalike}
\bibliography{bibliografia}

Using the above commands the output in the bibliography is perfect. However, the citation within the text only appears as “(sanmarti2005)”, which is my actual problem.

enter image description here

Stefan Kottwitz
  • 231,401
  • I forgot to mention that the first entry,jones2008 is perfect, the issue is with the second entry which have 2 authors – david 007 Nov 13 '19 at 14:55
  • Welcome to TeX.SX. You might wanna add here as well, whihc bibliographystyle you are using. Guesswork is wasting everyone's time. – Johannes_B Nov 13 '19 at 15:59
  • bibliographystyle apalike. So I have the following: – david 007 Nov 13 '19 at 18:46
  • \documentclass[11pt,a4paper,oldfontcommands]{memoir} \usepackage[ansinew]{inputenc} \usepackage[T1]{fontenc} \usepackage[spanish]{babel} \usepackage{microtype} \usepackage[dvips]{graphicx} \usepackage{xcolor} \usepackage{times} \usepackage{epigraph} \usepackage[utf8]{inputenc} \usepackage[round]{natbib} \usepackage{cite} Begin document \bibliographystyle{apalike} \bibliography{bibliografia} – david 007 Nov 13 '19 at 18:50
  • 2
    Please edit your original question to add code instead of trying to write it in comments! – pst Nov 13 '19 at 19:34
  • See also https://tex.stackexchange.com/q/36396/35864. Regardless of the desired output the only correct input for several names in the .bib file is by separating them with an and. If you need the output to use the Spanish word for and you need to choose a style that speaks Spanish. (apalike only speaks English.) – moewe Nov 13 '19 at 19:37
  • Is there any news here? – Johannes_B Nov 17 '19 at 16:25

2 Answers2

2
author={Sanmartí,­ Joan y Santacana, Joan},

That should be

author={Sanmartí,­ Joan and Santacana, Joan},

"and" is used in the bibtex format between multiple names. How it then looks in the output (maybe "&") depends on the style.

pst
  • 4,674
  • If I use AND it will look in the output= (Sanmartí and Santacana 2005, 49) as I use the command citep [49]{sanmartiandsantacana). However, it is a big strange because the output in the bibliography reference is perfect – david 007 Nov 13 '19 at 18:36
  • I really need the conjunction AND in Spanish, Y. For whatever reason, it seems to read it ok for the bibliography list but not within the text, which is my problen, as it appears within the text as sanmartiandsantacana, that is, the label I use in: @book{sanmartiysantacana2005, title={Els ibers del nord}, author={Sanmartí,­ Joan y Santacana, Joan}, publisher={Editorial Dalmau}, year={2005} } – david 007 Nov 13 '19 at 18:39
  • I know that AND is used in the bibtex format but, I guess, there must be a form to sort out this problem and I cannot find it. Any suggestion are very welcome – david 007 Nov 13 '19 at 18:42
  • What do you mean, @david007? If you know that, why don't you use it? You have some problem you want help with. So show us "good files" that give another result than what you want and not "bad files"! It would really really help if you actually showed a short complete LaTeX file that (together with a corrected bib file) doesn't give the result you want. (Don't include unnecessary stuff in it, like changing fonts etc.) – pst Nov 13 '19 at 19:33
0

As moewe wrote in a comment the main problem is that the style apastyle only speaks English. If you are willing to change your underlying bibliography system I show how you can use biblatex instead. Since you used apastyle I have used the biblatex style apa in the example, and I also added the natbib option that makes it behave more like natbib which you are used to.

This document

\documentclass{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage[style=apa,natbib]{biblatex}
\addbibresource{bibliografia.bib}
\begin{document}
Prueba \citep{doe19, sanmartiysantacana2005}.

\printbibliography
\end{document}

with bibliografia.bib containing

@Thesis{doe19,
  author =   {Doe, Jane},
  title =    {My thesis},
  type =     {mathesis},
  institution =  {Duckburg university},
  year =     2019}

@book{sanmartiysantacana2005,
title={Els ibers del nord},
author={Sanmartí, Joan and Santacana, Joan},
publisher={Editorial Dalmau},
year={2005}
}

gives the text "Prueba (Doe, 2019; Sanmartí & Santacana, 2005)." Since "&" is used by the style you don't see that it is really adapted for Spanish just because of the use of babel. To see that it is I added that reference doe19 and now the bibliography looks like this: enter image description here

pst
  • 4,674
  • Thanks for your answer. However, have a look to what I posted and the output. The problem doesn't lie in the bibliography but in the citation within the text, which appears as (sanmarti,2005,49), when it should be (sanmarti y Santacana 2005,49) – david 007 Nov 14 '19 at 09:54
  • Basically, in the citation within the text there is missing one name, Santacana, and I don't really know why? – david 007 Nov 14 '19 at 10:12
  • That citation had one name because you only had one name in your bib file. To have several names you need to put "and" between them. That was part 1, which you said you already knew.

    Then when you've fixed that your next problem is that you want Spanish "y" instead of English "and" in the citations. For that you need a style that knows about Spanish. In my answer I give an example with such a style, but since it uses "&" there you don't see that it actually knows about Spanish.

    – pst Nov 14 '19 at 10:56
  • The problem with biblatex is that I installed before posting my issue and, not sure why, I received an error message saying that biblatex version was incompatible with biber, So I came back again to natbib hoping to sort out the issue with natbib. – david 007 Nov 14 '19 at 11:18
  • I used the following packages and definitions: %\usepackage[style=apa,natbib=true,backend=biber]{biblatex} %\DeclareLanguageMapping{spanish}{spanish-apa} %reactivate smartand: %\makeatletter %\DefineBibliographyExtras{spanish} %{\setcounter{smartand}{1}% or some other value % \let\lbx@finalnamedelim=\lbx@es@smartand % \let\lbx@finallistdelim=\lbx@es@smartand} %\makeatother
    %\usepackage{csquotes} %\addbibresource{preiberico.bib}
    – david 007 Nov 14 '19 at 11:18
  • https://latex.org/forum/viewtopic.php?f=50&t=33033&sid=f41de84a0694547ef7ef805882d80900 – Johannes_B Nov 14 '19 at 17:18
  • @david007 Why did you use \let\lbx@finalnamedelim=\lbx@es@smartand and the like? What does it do? – Johannes_B Nov 14 '19 at 17:19
  • I have used, for instance, the code smartand{1} when I tried biblatex because it is the command, in the biblatex manual, to change the conjuction And for the Spanish Y or E, depending on the context. However, it didn't work, I guess, because when I installed biblatex and configured tex maker to use biber I received an error message stating that there was some sort of incompatibility between the biblatex installed by me and biber. – david 007 Nov 14 '19 at 20:50
  • I am going to try tomorrow with apacite and see if I am more lucky. Fingers cross! – david 007 Nov 14 '19 at 20:50