我对参考书目的布局有些困惑。它应该有三列,如下所示:
- 第 1 列:[数字]
- 第 2 列:作者
- 第 3 列:标题、年份、…
我对我最近的解决方案不满意,因为第 1 列中的数字没有与顶部对齐。
这是代码:
\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},
}
@BOOK{mwe2012asdf,
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},
}
@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},
}
@ARTICLE{Goossens,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@ARTICLE{mwe20122,
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{mwe20112,
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},
}
@ARTICLE{einstein2,
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},
}
@ARTICLE{Goossens2,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@ARTICLE{mwe20123,
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{mwe20113,
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},
}
@ARTICLE{einstein3,
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},
}
@ARTICLE{Goossens3,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
\end{filecontents}
\documentclass{article}
% ------------- Schrift --------------
% ------------------------------------------
\usepackage[english,german,ngerman]{babel}
\usepackage{textcomp}
\usepackage[T1]{fontenc} %% Schriftkodierung, die nativ Umlaute unterstützt
\usepackage[ngerman]{varioref} % Querverweise mit Seitenreferenz
\usepackage[ngerman]{cleveref} % es wird automatisch "Abschnitt/Abbildung/Tabelle/Kapitel" 2.3.1 geschrieben
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss} % schönere Schrift
\usepackage[utf8]{inputenc}
\usepackage{varwidth}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
%\usepackage{textcomp}
%\usepackage[ngerman]{babel}
%\usepackage{showframe}
\usepackage{array} % > in table
\usepackage{ragged2e} % \RaggedRight in table
\usepackage{tabularx,booktabs}
\usepackage{xcolor}
\usepackage{csquotes}
\usepackage{rotating}
\usepackage[%
backend = biber,
maxnames = 99,
% sorting = nyvt,
sorting=none, % Mit der Einstellung sorting=none wird nicht sortiert, sondern die Einträge werden in der Reihenfolge, in der sie zitiert werden aufgeführt.
hyperref = true,
maxcitenames = 2,
mincitenames = 1,
natbib = true,
giveninits = true, % firstinits
style = numeric,
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{microtype}
\usepackage[colorlinks=true,breaklinks]{hyperref}
%\usepackage[sort&compress,numbers]{natbib}
%%\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.3\textwidth}>{\RaggedRight}p{0.02\textwidth}>{\RaggedRight}p{0.68\textwidth}}\\
\printnames{author} &
& % um Abstand zu erh�hen
\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}}
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\begin{tabular}[]{>{\RaggedRight}p{0.3\textwidth}>{\RaggedRight}p{0.02\textwidth}>{\RaggedRight}p{0.68\textwidth}}\\
\printnames{author} &
& % um Abstand zu erh�hen
\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{*}
asdfafwer\autocite[]{einstein}\autocite[]{mwe2011}\\
asdfafwer\autocite[]{einstein2}\autocite[]{mwe20112}\\
asdfafwer\autocite[]{einstein3}\autocite[]{mwe20113}\\
asdfafwer\autocite[]{einstein3}\autocite[]{mwe2012asdf}
\printbibliography[title=Literaturverzeichnis]
\end{document}
这是我得到的:
但它看起来应该是这样的:
答案1
使用
\begin{tabular}[t]{>{\RaggedRight}p{0.3\textwidth}>{\RaggedRight}p{0.02\textwidth}>{\RaggedRight}p{0.68\textwidth}}
\printnames{author} &
& % um Abstand zu erhöhen
...
顺便说一句,我认为为了获得额外的间距,最好使用@{\hspace{...}
而不是虚拟列>{\RaggedRight}p{0.02\textwidth}
。然后省去额外的& % um Abstand zu erhöhen
。对于不包含任何文本的列来说,>{\RaggedRight}
这无论如何都没有意义。