3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "Converter.h"
16 #include "buffer_funcs.h"
17 #include "BufferParams.h"
18 #include "ConverterCache.h"
20 #include "ErrorList.h"
27 #include "frontends/alert.h"
29 #include "support/debug.h"
30 #include "support/FileNameList.h"
31 #include "support/filetools.h"
32 #include "support/gettext.h"
33 #include "support/lassert.h"
34 #include "support/lstrings.h"
35 #include "support/os.h"
36 #include "support/Package.h"
37 #include "support/PathChanger.h"
38 #include "support/Systemcall.h"
41 using namespace lyx::support;
45 namespace Alert = lyx::frontend::Alert;
50 string const token_from("$$i");
51 string const token_base("$$b");
52 string const token_to("$$o");
53 string const token_path("$$p");
54 string const token_orig_path("$$r");
55 string const token_orig_from("$$f");
56 string const token_encoding("$$e");
57 string const token_latex_encoding("$$E");
60 string const add_options(string const & command, string const & options)
63 string const tail = split(command, head, ' ');
64 return head + ' ' + options + ' ' + tail;
68 string const dvipdfm_options(BufferParams const & bp)
72 if (bp.papersize != PAPER_CUSTOM) {
73 string const paper_size = bp.paperSizeName(BufferParams::DVIPDFM);
74 if (!paper_size.empty())
75 result = "-p "+ paper_size;
77 if (bp.orientation == ORIENTATION_LANDSCAPE)
85 class ConverterEqual {
87 ConverterEqual(string const & from, string const & to)
88 : from_(from), to_(to) {}
89 bool operator()(Converter const & c) const {
90 return c.from() == from_ && c.to() == to_;
100 Converter::Converter(string const & f, string const & t,
101 string const & c, string const & l)
102 : from_(f), to_(t), command_(c), flags_(l),
103 From_(0), To_(0), latex_(false), xml_(false),
104 need_aux_(false), nice_(false), need_auth_(false)
108 void Converter::readFlags()
110 string flag_list(flags_);
111 while (!flag_list.empty()) {
112 string flag_name, flag_value;
113 flag_list = split(flag_list, flag_value, ',');
114 flag_value = split(flag_value, flag_name, '=');
115 if (flag_name == "latex") {
117 latex_flavor_ = flag_value.empty() ?
118 "latex" : flag_value;
119 } else if (flag_name == "xml")
121 else if (flag_name == "needaux")
123 else if (flag_name == "resultdir")
124 result_dir_ = (flag_value.empty())
125 ? token_base : flag_value;
126 else if (flag_name == "resultfile")
127 result_file_ = flag_value;
128 else if (flag_name == "parselog")
129 parselog_ = flag_value;
130 else if (flag_name == "nice")
132 else if (flag_name == "needauth")
135 if (!result_dir_.empty() && result_file_.empty())
136 result_file_ = "index." + formats.extension(to_);
137 //if (!contains(command, token_from))
142 Converter const * Converters::getConverter(string const & from,
143 string const & to) const
145 ConverterList::const_iterator const cit =
146 find_if(converterlist_.begin(), converterlist_.end(),
147 ConverterEqual(from, to));
148 if (cit != converterlist_.end())
155 int Converters::getNumber(string const & from, string const & to) const
157 ConverterList::const_iterator const cit =
158 find_if(converterlist_.begin(), converterlist_.end(),
159 ConverterEqual(from, to));
160 if (cit != converterlist_.end())
161 return distance(converterlist_.begin(), cit);
167 void Converters::add(string const & from, string const & to,
168 string const & command, string const & flags)
172 ConverterList::iterator it = find_if(converterlist_.begin(),
173 converterlist_.end(),
174 ConverterEqual(from , to));
176 Converter converter(from, to, command, flags);
177 if (it != converterlist_.end() && !flags.empty() && flags[0] == '*') {
179 converter.setCommand(command);
180 converter.setFlags(flags);
182 converter.readFlags();
184 // The latex_command is used to update the .aux file when running
185 // a converter that uses it.
186 if (converter.latex()) {
187 if (latex_command_.empty() ||
188 converter.latex_flavor() == "latex")
189 latex_command_ = subst(command, token_from, "");
190 if (dvilualatex_command_.empty() ||
191 converter.latex_flavor() == "dvilualatex")
192 dvilualatex_command_ = subst(command, token_from, "");
193 if (lualatex_command_.empty() ||
194 converter.latex_flavor() == "lualatex")
195 lualatex_command_ = subst(command, token_from, "");
196 if (pdflatex_command_.empty() ||
197 converter.latex_flavor() == "pdflatex")
198 pdflatex_command_ = subst(command, token_from, "");
199 if (xelatex_command_.empty() ||
200 converter.latex_flavor() == "xelatex")
201 xelatex_command_ = subst(command, token_from, "");
204 if (it == converterlist_.end()) {
205 converterlist_.push_back(converter);
207 converter.setFrom(it->From());
208 converter.setTo(it->To());
214 void Converters::erase(string const & from, string const & to)
216 ConverterList::iterator const it =
217 find_if(converterlist_.begin(),
218 converterlist_.end(),
219 ConverterEqual(from, to));
220 if (it != converterlist_.end())
221 converterlist_.erase(it);
225 // This method updates the pointers From and To in all the converters.
226 // The code is not very efficient, but it doesn't matter as the number
227 // of formats and converters is small.
228 // Furthermore, this method is called only on startup, or after
229 // adding/deleting a format in FormPreferences (the latter calls can be
230 // eliminated if the formats in the Formats class are stored using a map or
231 // a list (instead of a vector), but this will cause other problems).
232 void Converters::update(Formats const & formats)
234 ConverterList::iterator it = converterlist_.begin();
235 ConverterList::iterator end = converterlist_.end();
236 for (; it != end; ++it) {
237 it->setFrom(formats.getFormat(it->from()));
238 it->setTo(formats.getFormat(it->to()));
243 // This method updates the pointers From and To in the last converter.
244 // It is called when adding a new converter in FormPreferences
245 void Converters::updateLast(Formats const & formats)
247 if (converterlist_.begin() != converterlist_.end()) {
248 ConverterList::iterator it = converterlist_.end() - 1;
249 it->setFrom(formats.getFormat(it->from()));
250 it->setTo(formats.getFormat(it->to()));
255 OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path,
256 Buffer const * buffer)
258 for (Graph::EdgePath::const_iterator cit = path.begin();
259 cit != path.end(); ++cit) {
260 Converter const & conv = converterlist_[*cit];
262 if (conv.latex_flavor() == "latex")
263 return OutputParams::LATEX;
264 if (conv.latex_flavor() == "xelatex")
265 return OutputParams::XETEX;
266 if (conv.latex_flavor() == "lualatex")
267 return OutputParams::LUATEX;
268 if (conv.latex_flavor() == "dvilualatex")
269 return OutputParams::DVILUATEX;
270 if (conv.latex_flavor() == "pdflatex")
271 return OutputParams::PDFLATEX;
274 return OutputParams::XML;
276 return buffer ? buffer->params().getOutputFlavor()
277 : OutputParams::LATEX;
281 bool Converters::checkAuth(Converter const & conv, string const & doc_fname)
283 if (!conv.need_auth())
285 if (lyxrc.use_converter_needauth_forbidden) {
286 frontend::Alert::warning(
287 _("Potentially harmful external converters disabled"),
288 _("Requested operation needs use of a potentially harmful external converter program,"
289 "which is forbidden by default.\nThese converters are tagged by the 'needauth' option. "
290 "In order to unlock execution of these converters,\nplease, go to "
291 "Preferences->File Handling->Converters and uncheck "
292 "Security->Forbid needauth converters."), true);
295 if (!lyxrc.use_converter_needauth)
297 static const docstring security_title = _("Launch of external converter needs user authorization");
298 static const char security_warning[] = "LyX is about to run converter '%1$s' which is launching an external program "
299 "that normally acts as a picture/format converter. However, this external program is known to be able to "
300 "execute arbitrary actions on the system on behalf of the user, including dangerous ones such as deleting "
301 "files, if instructed to do so by a maliciously crafted .lyx document.\n\nWould you like to run the converter?\n\n"
302 "ANSWER RUN ONLY IF YOU TRUST THE ORIGIN/SENDER OF THE LYX DOCUMENT!";
304 if (!doc_fname.empty()) {
305 LYXERR(Debug::FILES, "looking up: " << doc_fname);
306 if (auth_files_.find(doc_fname) == auth_files_.end()) {
307 choice = frontend::Alert::prompt(security_title,
308 bformat(_(security_warning), from_utf8(conv.command())),
309 0, 0, _("Do &NOT run"), _("&Run"), _("&Always run for this document"));
311 auth_files_.insert(doc_fname);
316 choice = frontend::Alert::prompt(security_title,
317 bformat(_(security_warning), from_utf8(conv.command())),
318 0, 0, _("Do &NOT run"), _("&Run"));
324 bool Converters::convert(Buffer const * buffer,
325 FileName const & from_file, FileName const & to_file,
326 FileName const & orig_from,
327 string const & from_format, string const & to_format,
328 ErrorList & errorList, int conversionflags)
330 if (from_format == to_format)
331 return move(from_format, from_file, to_file, false);
333 if ((conversionflags & try_cache) &&
334 ConverterCache::get().inCache(orig_from, to_format))
335 return ConverterCache::get().copy(orig_from, to_format, to_file);
337 Graph::EdgePath edgepath = getPath(from_format, to_format);
338 if (edgepath.empty()) {
339 if (conversionflags & try_default) {
340 // if no special converter defined, then we take the
341 // default one from ImageMagic.
342 string const from_ext = from_format.empty() ?
343 getExtension(from_file.absFileName()) :
344 formats.extension(from_format);
345 string const to_ext = formats.extension(to_format);
346 string const command =
348 quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) +
349 ' ' + from_ext + ' ' +
350 quoteName(from_file.toFilesystemEncoding()) +
352 quoteName(to_file.toFilesystemEncoding());
353 LYXERR(Debug::FILES, "No converter defined! "
354 "I use convertDefault.py:\n\t" << command);
356 one.startscript(Systemcall::Wait, command,
357 buffer ? buffer->filePath() : string(),
358 buffer ? buffer->layoutPos() : string());
359 if (to_file.isReadableFile()) {
360 if (conversionflags & try_cache)
361 ConverterCache::get().add(orig_from,
367 // only warn once per session and per file type
368 static std::map<string, string> warned;
369 if (warned.find(from_format) != warned.end() && warned.find(from_format)->second == to_format) {
372 warned.insert(make_pair(from_format, to_format));
374 Alert::error(_("Cannot convert file"),
375 bformat(_("No information for converting %1$s "
376 "format files to %2$s.\n"
377 "Define a converter in the preferences."),
378 from_ascii(from_format), from_ascii(to_format)));
382 // buffer is only invalid for importing, and then runparams is not
384 OutputParams runparams(buffer ? &buffer->params().encoding() : 0);
385 runparams.flavor = getFlavor(edgepath, buffer);
388 runparams.use_japanese =
389 buffer->params().bufferFormat() == "latex"
390 && buffer->params().encoding().package() == Encoding::japanese;
391 runparams.use_indices = buffer->params().use_indices;
392 runparams.bibtex_command = (buffer->params().bibtex_command == "default") ?
393 string() : buffer->params().bibtex_command;
394 runparams.index_command = (buffer->params().index_command == "default") ?
395 string() : buffer->params().index_command;
396 runparams.document_language = buffer->params().language->babel();
399 // Some converters (e.g. lilypond) can only output files to the
400 // current directory, so we need to change the current directory.
401 // This has the added benefit that all other files that may be
402 // generated by the converter are deleted when LyX closes and do not
403 // clutter the real working directory.
404 // FIXME: This does not work if path is an UNC path on windows
406 string const path(onlyPath(from_file.absFileName()));
407 // Prevent the compiler from optimizing away p
411 // empty the error list before any new conversion takes place.
414 bool run_latex = false;
415 string from_base = changeExtension(from_file.absFileName(), "");
416 string to_base = changeExtension(to_file.absFileName(), "");
418 FileName outfile = from_file;
419 for (Graph::EdgePath::const_iterator cit = edgepath.begin();
420 cit != edgepath.end(); ++cit) {
421 Converter const & conv = converterlist_[*cit];
422 bool dummy = conv.To()->dummy() && conv.to() != "program";
424 LYXERR(Debug::FILES, "Converting from "
425 << conv.from() << " to " << conv.to());
428 outfile = FileName(conv.result_file().empty()
429 ? changeExtension(from_file.absFileName(), conv.To()->extension())
430 : addName(subst(conv.result_dir(),
431 token_base, from_base),
432 subst(conv.result_file(),
433 token_base, onlyFileName(from_base))));
435 // if input and output files are equal, we use a
436 // temporary file as intermediary (JMarc)
437 FileName real_outfile;
438 if (!conv.result_file().empty())
439 real_outfile = FileName(changeExtension(from_file.absFileName(),
440 conv.To()->extension()));
441 if (outfile == infile) {
442 real_outfile = infile;
443 // when importing, a buffer does not necessarily exist
445 outfile = FileName(addName(buffer->temppath(), "tmpfile.out"));
447 outfile = FileName(addName(package().temp_dir().absFileName(),
451 if (!checkAuth(conv, buffer->absFileName()))
456 string command = conv.command();
457 command = subst(command, token_from, "");
458 command = subst(command, token_latex_encoding, buffer ?
459 buffer->params().encoding().latexName() : string());
460 LYXERR(Debug::FILES, "Running " << command);
461 if (!runLaTeX(*buffer, command, runparams, errorList))
464 if (conv.need_aux() && !run_latex) {
466 switch (runparams.flavor) {
467 case OutputParams::DVILUATEX:
468 command = dvilualatex_command_;
470 case OutputParams::LUATEX:
471 command = lualatex_command_;
473 case OutputParams::PDFLATEX:
474 command = pdflatex_command_;
476 case OutputParams::XETEX:
477 command = xelatex_command_;
480 command = latex_command_;
483 if (!command.empty()) {
484 LYXERR(Debug::FILES, "Running "
486 << " to update aux file");
487 if (!runLaTeX(*buffer, command,
488 runparams, errorList))
494 string const infile2 =
495 to_utf8(makeRelPath(from_utf8(infile.absFileName()), from_utf8(path)));
496 string const outfile2 =
497 to_utf8(makeRelPath(from_utf8(outfile.absFileName()), from_utf8(path)));
499 string command = conv.command();
500 command = subst(command, token_from, quoteName(infile2));
501 command = subst(command, token_base, quoteName(from_base));
502 command = subst(command, token_to, quoteName(outfile2));
503 command = subst(command, token_path, quoteName(onlyPath(infile.absFileName())));
504 command = subst(command, token_orig_path, quoteName(onlyPath(orig_from.absFileName())));
505 command = subst(command, token_orig_from, quoteName(onlyFileName(orig_from.absFileName())));
506 command = subst(command, token_encoding, buffer ? buffer->params().encoding().iconvName() : string());
508 if (!conv.parselog().empty())
509 command += " 2> " + quoteName(infile2 + ".out");
511 // it is not actually not necessary to test for buffer here,
512 // but it pleases coverity.
513 if (buffer && conv.from() == "dvi" && conv.to() == "ps")
514 command = add_options(command,
515 buffer->params().dvips_options());
516 else if (buffer && conv.from() == "dvi" && prefixIs(conv.to(), "pdf"))
517 command = add_options(command,
518 dvipdfm_options(buffer->params()));
520 LYXERR(Debug::FILES, "Calling " << command);
522 buffer->message(_("Executing command: ")
523 + from_utf8(command));
528 res = one.startscript(Systemcall::DontWait,
529 to_filesystem8bit(from_utf8(command)),
530 buffer ? buffer->filePath() : string(),
531 buffer ? buffer->layoutPos() : string());
532 // We're not waiting for the result, so we can't do anything
535 res = one.startscript(Systemcall::Wait,
536 to_filesystem8bit(from_utf8(command)),
537 buffer ? buffer->filePath()
539 buffer ? buffer->layoutPos()
541 if (!real_outfile.empty()) {
542 Mover const & mover = getMover(conv.to());
543 if (!mover.rename(outfile, real_outfile))
546 LYXERR(Debug::FILES, "renaming file " << outfile
547 << " to " << real_outfile);
548 // Finally, don't forget to tell any future
549 // converters to use the renamed file...
550 outfile = real_outfile;
553 if (!conv.parselog().empty()) {
554 string const logfile = infile2 + ".log";
555 string const command2 = conv.parselog() +
556 " < " + quoteName(infile2 + ".out") +
557 " > " + quoteName(logfile);
558 one.startscript(Systemcall::Wait,
559 to_filesystem8bit(from_utf8(command2)),
561 buffer->layoutPos());
562 if (!scanLog(*buffer, command, makeAbsPath(logfile, path), errorList))
568 if (conv.to() == "program") {
569 Alert::error(_("Build errors"),
570 _("There were errors during the build process."));
572 // FIXME: this should go out of here. For example, here we cannot say if
573 // it is a document (.lyx) or something else. Same goes for elsewhere.
574 Alert::error(_("Cannot convert file"),
575 bformat(_("An error occurred while running:\n%1$s"),
576 wrapParas(from_utf8(command))));
583 Converter const & conv = converterlist_[edgepath.back()];
584 if (conv.To()->dummy())
587 if (!conv.result_dir().empty()) {
588 // The converter has put the file(s) in a directory.
589 // In this case we ignore the given to_file.
590 if (from_base != to_base) {
591 string const from = subst(conv.result_dir(),
592 token_base, from_base);
593 string const to = subst(conv.result_dir(),
594 token_base, to_base);
595 Mover const & mover = getMover(conv.from());
596 if (!mover.rename(FileName(from), FileName(to))) {
597 Alert::error(_("Cannot convert file"),
598 bformat(_("Could not move a temporary directory from %1$s to %2$s."),
599 from_utf8(from), from_utf8(to)));
605 if (conversionflags & try_cache)
606 ConverterCache::get().add(orig_from, to_format, outfile);
607 return move(conv.to(), outfile, to_file, conv.latex());
612 bool Converters::move(string const & fmt,
613 FileName const & from, FileName const & to, bool copy)
618 bool no_errors = true;
619 string const path = onlyPath(from.absFileName());
620 string const base = onlyFileName(removeExtension(from.absFileName()));
621 string const to_base = removeExtension(to.absFileName());
622 string const to_extension = getExtension(to.absFileName());
624 support::FileNameList const files = FileName(path).dirList(getExtension(from.absFileName()));
625 for (support::FileNameList::const_iterator it = files.begin();
626 it != files.end(); ++it) {
627 string const from2 = it->absFileName();
628 string const file2 = onlyFileName(from2);
629 if (prefixIs(file2, base)) {
630 string const to2 = changeExtension(
631 to_base + file2.substr(base.length()),
633 LYXERR(Debug::FILES, "moving " << from2 << " to " << to2);
635 Mover const & mover = getMover(fmt);
636 bool const moved = copy
637 ? mover.copy(*it, FileName(to2))
638 : mover.rename(*it, FileName(to2));
639 if (!moved && no_errors) {
640 Alert::error(_("Cannot convert file"),
642 _("Could not copy a temporary file from %1$s to %2$s.") :
643 _("Could not move a temporary file from %1$s to %2$s."),
644 from_utf8(from2), from_utf8(to2)));
653 bool Converters::formatIsUsed(string const & format)
655 ConverterList::const_iterator cit = converterlist_.begin();
656 ConverterList::const_iterator end = converterlist_.end();
657 for (; cit != end; ++cit) {
658 if (cit->from() == format || cit->to() == format)
665 bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
666 FileName const & filename, ErrorList & errorList)
668 OutputParams runparams(0);
669 runparams.flavor = OutputParams::LATEX;
670 LaTeX latex("", runparams, filename);
672 int const result = latex.scanLogFile(terr);
674 if (result & LaTeX::ERRORS)
675 buffer.bufferErrors(terr, errorList);
684 : public boost::signals2::trackable {
686 ShowMessage(Buffer const & b) : buffer_(b) {}
687 void operator()(docstring const & msg) const { buffer_.message(msg); }
689 Buffer const & buffer_;
695 bool Converters::runLaTeX(Buffer const & buffer, string const & command,
696 OutputParams const & runparams, ErrorList & errorList)
698 buffer.setBusy(true);
699 buffer.message(_("Running LaTeX..."));
701 // do the LaTeX run(s)
702 string const name = buffer.latexName();
703 LaTeX latex(command, runparams, FileName(makeAbsPath(name)),
704 buffer.filePath(), buffer.layoutPos(),
705 buffer.lastPreviewError());
707 ShowMessage show(buffer);
708 latex.message.connect(show);
709 int const result = latex.run(terr);
711 if (result & LaTeX::ERRORS)
712 buffer.bufferErrors(terr, errorList);
714 if (!errorList.empty()) {
715 // We will show the LaTeX Errors GUI later which contains
716 // specific error messages so it would be repetitive to give
717 // e.g. the "finished with an error" dialog in addition.
719 else if (result & LaTeX::NO_LOGFILE) {
720 docstring const str =
721 bformat(_("LaTeX did not run successfully. "
722 "Additionally, LyX could not locate "
723 "the LaTeX log %1$s."), from_utf8(name));
724 Alert::error(_("LaTeX failed"), str);
725 } else if (result & LaTeX::NONZERO_ERROR) {
726 docstring const str =
727 bformat(_( "The external program\n%1$s\n"
728 "finished with an error. "
729 "It is recommended you fix the cause of the external "
730 "program's error (check the logs). "), from_utf8(command));
731 Alert::error(_("LaTeX failed"), str);
732 } else if (result & LaTeX::NO_OUTPUT) {
733 Alert::warning(_("Output is empty"),
734 _("No output file was generated."));
738 buffer.setBusy(false);
740 int const ERROR_MASK =
745 return (result & ERROR_MASK) == 0;
750 void Converters::buildGraph()
752 // clear graph's data structures
753 G_.init(formats.size());
754 // each of the converters knows how to convert one format to another
755 // so, for each of them, we create an arrow on the graph, going from
756 // the one to the other
757 ConverterList::iterator it = converterlist_.begin();
758 ConverterList::iterator const end = converterlist_.end();
759 for (; it != end ; ++it) {
760 int const from = formats.getNumber(it->from());
761 int const to = formats.getNumber(it->to());
762 LASSERT(from >= 0, continue);
763 LASSERT(to >= 0, continue);
764 G_.addEdge(from, to);
769 FormatList const Converters::intToFormat(vector<int> const & input)
771 FormatList result(input.size());
773 vector<int>::const_iterator it = input.begin();
774 vector<int>::const_iterator const end = input.end();
775 FormatList::iterator rit = result.begin();
776 for ( ; it != end; ++it, ++rit) {
777 *rit = &formats.get(*it);
783 FormatList const Converters::getReachableTo(string const & target,
784 bool const clear_visited)
786 vector<int> const & reachablesto =
787 G_.getReachableTo(formats.getNumber(target), clear_visited);
789 return intToFormat(reachablesto);
793 FormatList const Converters::getReachable(string const & from,
794 bool const only_viewable, bool const clear_visited,
795 set<string> const & excludes)
797 set<int> excluded_numbers;
799 set<string>::const_iterator sit = excludes.begin();
800 set<string>::const_iterator const end = excludes.end();
801 for (; sit != end; ++sit)
802 excluded_numbers.insert(formats.getNumber(*sit));
804 vector<int> const & reachables =
805 G_.getReachable(formats.getNumber(from),
810 return intToFormat(reachables);
814 bool Converters::isReachable(string const & from, string const & to)
816 return G_.isReachable(formats.getNumber(from),
817 formats.getNumber(to));
821 Graph::EdgePath Converters::getPath(string const & from, string const & to)
823 return G_.getPath(formats.getNumber(from),
824 formats.getNumber(to));
828 FormatList Converters::importableFormats()
830 vector<string> l = loaders();
831 FormatList result = getReachableTo(l[0], true);
832 vector<string>::const_iterator it = l.begin() + 1;
833 vector<string>::const_iterator en = l.end();
834 for (; it != en; ++it) {
835 FormatList r = getReachableTo(*it, false);
836 result.insert(result.end(), r.begin(), r.end());
842 FormatList Converters::exportableFormats(bool only_viewable)
844 vector<string> s = savers();
845 FormatList result = getReachable(s[0], only_viewable, true);
846 vector<string>::const_iterator it = s.begin() + 1;
847 vector<string>::const_iterator en = s.end();
848 for (; it != en; ++it) {
849 FormatList r = getReachable(*it, only_viewable, false);
850 result.insert(result.end(), r.begin(), r.end());
856 vector<string> Converters::loaders() const
861 v.push_back("textparagraph");
866 vector<string> Converters::savers() const
869 v.push_back("docbook");
870 v.push_back("latex");
871 v.push_back("literate");
872 v.push_back("luatex");
873 v.push_back("dviluatex");
875 v.push_back("xhtml");
876 v.push_back("pdflatex");
877 v.push_back("platex");
879 v.push_back("xetex");