Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need list references with a custom format, with a label showing the type of entry (@article, @book, etc.) and labeling fix/variable fields in a tabular environment. I have successfully obtained this (see MWE below), but I still need to control/improve some aspects:

  1. Avoid numeration (How I can suppress [1] and [2] in the MWE?)
  2. Vertical position of the number of reference and their label ("Article"). How to move both to the top (unrotated) or at the same level that the first field, but both rotated, to save left space?
  3. How to center correctly the main label (Article) when rotated 90º as in the MWE?
  4. How to avoid the extra labels DOI and URL?

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{csquotes}
\usepackage{rotating}
\usepackage[backend=biber, maxnames=99, sorting=none, hyperref=true]{biblatex}
\usepackage[colorlinks=true]{hyperref}

\begin{filecontents}{\jobname.bib}

@ARTICLE{mwe2012,
  author = {Smith, A. and Johnson, B. and Willians, C.},
  title = {The three most common surnames in the United States of America},
  journal = {Review of Useless Knowledge},
  year = {2012},
  volume = {8},
  number = {1},
  pages = {290--290}
}

@ARTICLE{mwe2011,
  author = {Miller, J. and Brown, D.},
  title = {Most used surnames in fake passports},
  journal = {Journal of Nosense Ranks},
  year = {2011},
  volume = {5},
  number = {3},
  pages = {1--130},
  pmid = {1234567},
  url = {http://www.mwe.com/mwe2011},
  doi = {http://dx.doi.org/10.1016/jnr.2011.01.01},
}



\end{filecontents}

\addbibresource{\jobname.bib}  

\AtEveryBibitem{
\ifentrytype{article}{\begin{sideways}Article\end{sideways}}{}
}

% \DeclareNameFormat[article]{author}{\dotfill #1 \dotfill}
\DeclareFieldFormat[article,incollection]{title}{\bf #1\isdot}
\DeclareFieldFormat{journaltitle}{\emph{#1}}
\DeclareFieldFormat[article,incollection]{volume}{#1}
\DeclareFieldFormat[article]{number}{#1}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{year}{#1}


\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
\begin{tabular}{lp{0.75\textwidth}}     \\ 
 \textcolor{gray}{Authors:}   & \printnames{author}       \\ 
 \textcolor{gray}{Title:}    & \printfield{title}        \\  
 \textcolor{gray}{Year:}       & \printfield{year}         \\
 \textcolor{gray}{Journal:}   & \printfield{journaltitle} \\ 
 \textcolor{gray}{Volume:}   & \printfield{volume}       \\
 \textcolor{gray}{Number:}    & \printfield{number}       \\
 \textcolor{gray}{Pages:}   & \printfield{pages}        \\
 \iffieldundef{url}{}{\textcolor{gray}{\sc url:}     & \printfield{url}     \\}%
 \iffieldundef{doi}{}{\textcolor{gray}{\sc doi:}     & \printfield{doi}     \\}%
\end{tabular}
\vspace{1em}
\hrule
\usebibmacro{finentry}}

\begin{document}
\nocite{*}
\printbibliography[title=My example articles]
\end{document}
share|improve this question
add comment

1 Answer

up vote 10 down vote accepted

To avoid numeration use style=authoryear as one of the option of biblatex

For the vertical position of the Article label \rotatebox[origin=c]{90}{Article} instead of the sideways environment (It is not clear to me if you want the reference number with Article)

For removing DOI and URL use \DeclareFieldFormat{x}{\printtext[bibhyperref]{#1}} where x is either url or doi.

enter image description here

To keep the reference numbers and to have them (vertically rotated) with the Article label, an option is to redefine bibliography

\defbibenvironment{bibliography}
  {\list
     {\ifentrytype{article}
       {\rotatebox[origin=c]{90}{
         \printtext[labelnumberwidth]{%
             \printfield{prefixnumber}%
              \printfield{labelnumber}}%
            \addspace%
            \MakeSentenceCase{\thefield{entrytype}}}}
       {\printtext[labelnumberwidth]{%
         \printfield{prefixnumber}%
         \printfield{labelnumber}}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

In particular we change the fist argument where we change the argument of \list which defines the default label. With this solution there in no need to use at \AtEveryBibitem, and one can use the numeric option for style (or leave style out)

enter image description here

share|improve this answer
    
Great answer ;) –  Fran Oct 25 '12 at 2:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.