2 * \file InsetBibtex.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
7 * \author Richard Heck (BibTeX parser improvements)
8 * \author Jürgen Spitzmüller
10 * Full author contact details are available in file CREDITS.
15 #include "InsetBibtex.h"
17 #include "BiblioInfo.h"
19 #include "BufferParams.h"
20 #include "CiteEnginesList.h"
22 #include "DispatchResult.h"
26 #include "FuncRequest.h"
27 #include "FuncStatus.h"
28 #include "LaTeXFeatures.h"
29 #include "output_xhtml.h"
30 #include "OutputParams.h"
31 #include "PDFOptions.h"
32 #include "texstream.h"
33 #include "TextClass.h"
35 #include "frontends/alert.h"
37 #include "support/convert.h"
38 #include "support/debug.h"
39 #include "support/docstream.h"
40 #include "support/ExceptionMessage.h"
41 #include "support/FileNameList.h"
42 #include "support/filetools.h"
43 #include "support/gettext.h"
44 #include "support/lstrings.h"
45 #include "support/os.h"
46 #include "support/PathChanger.h"
47 #include "support/textutils.h"
52 using namespace lyx::support;
56 namespace Alert = frontend::Alert;
57 namespace os = support::os;
60 InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
61 : InsetCommand(buf, p)
63 buffer().invalidateBibfileCache();
64 buffer().removeBiblioTempFiles();
68 InsetBibtex::~InsetBibtex()
70 if (isBufferLoaded()) {
71 /* We do not use buffer() because Coverity believes that this
72 * may throw an exception. Actually this code path is not
73 * taken when buffer_ == 0 */
74 buffer_-> invalidateBibfileCache();
75 buffer_->removeBiblioTempFiles();
80 ParamInfo const & InsetBibtex::findInfo(string const & /* cmdName */)
82 static ParamInfo param_info_;
83 if (param_info_.empty()) {
84 param_info_.add("btprint", ParamInfo::LATEX_OPTIONAL);
85 param_info_.add("bibfiles", ParamInfo::LATEX_REQUIRED);
86 param_info_.add("options", ParamInfo::LYX_INTERNAL);
87 param_info_.add("biblatexopts", ParamInfo::LATEX_OPTIONAL);
93 void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
95 switch (cmd.action()) {
101 case LFUN_INSET_MODIFY: {
102 InsetCommandParams p(BIBTEX_CODE);
104 if (!InsetCommand::string2params(to_utf8(cmd.argument()), p)) {
105 cur.noScreenUpdate();
108 } catch (ExceptionMessage const & message) {
109 if (message.type_ == WarningException) {
110 Alert::warning(message.title_, message.details_);
111 cur.noScreenUpdate();
119 buffer().invalidateBibfileCache();
120 buffer().removeBiblioTempFiles();
121 cur.forceBufferUpdate();
126 InsetCommand::doDispatch(cur, cmd);
132 bool InsetBibtex::getStatus(Cursor & cur, FuncRequest const & cmd,
133 FuncStatus & flag) const
135 switch (cmd.action()) {
136 case LFUN_INSET_EDIT:
137 flag.setEnabled(true);
141 return InsetCommand::getStatus(cur, cmd, flag);
146 void InsetBibtex::editDatabases() const
148 vector<docstring> bibfilelist = getVectorFromString(getParam("bibfiles"));
150 if (bibfilelist.empty())
153 int nr_databases = bibfilelist.size();
154 if (nr_databases > 1) {
155 docstring const engine = usingBiblatex() ? _("Biblatex") : _("BibTeX");
156 docstring message = bformat(_("The %1$s[[BibTeX/Biblatex]] inset includes %2$s databases.\n"
157 "If you proceed, all of them will be opened."),
158 engine, convert<docstring>(nr_databases));
159 int const ret = Alert::prompt(_("Open Databases?"),
160 message, 0, 1, _("&Cancel"), _("&Proceed"));
166 vector<docstring>::const_iterator it = bibfilelist.begin();
167 vector<docstring>::const_iterator en = bibfilelist.end();
168 for (; it != en; ++it) {
169 FileName const bibfile = getBibTeXPath(*it, buffer());
170 theFormats().edit(buffer(), bibfile,
171 theFormats().getFormatFromFile(bibfile));
176 bool InsetBibtex::usingBiblatex() const
178 return buffer().masterParams().useBiblatex();
182 docstring InsetBibtex::screenLabel() const
184 return usingBiblatex() ? _("Biblatex Generated Bibliography")
185 : _("BibTeX Generated Bibliography");
189 docstring InsetBibtex::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/) const
191 docstring tip = _("Databases:");
192 vector<docstring> bibfilelist = getVectorFromString(getParam("bibfiles"));
195 if (bibfilelist.empty())
196 tip += "<li>" + _("none") + "</li>";
198 for (docstring const & bibfile : bibfilelist)
199 tip += "<li>" + bibfile + "</li>";
204 docstring style = getParam("options"); // maybe empty! and with bibtotoc
205 docstring bibtotoc = from_ascii("bibtotoc");
206 if (prefixIs(style, bibtotoc)) {
208 if (contains(style, char_type(',')))
209 style = split(style, bibtotoc, char_type(','));
212 docstring const btprint = getParam("btprint");
213 if (!usingBiblatex()) {
214 tip += _("Style File:");
215 tip += "<ul><li>" + (style.empty() ? _("none") : style) + "</li></ul>";
217 tip += _("Lists:") + " ";
218 if (btprint == "btPrintAll")
219 tip += _("all references");
220 else if (btprint == "btPrintNotCited")
221 tip += _("all uncited references");
223 tip += _("all cited references");
226 tip += _("included in TOC");
228 if (!buffer().parent()
229 && buffer().params().multibib == "child") {
231 tip += _("Note: This bibliography is not output, since bibliographies in the master file "
232 "are not allowed with the setting 'Multiple bibliographies per child document'");
235 tip += _("Lists:") + " ";
236 if (btprint == "bibbysection")
237 tip += _("all reference units");
238 else if (btprint == "btPrintAll")
239 tip += _("all references");
241 tip += _("all cited references");
244 tip += _("included in TOC");
246 if (!getParam("biblatexopts").empty()) {
248 tip += _("Options: ") + getParam("biblatexopts");
256 void InsetBibtex::latex(otexstream & os, OutputParams const & runparams) const
258 // The sequence of the commands:
259 // With normal BibTeX:
260 // 1. \bibliographystyle{style}
261 // 2. \addcontentsline{...} - if option bibtotoc set
262 // 3. \bibliography{database}
264 // 1. \bibliographystyle{style}
265 // 2. \begin{btSect}{database}
266 // 3. \btPrint{Cited|NotCited|All}
269 // \printbibliography[biblatexopts]
271 // \bibbysection[biblatexopts] - if btprint is "bibbysection"
273 // chapterbib does not allow bibliographies in the master
274 if (!usingBiblatex() && !runparams.is_child
275 && buffer().params().multibib == "child")
278 string style = to_utf8(getParam("options")); // maybe empty! and with bibtotoc
280 if (prefixIs(style, "bibtotoc")) {
281 bibtotoc = "bibtotoc";
282 if (contains(style, ','))
283 style = split(style, bibtotoc, ',');
286 if (usingBiblatex()) {
288 string opts = to_utf8(getParam("biblatexopts"));
290 if (!bibtotoc.empty())
291 opts = opts.empty() ? "heading=bibintoc" : "heading=bibintoc," + opts;
292 // The bibliography command
293 docstring btprint = getParam("btprint");
294 if (btprint == "btPrintAll")
295 os << "\\nocite{*}\n";
296 if (btprint == "bibbysection" && !buffer().masterParams().multibib.empty())
297 os << "\\bibbysection";
299 os << "\\printbibliography";
301 os << "[" << opts << "]";
303 } else {// using BibTeX
305 vector<docstring> const db_out =
306 buffer().prepareBibFilePaths(runparams, getBibFiles(), false);
308 if (style == "default")
309 style = buffer().masterParams().defaultBiblioStyle();
310 if (!style.empty() && !buffer().masterParams().useBibtopic()) {
311 string base = buffer().masterBuffer()->prepareFileNameForLaTeX(style, ".bst", runparams.nice);
312 FileName const try_in_file =
313 makeAbsPath(base + ".bst", buffer().filePath());
314 bool const not_from_texmf = try_in_file.isReadableFile();
315 // If this style does not come from texmf and we are not
316 // exporting to .tex copy it to the tmp directory.
317 // This prevents problems with spaces and 8bit characters
319 if (!runparams.inComment && !runparams.dryrun && !runparams.nice &&
321 // use new style name
322 DocFileName const in_file = DocFileName(try_in_file);
323 base = removeExtension(in_file.mangledFileName());
324 FileName const out_file = makeAbsPath(base + ".bst",
325 buffer().masterBuffer()->temppath());
326 bool const success = in_file.copyTo(out_file);
328 LYXERR0("Failed to copy '" << in_file
329 << "' to '" << out_file << "'");
333 os << "\\bibliographystyle{"
334 << from_utf8(latex_path(buffer().prepareFileNameForLaTeX(base, ".bst", runparams.nice)))
337 // Warn about spaces in bst path. Warn only once.
338 static bool warned_about_bst_spaces = false;
339 if (!warned_about_bst_spaces && runparams.nice && contains(style, ' ')) {
340 warned_about_bst_spaces = true;
341 Alert::warning(_("Export Warning!"),
342 _("There are spaces in the path to your BibTeX style file.\n"
343 "BibTeX will be unable to find it."));
345 // Handle the bibtopic case
346 if (!db_out.empty() && buffer().masterParams().useBibtopic()) {
347 os << "\\begin{btSect}";
349 os << "[" << style << "]";
350 os << "{" << getStringFromVector(db_out) << "}\n";
351 docstring btprint = getParam("btprint");
354 btprint = from_ascii("btPrintCited");
355 os << "\\" << btprint << "\n"
356 << "\\end{btSect}\n";
359 if (!bibtotoc.empty() && !buffer().masterParams().useBibtopic()) {
360 // set label for hyperref, see http://www.lyx.org/trac/ticket/6470
361 if (buffer().masterParams().pdfoptions().use_hyperref)
362 os << "\\phantomsection";
363 if (buffer().masterParams().documentClass().hasLaTeXLayout("chapter"))
364 os << "\\addcontentsline{toc}{chapter}{\\bibname}";
365 else if (buffer().masterParams().documentClass().hasLaTeXLayout("section"))
366 os << "\\addcontentsline{toc}{section}{\\refname}";
368 // The bibliography command
369 if (!db_out.empty() && !buffer().masterParams().useBibtopic()) {
370 docstring btprint = getParam("btprint");
371 if (btprint == "btPrintAll") {
372 os << "\\nocite{*}\n";
374 os << "\\bibliography{" << getStringFromVector(db_out) << "}\n";
380 support::FileNamePairList InsetBibtex::getBibFiles() const
382 FileName path(buffer().filePath());
383 support::PathChanger p(path);
385 // We need to store both the real FileName and the way it is entered
386 // (with full path, rel path or as a single file name).
387 // The latter is needed for biblatex's central bibfile macro.
388 support::FileNamePairList vec;
390 vector<docstring> bibfilelist = getVectorFromString(getParam("bibfiles"));
391 vector<docstring>::const_iterator it = bibfilelist.begin();
392 vector<docstring>::const_iterator en = bibfilelist.end();
393 for (; it != en; ++it) {
394 FileName const file = getBibTeXPath(*it, buffer());
397 vec.push_back(make_pair(*it, file));
399 LYXERR0("Couldn't find " + to_utf8(*it) + " in InsetBibtex::getBibFiles()!");
408 // methods for parsing bibtex files
410 typedef map<docstring, docstring> VarMap;
412 /// remove whitespace characters, optionally a single comma,
413 /// and further whitespace characters from the stream.
414 /// @return true if a comma was found, false otherwise
416 bool removeWSAndComma(ifdocstream & ifs) {
425 } while (ifs && isSpace(ch));
438 } while (ifs && isSpace(ch));
453 /// remove whitespace characters, read characer sequence
454 /// not containing whitespace characters or characters in
455 /// delimChars, and remove further whitespace characters.
457 /// @return true if a string of length > 0 could be read.
459 bool readTypeOrKey(docstring & val, ifdocstream & ifs,
460 docstring const & delimChars, docstring const & illegalChars,
473 } while (ifs && isSpace(ch));
479 bool legalChar = true;
480 while (ifs && !isSpace(ch) &&
481 delimChars.find(ch) == docstring::npos &&
482 (legalChar = (illegalChars.find(ch) == docstring::npos))
485 if (chCase == makeLowerCase)
486 val += lowercase(ch);
498 while (ifs && isSpace(ch)) {
506 return val.length() > 0;
509 /// read subsequent bibtex values that are delimited with a #-character.
510 /// Concatenate all parts and replace names with the associated string in
511 /// the variable strings.
512 /// @return true if reading was successfull (all single parts were delimited
514 bool readValue(docstring & val, ifdocstream & ifs, const VarMap & strings) {
527 } while (ifs && isSpace(ch));
532 // check for field type
533 if (isDigitASCII(ch)) {
535 // read integer value
539 } while (ifs && isDigitASCII(ch));
544 } else if (ch == '"' || ch == '{') {
546 char_type delim = ch == '"' ? '"': '}';
551 } while (ifs && isSpace(ch));
556 // We now have the first non-whitespace character
557 // We'll collapse adjacent whitespace.
558 bool lastWasWhiteSpace = false;
560 // inside this delimited text braces must match.
561 // Thus we can have a closing delimiter only
562 // when nestLevel == 0
565 while (ifs && (nestLevel > 0 || ch != delim)) {
567 lastWasWhiteSpace = true;
571 // We output the space only after we stop getting
572 // whitespace so as not to output any whitespace
573 // at the end of the value.
574 if (lastWasWhiteSpace) {
575 lastWasWhiteSpace = false;
581 // update nesting level
600 // FIXME Why is this here?
608 // reading a string name
611 while (ifs && !isSpace(ch) && ch != '#' && ch != ',' && ch != '}' && ch != ')') {
612 strName += lowercase(ch);
619 // replace the string with its assigned value or
620 // discard it if it's not assigned
621 if (strName.length()) {
622 VarMap::const_iterator pos = strings.find(strName);
623 if (pos != strings.end()) {
630 while (ifs && isSpace(ch)) {
637 // continue reading next value on concatenate with '#'
647 void InsetBibtex::collectBibKeys(InsetIterator const & /*di*/, FileNameList & checkedFiles) const
649 parseBibTeXFiles(checkedFiles);
653 void InsetBibtex::parseBibTeXFiles(FileNameList & checkedFiles) const
655 // This bibtex parser is a first step to parse bibtex files
658 // - it reads the whole bibtex entry and does a syntax check
659 // (matching delimiters, missing commas,...
660 // - it recovers from errors starting with the next @-character
661 // - it reads @string definitions and replaces them in the
663 // - it accepts more characters in keys or value names than
666 // Officially bibtex does only support ASCII, but in practice
667 // you can use the encoding of the main document as long as
668 // some elements like keys and names are pure ASCII. Therefore
669 // we convert the file from the buffer encoding.
670 // We don't restrict keys to ASCII in LyX, since our own
671 // InsetBibitem can generate non-ASCII keys, and nonstandard
672 // 8bit clean bibtex forks exist.
676 support::FileNamePairList const files = getBibFiles();
677 support::FileNamePairList::const_iterator it = files.begin();
678 support::FileNamePairList::const_iterator en = files.end();
679 for (; it != en; ++ it) {
680 FileName const bibfile = it->second;
681 if (find(checkedFiles.begin(), checkedFiles.end(), bibfile) != checkedFiles.end())
682 // already checked this one. Skip.
685 // record that we check this.
686 checkedFiles.push_back(bibfile);
687 ifdocstream ifs(bibfile.toFilesystemEncoding().c_str(),
688 ios_base::in, buffer().masterParams().encoding().iconvName());
704 if (!readTypeOrKey(entryType, ifs, from_ascii("{("), docstring(), makeLowerCase)) {
705 lyxerr << "BibTeX Parser: Error reading entry type." << std::endl;
710 lyxerr << "BibTeX Parser: Unexpected end of file." << std::endl;
714 if (entryType == from_ascii("comment")) {
715 ifs.ignore(numeric_limits<int>::max(), '\n');
721 lyxerr << "BibTeX Parser: Unexpected end of file." << std::endl;
725 if ((ch != '(') && (ch != '{')) {
726 lyxerr << "BibTeX Parser: Invalid entry delimiter." << std::endl;
732 if (entryType == from_ascii("string")) {
734 // read string and add it to the strings map
735 // (or replace it's old value)
739 if (!readTypeOrKey(name, ifs, from_ascii("="), from_ascii("#{}(),"), makeLowerCase)) {
740 lyxerr << "BibTeX Parser: Error reading string name." << std::endl;
745 lyxerr << "BibTeX Parser: Unexpected end of file." << std::endl;
749 // next char must be an equal sign
751 if (!ifs || ch != '=') {
752 lyxerr << "BibTeX Parser: No `=' after string name: " <<
753 name << "." << std::endl;
757 if (!readValue(value, ifs, strings)) {
758 lyxerr << "BibTeX Parser: Unable to read value for string: " <<
759 name << "." << std::endl;
763 strings[name] = value;
765 } else if (entryType == from_ascii("preamble")) {
767 // preamble definitions are discarded.
768 // can they be of any use in lyx?
771 if (!readValue(value, ifs, strings)) {
772 lyxerr << "BibTeX Parser: Unable to read preamble value." << std::endl;
778 // Citation entry. Try to read the key.
781 if (!readTypeOrKey(key, ifs, from_ascii(","), from_ascii("}"), keepCase)) {
782 lyxerr << "BibTeX Parser: Unable to read key for entry type:" <<
783 entryType << "." << std::endl;
788 lyxerr << "BibTeX Parser: Unexpected end of file." << std::endl;
792 /////////////////////////////////////////////
793 // now we have a key, so we will add an entry
794 // (even if it's empty, as bibtex does)
796 // we now read the field = value pairs.
797 // all items must be separated by a comma. If
798 // it is missing the scanning of this entry is
799 // stopped and the next is searched.
803 BibTeXInfo keyvalmap(key, entryType);
805 bool readNext = removeWSAndComma(ifs);
807 while (ifs && readNext) {
810 if (!readTypeOrKey(name, ifs, from_ascii("="),
811 from_ascii("{}(),"), makeLowerCase) || !ifs)
814 // next char must be an equal sign
815 // FIXME Whitespace??
818 lyxerr << "BibTeX Parser: Unexpected end of file." << std::endl;
822 lyxerr << "BibTeX Parser: Missing `=' after field name: " <<
823 name << ", for key: " << key << "." << std::endl;
829 if (!readValue(value, ifs, strings)) {
830 lyxerr << "BibTeX Parser: Unable to read value for field: " <<
831 name << ", for key: " << key << "." << std::endl;
835 keyvalmap[name] = value;
836 data += "\n\n" + value;
837 keylist.addFieldName(name);
838 readNext = removeWSAndComma(ifs);
842 keylist.addEntryType(entryType);
843 keyvalmap.setAllData(data);
844 keylist[key] = keyvalmap;
845 } //< else (citation entry)
847 } //< for loop over files
849 buffer().addBiblioInfo(keylist);
853 FileName InsetBibtex::getBibTeXPath(docstring const & filename, Buffer const & buf)
855 string texfile = changeExtension(to_utf8(filename), "bib");
856 // note that, if the filename can be found directly from the path,
857 // findtexfile will just return a FileName object for that path.
858 FileName file(findtexfile(texfile, "bib"));
860 file = FileName(makeAbsPath(texfile, buf.filePath()));
865 bool InsetBibtex::addDatabase(docstring const & db)
867 docstring bibfiles = getParam("bibfiles");
868 if (tokenPos(bibfiles, ',', db) != -1)
870 if (!bibfiles.empty())
872 setParam("bibfiles", bibfiles + db);
877 bool InsetBibtex::delDatabase(docstring const & db)
879 docstring bibfiles = getParam("bibfiles");
880 if (contains(bibfiles, db)) {
881 int const n = tokenPos(bibfiles, ',', db);
884 // this is not the first database
885 docstring tmp = ',' + bd;
886 setParam("bibfiles", subst(bibfiles, tmp, docstring()));
888 // this is the first (or only) database
889 setParam("bibfiles", split(bibfiles, bd, ','));
897 void InsetBibtex::validate(LaTeXFeatures & features) const
899 BufferParams const & mparams = features.buffer().masterParams();
900 if (mparams.useBibtopic())
901 features.require("bibtopic");
902 else if (!mparams.useBiblatex() && mparams.multibib == "child")
903 features.require("chapterbib");
905 // It'd be better to be able to get this from an InsetLayout, but at present
906 // InsetLayouts do not seem really to work for things that aren't InsetTexts.
907 if (features.runparams().flavor == OutputParams::HTML)
908 features.addCSSSnippet("div.bibtexentry { margin-left: 2em; text-indent: -2em; }\n"
909 "span.bibtexlabel:before{ content: \"[\"; }\n"
910 "span.bibtexlabel:after{ content: \"] \"; }");
914 int InsetBibtex::plaintext(odocstringstream & os,
915 OutputParams const & op, size_t max_length) const
917 docstring const reflabel = buffer().B_("References");
919 // We could output more information here, e.g., what databases are included
920 // and information about options. But I don't necessarily see any reason to
921 // do this right now.
922 if (op.for_tooltip || op.for_toc || op.for_search) {
923 os << '[' << reflabel << ']' << '\n';
924 return PLAINTEXT_NEWLINE;
927 BiblioInfo bibinfo = buffer().masterBibInfo();
928 bibinfo.makeCitationLabels(buffer());
929 vector<docstring> const & cites = bibinfo.citedEntries();
931 size_t start_size = os.str().size();
933 refoutput += reflabel + "\n\n";
935 // Tell BiblioInfo our purpose
937 ci.context = CiteItem::Export;
939 // Now we loop over the entries
940 vector<docstring>::const_iterator vit = cites.begin();
941 vector<docstring>::const_iterator const ven = cites.end();
942 for (; vit != ven; ++vit) {
943 if (start_size + refoutput.size() >= max_length)
945 BiblioInfo::const_iterator const biit = bibinfo.find(*vit);
946 if (biit == bibinfo.end())
948 BibTeXInfo const & entry = biit->second;
949 refoutput += "[" + entry.label() + "] ";
950 // FIXME Right now, we are calling BibInfo::getInfo on the key,
951 // which will give us all the cross-referenced info. But for every
952 // entry, so there's a lot of repitition. This should be fixed.
953 refoutput += bibinfo.getInfo(entry.key(), buffer(), ci) + "\n\n";
956 return refoutput.size();
961 // docstring InsetBibtex::entriesAsXHTML(vector<docstring> const & entries)
962 // And then here just: entriesAsXHTML(buffer().masterBibInfo().citedEntries())
963 docstring InsetBibtex::xhtml(XHTMLStream & xs, OutputParams const &) const
965 BiblioInfo const & bibinfo = buffer().masterBibInfo();
966 bool const all_entries = getParam("btprint") == "btPrintAll";
967 vector<docstring> const & cites =
968 all_entries ? bibinfo.getKeys() : bibinfo.citedEntries();
970 docstring const reflabel = buffer().B_("References");
972 // tell BiblioInfo our purpose
974 ci.context = CiteItem::Export;
976 ci.max_key_size = UINT_MAX;
978 xs << html::StartTag("h2", "class='bibtex'")
980 << html::EndTag("h2")
981 << html::StartTag("div", "class='bibtex'");
983 // Now we loop over the entries
984 vector<docstring>::const_iterator vit = cites.begin();
985 vector<docstring>::const_iterator const ven = cites.end();
986 for (; vit != ven; ++vit) {
987 BiblioInfo::const_iterator const biit = bibinfo.find(*vit);
988 if (biit == bibinfo.end())
991 BibTeXInfo const & entry = biit->second;
992 string const attr = "class='bibtexentry' id='LyXCite-"
993 + to_utf8(html::cleanAttr(entry.key())) + "'";
994 xs << html::StartTag("div", attr);
996 // don't print labels if we're outputting all entries
998 xs << html::StartTag("span", "class='bibtexlabel'")
1000 << html::EndTag("span");
1003 // FIXME Right now, we are calling BibInfo::getInfo on the key,
1004 // which will give us all the cross-referenced info. But for every
1005 // entry, so there's a lot of repitition. This should be fixed.
1006 xs << html::StartTag("span", "class='bibtexinfo'")
1007 << XHTMLStream::ESCAPE_AND
1008 << bibinfo.getInfo(entry.key(), buffer(), ci)
1009 << html::EndTag("span")
1010 << html::EndTag("div")
1013 xs << html::EndTag("div");
1018 void InsetBibtex::write(ostream & os) const
1020 params().Write(os, &buffer());
1024 string InsetBibtex::contextMenuName() const
1026 return "context-bibtex";