我还想删除参考书目中的数字并用命令替换它们\softbullet
。我该怎么做?
以下是 MWE:
\documentclass{article}
\usepackage{xcolor}
\definecolor{soft}{rgb}{0.45,0.45,0.45}
% From .sty file:
\newcommand{\softbullet}{\textcolor{soft}{\small\textbullet}\hspace{0.5em}}
\makeatletter
\newcommand{\firstname}[1]{\def\@firstname{#1}}
\newcommand{\vonname}[1]{\def\@vonname{#1}}
\newcommand{\lastname}[1]{\def\@lastname{#1}}
\newcommand{\name}{\@firstname\ \@vonname \@lastname}
\makeatother
\RequirePackage[%
backend=biber,
bibstyle=publist,
hyperref=auto
]{biblatex}
% Some code to get first name, middle name von-part and surname.
\makeatletter
\plauthorname[\@firstname][\@vonname]{\@lastname}
\makeatother
\renewcommand{\bibsetup}{\vspace*{-\baselineskip}}
\AtEveryBibitem{\makebox[\bibhang][l]{\softbullet}}
\setlength{\bibitemsep}{0.25\baselineskip}
\begin{filecontents}[overwrite]{sample.bib}
@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",
}
@book{dirac,
title = {The Principles of Quantum Mechanics},
author = {Paul Adrien Maurice Dirac},
isbn = {9780198520115},
series = {International series of monographs on physics},
year = {1981},
publisher = {Clarendon Press},
}
\end{filecontents}
\addbibresource{sample.bib}
% This will be defined by users:
\firstname{Paul Adrien Maurice}
\lastname{Dirac}
\begin{document}
Hello, my name is \par
\name
\nocite{*}
\printbibliography
\end{document}
输出如下:
我希望灰点位于数字所在的位置。如果我使用style=authoryear,
而不是 ,bibstyle=publist,
我会得到以下结果:
这正是我想要的,但能够bibstyle=publist,
隐藏作者。
答案1
itemize
您可以根据中的定义来定义一个书目环境article
。
\documentclass{article}
\usepackage{xcolor}
\definecolor{soft}{rgb}{0.45,0.45,0.45}
% From .sty file:
\newcommand{\softbullet}{\textcolor{soft}{\small\textbullet}\hspace{0.5em}}
\makeatletter
\newcommand{\firstname}[1]{\def\@firstname{#1}}
\newcommand{\vonname}[1]{\def\@vonname{#1}}
\newcommand{\lastname}[1]{\def\@lastname{#1}}
\newcommand{\name}{\@firstname\ \@vonname \@lastname}
\makeatother
\RequirePackage[%
backend=biber,
bibstyle=publist,
plnumbered=false,
]{biblatex}
% Some code to get first name, middle name von-part and surname.
\makeatletter
\plauthorname[\@firstname][\@vonname]{\@lastname}
\makeatother
\renewcommand{\bibsetup}{\vspace*{-\baselineskip}}
\setlength{\bibitemsep}{0.25\baselineskip}
\defbibenvironment{bibliography}
{\list
{\labelitemfont\softbullet}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\def\makelabel##1{\hss\llap{##1}}}}%
{\endlist}
{\item}
\begin{filecontents}{\jobname.bib}
@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",
}
@book{dirac,
title = {The Principles of Quantum Mechanics},
author = {Paul Adrien Maurice Dirac},
isbn = {9780198520115},
series = {International series of monographs on physics},
year = {1981},
publisher = {Clarendon Press},
}
\end{filecontents}
\addbibresource{\jobname.bib}
% This will be defined by users:
\firstname{Paul Adrien Maurice}
\vonname{}
\lastname{Dirac}
\begin{document}
Hello, my name is \par
\name
\nocite{*}
\printbibliography
\end{document}