0

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}
  • for the author: can you give an example on how an entry has to look like? "[1] Author, title" includes a large number of possibilities... – naphaneal Dec 7 '16 at 16:53
  • I want to ask the one in the question(name of institute), it only showed "Health Statistics" as author, but I want it to show "National Center for Health Statistics". Thank you @naphaneal – Vivian Dec 7 '16 at 17:02
4

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.

  • Thank you!I used \footnote and\footcite together, because I need to cite the same article in different places, so the first one I cite with a \footnote{\label{note1}\footcite{unintentional}}, later I can refer to it with \footnoteref{note1}. I do need both footcite and also reference function from footnote, do you have a better solution for this?How can I use labelname from your solution? I have tried your solution but it doesn´t create bibliography, and in footpartcite, it only showed "1 unintentional". Why doesn´t it reproduce the same result as what you´ve showed in your answer? – Vivian Dec 9 '16 at 9:39
  • 1
    @Vivian: Have you tried exactly my example or something different? Once more: You should not use \footcite inside \footnote. Use either \footcite or another cite command, e.g., \cite, inside \footnote. – Schweinebacke Dec 9 '16 at 17:33
  • Your example works now, very weird. I have tried \cite inside \footnote, but it only shows "1[1]" in footnote. And if I use \footpartcite in \footnote, in footnote it shows "1([1]National Center for Health Statistics.Accidents or Unintentional Injuries)". So the problem still exists, unfortunately – Vivian Dec 9 '16 at 18:53
  • 1
    @Vivian "another cite command" may also be another self defined cite command. I've now extended the answer by a definition without auto-creation of a footnote. But please read the documentation of the used commands in the biblatex manual to understand how it works and what the difference between \partcite and \footpartcite is. – Schweinebacke Dec 10 '16 at 12:40
  • Hi, Schweinebacke, I have tried again your script, it works fine in MWE, but with my complete script, it has 2 small problems, in footnote it appears [author,book name] instead of [1]. And also no [1] appears for footcite. What can be the reason behind this? Can I send you my complete preamble to check it? Thank you! – Vivian Dec 21 '16 at 21:11

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.