4

I need to hide the cite to the references in a large text file. Is there a function that hides the cite to the references without manually deleting them from the text

Example

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
\end{filecontents}


\documentclass[a4paper,10pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{csquotes}
\usepackage[%
  style=numeric, 
  sortcites,
  backend=biber,
  giveninits=true % <===================================================
]{biblatex}
\addbibresource{\jobname.bib}

\DeclareNameAlias{default}{family-given} % <============================


\begin{document}

\section{First Section}
This document is an example of BibTeX using in bibliography management. 
Three items are cited: \textit{The \LaTeX\ Companion} book 
\cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and 
the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related 
items are \cite{latexcompanion,knuthwebsite}. 

\medskip

\printbibliography

\end{document}

How can I hide cite to references without deleting them from text?

As this picture enter image description here

  • 1
    Try \citetitle{latexcompanion} instead of \textit{The \LaTeX\ Companion}. – moewe Nov 2 '17 at 17:40
5

You could change the cite command to do nothing using \DeclareCiteCommand{\cite}{}{}{}{}.

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
\end{filecontents}


\documentclass[a4paper,10pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{csquotes}
\usepackage[%
  style=numeric, 
  sortcites,
  backend=biber,
  giveninits=true % <===================================================
]{biblatex}
\addbibresource{\jobname.bib}

\DeclareNameAlias{default}{family-given} % <============================

\DeclareCiteCommand{\cite}{}{}{}{}

\begin{document}

\section{First Section}
This document is an example of BibTeX using in bibliography management. 
Three items are cited: \textit{The \LaTeX\ Companion} book 
\cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and 
the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related 
items are \cite{latexcompanion,knuthwebsite}. 

\medskip

\printbibliography

\end{document}

Sample output

7

You can use \nocite instead of \cite. But you have to delete the blanks before \nocite like this:

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
\end{filecontents}


\documentclass[a4paper,10pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{csquotes}
\usepackage[%
  style=numeric, 
  sortcites,
  backend=biber,
  giveninits=true 
]{biblatex}
\addbibresource{\jobname.bib}

\DeclareNameAlias{default}{family-given} 


\begin{document}

\section{First Section}
This document is an example of BibTeX using in bibliography management. 
Three items are cited: \textit{The \LaTeX\ Companion}
book\nocite{latexcompanion}, % <========================================
the Einstein journal paper\nocite{einstein}, % <========================
and the Donald Knuth's website\nocite{knuthwebsite}. % <================
The \LaTeX\ related 
items are\nocite{latexcompanion,knuthwebsite}. % <======================

\medskip

\printbibliography

\end{document} 

with the result:

enter image description here

So you can use \cite{key} if you need the citing in the text or \nocite{key} to get only the entry key added to the bibliography ...

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.