diff options
author | Karl Berry <karl@freefriends.org> | 2016-06-06 22:57:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-06-06 22:57:41 +0000 |
commit | 24f9b9f3765cce36b365687c66f49278a94fbc7a (patch) | |
tree | e8717688db148c270b6df1fc4d22fa544fa9021e | |
parent | c33cac2db6aa4544a9ba06bc2550633d33b0ea67 (diff) |
biblatex-realauthor (5jun16)
git-svn-id: svn://tug.org/texlive/trunk@41298 c570f23f-e606-0410-a88d-b1316a301751
7 files changed, 191 insertions, 24 deletions
diff --git a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.pdf b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.pdf Binary files differindex 0a3750b3957..d0e845b99cd 100644 --- a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.pdf +++ b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.pdf diff --git a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.tex b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.tex index bafc76165ff..d6cf3363a70 100644 --- a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.tex +++ b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/biblatex-realauthor.tex @@ -20,8 +20,8 @@ subtitle={New data field}, email={maieul <at> maieul <dot> net}, author={Maïeul Rouquette}, - revision={2.3.0}, - date={03/11/2016}, + revision={2.4.0}, + date={06/05/2016}, url={https://github.com/maieul/biblatex-realauthor}} % biblatex @@ -36,6 +36,8 @@ The standard biblatex fields allow to describe the author of a work, with the so called \bibfield{authors} field. However, some works are published without name, or with pseudonyme, but the scholars know the real author. This package adds a new field \bibfield{realauthor}, to specify the knew real author. +It also add a new field \bibfield{realeditor}, to specify the knew real editor. + \section{Basic use} \subsection{Requirement} @@ -43,7 +45,7 @@ The standard biblatex fields allow to describe the author of a work, with the so The packages require \biblatex~3.3 or later. \subsection{The .bib file} -Basically, you just have to add the real author name in the field \bibfield{realauthor}, like in the two following examples: +Basically, you just have to add the real author / editor name in the field \bibfield{realauthor} / \bibfield{realdeditor}, like in the following examples: \inputminted{tex}{example-realauthor.bib} @@ -55,7 +57,19 @@ When loading the \biblatex package, use the \namebibstyle{realauthor} bibstyle, \usepackage[citestyle=verbose,bibstyle=realauthor]{biblatex} \end{minted} -Not that the package patches \verb+author+ and \verb+author/editor+others/translator+others+ macro. If you redefine them, don't forget the patches\footnote{We suppose that, if you redefine them, you could understand the packages.}. +Not that the package patches some bibmacro. +If you redefine them, don't forget the patches\footnote{We suppose that, if you redefine them, you could understand the packages.}. +Here the list of macro patched: +\begin{itemize} + \item author; + \item author/editor+others; + \item author/translator+others; + \item author/editor+others/translator+others; + \item bbx:editor; + \item byeditor; + \item byeditor+others; + \item cite:name (patched at the beginning of the document); +\end{itemize} \subsection{Example of result} @@ -80,13 +94,15 @@ Note that this field is not affected by \verb+useauthor+ option, but it is by \v Used in a bibliography macro or driver, \cmd{ifuserealauthor}\mprm{true}\mprm{false} expands to \prm{true} if the \opt{userealauthor} option is enabled (either globally or for the current entry), and \prm{false} otherwise. +There is also a \verb+userealeditor+ option and a \cmd{ifuserealeditor} field, similar, but for \bibfield{realeditor} field. + \subsection{Sorting}\label{sorting} The default sorting schemes \verb+nty+ is problematic, because it doesn't consider the \bibfield{realauthor} field as a name. That is why the package provides two sorting scheme: \begin{itemize} - \item \verb|anonymous|, which but considers the \bibfield{realauthor} field to sort list by authors' name. If an entry has both \bibfield{realauthor} and \bibfield{author}, only the \bibfield{author} field we be used. - \item \verb|anonymous+realauthor|, which push the anonymous texts at the begininng of the list (as the \verb+anonymous+ sorting of the \emph{biblatex-anonymous+} package), but considers the \bibfield{realauthor} field to sort list by authors' name (as the \verb+realauthor+ sorting). + \item \verb|realauthor|, which but considers the \bibfield{realauthor} and \bibfield{realeditor} fields to sort list by authors' name. If an entry has both \bibfield{realauthor} and \bibfield{author}, only the \bibfield{author} field will be used. + \item \verb|anonymous+realauthor|, which push the anonymous texts at the beginning of the list (as the \verb+anonymous+ sorting of the \emph{biblatex-anonymous+} package), but considers the \bibfield{realauthor} and \bibfield{realeditor} fields to sort list by authors' name (as the \verb+realauthor+ sorting). \end{itemize} See the example file to have an illustration. @@ -98,9 +114,10 @@ This option, when set to false: \begin{itemize} \item Disable use of \bibfield{realauthor} as label name. \item Disable use of \bibfield{realauthor} for sorting. - \item With the default style, and contrary to the \verb+useauthor+ option, also disable printing of \bibfield{realauthor}. + \item Before the version 2.4.0. with the default style, and contrary to the \verb+useauthor+ option, also disabled printing of \bibfield{realauthor}. From version 2.4.0, if you don't want to print the field, don't use the package\ldots. \end{itemize} +The same is true for \opt{realeditor} option for the \bibfield{realeditor}. \section{Customization} @@ -116,6 +133,8 @@ You can also redefine the \cmd{realauthorequalsign} command to change the sign b \newcommand{\realauthorequalsign}{\addnbthinspace=\addnbthinspace} \end{minted} +There are also \cmd{mkrealeditor}, which by default calls \cmd{mkrealauthor}, and \cmd{realeditorequalsign}, which by default calls \cmd{realauthorequalsign}. + For more customization, you have to redefine the macros defined in \file{realauthor.bbx}. @@ -136,6 +155,12 @@ All issues can be submitted, in French or English, in the GitHub issues page\foo \begin{changelog} + \begin{release}{2.4.0}{2016-06-05} + \item Adds \bibfield{realeditor}. + \item Restores normal behavior of \opt{userealeditor}. + \item Uses \bibfield{realauthor} / \bibfield{realeditor} in the abreviatted form of citation. + \end{release} + \begin{release}{2.3.0}{2016-03-11} \item Compatibility with biblatex 3.3. \end{release} diff --git a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.bib b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.bib index 993de7fe25a..fc22e7f7699 100644 --- a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.bib +++ b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.bib @@ -17,6 +17,15 @@ sur l'Histoire Critique du Vieux Testament}, Year = {1686}} + +@book{Nausea1531, + Address = {Cologne}, + Pagination = {folio}, + Publisher = {Quentel}, + Realeditor = {Friedrich Nausea}, + Title = {Anonymi Philalethi Eusebiani in vitas, miracula, passionesque Apostolorum Rhapsodiae}, + Year = {1531} +} @book{noauthor-norealauthor, Title = {Here an anonymous work}, } diff --git a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.pdf b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.pdf Binary files differindex 2b421053138..7acd9511bbd 100644 --- a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.pdf +++ b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.pdf diff --git a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.tex b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.tex index aa95a1a4172..2056a38193a 100644 --- a/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.tex +++ b/Master/texmf-dist/doc/latex/biblatex-realauthor/documentation/example-realauthor.tex @@ -1,6 +1,7 @@ \documentclass{article} -\usepackage[bibstyle=verbose, citestyle=verbose-trad2,bibstyle=realauthor]{biblatex} +\usepackage[citestyle=verbose-trad2,bibstyle=realauthor]{biblatex} +\usepackage{libertineotf} \bibliography{example-realauthor.bib} @@ -20,6 +21,8 @@ \cite{noauthor-norealauthor2} +\cite{Nausea1531} + \newrefcontext[sorting=nty] \printbibliography[title={Default sorting (nty)}] diff --git a/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.bbx b/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.bbx index 3f2bdaae653..840a0fca242 100644 --- a/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.bbx @@ -13,7 +13,7 @@ % The Current Maintainer of this work is Maïeul Rouquette % This work consists of the files realauthor.dbx, realauthor.bbx \ProvidesFile{realauthor.dbx} -[2016/03/11 v2.3.0 biblatex bibliography style (MR)] +[2016/06/05 v2.4.0 biblatex bibliography style (MR)] \ifdef{\biblatexmultipledm@bibstyle} {\RequireBibliographyStyle{\biblatexmultipledm@bibstyle}} @@ -30,6 +30,7 @@ \field{realauthor} \field{shorteditor} \field{editor} + \field{realeditor}% \field{translator}} % Command for being redefined @@ -42,6 +43,13 @@ \newcommand{\mkrealauthor}[1]{\mkbibbrackets{#1}} \newcommand{\realauthorequalsign}{\addnbthinspace=\addnbthinspace} +\newcommand{\mkbibrealeditor}[1]{% + \ifnameundef{editor}% + {\mkrealeditor{#1}}% + {\mkrealeditor{\realeditorequalsign#1}}% +} +\newcommand{\mkrealeditor}[1]{\mkrealauthor{#1}}% +\newcommand{\realeditorequalsign}{\realauthorequalsign}% % A format which could be overrided \DeclareNameFormat{realauthor}{% @@ -58,16 +66,28 @@ }% \usebibmacro{name:andothers}}} +\DeclareNameFormat{realeditor}{% + \nameparts{#1}% + \mkbibrealeditor{% + \ifboolexpr{test {\ifbibliography} and test {\ifnameundef{editor}}}% + {\ifgiveninits% + {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}% + {\usebibmacro{name:family-given}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}}% + }% + {\ifgiveninits% + {\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}% + {\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}}% + }% + \usebibmacro{name:andothers}}} % Patching some standard bibmacros %% For the drivers \xapptobibmacro{author}{% - \ifuserealauthor{% \ifnameundef{author}{}{% - \ifnameundef{realauthor}{}{\addspace\nopunct}% + \ifnameundef{realauthor}{}{\addspace\nopunct}% }% \printnames{realauthor}% - }{}% + {}% }{}{} \xpatchbibmacro{author/editor+others} @@ -89,19 +109,127 @@ {} {} -%% For the shorter version -\newbibmacro{realauthor:as:labelname}{% - \ifnamesequal{labelname}{realauthor}% - {\printnames{realauthor}}% - {\printnames{labelname}% - \ifnameundef{realauthor}{}{\addspace\nopunct}% - \printnames{realauthor}% - }% +\xpatchbibmacro{author/editor+others/translator+others} + {\ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + }% + } + {\ifboolexpr{ + (test \ifuseeditor% + and + not test {\ifnameundef{editor}}% + ) + or + (test \ifuserealeditor% + and + not test {\ifnameundef{realeditor}}% + )% + }% + } +{}{} + + + + +\xpatchbibmacro{bbx:editor} + {\ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + }} + {\ifboolexpr{ + (test \ifuseeditor% + and + not test {\ifnameundef{editor}}% + ) + or + (test \ifuserealeditor% + and + not test {\ifnameundef{realeditor}}% + )% + }% + } +{}{} +\xpatchbibmacro{bbx:editor} + {\clearname{editor}} + {\clearname{editor} + \clearname{realeditor} + } +{}{} + +\xpatchbibmacro{bbx:editor} + {\printnames{editor}}% + {\printnames{editor}% + \usebibmacro{printeditor}% + }% +{}{} + + +\xpatchbibmacro{byeditor} + {\ifnameundef{editor}}% + {\ifboolexpr{test{\ifnameundef{editor}} and test{\ifnameundef{realeditor}}}}% +{}{} + +\xpatchbibmacro{byeditor} + {\printnames[byeditor]{editor}}% + {\usebibmacro{printbyeditor+realeditor}} +{}{} + +\xpatchbibmacro{byeditor+others} + {\ifnameundef{editor}}% + {\ifboolexpr{test{\ifnameundef{editor}} and test{\ifnameundef{realeditor}}}}% +{}{} + +\xpatchbibmacro{byeditor+others} + {\printnames[byeditor]{editor}}% + {\usebibmacro{printbyeditor+realeditor}} +{}{} + +\newbibmacro{printbyeditor+realeditor}{% + \printnames[byeditor]{editor}% + \ifnameundef{editor}{}{% + \ifnameundef{realeditor}{}{\addspace\nopunct}% + }% + \printnames{realeditor}% +} + +\newbibmacro{printeditor}{% + \ifnameundef{editor}{}{% + \ifnameundef{realeditor}{}{\addspace\nopunct}% + }% + \printnames{realeditor}% } -\xpatchbibmacro{cite:name}{\printnames{labelname}}{\usebibmacro{realauthor:as:labelname}}{}{} +%% For the shorter version +\newbibmacro{realauthor:as:labelname}{% + \ifboolexpr{% + test {\ifnamesequal{labelname}{realauthor}}% + or + test {\ifnamesequal{labelname}{realeditor}}% + }{% + \ifnamesequal{labelname}{realauthor}% + {\printnames{realauthor}}% + {\printnames{realeditor}}% + }% + {% + \printnames{labelname}% + \ifnamesequal{labelname}{author}{% + \ifnameundef{realauthor}{}{\addspace\nopunct}% + \printnames{realauthor}% + }{}% + \ifnamesequal{labelname}{editor}{% + \ifnameundef{realeditor}{}{\addspace\nopunct}% + \printnames{realeditor}% + }{}% + }% +} +\AtBeginDocument{% + \xpatchbibmacro{cite:name}{\printnames{labelname}}{\usebibmacro{realauthor:as:labelname}}{}{} +} % Sorting @@ -118,6 +246,7 @@ \field{author} \field{realauthor} \field{editor} + \field{realeditor} \field{translator} \field{sorttitle} \field{title} @@ -148,6 +277,7 @@ \field{author} \field{realauthor} \field{editor} + \field{realeditor} \field{translator} \literal{0000} } diff --git a/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.dbx b/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.dbx index 2673e66a6fa..4efbd208d05 100644 --- a/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.dbx +++ b/Master/texmf-dist/tex/latex/biblatex-realauthor/realauthor.dbx @@ -13,8 +13,8 @@ % The Current Maintainer of this work is Maïeul Rouquette % This work consists of the files realauthor.dbx, realauthor.bbx \ProvidesFile{realauthor.dbx} -[2016/03/11 v2.3.0 biblatex bibliography style (MR)] +[2016/06/05 v2.4.0 biblatex bibliography style (MR)] -\DeclareDatamodelFields[type=list,datatype=name]{realauthor} -\DeclareDatamodelEntryfields{realauthor} +\DeclareDatamodelFields[type=list,datatype=name]{realauthor,realeditor} +\DeclareDatamodelEntryfields{realauthor,realeditor} \endinput
\ No newline at end of file |