
我有一個關於參考書目的問題。我不是 LaTeX 專業人士,目前是否必須使用嵌入式參考書目或 bobtex 對我來說並不重要。問題是,我怎麼能完成我需要的格式化。以下是參考書目成員的範例:
[1] Doe J.: How to format bibliography?. JohnDoe limited, Warsaw, 2015.
正如您所看到的,作者姓名的放置方式是點和冒號。標題應該是斜體。然後是昏迷出版商、城鎮和年份。我將不勝感激所有與此相關的幫助!
答案1
為了達到你想要的效果,你可以修改utphys.bst文件如下:
首先,您必須更換
FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
{ ", " * write$ }
{ output.state after.quote =
{ " " * write$ }
{ output.state after.block =
{ add.period$ write$
newline$
"\newblock " write$
}
{ output.state before.all =
'write$
{ output.state after.quoted.block =
{ write$
newline$
"\newblock " write$
}
{ add.period$ " " * write$ }
if$
}
if$
}
if$
}
if$
mid.sentence 'output.state :=
}
if$
s
}
by(這將用冒號替換最後一個作者後面的逗號):
FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
{ ": " * write$ } % Modified
{ output.state after.quote =
{ " " * write$ } % between Title and journal
{ output.state after.block =
{ add.period$ write$
newline$
"\newblock " write$
}
{ output.state before.all =
'write$
{ output.state after.quoted.block =
{ write$
newline$
"\newblock " write$
}
{ add.period$ " " * write$ }
if$
}
if$
}
if$
}
if$
mid.sentence 'output.state :=
}
if$
s
}
並且您還應該替換代碼:
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := % Modified
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ "," * }
'skip$
if$
t "others" =
{ " {\em et~al.}" * }
{ string.and * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
by (這會將姓名格式變更為{jj.~}{vv~}{ll}{ f}
,其中:jj
代表後綴,例如 Sr,vv
代表 von 部分,ll
代表姓氏,f
代表名字的第一個字母):
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr "{jj.~}{vv~}{ll}{ f}" format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ "," * } % { "," * }
'skip$
if$
t "others" =
{ " {\em et~al.}" * }
{ string.and * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
要製作文章標題italic
並刪除其周圍的引號,您必須替換代碼:
FUNCTION {format.title}
{ title empty$
{ "" }
{ "``" title "t" change.case$ * ",''" * }
if$
}
FUNCTION {format.title.p}
{ title empty$
{ "" }
{ "``" title "t" change.case$ * ".''" * }
if$
}
透過代碼:
FUNCTION {format.title}
{ title empty$
{ "" }
{ "" title emphasize "t" change.case$ * "." * } % Modified
if$
}
FUNCTION {format.title.p}
{ title empty$
{ "" }
{ "``" title "t" change.case$ * " ''." * }
if$
}
為了防止「期刊名稱」被替換,italic
您必須替換
FUNCTION {format.journal}
{ journal missing$
{ "" }
{journal emphasize " " *
format.volume *
format.number *
format.date.paren *
format.pages.nopp *
}
if$
}
經過
FUNCTION {format.journal}
{ journal missing$
{ "" }
{journal " " * % Modified
format.volume *
format.number *
format.date.paren *
format.pages.nopp *
}
if$
}
A微量元素:
\documentclass{article}
\begin{filecontents*}{test.bib}
@book{Albuquerque2015,
address = {Cham},
author = {Albuquerque, Ulysses Paulino},
doi = {10.1007/978-3-319-06517-5},
isbn = {978-3-319-06516-8},
pages = {67},
publisher = {Springer International Publishing},
title = {{Speaking in Public About Science}},
year = {2015}
}
@article{B,
author = {AuthorA, A. and AuthorB, B. and AuthorC, C.},
journal = {Journal of Physics},
pages = {1233},
title = {{Title of the paper}},
volume = {567},
year = {2016}
}
\end{filecontents*}
\begin{document}
~\nocite{*}
%Bibleography
\bibliographystyle{utphys}
\bibliography{test}
\end{document}
它給:
更新:為了在縮寫名稱後面有一個點並and
在姓氏之前刪除,您FUNCTION {format.names}
必須替換為:
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr "{jj.~}{vv~}{ll}{ f.}" format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ ", " * } % { "," * }
'skip$
if$
t "others" =
{ " {\em et~al.}" * }
{ t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}