[Tex/LaTex] How to customize citation style and references

biblatexcitingfootnotes

I have three questions:

  • how to remove the brackets in footnote?

  • how to edit the reference info in order to show the full name of author/institute? (solved)

  • how to show a citation as "[1]Author, book " in footcite and bibliography? I have tried \setcitestyle{square}, but it comes out error.

Thank you

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=authortitle-comp,
        natbib=true, 
        ]{biblatex}
\begin{filecontents}{\jobname.bib}
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={blue!50!black},
}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=authortitle-comp,
        natbib=true, 
        ]{biblatex}
\begin{filecontents}{\jobname.bib}
@Electronic{unintentional,
Title                    = {Accidents or Unintentional Injuries},
Author                   = {National Center for Health Statistics},
Note                     = {[Accessed on August 10, 2016]. Available on:\textcolor{blue}{http://www.cdc.gov/nchs/fastats/accidental-injury.htm}}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
here is just a test . \footnote{\label{note1}\footcite{unintentional}}

\printbibliography
\end{document}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
here is just a test . \footnote{\label{note1}\footcite{unintentional}}
\printbibliography
\end{document}

Best Answer

The code of your example is broken (e.g. two \documentclass). After fixing this the problem persists, because biblatex tries to split the organization name National Center for Health Statistics at the author field into firstname and lastname. You can avoid this using extra braces:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={blue!50!black},
}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=authortitle-comp,
        natbib=true, 
        ]{biblatex}
\begin{filecontents}{\jobname.bib}
@Electronic{unintentional,
Title                    = {Accidents or Unintentional Injuries},
Author                   = {{National Center for Health Statistics}},
Note                     = {[Accessed on August 10, 2016]. Available on:\textcolor{blue}{http://www.cdc.gov/nchs/fastats/accidental-injury.htm}}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
here is just a test. \footcite{unintentional}

\printbibliography
\end{document}

BTW: \footcite isn't made to be used inside \footnote but makes a footnote itself.

Generally I would suggest to use biber instead of bibtex. New biblatex features need biber. It is time to change.

To get cites with numbers in brackets you can use the numeric style of biblatex. But \footcite won't show the author and title in this case. Audrey has already shown in how to define such a footcite command:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{parskip}% Much better than:
% \setlength{\parskip}{1.2ex}
% \setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=numeric,
        natbib=true, 
        ]{biblatex}
\usepackage{hyperref}% Generally last package loaded
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={blue!50!black},
}
\begin{filecontents}{\jobname.bib}
@Electronic{unintentional,
Title                    = {Accidents or Unintentional Injuries},
Author                   = {{National Center for Health Statistics}},
URL                      = {http://www.cdc.gov/nchs/fastats/accidental-injury.htm},
urldate                  = {2016-08-10},
}
\end{filecontents}
% Define new \footcite like command with number and author
\DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \mkbibbrackets{\usebibmacro{cite}}%
   \setunit{\addnbspace}
   \printnames{labelname}%
   \setunit{\labelnamepunct}
   \printfield[citetitle]{title}%
   \newunit
   \printfield{year}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\footpartcites}[\mkbibfootnote]{\footpartcite}{\addsemicolon\space}

\addbibresource{\jobname.bib}

\begin{document}
here is just a test. \footpartcite{unintentional}

\printbibliography
\end{document}

This will produce:

References

Footnote

Note, I've also replaced the Note field by URL and urldate. See the biblatex manual for more information about these and about how to customize the output of the URL date.

If you need a similar cite command, that does not create a footnote itself but can be used inside \footnote or somewhere else without creating a footnote just use the same definitions without the optional argument \mkbibfootnote:

\DeclareCiteCommand{\partcite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \mkbibbrackets{\usebibmacro{cite}}%
   \setunit{\addnbspace}
   \printnames{labelname}%
   \setunit{\labelnamepunct}
   \printfield[citetitle]{title}%
   \newunit
   \printfield{year}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\partcites}{\partcite}{\addsemicolon\space}

With this you can use:

Test: \footnote{\label{ftn:unintentional}\partcite{unintentional}}

See footnote \ref{ftn:unintentional}.

To create a footnote with label.

Please read the documentation of the used commands, i.e., \DeclareCiteCommand in the biblatex manual for more information about creating new cite commands.