]> git.lyx.org Git - features.git/commitdiff
Fix for bug 4670, by JMarc.
authorRichard Heck <rgheck@comcast.net>
Wed, 26 Mar 2008 16:43:29 +0000 (16:43 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 26 Mar 2008 16:43:29 +0000 (16:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23974 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCitation.cpp

index 260bd41bf23aef70e81c2d1524ca8bdff70c2d61..45eaccf067c7da16527ba39f9fa1590b8d3b950d 100644 (file)
@@ -508,13 +508,16 @@ void InsetCitation::textString(odocstream & os) const
 // the \cite command is valid. Eg, the user has natbib enabled, inputs some
 // citations and then changes his mind, turning natbib support off. The output
 // should revert to \cite[]{}
-int InsetCitation::latex(odocstream & os, OutputParams const &) const
+int InsetCitation::latex(odocstream & os, OutputParams const & op) const
 {
        biblio::CiteEngine cite_engine = buffer().params().citeEngine();
        // FIXME UNICODE
        docstring const cite_str = from_utf8(
                asValidLatexCommand(getCmdName(), cite_engine));
 
+       if (op.moving_arg)
+               os << "\\protect";
+
        os << "\\" << cite_str;
 
        docstring const & before = getParam("before");