mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Assure widest nomencl label is encodable
This commit is contained in:
parent
ccdf8ba701
commit
fe43d03448
@ -448,11 +448,18 @@ void InsetPrintNomencl::latex(otexstream & os, OutputParams const & runparams_in
|
|||||||
if (autowidth || getParam("set_width") == "textwidth") {
|
if (autowidth || getParam("set_width") == "textwidth") {
|
||||||
docstring widest = autowidth ? nomenclWidest(buffer())
|
docstring widest = autowidth ? nomenclWidest(buffer())
|
||||||
: getParam("width");
|
: getParam("width");
|
||||||
|
// We need to validate that all characters are representable
|
||||||
|
// in the current encoding. If not try the LaTeX macro which might
|
||||||
|
// or might not be a good choice, and issue a warning.
|
||||||
|
pair<docstring, docstring> widest_latexed =
|
||||||
|
runparams.encoding->latexString(widest, runparams.dryrun);
|
||||||
|
if (!widest_latexed.second.empty())
|
||||||
|
LYXERR0("Uncodable character in nomencl entry. List width might be wrong!");
|
||||||
// Set the label width via nomencl's command \nomlabelwidth.
|
// Set the label width via nomencl's command \nomlabelwidth.
|
||||||
// This must be output before the command \printnomenclature
|
// This must be output before the command \printnomenclature
|
||||||
if (!widest.empty()) {
|
if (!widest_latexed.first.empty()) {
|
||||||
os << "\\settowidth{\\nomlabelwidth}{"
|
os << "\\settowidth{\\nomlabelwidth}{"
|
||||||
<< widest
|
<< widest_latexed.first
|
||||||
<< "}\n";
|
<< "}\n";
|
||||||
}
|
}
|
||||||
} else if (getParam("set_width") == "custom") {
|
} else if (getParam("set_width") == "custom") {
|
||||||
|
Loading…
Reference in New Issue
Block a user