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 having problems with my bibtex keys. According to my style guide, they should be left-aligned, whereas now they're right-aligned. Is there a way to change that? I am using amsalpha bibliography style.

right-aligned bibliography keys

Also, in the authors list, I need to have a localized value of 'and' before the last author. I've found a bunch of bibtex localization files in it's installation directory. Will I need to copy one and change strings in it? How do I tell bibtex which one to use (I'm using XeLaTeX for my document)?

Removing the 'and' completely and just leaving the comma before it will do too. I do not need a good solution to this one right now, a quick one will suffice.

EDIT Ok, i managed to figure out the right alignment of keys is cause by natbib package. I include MWE below:

mwe.tex:

\documentclass[a4paper]{article}

\usepackage{natbib}

\bibliographystyle{amsalpha}

\begin{document}

\cite{hu62}
\cite{ss97}
\cite{crm03}

\bibliography{mwe}

\end{document}

mwe.bib:

@Article{hu62,
    title = {Visual Pattern Recognition by Moment Invariants},
    journal = {IRE Transactions on Information Theory},
    pages = {179--187},
    year = {1962},
    author = {Hu, Ming-Kuei}
}

@Conference{ss97,
    title = {Hu’s moment invariants: How invariant are they under skew and perspective transformations?},
    booktitle = {IEEE WESCANEX 97: Communications, Power and Computing. Conference Proceedings.},
    pages = {292--295},
    year = {1997},
    author = {Sivaramakrishna, Radhika and Shashidhar, N. S.}
}

@Article{crm03,
    title = {A comparative analysis of algorithms for fast computation of Zernike moments},
    journal = {Pattern Recognition},
    pages = {731--742},
    year = {2003},
    author = {Chong, Chee-Way and Raveendran, P. and Mukundan, R.}
}

I am using bibtex and xelatex.

share|improve this question
    
In biblatex, look for finalnamedelim (also \finalnamecomma). (Sorry, I can't easily answer the first question since I've never used such a style, or looked into its implementation.) –  jon Jun 22 '12 at 4:33
1  
Do you mean biblatex or BibTeX? biblatex doesn't have a style amsalpha. Please provide a minimal example. –  Marco Daniel Jun 22 '12 at 17:06

2 Answers 2

up vote 1 down vote accepted

You may try babelbib; I've adapted your example to Italian and I get "e" instead of "and".

\begin{filecontents*}{mwe.bib}
@Article{hu62,
    title = {Visual Pattern Recognition by Moment Invariants},
    journal = {IRE Transactions on Information Theory},
    pages = {179--187},
    year = {1962},
    author = {Hu, Ming-Kuei}
}

@Conference{ss97,
    title = {Hu's moment invariants: How invariant are they under skew and perspective transformations?},
    booktitle = {IEEE WESCANEX 97: Communications, Power and Computing. Conference Proceedings.},
    pages = {292--295},
    year = {1997},
    author = {Sivaramakrishna, Radhika and Shashidhar, N. S.}
}

@Article{crm03,
    title = {A comparative analysis of algorithms for fast computation of Zernike moments},
    journal = {Pattern Recognition},
    pages = {731--742},
    year = {2003},
    author = {Chong, Chee-Way and Raveendran, P. and Mukundan, R.}
}\end{filecontents*}
\documentclass[a4paper]{article}
\usepackage[italian]{babel}
\usepackage[italian]{babelbib}

\bibliographystyle{babalpha}

\begin{document}

\cite{hu62}
\cite{ss97}
\cite{crm03}

\bibliography{mwe}

\end{document}

enter image description here

Hyphenation is incorrect, though. Check babelbib documentation.

share|improve this answer
    
You might be right, but babelbib doesn't have the language I need (lithuanian) and your new mwe doesn't use natbib. Nevertheless, your answer is much cleaner, so I will accept it, even though I will probably be using my own method until I find something else. Thank you. –  Paulius K. Jun 27 '12 at 14:46
1  
@guilty Unfortunately there's no support for Lithuanian, but the .bdf file that babelbib uses is just a list of keywords and it shouldn't be too difficult to write one for your language. –  egreg Jun 27 '12 at 14:51

I think I've found solutions to both of my problems.

Keys can be made left-aligned with following code in your preamble or style file (source):

\makeatletter
\renewcommand{\@biblabel}[1]{[#1]\hfill}
\makeatother

For the last delimiter problem, I had to edit amsalpha.bst file, which I found under /usr/local/texlive/2011/texmf-dist/bibtex/bst/amscls in my machine (make sure to do a backup).

Specific changes:

  1. Line 351 { "," * } to { "" *}. This removes the comma before the last author.
  2. Line 356 { " and " * t * } to { " ir " * t * }, where ir is a localized value of and, of course. Mind the spaces.

It is not the prettiest solution, but i don't think there's another one. As you might notice, the strings in amsalpha.bst are hardcoded, so the only way to change them is by hand. I would be happy if anyone more experienced could confirm this.

These solutions work with

BibTeX 0.99d (TeX Live 2011)
kpathsea version 6.0.1
share|improve this answer

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.