## Copyright (C) 2013 Júlio Hoffimann
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, see
## <http://www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn  {Function File} {} citation ()
## @deftypefnx {Function File} {} citation ("@var{pkgname}")
## Print a BibTeX entry for citing GNU Octave or a package
## named @var{pkgname}.
## @seealso{info, version}
## @end deftypefn

function citation (pkgname)

  if (nargin == 0)
    disp (["\n"
    'To cite GNU Octave in publications use:'
    "\n"
    '  John W. Eaton, David Bateman, and Soren Hauberg.'
    '  Gnu Octave Version 3.0.1 Manual: A High-Level Interactive Language For'
    '  Numerical Computations. CreateSpace Independent Publishing Platform, 2009.'
    '  ISBN 1441413006. URL http://www.gnu.org/software/octave/doc/interpreter/.'
    "\n"
    'A BibTeX entry for LaTeX users is'
    "\n"
    '@book{,'
    'Author = {John W. Eaton and David Bateman and S\o ren Hauberg},'
    'Title = {Gnu Octave Version 3.0.1 Manual: A High-Level Interactive Language For Numerical Computations},'
    'Publisher = {CreateSpace Independent Publishing Platform},'
    'Year = {2009},'
    'ISBN = {1441413006},'
    'URL = {http://www.gnu.org/software/octave/doc/interpreter}'
    '}'
    "\n"
    'See also `citation("pkgname")` for citing GNU Octave packages.'
    "\n"]);
  elseif (ischar (pkgname) || iscellstr (pkgname))
    # FIXME: How packages are integrated to the core?
    disp ("\nThis feature is not implemented yet, sorry.\n");
  else
    print_usage ();
  endif

endfunction

%!assert (~isempty (citation ()))
