texlive[48983] Master/texmf-dist: biblatex-opcit-booktitle (24oct18)

commits+karl at tug.org commits+karl at tug.org
Wed Oct 24 22:30:14 CEST 2018


Revision: 48983
          http://tug.org/svn/texlive?view=revision&revision=48983
Author:   karl
Date:     2018-10-24 22:30:14 +0200 (Wed, 24 Oct 2018)
Log Message:
-----------
biblatex-opcit-booktitle (24oct18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle-example.pdf
    trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle.pdf
    trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle.tex
    trunk/Master/texmf-dist/tex/latex/biblatex-opcit-booktitle/biblatex-opcit-booktitle.sty

Modified: trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle-example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle.tex	2018-10-24 20:29:56 UTC (rev 48982)
+++ trunk/Master/texmf-dist/doc/latex/biblatex-opcit-booktitle/documentation/biblatex-opcit-booktitle.tex	2018-10-24 20:30:14 UTC (rev 48983)
@@ -13,6 +13,7 @@
 \hypersetup{citecolor=black}
 % Usefull commands
 \newcommand{\biblatex}{biblatex\xspace}
+\newcommand{\meta}[1]{\texttt{<#1>}}
 \pretocmd{\bibfield}{\sloppy}{}{}
 \pretocmd{\bibtype}{\sloppy}{}{}
 \newcommand{\namebibstyle}[1]{\texttt{#1}}
@@ -22,8 +23,8 @@
   subtitle={Abbreviated references},
   email={maieul <at> maieul <dot> net},
   author={Maïeul Rouquette},
-  revision={1.8.0},
-  date={2017/03/27},
+  revision={1.9.0},
+  date={2018/10/24},
   url={https://git.framasoft.org/maieul/biblatex-opcit-booktitle}}
 
 % biblatex
@@ -139,12 +140,12 @@
 
 There is not other thing to do!
 
-The feature works with these entrytypes:  \bibtype{inbook}, \bibtype{incollection}, \bibtype{inproceedings}, \bibtype{bookinbook}. 
+The feature works with these entrytypes:  \bibtype{inbook}, \bibtype{incollection}, \bibtype{inproceedings}, \bibtype{bookinbook}.
 
 If you define a \bibfield{shorttitle} in the main entry, it will be used instead of the full title when we need an abbreviated form.
 \subsection{Limits}
 
-We have not implemented options to use abbreviation like \verb+ibid+, because we want to have not ambiguous abbreviated forms. 
+We have not implemented options to use abbreviation like \verb+ibid+, because we want to have not ambiguous abbreviated forms.
 
 If you have redefined the \verb+cite+ bibliographic macro, you must changes:
 \begin{minted}{latex}
@@ -158,6 +159,17 @@
 \usebibmacro{cite:test:ifrelated}
 \end{minted}
 
+\subsection{Use in final bibliography}\label{bibliography}
+
+The package has a \opt{bibliography=<value>} option. \meta{value}  can be:
+\begin{description}
+  \item[shorttitle] the final bibliography will print the short form of \bibfield{booktitle} field, and not the full form;
+  \item[onlyshortitle] like the previous one, but also clear the field related to the main entry (except the editor), like the location, the date, the publisher.
+\end{description}
+If loaded, the final bibliography will print the short form of \bibfield{booktitle} field, and not the full form.
+
+
+
 \subsection{Use with own citation style}
 
 If you have created your own citation style file (\verb.+cbx.), you must create a bibliographic driver called \verb+inbook:rel:<yourcitationstyle>+. You can look at the model \verb+inbook:rel:verbose-trad-xxx+  in the .sty file, or just use \cs{DeclareBibliographyAlias} to use an already existing model.
@@ -174,8 +186,8 @@
 \subsection{Use with new entrytypes}
 
 If you create new entrytypes, as the \emph{biblatex-bookintother} package does, you can let know to \emph{biblatex-opcit-booktitle} that these entry types are concerned by using short form of the main entry.
- 
 
+
 To do it, just add in your \verb+.bbx+ or \verb+.dbx+ file:
 \begin{minted}{latex}
 \listadd\opcit at booktitle@entrytypes{<newentrytype>}
@@ -198,7 +210,7 @@
 
 
 
-This package was created for Maïeul Rouquette's phd dissertation\footnote{\url{http://apocryphes.hypothese.org}.} in 2015. It is freely inspired by Paul Stanley code.\footnote{\url{http://tex.stackexchange.com/a/172777/7712}.} It is licensed on the \emph{\LaTeX\ Project Public License}.\footnote{\url{http://latex-project.org/lppl/lppl-1-3c.html}.}.
+This package was created for Maïeul Rouquette's phd dissertation\footnote{\url{http://apocryphes.hypothese.org}.} in 2015. It is freely inspired by Paul Stanley code.\footnote{\url{http://tex.stackexchange.com/a/172777/7712}.} It is licensed on the \emph{\LaTeX\ Project Public License}.\footnote{\url{http://latex-project.org/lppl/lppl-1-3c.html}.}
 
 
 All issues can be submitted, in French or English, in the Framasoft issues page\footnote{\url{https://git.framasoft.org/maieul/biblatex-opcit-booktitle/issues}.}.
@@ -209,11 +221,16 @@
 
 \begin{changelog}
 
-\begin{release}{1.8.0}{2016-03-27}
+\begin{release}{1.9.0}{2018-10-24}
+  \item Add \opt{bibliography} option to the package. See~\ref{bibliography}.
+  \item Avoid side effect when mixing entries with direct booktitle and entry with inherited booktitle.
+\end{release}
+
+\begin{release}{1.8.0}{2017-03-27}
   \item Add support entrytype where you don't need to print volume number.
 \end{release}
 
-\begin{release}{1.7.0}{2016-09-08}
+\begin{release}{1.7.0}{2017-02-08}
   \item Add support for the \option{citetracker=context} option of \biblatex.
 \end{release}
 

Modified: trunk/Master/texmf-dist/tex/latex/biblatex-opcit-booktitle/biblatex-opcit-booktitle.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/biblatex-opcit-booktitle/biblatex-opcit-booktitle.sty	2018-10-24 20:29:56 UTC (rev 48982)
+++ trunk/Master/texmf-dist/tex/latex/biblatex-opcit-booktitle/biblatex-opcit-booktitle.sty	2018-10-24 20:30:14 UTC (rev 48983)
@@ -1,5 +1,5 @@
 % Copyright 2015-... Maïeul Rouquette
-% 
+%
 % Inspired by Paul Stanley http://tex.stackexchange.com/a/172777/7712
 %
 %
@@ -12,14 +12,20 @@
 % version 2005/12/01 or later.
 %
 % This work has the LPPL maintenance status `maintained'.
-% 
+%
 % The Current Maintainer of this work is Maïeul Rouquette
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{biblatex-opcit-booktitle}[2017/03/27 v1.8.0 Manage op. cit. when using subentry]
+\ProvidesPackage{biblatex-opcit-booktitle}[2018/10/24 v1.9.0 Manage op. cit. when using subentry]
 \RequirePackage{xpatch}
+\RequirePackage{xkeyval}%
 
+\newtoggle{opcit at booktitle@bibliography at shorttitle}%
+\newtoggle{opcit at booktitle@bibliography at onlyshorttitle}%
+\DeclareOptionX{bibliography}[]{\toggletrue{opcit at booktitle@bibliography@#1}}%
+\ProcessOptionsX%
+
+% Declaration of the entries concerned. Some package could have already add their own entry
 \def\opcit at booktitle@entrytypes at novolume{}
-% Declaration of the entry concerned. Some package could have already add their own entry
 \listadd\opcit at booktitle@entrytypes{inbook}
 \listadd\opcit at booktitle@entrytypes{incollection}
 \listadd\opcit at booktitle@entrytypes{inproceedings}
@@ -61,9 +67,9 @@
    {#1}%
   }%
 }%
-   
 
 
+
 \RequirePackage{ltxcmds}
 \newcommand{\opcit at booktitle@failpatch}[2]{%
   \PackageError{opcit-booktitle}{Fail to patch `#1` bibmacro (#2)}{}%
@@ -116,20 +122,33 @@
          \usebibmacro{cite:seen:related}%
          \usebibmacro{cite:full}%
          }}%
-        {\usebibmacro{related:info}}}} 
-        
-\newbibmacro*{related:info}{%
-  % Here an hack to use the short form of the booktitle without recurring to a .dbx file in order to define new fields (because recurring to a .dbx file for such feature is complex for a little feature)
+        {\usebibmacro{related:info}}}}
+
+% Here an hack to use the short form of the booktitle without recurring to a .dbx file in order to define new fields (because recurring to a .dbx file for such feature is complex for a little feature).
+% The related:info:booktitle macro change the booktitle field to the shorttitle field of the parent entry.
+% The related:info calls this macro and them call the driver of the main entry.
+
+\newbibmacro*{related:info:booktitle}{%
+  \undef\shortbooktitle%
+  \undef\bookentrytype%
   \entrydata{\thefield{crossref}}{%
     \savefield{shorttitle}{\shortbooktitle}%
     \savefield{entrytype}{\bookentrytype}%
   }%
   \ifdef{\shortbooktitle}%
+  {%
+    \iffieldundef{crossref}%
+    {}%
     {%
       \restorefield{booktitle}{\shortbooktitle}%
       \clearfield{booksubtitle}%
     }%
-    {}%
+  }%
+  {}%
+}%
+
+\newbibmacro*{related:info}{%
+  \usebibmacro{related:info:booktitle}%
   \usebibmacro{cite:full:citepages}%
   \printtext[bibhypertarget]{\usedriver%
     {\DeclareNameAlias{sortname}{default}}%
@@ -275,4 +294,32 @@
       \setunit{\labelnamepunct}\newblock%
       }%
 }
+
+% Patching begenentry macro to apply bibliography option
+\xpretobibmacro{begentry}%
+  {%
+    \ifbibliography%
+      {\usebibmacro{opcitbooktitle:bibliography}}%
+      {}%
+  }%
+  {}%
+  {\opcit at booktitle@failpatch{begentry}{standard.bbx}}%
+
+\newbibmacro{opcitbooktitle:bibliography}{%
+  \iftoggle{opcit at booktitle@bibliography at shorttitle}%
+    {\usebibmacro{related:info:booktitle}}%
+    {}%
+  \iftoggle{opcit at booktitle@bibliography at onlyshorttitle}{%
+    \usebibmacro{related:info:booktitle}%
+    \iffieldundef{crossref}{}{%
+      \clearlist{publisher}%
+      \clearlist{location}%
+      \clearfield{series}%
+      \clearfield{number}%
+      \clearfield{year}%
+      \clearfield{month}%
+      \clearfield{day}%
+      }%
+    }{}%
+}%
 \endinput



More information about the tex-live-commits mailing list