[OS X TeX] problem with natbib in spanish

Josep Maria Font jmfont at ub.edu
Fri Dec 25 22:59:45 CET 2009


El dia 25/12/2009, a les 13:24, Sr Sur va escriure:

> I am a new user of Latex. I have installed Mac TeX with the Tex Live  
> '08 version. I'm writing my PhD thesis in spanish and I have  
> problems with natbib package. when I \cite a reference with two  
> authors the output is "Freeman and Bermudez (year)" but the correct  
> way in spanish would be "Freeman y Bermudez (year)". How can I put  
> the "spanish y" instead "and"???

The problem is not with the natbib package, but with BibTeX, the  
bibliography-generating program. The BibTeX style files corresponding  
to the style you want to use have such particles as "and", "of", "In",  
"edition", etc. hard-wired, so I think the only solution is to  
manually edit them. Here is what you should do:

1) Locate the style file with suffix .bst corresponding to the  
bibliography style you are using (plainnat.bst for plain, unsrtnat.bst  
or abbrvnat.bast ofr other styles). Duplicate it, change its name to  
"myplainnat.bst" or the like, and store it in your ~/Library/texmf/ 
bibtex/bst folder (create it if necesssary).

2) Edit the new file, with TeXShop itself or another plain text  
editor. Locate all occurrences of the strings you want changed and  
replace them with the corresponding Spanish ones (y, de, En, edición,  
etc.). Keep a record of the changes by inserting comments with %. If  
you are new to LaTeX then you will find the syntax of the bst files  
very strange, but if you are a programer you will understand it  
quickly (it uses reverse Polish notation). The LaTeX Companion might  
help you here; however, it is not necessary to *understand* how it  
works just to change these words. Keep attention to all " quoting text  
strings.

3) In your document, put \bibliographystyle{myplainnat} or whatever  
new style you have created, instead of the standard one. Do not change  
the \usepackage{natbib} nor its options, nor the  
\bibliography{data_bases}.

At least this is what I did (adding then a lot of other cosmetic  
changes, once I understood the whole process) and it worked without  
problems.

I hope the above is correct. Perhaps other, more knowledgeable users  
may correct me.

Hope this helps. natbib is a great package, and with these  
modifications I got a terrific formatting of my citations in Catalan.

Best,


JMaF




More information about the macostex-archives mailing list