From: Richard Heck Date: Fri, 29 Oct 2010 14:31:52 +0000 (+0000) Subject: This has to be delayed, since otherwise it provides the command before X-Git-Tag: 2.0.0~2189 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=91b4afa3c1dad5e5a4c23e4d5d6f6c1e1812d0c1;p=features.git This has to be delayed, since otherwise it provides the command before the user gets to do so. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35907 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index 83d1bd8632..0982d5e5d5 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -276,7 +276,7 @@ void InsetRef::validate(LaTeXFeatures & features) const docstring label; string const fcmd = to_utf8(getFormattedCmd(data, label)); if (fcmd != "\\ref") { - string lcmd = "\\providecommand" + fcmd + "[1]{\\ref{#1}}"; + string lcmd = "\\AtBeginDocument{\\providecommand" + fcmd + "[1]{\\ref{#1}}}"; features.addPreambleSnippet(lcmd); } } else