mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
tex2lyx: refsection and bibbysection support (biblatex)
This commit is contained in:
parent
f22213a04f
commit
1a3dbbf07a
@ -1073,6 +1073,16 @@ void Preamble::handle_package(Parser &p, string const & name,
|
|||||||
if (!opt.empty())
|
if (!opt.empty())
|
||||||
h_biblatex_bibstyle = opt;
|
h_biblatex_bibstyle = opt;
|
||||||
}
|
}
|
||||||
|
opt = process_keyval_opt(options, "refsection");
|
||||||
|
if (!opt.empty()) {
|
||||||
|
if (opt == "none" || opt == "part"
|
||||||
|
|| opt == "chapter" || opt == "section"
|
||||||
|
|| opt == "subsection")
|
||||||
|
h_multibib = opt;
|
||||||
|
else
|
||||||
|
cerr << "Ignoring unkown refesection value '"
|
||||||
|
<< opt << "'.";
|
||||||
|
}
|
||||||
if (!options.empty()) {
|
if (!options.empty()) {
|
||||||
h_biblio_options = join(options, ",");
|
h_biblio_options = join(options, ",");
|
||||||
options.clear();
|
options.clear();
|
||||||
@ -1312,6 +1322,8 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
|
|||||||
os << "\\biblatex_bibstyle " << h_biblatex_bibstyle << "\n";
|
os << "\\biblatex_bibstyle " << h_biblatex_bibstyle << "\n";
|
||||||
if (!h_biblatex_citestyle.empty())
|
if (!h_biblatex_citestyle.empty())
|
||||||
os << "\\biblatex_citestyle " << h_biblatex_citestyle << "\n";
|
os << "\\biblatex_citestyle " << h_biblatex_citestyle << "\n";
|
||||||
|
if (!h_multibib.empty())
|
||||||
|
os << "\\multibib " << h_multibib << "\n";
|
||||||
os << "\\use_indices " << h_use_indices << "\n"
|
os << "\\use_indices " << h_use_indices << "\n"
|
||||||
<< "\\paperorientation " << h_paperorientation << '\n'
|
<< "\\paperorientation " << h_paperorientation << '\n'
|
||||||
<< "\\suppress_date " << h_suppress_date << '\n'
|
<< "\\suppress_date " << h_suppress_date << '\n'
|
||||||
|
@ -133,6 +133,7 @@ private:
|
|||||||
|
|
||||||
std::ostringstream h_preamble;
|
std::ostringstream h_preamble;
|
||||||
std::string h_backgroundcolor;
|
std::string h_backgroundcolor;
|
||||||
|
std::string h_multibib;
|
||||||
std::string h_biblio_style;
|
std::string h_biblio_style;
|
||||||
std::string h_biblio_options;
|
std::string h_biblio_options;
|
||||||
std::string h_biblatex_bibstyle;
|
std::string h_biblatex_bibstyle;
|
||||||
|
@ -114,13 +114,9 @@ Format LaTeX feature LyX feature
|
|||||||
Same for:
|
Same for:
|
||||||
\Cites, \textcites, \Textcites, \parencites, \Parencites, \smartcites, \Smartcites, \autocites, Autocites
|
\Cites, \textcites, \Textcites, \parencites, \Parencites, \smartcites, \Smartcites, \autocites, Autocites
|
||||||
533 Multibib support
|
533 Multibib support
|
||||||
\begin{btUnit}...\end{btUnit} \multibib {none|part|chapter|section|subsetion}
|
\begin{btUnit}...\end{btUnit} \multibib {none|part|chapter|section|subsection}
|
||||||
(if a part, chapter, section etc.
|
(if a part, chapter, section etc.
|
||||||
follows the \begin...)
|
follows the \begin...)
|
||||||
\usepackage[refsection=<val> \multibib <val>
|
|
||||||
\bibbysection[<opts>] \begin_inset CommandInset bibtex
|
|
||||||
biblatexopts "<opts>"
|
|
||||||
btprint "bibbysection"
|
|
||||||
534 Chapterbib support
|
534 Chapterbib support
|
||||||
\usepackage{chapterbib} \multibib child
|
\usepackage{chapterbib} \multibib child
|
||||||
|
|
||||||
|
@ -4671,6 +4671,35 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
need_commentbib = false;
|
need_commentbib = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (t.cs() == "bibbysection") {
|
||||||
|
context.check_layout(os);
|
||||||
|
string BibOpts;
|
||||||
|
string bbloptions = p.hasOpt() ? p.getArg('[', ']') : string();
|
||||||
|
vector<string> opts = getVectorFromString(bbloptions);
|
||||||
|
vector<string>::iterator it =
|
||||||
|
find(opts.begin(), opts.end(), "heading=bibintoc");
|
||||||
|
if (it != opts.end()) {
|
||||||
|
opts.erase(it);
|
||||||
|
BibOpts = "bibtotoc";
|
||||||
|
}
|
||||||
|
bbloptions = getStringFromVector(opts);
|
||||||
|
begin_command_inset(os, "bibtex", "bibtex");
|
||||||
|
os << "btprint " << '"' << "bibbysection" << '"' << "\n";
|
||||||
|
string bibfiles;
|
||||||
|
for (auto const & bf : preamble.biblatex_bibliographies) {
|
||||||
|
if (!bibfiles.empty())
|
||||||
|
bibfiles += ",";
|
||||||
|
bibfiles += normalize_filename(bf);
|
||||||
|
}
|
||||||
|
if (!bibfiles.empty())
|
||||||
|
os << "bibfiles " << '"' << bibfiles << '"' << "\n";
|
||||||
|
os << "options " << '"' << BibOpts << '"' << "\n";
|
||||||
|
if (!bbloptions.empty())
|
||||||
|
os << "biblatexopts " << '"' << bbloptions << '"' << "\n";
|
||||||
|
end_inset(os);
|
||||||
|
need_commentbib = false;
|
||||||
|
}
|
||||||
|
|
||||||
else if (t.cs() == "parbox") {
|
else if (t.cs() == "parbox") {
|
||||||
// Test whether this is an outer box of a shaded box
|
// Test whether this is an outer box of a shaded box
|
||||||
p.pushPosition();
|
p.pushPosition();
|
||||||
|
Loading…
Reference in New Issue
Block a user