Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to perform some string manipulation (using the xstring package) on the result of a \cite{} (the bib package is given to me, and wouldn't allow what I want to do without a major rewrite). However, I can't find a way to assign the result of the \cite{} to a variable. \edef doesn't work, nor does \protected@edef. Any suggestions?

share|improve this question
    
Welcome to tex.stackexchange! You can format inline code in your question with backticks (`). –  Caramdir Jan 3 '11 at 15:34
1  
The \cite macro is not expandable, and so you cannot do what you want in the way you want. Perhaps you might explain a bit more what manipulation you need to carry out? –  Joseph Wright Jan 3 '11 at 15:52
    
I would like to take the result, such as "[Author et al. 2005]" and transform it to "Author et al. [2005]". For instance, natbib supports this directly (via \citet), however, the one I have to use (for a publication) doesn't allow this (it's not using \citeauthoryear internally). –  J Witherspoon Jan 3 '11 at 15:59
1  
Maybe you want to instead look at the the aux or bbl files? –  Matthew Leingang Jan 3 '11 at 17:23
5  
If it is for a publication, maybe you shouldn't tamper too much with the style of citations? (the journal might want uniformity) –  Bruno Le Floch Jan 3 '11 at 18:26
show 1 more comment

1 Answer 1

If I'm understanding your comment correctly, what you really want is the output of \citet but without the parentheses around the year. In that case, you want to use \citealt.

If you want a different behavior, you should add more details.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.