mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
TexRow for InsetArgument
This commit is contained in:
parent
676a0639c5
commit
6edbc1da66
@ -277,20 +277,23 @@ void InsetArgument::latexArgument(otexstream & os,
|
||||
OutputParams const & runparams_in, docstring const & ldelim,
|
||||
docstring const & rdelim, docstring const & presetarg) const
|
||||
{
|
||||
odocstringstream ss;
|
||||
otexstream ots(ss);
|
||||
otexstringstream ots;
|
||||
OutputParams runparams = runparams_in;
|
||||
if (!pass_thru_chars_.empty())
|
||||
runparams.pass_thru_chars += pass_thru_chars_;
|
||||
InsetText::latex(ots, runparams);
|
||||
docstring str = ss.str();
|
||||
docstring const sep = str.empty() ? docstring() : from_ascii(", ");
|
||||
if (!presetarg.empty())
|
||||
str = presetarg + sep + str;
|
||||
if (ldelim != "{" && support::contains(str, rdelim))
|
||||
str = '{' + str + '}';
|
||||
// TODO: append texrow information
|
||||
os << ldelim << str << rdelim;
|
||||
TexString ts = ots.release();
|
||||
bool const add_braces = ldelim != "{" && support::contains(ts.str, rdelim);
|
||||
os << ldelim;
|
||||
if (add_braces)
|
||||
os << '{';
|
||||
os << presetarg;
|
||||
if (!presetarg.empty() && !ts.str.empty())
|
||||
os << ", ";
|
||||
os << move(ts);
|
||||
if (add_braces)
|
||||
os << '}';
|
||||
os << rdelim;
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,9 +30,9 @@ public:
|
||||
InsetArgument(Buffer *, std::string const &);
|
||||
|
||||
/// Outputting the parameter of a LaTeX command
|
||||
void latexArgument(otexstream &, OutputParams const &,
|
||||
docstring const&, docstring const &,
|
||||
docstring const &) const;
|
||||
void latexArgument(otexstream & os, OutputParams const & runparams_in,
|
||||
docstring const & ldelim, docstring const & rdelim,
|
||||
docstring const & presetarg) const;
|
||||
|
||||
std::string name() const { return name_; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user