0

This question already has an answer here:

I am writing a thesis for which the majority of my references are in the standard style text [XX] (or text^XX, depending on citation style) achieved by doing \cite{ThingThatGivesXX}. However, for a couple of citations, I need to adapt papers I have co-written, and include the phrase Adapted from Ref. YY (without the brackets) and want to achieve it with something like \cite[special_option]{ThingThatGivesYY} but haven't had luck tracking down [special_option]. Note: XX and YY are numbers.

Edit: clarified question.

Answer: looks like what I need is Ref. \citealp{ThingThatGivesYY} to get Ref. YY for this particular special use case.

Thanks for the natbib reference

marked as duplicate by Chris H, Stefan Pinnow, barbara beeton, Mico bibtex Nov 3 '16 at 13:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    From what you have written it is not clear to me why you can't just use: Adapted from \cite{ThingThatGivesYY}. How should the output differ from this? Can you please add some more details of what you want and preferably a minimal working example that compiles and demonstrates your problem. – Andrew Oct 4 '16 at 0:24
  • ... or, indeed, why not \newcommand{\sepcialoption}[1]{Adapted from~\cite{#1}} and then \specialoption{ThingThatGivesYY} if you want it in some command? – jon Oct 4 '16 at 3:28
  • I'm hoping to remove the brackets around the number in the citation. Alternately, this would allow for a temporary shift from superscript footnotes (depending on the style). – Necarion Oct 4 '16 at 4:08
  • Shifting the citation call-out style within a document will almost certainly cause a lot of confusion and hesitation among your readers. Why do you want to incur this risk? If it's just a couple of papers that need to receive special treatment, what's stopping you from hard-coding the citation? – Mico Oct 4 '16 at 5:16
  • 3
    Having just answered I tried to track down the source of my own code. Now I think this a duplicate of BibTeX natbib with super does not allow using occasional \citet -- please correct me if I'm wrong. – Chris H Nov 3 '16 at 11:36
1

You could create your own command by adding this at the top of your document:

\newcommand{\newCommandName}{Adapted from Ref. }

Note the space after "Ref." -- this is so that the citation that comes afterwards doesn't crowd it.

You can name the new command anything you like, just make sure that you pick a name that isn't already being used. For convenience, you can pick something smaller so that it saves you time, rather than having to write out "Adapted from Ref." every single time. This also means that if you decide to change "Adapted from Ref." to something else, you'll only need to change this one bit of text at the top of the document. There is more on this method here: Define a variable in LaTeX

Then, you can change the style of your citation, by using a command other than \cite -- for example: \citeauthor Here is a list of different commands to change how the citation appears: Citation reference sheet

Here is a working example, defining the custom command as \adapted:

\documentclass{article}
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={(},close={)}}
\newcommand{\adapted}{Adapted from Ref. }

\begin{document}

This is a sentence with a normal citation (\citeauthor{bookname}).

This is another bit of text. \adapted\citet{bookname}

\bibliographystyle{plainnat}
\bibliography{refs} 
\end{document}

And here is what it results in:

Screenshot of the result

This method wouldn't specifically give you \cite{ThingThatGivesXX} but it would enable the functionality that you seem to be looking for. If you desire a different citation style than illustrated in the image above, the citation reference sheet link should give you more options.

1

In my collection of macros I have the following which I call \citenumns. I always use a numeric citation style, and if I have the choice a superscripted one, but I needed bare citation numbers for similar cases. I like to keep the "adapted from" text outside the citation macro, as there are a variety of related phrases which may have to change based on the text rather than the citation (e.g. expand to "...following the method in Ref. XX but additionally taking into account..." when the reviewer asks how it was adapted).

\makeatletter
\newcommand*{\citenumns}[2][]{%
  \begingroup
  \let\NAT@mbox=\mbox
  \let\@cite\NAT@citenum
  \let\NAT@space\NAT@spacechar
  \let\NAT@super@kern\relax
  \renewcommand\NAT@open{}%
  \renewcommand\NAT@close{}%
  \cite[#1]{#2}%
  \endgroup
}
\makeatother

I haven't used it much since switching to biblatex (equivalent Q) and it's likely that little of it is my own.

Not the answer you're looking for? Browse other questions tagged or ask your own question.