TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

BibTeX
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


ASCII2BibTeX | 
Bib manager (GUI) |  bib-file test |  Bibliography as Footnotes |  Bibliography in TOC |  Bibliography with No Label |  BibTeX-Software | 
Changing Bibliography/References-name |  Citation with no reference | 
Default Path for bib-files | 
Editing BibTex-stylefiles |  Examples for bibentries | 
footbib | 
Harvard-Style |  Heading numbered |  Heading title |  Heading title name changing | 
No Label in Bibliography | 
Multiple citations | 
Natbib Demo |  Numbered heading | 
overcite | 
paranthesis in citation or bibliography |  Path for bib-files |  "pnamed" BibTeXstyle |  Preamble |  Printing all bibfile entries | 
Spacing | 
Testing a bib-file |  Title  | 
URL's in bibentries  | 
Vertical Spacing  | 
Links
Packages
achemso
achicago-bst
apacite
apasoft
beebe
bibdb
bibfins
bibfins
biblist
chem-journal
custom-bib
frankenbundle
germbib
jurabib
neuron
oxford
urlbst


BiBTeX manager and tools

Bibtex Manager | BibDB | Bookcase | JabREF | Java BibTeX | Pybliographer | refDB | Document Database | ZNote | tkBibTeX | Barracuda | GBib |


Changing the Bibliography Title
Write just at the place where the bib should be printed.
\begingroup
  \makeatletter
  \def\@schapter#1{%
    \parindent\z@\raggedright
    \Huge\textsc{\bibname}\par\normalsize%
    \rule{\textwidth}{1pt}
    \nobreak
    \vskip 40\p@
  }
  \makeatother
  \bibliographystyle{< the bibstyle >}
  \bibliography{< the database >}
\endgroup
Changing only the bibliography name go
here.


Citations with natbib
demo bib file


Citation of an Url
Look at the
example file for different possibilities of an bibtex entry for an URL. The dinat.bst supports printing of URL's in an excellent way:

Another example.


Default Path for *.bib files
You can define a default searchpath for the bibfiles:
export BIBINPUTS=/home/foo/bib:  (in .bashrc if you use bash)
setenv BIBINPUTS /home/foo/bib: (in .tcshrc if you use tcsh)


Harvard-Style
\usepackage{harvard}
in Latex Preamble and insert the bibliography with bibstyle "jphysicsB".

the possible styles for harvard are:

-rwxr-xr-x   1 root     root        25549 Feb 29  2000 agsm.bst
-rwxr-xr-x   1 root     root        25357 Feb 29  2000 apsr.bst
-rwxr-xr-x   1 root     root        25741 Feb 29  2000 jmr.bst
-rwxr-xr-x   1 root     root        24428 Feb 29  2000 jphysicsB.bst
-rwxr-xr-x   1 root     root        24967 Feb 29  2000 kluwer.bst
-rwxr-xr-x   1 root     root        38053 Feb 29  2000 nederlands.bst


Multiple Citations
If you do not like [1,2,3,4,5], you can get [1-5] by using package cite. cite.sty maybe part of your local TeX installtion, otherwise get it at CTAN.


No Labels in Bibliography
with

\renewcommand\@biblabel[1]{}

in latex preamble you'll get a biblist with no labels (dvi-view)


Editing BibTeX-stylefiles
All BibTeX-stylefiles have the suffix ".bst" and located in /usr/share/texmf/bibtex/bst/
Changing a stylefile is possible by hacking it. For example, we want to change the word "and" between two authors to ",".

in every bst-file is a function for the names. here you can change the word. In all other bst-files you'll find this function, too. For example we change it in the standard bst-file plain.bst, located in /usr/share/texmf/bibtex/bst/base/plain.bst

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
      nameptr #1 >
        { namesleft #1 >
            { ", " * t * }
            { numnames #2 >
                { "," * }
                'skip$
              if$
              t "others" =
                { " et~al." * }
                { " and " * t * }  %<----- change " and " to " , "
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}


Numbered Heading
By default the bib heading is a \chapter* -style, a chapter heading-style without numbering and without part of the TOC. Changing this to a nonstar-chapter is very easy for all koma-classes. For the standard book-class the bibliography environment has to be completely rewritten. Also in latex preamble:
\renewenvironment{thebibliography}[1]
     {\chapter{\bibname%  for article class:    {\section{\refname%
%        \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}
     }%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}


Changing Heading title
Write in LaTeX-preamble or anywhere else.
  • For book-classes:
    \renewcommand\bibname{your heading for bibliography}
  • For article-classes:
    \renewcommand\refname{your heading for bibliography}

  • If you don't like a heading title for your Bibliography/References:
    \renewcommand\bibname{ }
    with a space between the paranthesis! Same for \refname.

    This does not work if you load any specific language package, like german. These packages overwrite all language specific commands. In this case write

    \AtBeginDocument{\renewcommand\bibname{your heading for bibliography}}
    Same for \refname

    If you work with different languages in your text, use the following commands, otherwise your definitions are overwritten by babel:
    \addto\captionsgerman{%
       \renewcommand{\figurename}%
         {your figure-refname}%
    }


    Testing a bibtex-file
    you can test a bibtex-file in an easy way. In the document write only
    \nocite{*}
    and then insert the bibtex data base as usual.Run LaTeX and you'll see all available entries.


    overcite
    the overcite.sty is very similiar to cite.sty. therefore it's possible to get citation in overcite-mode in the text and in standard-mode in footnote. in fact of the variables it's a little bit strange to get an easy solution:

    in latex preamble

    \usepackage{cite}
    \newcommand{\cd}{% overcite-mode
      \renewcommand{\citeleft}{$^[$}%
      \renewcommand{\citeright}{$^]$}%
    }
    \newcommand{\cf}{% defaultcite - mode
      \renewcommand\citeleft{[}%
      \renewcommand\citeright{]}%
    }
    \cd %like overcite
    \renewcommand{\citeform}[1]{$^{#1}$}
    citations in footnotes:

    a) BEFORE the citation in tex (red):

    \cf\renewcommand{\citeform}[1]{#1}
    b) BEHIND the citation, in tex (red) too:
    \cd\renewcommand{\citeform}[1]{$^{#1}$} 


    Citation with no reference
    with \nocite{myBibKey} the bibentry with the bibkey "myBibKey" is part of the bibliography without any citation-reference in the text. This is an excellent way to list the whole contents of a bib-file. With \nocite{*} all entries in the specified bib-file are listed.


    Paranthesis in Citation or Bibliography

    To change the style of the paranthesis in bib-labels and bibliography-numerating the following commands are needed:
    (the star "*" stands for anything, e.g. {, [ or / and the same for },] or /. the first * is the first character and the second star the second one ... if you use the commands in this form with the star, biblabels look like *Meyer00* ;-))

    \renewcommand{\@cite}[2]{*{#1\if@tempswa , #2\fi}*}  % for text-labels
    \renewcommand{\@biblabel}[1]{*#1*}    % für bib-numbering
    changing only the label-style another possibility is using package "cite"
    \usepackage{cite}           % all in latex preamble
    \citeleft{*}
    \citeright{*}
    
    for the star "*" any character can be choosen.
  • local time: Tue Sep 17 08:22:24 CEST 2019 ; file is: 85.9028819444444 days old
    contact webmaster _at_ TeXnik.de