BibTeX, biblatex and biber ⇒ harvard | Modify '\possessivecite'
-
- Posts: 3
- Joined: Fri Jan 27, 2012 5:20 pm
harvard | Modify '\possessivecite'
Does anybody know if it's possible to modify the harvard package so the possessive is ' (just an apostrophe) when the author's name ends with s/sh/sj/rs/z, and just s (no apostrophe) in any other case?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
harvard | Modify '\possessivecite'
Code: Select all
\makeatletter
\newcommand{\possessivecites}{\@ifstar{\@ifstar{\HAR@acitespos}{\HAR@fcitespos}}%
{\HAR@dcitespos}%
}
\newcommand{\HAR@fcitespos}[2][\null]{\HAR@citetoaux{#2}\HAR@checkdef{#2}{%
{\HAR@fname{#2}' \harvardyearleft\HAR@year{#2}\ifthenelse{\equal{#1}{\null}}
{}{, #1}\harvardyearright}\HAR@setd{#2}}%
}
\newcommand{\HAR@acitespos}[2][\null]{\HAR@citetoaux{#2}\HAR@checkdef{#2}{%
{\HAR@aname{#2}' \harvardyearleft\HAR@year{#2}\ifthenelse{\equal{#1}{\null}}
{}{, #1}\harvardyearright}\HAR@setd{#2}}%
}
\newcommand{\HAR@dcitespos}[2][\null]{\HAR@citetoaux{#2}\HAR@checkdef{#2}{%
{\HAR@name{#2}' \harvardyearleft\HAR@year{#2}\ifthenelse{\equal{#1}{\null}}
{}{, #1}\harvardyearright}\HAR@setd{#2}}%
}
\makeatother
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 3
- Joined: Fri Jan 27, 2012 5:20 pm
harvard | Modify '\possessivecite'
The problem now is that the possessive seems to be ' (just an apostroph) in any case, not just when the author's name ends with s/sh/sj/rs/z.
Is it possible to fix this, so the possessive is the letter s when the author's name ends in any other letters. E.g. for Knuth it should display Knuths, not Knuth'.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
harvard | Modify '\possessivecite'
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 3
- Joined: Fri Jan 27, 2012 5:20 pm
Re: harvard | Modify '\possessivecite'
I was hoping it was possible to have just one command that automatically added the correct possessive, depending on the author's name.
Maybe this isn't even possible?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
harvard | Modify '\possessivecite'
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10