1

I have two problems I am grappling with.

The first involves editing the BST file to suit my needs. I want something that looks like this: enter image description here

I was able to get the line break between the note and the URL by inserting \par in the original bib entry (e.g. note={\par blah blah blah}) but surely there is an easier, more elegant way? Also, I would like a line break after the article title. I have made various modifications to:

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
}

Without any success. Where or how can I modify the above to insert a line break. Or should be editing:

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

and

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$
} ?

The other issue is the date. I don't want a period after the year, I just want a space. (I swore this is what I instructed makebst...) In the past I have editted the date field to replace a comma with a period but I can't see anything about periods and commas in the date function:

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$
}

The second question is more daring. I want PDFLaTeX to call the citation (as defined in the BST file) in the body of the document as if it were inputting a .tex file instead of a citation. So, instead of the text showing (for example) Akbarzadeh et al 2016 it will load the entire entry as I have defined it. I don't want something that looks like a bibliography but will look more like this:

enter image description here

Any ideas how to accomplish this? I am hoping there is a package somewhere that does just this.

I'm not sure what type of minimal example is needed... Let me know what you think you need to help solve this.

Thanks

  • The best option for your requests would be to switch to biblatex. You can program the output of your bibliography in latex. The second requests would be just a by-product of the switch and all you need is to call \fullcite{key}. – Guido Feb 15 '16 at 1:13
  • Thank you, Guido. I will have a look at BibLaTeX and see if I can figure it out. Thanks also for tidying up my post. I couldn't figure out how to insert the code. Thanks – Tyrone Feb 15 '16 at 13:47
1

I couldn't figure out BibLaTeX (it doesn't seem to run in TeXWorks or there was a problem with the Package or something...) but I found a solution here: https://tug.org/pracjourn/2008-1/calleecharan/

Minimal examples: The Tex File

\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}

The bib file:

@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
}

the bst file:

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}

I would like to find a way to include the \url formatting in the BST instead of the bib file but haven't figured out how to. This isn't as elegant a solution as I had hoped but it will do a job.

If anyone has any suggestions on how to tidy the code it would be much appreciated. I don't really know what I'm doing...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.