#include "Format.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
+#include "Language.h"
#include "LaTeXFeatures.h"
#include "output_xhtml.h"
#include "OutputParams.h"
+#include "PDFOptions.h"
#include "TextClass.h"
#include "frontends/alert.h"
InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "bibtex")
+ : InsetCommand(buf, p)
{
- buffer_->invalidateBibinfoCache();
+ buffer().invalidateBibinfoCache();
}
InsetBibtex::~InsetBibtex()
{
if (isBufferLoaded())
- buffer_->invalidateBibfileCache();
+ buffer().invalidateBibfileCache();
}
case LFUN_INSET_MODIFY: {
InsetCommandParams p(BIBTEX_CODE);
try {
- if (!InsetCommand::string2params("bibtex",
- to_utf8(cmd.argument()), p)) {
+ if (!InsetCommand::string2params(to_utf8(cmd.argument()), p)) {
cur.noScreenUpdate();
break;
}
<< "' to '" << out_file << "'"
<< endl;
}
- } else if (!runparams.inComment && runparams.nice && not_from_texmf &&
- !isValidLaTeXFileName(database)) {
+ } else if (!runparams.inComment && runparams.nice && not_from_texmf) {
+ if (!isValidLaTeXFileName(database)) {
frontend::Alert::warning(_("Invalid filename"),
- _("The following filename is likely to cause trouble "
- "when running the exported file through LaTeX: ") +
- from_utf8(database));
+ _("The following filename will cause troubles "
+ "when running the exported file through LaTeX: ") +
+ from_utf8(database));
+ }
+ if (!isValidDVIFileName(database)) {
+ frontend::Alert::warning(_("Problematic filename for DVI"),
+ _("The following filename can cause troubles "
+ "when running the exported file through LaTeX "
+ "and opening the resulting DVI: ") +
+ from_utf8(database), true);
+ }
}
if (didone)
// bibtotoc-Option
if (!bibtotoc.empty() && !buffer().params().use_bibtopic) {
- if (buffer().params().documentClass().hasLaTeXLayout("chapter")) {
- if (buffer().params().sides == OneSide) {
- // oneside
- os << "\\clearpage";
- } else {
- // twoside
- os << "\\cleardoublepage";
- }
+ // set label for hyperref, see http://www.lyx.org/trac/ticket/6470
+ if (buffer().params().pdfoptions().use_hyperref)
+ os << "\\phantomsection";
+ if (buffer().params().documentClass().hasLaTeXLayout("chapter"))
os << "\\addcontentsline{toc}{chapter}{\\bibname}";
- } else if (buffer().params().documentClass().hasLaTeXLayout("section"))
+ else if (buffer().params().documentClass().hasLaTeXLayout("section"))
os << "\\addcontentsline{toc}{section}{\\refname}";
}
bool const numbers =
(engine == ENGINE_BASIC || engine == ENGINE_NATBIB_NUMERICAL);
+ docstring reflabel = from_ascii("References");
+ Language const * l = buffer().params().language;
+ if (l)
+ reflabel = translateIfPossible(reflabel, l->code());
+
xs << html::StartTag("h2", "class='bibtex'")
- << _("References")
+ << reflabel
<< html::EndTag("h2")
<< html::StartTag("div", "class='bibtex'");
// which will give us all the cross-referenced info. But for every
// entry, so there's a lot of repitition. This should be fixed.
xs << html::StartTag("span", "class='bibtexinfo'")
+ << XHTMLStream::NextRaw()
<< bibinfo.getInfo(entry.key(), buffer(), true)
<< html::EndTag("span")
<< html::EndTag("div");