diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-ext/ext-dashed-common.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-ext/ext-dashed-common.bbx | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-ext/ext-dashed-common.bbx b/Master/texmf-dist/tex/latex/biblatex-ext/ext-dashed-common.bbx new file mode 100644 index 00000000000..9cc19172a35 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-ext/ext-dashed-common.bbx @@ -0,0 +1,73 @@ +\ProvidesFile{ext-dashed-common.bbx} + [2018/03/18 v0.1 common files for extended biblatex + dashed bibliography styles (MW)] + +% \DeclareBibliographyOption checks if an option is already defined. +% if we want to overwrite the definition we need to trick it into +% thinking the option has not been defined yet. +\csundef{KV@blx@opt@pre@dashed} +% We want to define 'dashed' with a new type, so we need to make biblatex +% forget about the old type when it passes the options over to Biber. +\ifundef\listcsremove + {\PackageWarningNoLine{biblatex-ext}{% + 'etoolbox' does not provide '\string\listcsremove'.\MessageBreak + Please update 'etoolbox' to v2.4 (2017-01-02)\MessageBreak or later}} + {\listcsremove{blx@globalopts@boolean}{dashed}} + +\DeclareBibliographyOption[string]{dashed}[true]{% + \ifcsdef{extblx@opt@dashed@#1} + {\csuse{extblx@opt@dashed@#1}} + {\PackageWarningNoLine{biblatex-ext}{% + Invalid value '#1' for option 'dashed'.\MessageBreak + Possible values are 'fullhash', 'true',\MessageBreak + 'bibnamehash', 'false'.\MessageBreak + Falling back to 'dashed=false'}% + \csuse{extblx@opt@dashed@false}}} + +\csdef{extblx@opt@dashed@fullhash}{% + \ExecuteBibliographyOptions{pagetracker}% + \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@lasthash}}% + \renewbibmacro*{bbx:dashcheck}[2]{% + \ifboolexpr{ + test {\iffieldequals{fullhash}{\bbx@lasthash}} + and + not test \iffirstonpage + and + ( + not bool {bbx@inset} + or + test {\iffieldequalstr{entrysetcount}{1}} + ) + } + {##1} + {##2}}} +\csletcs{extblx@opt@dashed@true}{extblx@opt@dashed@fullhash} + +\csdef{extblx@opt@dashed@bibnamehash}{% + \ExecuteBibliographyOptions{pagetracker}% + \renewbibmacro*{bbx:savehash}{\savefield{bibnamehash}{\bbx@lasthash}}% + \renewbibmacro*{bbx:dashcheck}[2]{% + \ifboolexpr{ + test {\iffieldequals{bibnamehash}{\bbx@lasthash}} + and + not test \iffirstonpage + and + ( + not bool {bbx@inset} + or + test {\iffieldequalstr{entrysetcount}{1}} + ) + } + {##1} + {##2}}} + +\csdef{extblx@opt@dashed@false}{% + \renewbibmacro*{bbx:savehash}{}% + \renewbibmacro*{bbx:dashcheck}[2]{##2}} + +% We need to execute the option that were already executed +% by the standard styles again, because we changed the +% underlying definitions. +\ExecuteBibliographyOptions{dashed=true}% + +\endinput |