修改 BST 樣式並呼叫引用

修改 BST 樣式並呼叫引用

我有兩個正在努力解決的問題。

第一個涉及編輯 BST 文件以滿足我的需要。我想要看起來像這樣的東西: 在此輸入影像描述

\par我能夠透過插入原始圍兜條目(例如)來獲得註釋和 URL 之間的換行符,note={\par blah blah blah}但肯定有一種更簡單、更優雅的方法嗎?另外,我想在文章標題後換行。我做了各種修改:

FUNCTION {article}
{ output.bibitem
    format.title "title" output.check
  new.block
  format.authors "author" output.check
  new.block
  crossref missing$
    {
      journal
      "journal" bibinfo.check
      emphasize
      "journal" output.check
      format.date "year" output.check
      date.block
      format.vol.num.pages output
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  format.issn output
  new.block
  format.url output 
  new.block
  format.note output
  fin.entry
}

沒有任何成功。我在哪裡或如何修改上面的內容以插入換行符。或應該編輯:

FUNCTION {format.title}
{ title
  duplicate$ empty$ 'skip$
    { "t" change.case$ }
  if$
  "title" bibinfo.check
  duplicate$ empty$ 'skip$
    {
      bolden
    }
  if$
}

FUNCTION {format.note}
{
 note empty$
    {  "" }
    { note #1 #1 substring$
      duplicate$ "{" =
        'skip$
        { output.state mid.sentence =
          { "l" }
          { "u" }
       if$
        change.case$
        }
      if$
      note #2 global.max$ substring$ * "note" bibinfo.check
    }
  if$
} ?

另一個問題是日期。我不想要年後的句號,我只想要一個空間。 (我發誓這是我指示 makebst 的...)過去我編輯了日期字段以用句點替換逗號,但我在日期函數中看不到有關句點和逗號的任何內容:

FUNCTION {format.date}
{
  month "month" bibinfo.check
  duplicate$ empty$
  year  "year"  bibinfo.check duplicate$ empty$
    { swap$ 'skip$
        { "there's a month but no year in " cite$ * warning$ }
      if$
      *
    }
    { swap$ 'skip$
        {
          swap$
          " " * swap$
        }
      if$
      *
    }
  if$
  duplicate$ empty$
    'skip$
    {
      before.all 'output.state :=
    " " swap$ *
    }
  if$
}

第二個問題就更大膽了。我希望 PDFLaTeX 在文件正文中呼叫引文(如 BST 檔案中定義),就像輸入 .tex 檔案而不是引文一樣。因此,它將載入我定義的整個條目,而不是顯示(例如)Akbarzadeh et al 2016 的文字。我不想要看起來像參考書目但看起來更像這樣的東西:

在此輸入影像描述

有什麼想法如何實現這一點?我希望有一個包可以做到這一點。

我不確定需要什麼類型的最小範例...讓我知道您認為需要什麼來幫助解決這個問題。

謝謝

答案1

我無法弄清楚 BibLaTeX (它似乎無法在 TeXWorks 中運行,或者包有問題或其他什麼...),但我在這裡找到了解決方案:https://tug.org/pracjourn/2008-1/calleecharan/

最小範例:Tex 文件

\documentclass[a4paper]{article}
\usepackage[twoside,inner=25.4mm,tmargin=25.4mm,nohead,bmargin=25.4mm,textwidth=159.2mm]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{lastpage}
\usepackage{url}

\begin{document}
\nocite{begcla1}

\nocite{art2}

\nocite{endcla1}

\nocite{art1}

\nocite{endcla2}

%\nocite{Elem2}

\bibliographystyle{datastyle}
\bibliography{dataset}

\end{document}

圍兜文件:

@CREATESECTION{begcla1,
heading={Section 1} 
}

@style1{art1,
title = { My dog eats cats},
author = {Katz, JP},
journal = { Cat cuisine},
volume = {1},
pages = {3--5},
year = {2016},
url = {\url{http://www.cateaters.com}},
note = {I found this article delicious.}
}

@ENDSECTION{endcla1
}

@CREATESECTION{begcla2,
heading={Section 2} 
}

@style1{art2,
title = { My cat eats dogs},
author = {Dags, JP},
journal = { Dog cuisine},
volume = {1},
pages = {3--5},
year = {2016},
url = {\url{http://www.dogeaters.com}},
note = {It made me gag.}
}

@ENDSECTION{endcla2
}

.bst 檔案:

Entry
{
title
heading
author
journal
volume
pages
year
url
note
} {} {}

FUNCTION{print}
{
    cite$ pop$
}

FUNCTION {bolden}
{ duplicate$ empty$
    { pop$ "" }
    { "{\fontfamily{lmss}\bfseries\selectfont\large " swap$ * "}" * }
  if$
}

FUNCTION {format.heading}
{ heading bolden
}

FUNCTION{createsection}
{
"\vspace{0.5cm}" write$
newline$ newline$ write$
newline$ newline$ write$
 write$ newline$ print format.heading write$ newline$  write$
newline$ newline$ write$
newline$ newline$ write$
"\vspace{0.25cm}" write$
}

FUNCTION{Style1}{
"{\fontfamily{lmss}\bfseries\selectfont " write$ print title write$ "}"     write$%
print write$ ". " write$ newline$ newline$
print write$ author write$%
print write$ ". " write$%
print "{\em " write$ print journal write$ "}" write$%
print write$ ", " write$%
print volume  write$%
print write$ ":" write$%
print pages  write$%
print write$ ", " write$%
print write$ year write$%
print write$ "." write$ newline$ newline$
print write$ url  write$ newline$ newline$
print write$ ``{\normalsize `` write$ print note write$ ``}'' write$     newline$ newline$
}

FUNCTION{fin}
{newline$
}

Read

ITERATE{call.type$}

EXECUTE{fin}

我想找到一種方法將\url格式包含在 BST 而不是 bib 檔案中,但還沒有弄清楚如何做。這不是我希望的那麼優雅的解決方案,但它會起作用。

如果有人對如何整理程式碼有任何建議,我們將不勝感激。我真的不知道我在做什麼...

相關內容