mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Compare commits
3 Commits
806a67c75b
...
a7e8397a84
Author | SHA1 | Date | |
---|---|---|---|
|
a7e8397a84 | ||
|
fb5782b62a | ||
|
16281b4cf1 |
@ -287,8 +287,13 @@ void InsetRef::latex(otexstream & os, OutputParams const & rp) const
|
|||||||
getFormattedCmd(data, label, prefix, use_refstyle, use_caps);
|
getFormattedCmd(data, label, prefix, use_refstyle, use_caps);
|
||||||
os << fcmd;
|
os << fcmd;
|
||||||
if (use_refstyle && use_plural)
|
if (use_refstyle && use_plural)
|
||||||
os << "[s]";
|
os << "[s]";
|
||||||
os << '{' << label << '}';
|
if (contains(label, ' '))
|
||||||
|
// refstyle bug: labels with blanks need to be grouped
|
||||||
|
// otherwise the blanks will be gobbled
|
||||||
|
os << "{{" << label << "}}";
|
||||||
|
else
|
||||||
|
os << '{' << label << '}';
|
||||||
}
|
}
|
||||||
else if (cmd == "labelonly") {
|
else if (cmd == "labelonly") {
|
||||||
docstring const & ref = getParam("reference");
|
docstring const & ref = getParam("reference");
|
||||||
@ -298,7 +303,7 @@ void InsetRef::latex(otexstream & os, OutputParams const & rp) const
|
|||||||
docstring prefix;
|
docstring prefix;
|
||||||
docstring suffix = split(ref, prefix, ':');
|
docstring suffix = split(ref, prefix, ':');
|
||||||
if (suffix.empty()) {
|
if (suffix.empty()) {
|
||||||
LYXERR0("Label `" << ref << "' contains no `:' separator.");
|
LYXERR0("Label `" << ref << "' contains no `:' separator.");
|
||||||
os << ref;
|
os << ref;
|
||||||
} else {
|
} else {
|
||||||
os << suffix;
|
os << suffix;
|
||||||
|
@ -1242,7 +1242,7 @@ docstring const escape(docstring const & lab)
|
|||||||
for (char_type const c : lab) {
|
for (char_type const c : lab) {
|
||||||
if (c >= 128 || c == '=' || c == '%' || c == '#' || c == '$'
|
if (c >= 128 || c == '=' || c == '%' || c == '#' || c == '$'
|
||||||
|| c == '}' || c == '{' || c == ']' || c == '[' || c == '&'
|
|| c == '}' || c == '{' || c == ']' || c == '[' || c == '&'
|
||||||
|| c == '\\' || c == ' ') // refstyle doesn't support spaces
|
|| c == '\\')
|
||||||
{
|
{
|
||||||
// Although char_type is a 32 bit type we know that
|
// Although char_type is a 32 bit type we know that
|
||||||
// UCS4 occupies only 21 bits, so we don't need to
|
// UCS4 occupies only 21 bits, so we don't need to
|
||||||
|
@ -4533,7 +4533,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
os << "reference \"";
|
os << "reference \"";
|
||||||
os << known_refstyle_prefixes[where - known_refstyle_commands]
|
os << known_refstyle_prefixes[where - known_refstyle_commands]
|
||||||
<< ":";
|
<< ":";
|
||||||
os << convert_literate_command_inset_arg(p.getArg('{', '}'))
|
string arg = p.getArg('{', '}');
|
||||||
|
// with refstyle, labels containing blanks are grouped
|
||||||
|
// remove the grouping
|
||||||
|
if (contains(arg, ' '))
|
||||||
|
arg = ltrim(rtrim(arg, "}"), "{");
|
||||||
|
os << convert_literate_command_inset_arg(arg)
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
os << "plural \"" << plural << "\"\n";
|
os << "plural \"" << plural << "\"\n";
|
||||||
os << "caps \"" << cap << "\"\n";
|
os << "caps \"" << cap << "\"\n";
|
||||||
|
@ -88,6 +88,8 @@ What's new
|
|||||||
|
|
||||||
- Handle linguistic structure trees in ePub and PDF (DocBook) output (bug 12372).
|
- Handle linguistic structure trees in ePub and PDF (DocBook) output (bug 12372).
|
||||||
|
|
||||||
|
- Improve the way spaces are handled in labels when refstyle is used.
|
||||||
|
|
||||||
|
|
||||||
* USER INTERFACE
|
* USER INTERFACE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user