Not yet used.
# The syntax of the cite command definitions below is:
-# LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
+# style@LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
#
+# * style: (Optional) citestyle to which this command is specific.
# * LyXName: The LyX name as output in the LyX file. For
# portability reasons, we try to use the same
# name for same-formatted commands in the
# The syntax of the cite command definitions below is:
-# LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
+# style@LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
#
+# * style: (Optional) citestyle to which this command is specific.
# * LyXName: The LyX name as output in the LyX file. For
# portability reasons, we try to use the same
# name for same-formatted commands in the
# The syntax of the cite command definitions below is:
-# LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
+# style@LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
#
+# * style: (Optional) citestyle to which this command is specific.
# * LyXName: The LyX name as output in the LyX file. For
# portability reasons, we try to use the same
# name for same-formatted commands in the
\end_layout
\begin_layout LyX-Code
+
+\change_inserted -712698321 1720623059
+style@
+\change_unchanged
LyXName|alias$*<!_stardesc!_stardesctooltip>[][]=latexcmd
\end_layout
+\begin_layout Itemize
+
+\change_inserted -712698321 1720623254
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1720623079
+style
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+:
+ If this is given,
+ the command is specific to this (biblatex) citation style.
+ E.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.,
+ with
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1720623135
+apa@nptextcite
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ a citation command
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1720623254
+
+\backslash
+nptextcite
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ which is only available with the
+\emph on
+apa
+\emph default
+ citation style can be defined.
+\end_layout
+
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\end_layout
\begin_layout Standard
+
+\change_inserted -712698321 1720623197
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
-Alias
+
+\change_inserted -712698321 1720623197
+Style
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+,
+
+\change_unchanged
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_deleted -712698321 1720623181
+A
+\change_inserted -712698321 1720623181
+a
+\change_unchanged
+lias
\end_layout
\end_inset
\end_layout
\begin_layout LyX-Code
-LyXName|alias$*<!_stardesc!_stardesctooltip>[][]=latexcmd
+style@LyXName|alias$*<!_stardesc!_stardesctooltip>[][]=latexcmd
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+style
+\end_layout
+
+\end_inset
+
+:
+ Wenn dies angegeben wird,
+ wird der Befehl als spezifisch für einen (Biblatex-)Zitierstil markiert.
+ Mit
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+apa@nptextcite
+\end_layout
+
+\end_inset
+
+ können Sie so bspw.
+ einen Befehl
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+nptextcite
+\end_layout
+
+\end_inset
+
+ definieren,
+ der nur mit dem Zitierstil
+\emph on
+apa
+\emph default
+ verfügbar ist.
\end_layout
\begin_layout Itemize
status collapsed
\begin_layout Plain Layout
-Alias
+Style
+\end_layout
+
+\end_inset
+
+,
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+alias
\end_layout
\end_inset
string style;
CiteStringMap csm(styles.size());
for (size_t i = 0; i != csm.size(); ++i) {
+ if (!styles[i].style.empty() && styles[i].style != buf.masterParams().biblatex_citestyle)
+ continue;
style = styles[i].name;
csm[i] = make_pair(from_ascii(style), getLabel(keys, buf, style, ci));
}
std::string stardesc;
/// Optional tooltip for the starred version
std::string startooltip;
+ /// Style that supports the command
+ std::string style;
/// upper casing author prefixes (van -> Van)
bool forceUpperCase;
/// starred version (full author list by default)
/** For portability reasons (between different
* cite engines such as natbib and biblatex),
* we distinguish between:
- * 1. The LyX name as output in the LyX file
- * 2. Possible aliases that might fall back to
+ * 1. The style that features this command
+ * 2. The LyX name as output in the LyX file
+ * 3. Possible aliases that might fall back to
* the given LyX name in the current engine
- * 3. The actual LaTeX command that is output
- * (2) and (3) are optional.
+ * 4. The actual LaTeX command that is output
+ * (1), (3) and (4) are optional.
* Also, the GUI string for the starred version can
* be changed
* The syntax is:
- * LyXName|alias,nextalias*<!stardesc!stardesctooltip>[][]=latexcmd
+ * style@LyXName|alias,nextalias*<!stardesc!stardesctooltip>[][]=latexcmd
*/
enum ScanMode {
LyXName,
string alias;
string latex_cmd;
string stardesc;
+ string style;
size_t const n = def.size();
for (size_t i = 0; i != n; ++i) {
ichar = def[i];
lyx_cmd += ichar;
}
}
+ // split off style prefix if there
+ if (contains(lyx_cmd, '@')) {
+ lyx_cmd = split(lyx_cmd, style, '@');
+ cs.style = style;
+ }
cs.name = lyx_cmd;
cs.cmd = latex_cmd.empty() ? lyx_cmd : latex_cmd;
if (!alias.empty()) {
for (int ii = 1; cit != end; ++cit, ++ii) {
docstring label = cit->second;
CitationStyle ccs = citeStyleList[ii - 1];
+ if (!ccs.style.empty() && ccs.style != bp.biblatex_citestyle)
+ continue;
ccs.forceUpperCase &= force;
ccs.hasStarredVersion &= star;
addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label),
for (; it != end; ++it) {
CitationStyle this_cs = *it;
if (this_cs.name == normalized_input) {
+ if (!this_cs.style.empty() && this_cs.style != bp.biblatex_citestyle) {
+ // citation not supported with current style
+ // reset to \cite
+ normalized_input = "cite";
+ it = valid_styles.begin();
+ continue;
+ }
cs = *it;
break;
}