ge-ne / bibtool

BibTool is a tool for manipulating BibTeX data bases. BibTeX provides a mean to integrate citations into LaTeX documents. BibTool allows the manipulation of BibTeX files which goes beyond the possibilities -- and intentions -- of BibTeX.
GNU General Public License v2.0
206 stars 32 forks source link

key generator neglects author names surrounded by curly brackets #14

Closed timmli closed 8 years ago

timmli commented 8 years ago

Names with additions (von, van, de) can be sourrounded by curly brackets to enforce a certain sorting, e.g. author={{van Gogh}, Vincent}. However, when applying key.format = { %2n(author):%-2d(year) } during key generation, BibTool does not use the name within curly brackets. It just prints :%-2d(year).

ge-ne commented 8 years ago

Braces enforce that certain name constituents are treated as one. A name may consist of the following part types: first von last junior {van Gogh}, Vincent is classified as: first: Vincent von: van Gogh last: junior:

the von parts are identified by something starting with a lowercase letter after skipping over ignorable characters. Thus the result depicted in the message is absolutely correct.

To force another classification prepend a TeX macro with two arguments, say author = {{\ignore{V}{v}an Gogh, Vincent} Let the first argument be expanded by BibTool (with tex.define{\ignore[2]=#1}) and the second by TeX (with \def \ignore#1#2{#2} or \newcommand), This trick goes back to Oren Patashnik and the BibTeX manual.

timmli commented 8 years ago

Thanks for clarifying this! So I decided to replace {van Gogh} by {\small{V}an Gogh} before generating the key with BibTool, and to undo this afterwards.