]> git.lyx.org Git - lyx.git/commitdiff
consider style-specifics for citation alias
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jul 2024 15:21:27 +0000 (17:21 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jul 2024 15:21:27 +0000 (17:21 +0200)
src/BufferParams.cpp

index 43b08f9d1bc29f5d26bc6654eb1556657d0d5d4b..acc74f6e0ce5b7353cc2c70f45fccc4620de9aa7 100644 (file)
@@ -3755,10 +3755,17 @@ bool BufferParams::fullAuthorList() const
 
 string BufferParams::getCiteAlias(string const & s) const
 {
-       vector<string> commands =
-               documentClass().citeCommands(citeEngineType());
+       bool realcmd = false;
+       vector<CitationStyle> const styles = citeStyles();
+       for (size_t i = 0; i != styles.size(); ++i) {
+               // only include variants that are supported in the current style
+               if (styles[i].name == s && isActiveBiblatexCiteStyle(styles[i])) {
+                       realcmd = true;
+                       break;
+               }
+       }
        // If it is a real command, don't treat it as an alias
-       if (find(commands.begin(), commands.end(), s) != commands.end())
+       if (realcmd)
                return string();
        map<string,string> aliases = documentClass().citeCommandAliases();
        if (aliases.find(s) != aliases.end())