mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Re-fix #2005
Loading keyval does not work any longer. Fix it properly by de-activating the equal character locally if graphics options use it. We do this statically for Turkish and Latin in stable, as opposed to master (where we have the ActiveChars languages tag)
This commit is contained in:
parent
9e9d51187d
commit
1c2700eb11
@ -1150,9 +1150,6 @@ Language turkish
|
||||
QuoteStyle english
|
||||
Encoding iso8859-9
|
||||
LangCode tr_TR
|
||||
PostBabelPreamble
|
||||
\usepackage{xkeyval}
|
||||
EndPostBabelPreamble
|
||||
End
|
||||
|
||||
# turkmen must be loaded locally with babel options,
|
||||
|
@ -60,6 +60,7 @@ TODO
|
||||
#include "FuncRequest.h"
|
||||
#include "FuncStatus.h"
|
||||
#include "InsetIterator.h"
|
||||
#include "Language.h"
|
||||
#include "LaTeXFeatures.h"
|
||||
#include "Length.h"
|
||||
#include "Lexer.h"
|
||||
@ -835,18 +836,31 @@ void InsetGraphics::latex(otexstream & os,
|
||||
string before;
|
||||
string after;
|
||||
|
||||
if (runparams.moving_arg)
|
||||
before += "\\protect";
|
||||
|
||||
// We never use the starred form, we use the "clip" option instead.
|
||||
before += "\\includegraphics";
|
||||
|
||||
// Write the options if there are any.
|
||||
bool const ps = runparams.flavor == OutputParams::LATEX
|
||||
|| runparams.flavor == OutputParams::DVILUATEX;
|
||||
string const opts = createLatexOptions(ps);
|
||||
LYXERR(Debug::GRAPHICS, "\tOpts = " << opts);
|
||||
|
||||
if (contains(opts, '=')) {
|
||||
std::set<Language const *> langs = buffer().masterBuffer()->getLanguages();
|
||||
for (auto const lang : langs) {
|
||||
if (lang->lang() == "turkish" || lang->lang() == "latin") {
|
||||
// Turkish and Latin activate = (#2005).
|
||||
// Deactivate locally for keyval option parsing
|
||||
before = "\\begingroup\\catcode`\\=12";
|
||||
after = "\\endgroup";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (runparams.moving_arg)
|
||||
before += "\\protect";
|
||||
|
||||
// We never use the starred form, we use the "clip" option instead.
|
||||
before += "\\includegraphics";
|
||||
|
||||
if (!opts.empty() && !message.empty())
|
||||
before += ('[' + opts + ',' + message + ']');
|
||||
else if (!opts.empty() || !message.empty())
|
||||
|
@ -58,6 +58,9 @@ What's new
|
||||
|
||||
* DOCUMENT INPUT/OUTPUT
|
||||
|
||||
- (Re-)fix problems with activated equal sign and graphic options in Turkish
|
||||
and Latin documents (bug 2005).
|
||||
|
||||
- Fix toprule with booktabs/longtable and captions (bug 11589).
|
||||
|
||||
- Avoid adding spaces when parsing an array in a macro template (bug 10499).
|
||||
|
Loading…
Reference in New Issue
Block a user