Skip to content

Commit

Permalink
Merge pull request #636 from moewew/issue520genmd
Browse files Browse the repository at this point in the history
Improve mergedate minimum and basic (#520)
  • Loading branch information
plk authored Oct 25, 2017
2 parents 7d5798d + c873099 commit 654c24b
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 108 deletions.
17 changes: 17 additions & 0 deletions doc/latex/biblatex/biblatex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9184,6 +9184,23 @@ \subsubsection{Stand-alone Tests}

As \cmd{ifend$<$datetype$>$dateuncertain} but for use in \cmd{mkbibdate*} formatting commands (\secref{aut:fmt:lng}) inside which the appropriate \cmd{ifend$<$datetype$>$dateuncertain} command is aliased to this command.

\cmditem{iflabeldateisdate}{true}{false}

Expands to \prm{true} if labeldate is defined and was obtained from date, and to \prm{false} otherwise.

\cmditem{ifdatehasyearonlyprecision}{datetype}{true}{false}

Expands to \prm{true} if the \prm{datetype}date is defined and would be shown with year precision \cmd{print$<$datetype$>$date}, and to false otherwise.

\cmditem{ifdatehastime}{datetype}{true}{false}

Expands to \prm{true} if the \prm{datetype}date is defined, has a time component and \opt{$<$datetype$>$dateusetime} is true, and to false otherwise.

\cmditem{ifdateshavedifferentprecision}{datetype1}{datetype2}{true}{false}

Expands to \prm{true} if the two dates \prm{datetype1} and \prm{datetype2} would show in different precision when printed with \cmd{print$<$datetype1$>$date} and \cmd{print$<$datetype2$>$date} respectively, and to \prm{false} otherwise.


\cmditem{ifcaselang}[language]{true}{false}

Expands to \prm{true} if the the optional \prm{language} is one of those
Expand Down
29 changes: 7 additions & 22 deletions tex/latex/biblatex/bbx/authoryear.bbx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@

\providebibmacro*{date+extrayear}{}

\newcommand*{\iflabeldateisdate}{%
\ifboolexpr{%
not test {\iffieldundef{labeldatesource}}
and
(test {\iffieldequalstr{labeldatesource}{}}
or test {\iffieldequalstr{labeldatesource}{year}})}}

\def\bbx@opt@mergedate@true{\bbx@opt@mergedate@compact}

% merge date/issue with date label
Expand Down Expand Up @@ -86,21 +79,17 @@
\ifboolexpr{
test {\iflabeldateisdate}
and
test {\iffieldundef{season}}
and
test {\iffieldundef{month}}
not test {\ifdateshavedifferentprecision{label}{}}
}
{}
{\printdate}}%
\renewbibmacro*{issue+date}{%
\ifboolexpr{
test {\iflabeldateisdate}
and
test {\iffieldundef{issue}}
and
test {\iffieldundef{season}}
not test {\ifdateshavedifferentprecision{label}{}}
and
test {\iffieldundef{month}}
test {\iffieldundef{issue}}
}
{}
{\printtext[parens]{%
Expand All @@ -119,9 +108,7 @@
\ifboolexpr{
test {\iflabeldateisdate}
and
test {\iffieldundef{season}}
and
test {\iffieldundef{month}}
not test {\ifdateshavedifferentprecision{label}{}}
and
test {\iffieldundef{extrayear}}
}
Expand All @@ -131,13 +118,11 @@
\ifboolexpr{
test {\iflabeldateisdate}
and
test {\iffieldundef{issue}}
and
test {\iffieldundef{season}}
and
test {\iffieldundef{month}}
not test {\ifdateshavedifferentprecision{label}{}}
and
test {\iffieldundef{extrayear}}
and
test {\iffieldundef{issue}}
}
{}
{\printtext[parens]{%
Expand Down
Loading

0 comments on commit 654c24b

Please sign in to comment.