BibTeX, biblatex and biberHow an we force one citation to appear at the top of the reference list?

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
jjmm
Posts: 13
Joined: Tue Jul 12, 2016 5:23 am

How an we force one citation to appear at the top of the reference list?

Post by jjmm »

I try to make one citation appear at the top of the reference list by adding a field in my bib file:
absorder = 1
absorder = 0
absorder = "//"
absorder = ""
However, any of the above would make that specific citation appear the bottom of the reference list. The only way in my mind is to add "absorder = 1" to that specific citation and "absorder = 100" to all the others.(I've not tried it, but I think it would work) Is there any easier way?

The following is part of my bst code. The full code is attached (in txt).

Code: Select all

%%% Create sort.key$: absorder -> author -> year -> order -> month -> title.
FUNCTION {presort.one}
{
  bst.no.sort #0 = not
    { order.cited int.to.str$ add.zero.to.number " " * }
    { "" }
  if$
  bst.sort.year #0 = not
    %% Use year field as the primary sorting key.
    { year convert.year * }
    'skip$
  if$
  bst.sort.entry.type #0 = not
    { type$ bst.sort.entry.type.order * " " * }
    'skip$
  if$
  absorder empty$
    { "/// " * }
    { bst.notuse.absorder.field #0 =
       { absorder "999" =
          { "zzz " * }
          { absorder add.zero.to.number "000" =
             { "/// " * }
             { absorder add.zero.to.number * " " * }
            if$
          }
         if$
       }
       { "/// " * }
      if$
    }
  if$
  " " *
  sort.label.abb *
  " " *  
  type$ "book" = type$ "inbook" = or
    'author.editor.sort
    { type$ "proceedings" =
        'editor.organization.sort
        { type$ "manual" =
            'author.organization.sort
            'author.sort
          if$
        }
      if$
    }
  if$
  * " " *
  " "
  order empty$
    { "/// " * }
    { bst.notuse.order.field #0 =
       { order "999" =
          { "zzz " * }
          { order add.zero.to.number "000" =
             { "/// " * }
             { order add.zero.to.number * " " * }
            if$
          }
         if$
       }
       { "/// " * }
      if$
    }
  if$
  month empty$
    { * "/// " * }
       { month "999" =
          { * month add.zero.to.number * "zzz " * }
          { month add.zero.to.number "000" =
             { * month add.zero.to.number * "/// " * }
             { * month add.zero.to.number * " " * }
            if$
          }
         if$
       }
  if$
  title field.or.null sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
  % For debug
  econ.debug #0 = not
    { "``\texttt{" write$
      sort.key$ write$
      "}''\\" write$
      newline$
    }
    'skip$
 if$
}
Attachments
bsttest.txt
(78.9 KiB) Downloaded 229 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply