1

I need to customize my references in the following style using biblatexs Alpha style having the columns Label, Author, and Title and Other Information.

enter image description here

Till now with your help I could already change the square brackets to slashes.

My code so far is:

 \documentclass[12pt]{scrartcl}
 .
 . 
 \usepackage[%
natbib        = true,
backend       = bibtex8, %bibtex, biber
style         = alphabetic,
%citestyle     = alphabetic,
maxcitenames  = 2,
mincitenames  = 1,
%bibstyle      = alphabetic, %authoryear, %draft, %,
sorting       = nyvt,
maxbibnames   = 6,
minbibnames   = 6,
language      = ngerman,
date          = long,
backref       = false,
backrefstyle  = none,  % none, three, two, two+, three+, all+
firstinits=true 
]{biblatex}
   \usepackage[babel,german=quotes]{csquotes}
   \bibliography{input/literatur} 

   \newrobustcmd{\mkbibslashes}[1]{/#1/}

    \DeclareFieldFormat{labelalphawidth}{\mkbibslashes{#1}}
   \DeclareFieldFormat{shorthandwidth}{\mkbibslashes{#1}}

   \DeclareCiteCommand{\cite}[\mkbibslashes]
   {\usebibmacro{prenote}}
   {\usebibmacro{citeindex}%
\usebibmacro{cite}}
   {\multicitedelim}
   {\usebibmacro{postnote}}

  \renewcaptionname{ngerman}{\refname}{Literaturverzeichnis}
  .
  .
  .

Thanks again

Stefan Pinnow
  • 29,535
az4477
  • 11

1 Answers1

3

Well, your question is not so easy as you perhaps think.

You are using biblatex and style alphabetic. Therefore you need to check the files standard.bbx, alphabetic.bbx, alphabetic.cbx and at last (if needed) you have to check and search in path (for MiKTeX) C:\Program Files\MiKTeX 2.9\tex\latex\biblatex for related informations.

In file standard.bbx you can find the definitions for the layout for articles, books, etc. For example we look to the driver for article:

\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{bytranslator+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{journal+issuetitle}%
  \newunit
  \usebibmacro{byeditor+others}%
  \newunit
  \usebibmacro{note+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{issn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

Based on the linked question you can now use the following code (I did it only for article! If your bib file contains book etc you have to add the relevant drivers too):

\RequirePackage{filecontents}
\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},
}
@Book{Goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) 
             [{On} the electrodynamics of moving bodies]},
  journal = {Annalen der Physik},
  volume  = {322},
  number  = {10},
  pages   = {891--921},
  year    = {1905},
  DOI     = {http://dx.doi.org/10.1002/andp.19053221004},
}
\end{filecontents}


\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[ngerman]{babel}

\usepackage{showframe}
\usepackage{array}    % > in table
\usepackage{ragged2e} % \RaggedRight in table

\usepackage{xcolor}
\usepackage{csquotes}
\usepackage{rotating}
\usepackage[%
  backend      = biber, 
  maxnames     = 99, 
  sorting      = nyvt, 
  hyperref     = true,
  maxcitenames = 2,
  mincitenames = 1,
  natbib       = true,
  giveninits   = true, % firstinits
  style        = alphabetic
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{microtype}
\usepackage[colorlinks=true,breaklinks]{hyperref}



\newrobustcmd{\mkbibslashes}[1]{/#1/}
\DeclareFieldFormat{labelalphawidth}{\mkbibslashes{#1}}
\DeclareFieldFormat{shorthandwidth}{\mkbibslashes{#1}}
\DeclareFieldFormat{mkbibslashes}{\mkbibslashes{#1}}

\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\finentrypunct}{}                  % no punct after entry

\DeclareCiteCommand{\cite}[\mkbibslashes]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}\usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}



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

\DeclareFieldFormat{doi}{\printtext[bibhyperref]{#1}}
\DeclareFieldFormat{url}{\printtext[bibhyperref]{#1}}



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


\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
\begin{tabular}{>{\RaggedRight}p{0.2\textwidth}>{\RaggedRight}p{0.68\textwidth}}\\ 
  \printnames{author} & 
    \printfield{title}\newunit \printfield{year}\newunit  
    \printfield{journaltitle}\newunit \printfield{volume}\newunit
    \printfield{number}\newunit \printfield{pages}\newunit 
    \printfield{url}\newunit \printfield{doi}\newunit \\%
\end{tabular}
\vspace{1em}% 1em
\hrule
\usebibmacro{finentry}}

\begin{document}
\nocite{*} \cite{mwe2011}
\printbibliography[title=My example articles]
\end{document}

To save a little bit space it is nice to rotate the label for 90 degrees. If you do not want this please change the code

   {\rotatebox[origin=c]{90}{
     \printtext[labelalphawidth]{% mkbibslashes
       \printfield{prefixnumber}%
       \printfield{labelalpha}%
       \printfield{extraalpha}}%
        %\addspace%
        %\MakeSentenceCase{\thefield{entrytype}}%
   }}

to

   {%\rotatebox[origin=c]{90}{
     \printtext[labelalphawidth]{% mkbibslashes
       \printfield{prefixnumber}%
       \printfield{labelalpha}%
       \printfield{extraalpha}}%
        %\addspace%
        %\MakeSentenceCase{\thefield{entrytype}}%
   }%}       

and change the line

  {\setlength{\labelwidth}{\labelnumberwidth}%\labelnumberwidth or \labelalphawidth

to

 {\setlength{\labelwidth}{\labelalphawidth}%\labelnumberwidth or \labelalphawidth      

I added some bib entrys to show you that you need to add the relevant drivers for book etc.

With the code

\begin{tabular}{>{\RaggedRight}p{0.2\textwidth}>{\RaggedRight}p{0.68\textwidth}}\\ 
  \printnames{author} & 
    \printfield{title}\newunit \printfield{year}\newunit  
    \printfield{journaltitle}\newunit \printfield{volume}\newunit 
    \printfield{number}\newunit \printfield{pages}\newunit 
    \printfield{url}\newunit \printfield{doi}\newunit \\%
\end{tabular}

I defined the needed tabular for your needs. Please see that you have to play with the width of the two columns p{0.2\textwidth} and p{0.68\textwidth}. With {\RaggedRight} I forced a left justified layout for both columns (better, because the lines becomes very short).

The two lines

\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\finentrypunct}{}                  % no punct after entry 

changes the sign between units to comma (as shown in your screenshot) and deletes the closing punct for each entry.

At last the two lines

\vspace{1em}% 1em
\hrule

divedes each printed entry with a horizontal rule. I personaly do not like that and would delete it.

You need to add similar drivers for the other types of entrys ...

Then I get the result:

result of changed mwe

Please see that this is a starting point, you need to complete it. But with the given information it should be possible ...

Mensch
  • 65,388