% $Id: btxdockit.sty,v 1.2d 2011/03/25 20:33:14 lehman stable $ % % Copyright (c) 2008-2011 Philipp Lehman. % % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License % (LPPL), version 1.3. % % The LPPL maintenance status of this software is % 'author-maintained'. % % This software is provided 'as is', without warranty of any kind, % either expressed or implied, including, but not limited to, the % implied warranties of merchantability and fitness for a % particular purpose. \def\ltd@rcsid$#1: #2 #3 #4 #5${#4 v#3} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{btxdockit} [\ltd@rcsid $Id: btxdockit.sty,v 1.2d 2011/03/25 20:33:14 lehman stable $ BibTeX documentation kit] \RequirePackage{etoolbox} \RequirePackage{ltxdockit} % environments \newenvironment*{fieldlist} {\list{}{% \setlength{\labelwidth}{\marglistwidth}% \setlength{\labelsep}{\marglistsep}% \setlength{\leftmargin}{0pt}% \renewcommand*{\makelabel}[1]{\hss\marglistfont##1}}% \def\fielditem##1##2{% \item[##1]% \ltd@pdfbookmark{##1}{##1}% field (##2)\par\nobreak \vspace{\itemsep}}% \def\listitem##1##2{% \item[##1]% \ltd@pdfbookmark{##1}{##1}% list (##2)\par\nobreak \vspace{\itemsep}}} {\endlist} \newenvironment*{typelist} {\list{}{% \setlength{\labelwidth}{\marglistwidth}% \setlength{\labelsep}{\marglistsep}% \setlength{\leftmargin}{0pt}% \renewcommand*{\makelabel}[1]{\hss\marglistfont##1}}% \def\typeitem##1{% \item[{##1}]% \ltd@pdfbookmark{##1}{##1}}% \def\reqitem{% \par\begingroup\itemsep0.5\itemsep\item Required fields: \btd@fieldloop} \def\optitem{% \par\begingroup\itemsep0.5\itemsep\item Optional fields: \btd@fieldloop}} {\endlist} \def\btd@fieldloop#1{% \interlinepenalty\@M\raggedright \def\@tempa{\def\@tempa{, }} \def\do##1{\@tempa\bibfield{##1}}% \docsvlist{#1}% \par\endgroup} % verbatim \lstdefinestyle{bibtex}{% moredelim=[is][\spotcolor]{<<}{>>}} % markup \newrobustcmd*{\bibfield}[1]{\mbox{\verbatimfont#1}} \newrobustcmd*{\bibtype}[1]{\mbox{\verbatimfont @#1}} \ifpdf \pdfstringdefDisableCommands{% \def\bibfield#1{'#1'}% \def\bibtype#1{@#1}} \fi \endinput