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"
28 #include "frontends/alert.h"
30 #include "support/debug.h"
31 #include "support/FileNameList.h"
32 #include "support/filetools.h"
33 #include "support/gettext.h"
34 #include "support/lassert.h"
35 #include "support/lstrings.h"
36 #include "support/os.h"
37 #include "support/Package.h"
38 #include "support/PathChanger.h"
39 #include "support/Systemcall.h"
42 using namespace lyx::support;
46 namespace Alert = lyx::frontend::Alert;
51 string const token_from("$$i");
52 string const token_base("$$b");
53 string const token_to("$$o");
54 string const token_path("$$p");
55 string const token_orig_path("$$r");
56 string const token_orig_from("$$f");
57 string const token_encoding("$$e");
58 string const token_latex_encoding("$$E");
61 string const add_options(string const & command, string const & options)
64 string const tail = split(command, head, ' ');
65 return head + ' ' + options + ' ' + tail;
69 string const dvipdfm_options(BufferParams const & bp)
73 if (bp.papersize != PAPER_CUSTOM) {
74 string const paper_size = bp.paperSizeName(BufferParams::DVIPDFM);
75 if (!paper_size.empty())
76 result = "-p "+ paper_size;
78 if (bp.orientation == ORIENTATION_LANDSCAPE)
86 class ConverterEqual {
88 ConverterEqual(string const & from, string const & to)
89 : from_(from), to_(to) {}
90 bool operator()(Converter const & c) const {
91 return c.from() == from_ && c.to() == to_;
101 Converter::Converter(string const & f, string const & t,
102 string const & c, string const & l)
103 : from_(f), to_(t), command_(c), flags_(l),
104 From_(0), To_(0), latex_(false), xml_(false),
105 need_aux_(false), nice_(false), need_auth_(false)
109 void Converter::readFlags()
111 string flag_list(flags_);
112 while (!flag_list.empty()) {
113 string flag_name, flag_value;
114 flag_list = split(flag_list, flag_value, ',');
115 flag_value = split(flag_value, flag_name, '=');
116 if (flag_name == "latex") {
118 latex_flavor_ = flag_value.empty() ?
119 "latex" : flag_value;
120 } else if (flag_name == "xml")
122 else if (flag_name == "needaux")
124 else if (flag_name == "resultdir")
125 result_dir_ = (flag_value.empty())
126 ? token_base : flag_value;
127 else if (flag_name == "resultfile")
128 result_file_ = flag_value;
129 else if (flag_name == "parselog")
130 parselog_ = flag_value;
131 else if (flag_name == "nice")
133 else if (flag_name == "needauth")
136 if (!result_dir_.empty() && result_file_.empty())
137 result_file_ = "index." + formats.extension(to_);
138 //if (!contains(command, token_from))
143 Converter const * Converters::getConverter(string const & from,
144 string const & to) const
146 ConverterList::const_iterator const cit =
147 find_if(converterlist_.begin(), converterlist_.end(),
148 ConverterEqual(from, to));
149 if (cit != converterlist_.end())
156 int Converters::getNumber(string const & from, string const & to) const
158 ConverterList::const_iterator const cit =
159 find_if(converterlist_.begin(), converterlist_.end(),
160 ConverterEqual(from, to));
161 if (cit != converterlist_.end())
162 return distance(converterlist_.begin(), cit);
168 void Converters::add(string const & from, string const & to,
169 string const & command, string const & flags)
173 ConverterList::iterator it = find_if(converterlist_.begin(),
174 converterlist_.end(),
175 ConverterEqual(from , to));
177 Converter converter(from, to, command, flags);
178 if (it != converterlist_.end() && !flags.empty() && flags[0] == '*') {
180 converter.setCommand(command);
181 converter.setFlags(flags);
183 converter.readFlags();
185 // The latex_command is used to update the .aux file when running
186 // a converter that uses it.
187 if (converter.latex()) {
188 if (latex_command_.empty() ||
189 converter.latex_flavor() == "latex")
190 latex_command_ = subst(command, token_from, "");
191 if (dvilualatex_command_.empty() ||
192 converter.latex_flavor() == "dvilualatex")
193 dvilualatex_command_ = subst(command, token_from, "");
194 if (lualatex_command_.empty() ||
195 converter.latex_flavor() == "lualatex")
196 lualatex_command_ = subst(command, token_from, "");
197 if (pdflatex_command_.empty() ||
198 converter.latex_flavor() == "pdflatex")
199 pdflatex_command_ = subst(command, token_from, "");
200 if (xelatex_command_.empty() ||
201 converter.latex_flavor() == "xelatex")
202 xelatex_command_ = subst(command, token_from, "");
205 if (it == converterlist_.end()) {
206 converterlist_.push_back(converter);
208 converter.setFrom(it->From());
209 converter.setTo(it->To());
215 void Converters::erase(string const & from, string const & to)
217 ConverterList::iterator const it =
218 find_if(converterlist_.begin(),
219 converterlist_.end(),
220 ConverterEqual(from, to));
221 if (it != converterlist_.end())
222 converterlist_.erase(it);
226 // This method updates the pointers From and To in all the converters.
227 // The code is not very efficient, but it doesn't matter as the number
228 // of formats and converters is small.
229 // Furthermore, this method is called only on startup, or after
230 // adding/deleting a format in FormPreferences (the latter calls can be
231 // eliminated if the formats in the Formats class are stored using a map or
232 // a list (instead of a vector), but this will cause other problems).
233 void Converters::update(Formats const & formats)
235 ConverterList::iterator it = converterlist_.begin();
236 ConverterList::iterator end = converterlist_.end();
237 for (; it != end; ++it) {
238 it->setFrom(formats.getFormat(it->from()));
239 it->setTo(formats.getFormat(it->to()));
244 // This method updates the pointers From and To in the last converter.
245 // It is called when adding a new converter in FormPreferences
246 void Converters::updateLast(Formats const & formats)
248 if (converterlist_.begin() != converterlist_.end()) {
249 ConverterList::iterator it = converterlist_.end() - 1;
250 it->setFrom(formats.getFormat(it->from()));
251 it->setTo(formats.getFormat(it->to()));
256 OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path,
257 Buffer const * buffer)
259 for (Graph::EdgePath::const_iterator cit = path.begin();
260 cit != path.end(); ++cit) {
261 Converter const & conv = converterlist_[*cit];
263 if (conv.latex_flavor() == "latex")
264 return OutputParams::LATEX;
265 if (conv.latex_flavor() == "xelatex")
266 return OutputParams::XETEX;
267 if (conv.latex_flavor() == "lualatex")
268 return OutputParams::LUATEX;
269 if (conv.latex_flavor() == "dvilualatex")
270 return OutputParams::DVILUATEX;
271 if (conv.latex_flavor() == "pdflatex")
272 return OutputParams::PDFLATEX;
275 return OutputParams::XML;
277 return buffer ? buffer->params().getOutputFlavor()
278 : OutputParams::LATEX;
282 bool Converters::checkAuth(Converter const & conv, string const & doc_fname)
284 if (!conv.need_auth())
286 const docstring security_warning = bformat(
287 _("<p>The requested operation requires the use of a converter from "
289 "<blockquote><p><tt>%1$s</tt></p></blockquote>"
290 "<p>This external program can execute arbitrary commands on your "
291 "system, including dangerous ones, if instructed to do so by a "
292 "maliciously crafted .lyx document.</p>"),
293 from_utf8(conv.command()), from_utf8(conv.from()),
294 from_utf8(conv.to()));
295 if (lyxrc.use_converter_needauth_forbidden) {
296 frontend::Alert::warning(
297 _("An external converter is disabled for security reasons"),
298 security_warning + _(
299 "<p>Your current settings forbid its execution.</p>"
300 "<p>(To change this setting, go to <i>Preferences ▹ File "
301 "Handling ▹ Converters</i> and uncheck <i>Security ▹ "
302 "Forbid needauth converters</i>.)"), false);
305 if (!lyxrc.use_converter_needauth)
307 static const docstring security_title =
308 _("An external converter requires your authorization");
310 const docstring security_warning2 = security_warning +
311 _("<p>Would you like to run this converter?</p>"
312 "<p><b>Only run if you trust the origin/sender of the LyX "
313 "document!</b></p>");
314 if (!doc_fname.empty()) {
315 LYXERR(Debug::FILES, "looking up: " << doc_fname);
316 std::set<std::string> & auth_files = theSession().authFiles().authFiles();
317 if (auth_files.find(doc_fname) == auth_files.end()) {
318 choice = frontend::Alert::prompt(security_title, security_warning2,
319 0, 0, _("Do ¬ run"), _("&Run"), _("&Always run for this document"));
321 auth_files.insert(doc_fname);
326 choice = frontend::Alert::prompt(security_title, security_warning2,
327 0, 0, _("Do ¬ run"), _("&Run"));
333 bool Converters::convert(Buffer const * buffer,
334 FileName const & from_file, FileName const & to_file,
335 FileName const & orig_from,
336 string const & from_format, string const & to_format,
337 ErrorList & errorList, int conversionflags)
339 if (from_format == to_format)
340 return move(from_format, from_file, to_file, false);
342 if ((conversionflags & try_cache) &&
343 ConverterCache::get().inCache(orig_from, to_format))
344 return ConverterCache::get().copy(orig_from, to_format, to_file);
346 Graph::EdgePath edgepath = getPath(from_format, to_format);
347 if (edgepath.empty()) {
348 if (conversionflags & try_default) {
349 // if no special converter defined, then we take the
350 // default one from ImageMagic.
351 string const from_ext = from_format.empty() ?
352 getExtension(from_file.absFileName()) :
353 formats.extension(from_format);
354 string const to_ext = formats.extension(to_format);
355 string const command =
357 quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) +
358 ' ' + from_ext + ' ' +
359 quoteName(from_file.toFilesystemEncoding()) +
361 quoteName(to_file.toFilesystemEncoding());
362 LYXERR(Debug::FILES, "No converter defined! "
363 "I use convertDefault.py:\n\t" << command);
365 one.startscript(Systemcall::Wait, command,
366 buffer ? buffer->filePath() : string(),
367 buffer ? buffer->layoutPos() : string());
368 if (to_file.isReadableFile()) {
369 if (conversionflags & try_cache)
370 ConverterCache::get().add(orig_from,
376 // only warn once per session and per file type
377 static std::map<string, string> warned;
378 if (warned.find(from_format) != warned.end() && warned.find(from_format)->second == to_format) {
381 warned.insert(make_pair(from_format, to_format));
383 Alert::error(_("Cannot convert file"),
384 bformat(_("No information for converting %1$s "
385 "format files to %2$s.\n"
386 "Define a converter in the preferences."),
387 from_ascii(from_format), from_ascii(to_format)));
391 // buffer is only invalid for importing, and then runparams is not
393 OutputParams runparams(buffer ? &buffer->params().encoding() : 0);
394 runparams.flavor = getFlavor(edgepath, buffer);
397 runparams.use_japanese =
398 buffer->params().bufferFormat() == "latex"
399 && buffer->params().encoding().package() == Encoding::japanese;
400 runparams.use_indices = buffer->params().use_indices;
401 runparams.bibtex_command = buffer->params().bibtexCommand();
402 runparams.index_command = (buffer->params().index_command == "default") ?
403 string() : buffer->params().index_command;
404 runparams.document_language = buffer->params().language->babel();
407 // Some converters (e.g. lilypond) can only output files to the
408 // current directory, so we need to change the current directory.
409 // This has the added benefit that all other files that may be
410 // generated by the converter are deleted when LyX closes and do not
411 // clutter the real working directory.
412 // FIXME: This does not work if path is an UNC path on windows
414 string const path(onlyPath(from_file.absFileName()));
415 // Prevent the compiler from optimizing away p
419 // empty the error list before any new conversion takes place.
422 bool run_latex = false;
423 string from_base = changeExtension(from_file.absFileName(), "");
424 string to_base = changeExtension(to_file.absFileName(), "");
426 FileName outfile = from_file;
427 for (Graph::EdgePath::const_iterator cit = edgepath.begin();
428 cit != edgepath.end(); ++cit) {
429 Converter const & conv = converterlist_[*cit];
430 bool dummy = conv.To()->dummy() && conv.to() != "program";
432 LYXERR(Debug::FILES, "Converting from "
433 << conv.from() << " to " << conv.to());
436 outfile = FileName(conv.result_file().empty()
437 ? changeExtension(from_file.absFileName(), conv.To()->extension())
438 : addName(subst(conv.result_dir(),
439 token_base, from_base),
440 subst(conv.result_file(),
441 token_base, onlyFileName(from_base))));
443 // if input and output files are equal, we use a
444 // temporary file as intermediary (JMarc)
445 FileName real_outfile;
446 if (!conv.result_file().empty())
447 real_outfile = FileName(changeExtension(from_file.absFileName(),
448 conv.To()->extension()));
449 if (outfile == infile) {
450 real_outfile = infile;
451 // when importing, a buffer does not necessarily exist
453 outfile = FileName(addName(buffer->temppath(), "tmpfile.out"));
455 outfile = FileName(addName(package().temp_dir().absFileName(),
459 if (!checkAuth(conv, buffer ? buffer->absFileName() : string()))
464 string command = conv.command();
465 command = subst(command, token_from, "");
466 command = subst(command, token_latex_encoding, buffer ?
467 buffer->params().encoding().latexName() : string());
468 LYXERR(Debug::FILES, "Running " << command);
469 if (!runLaTeX(*buffer, command, runparams, errorList))
472 if (conv.need_aux() && !run_latex) {
474 switch (runparams.flavor) {
475 case OutputParams::DVILUATEX:
476 command = dvilualatex_command_;
478 case OutputParams::LUATEX:
479 command = lualatex_command_;
481 case OutputParams::PDFLATEX:
482 command = pdflatex_command_;
484 case OutputParams::XETEX:
485 command = xelatex_command_;
488 command = latex_command_;
491 if (!command.empty()) {
492 LYXERR(Debug::FILES, "Running "
494 << " to update aux file");
495 if (!runLaTeX(*buffer, command,
496 runparams, errorList))
502 string const infile2 =
503 to_utf8(makeRelPath(from_utf8(infile.absFileName()), from_utf8(path)));
504 string const outfile2 =
505 to_utf8(makeRelPath(from_utf8(outfile.absFileName()), from_utf8(path)));
507 string command = conv.command();
508 command = subst(command, token_from, quoteName(infile2));
509 command = subst(command, token_base, quoteName(from_base));
510 command = subst(command, token_to, quoteName(outfile2));
511 command = subst(command, token_path, quoteName(onlyPath(infile.absFileName())));
512 command = subst(command, token_orig_path, quoteName(onlyPath(orig_from.absFileName())));
513 command = subst(command, token_orig_from, quoteName(onlyFileName(orig_from.absFileName())));
514 command = subst(command, token_encoding, buffer ? buffer->params().encoding().iconvName() : string());
516 if (!conv.parselog().empty())
517 command += " 2> " + quoteName(infile2 + ".out");
519 // it is not actually not necessary to test for buffer here,
520 // but it pleases coverity.
521 if (buffer && conv.from() == "dvi" && conv.to() == "ps")
522 command = add_options(command,
523 buffer->params().dvips_options());
524 else if (buffer && conv.from() == "dvi" && prefixIs(conv.to(), "pdf"))
525 command = add_options(command,
526 dvipdfm_options(buffer->params()));
528 LYXERR(Debug::FILES, "Calling " << command);
530 buffer->message(_("Executing command: ")
531 + from_utf8(command));
536 res = one.startscript(Systemcall::DontWait,
537 to_filesystem8bit(from_utf8(command)),
538 buffer ? buffer->filePath() : string(),
539 buffer ? buffer->layoutPos() : string());
540 // We're not waiting for the result, so we can't do anything
543 res = one.startscript(Systemcall::Wait,
544 to_filesystem8bit(from_utf8(command)),
545 buffer ? buffer->filePath()
547 buffer ? buffer->layoutPos()
549 if (!real_outfile.empty()) {
550 Mover const & mover = getMover(conv.to());
551 if (!mover.rename(outfile, real_outfile))
554 LYXERR(Debug::FILES, "renaming file " << outfile
555 << " to " << real_outfile);
556 // Finally, don't forget to tell any future
557 // converters to use the renamed file...
558 outfile = real_outfile;
561 if (!conv.parselog().empty()) {
562 string const logfile = infile2 + ".log";
563 string const command2 = conv.parselog() +
564 " < " + quoteName(infile2 + ".out") +
565 " > " + quoteName(logfile);
566 one.startscript(Systemcall::Wait,
567 to_filesystem8bit(from_utf8(command2)),
569 buffer->layoutPos());
570 if (!scanLog(*buffer, command, makeAbsPath(logfile, path), errorList))
576 if (conv.to() == "program") {
577 Alert::error(_("Build errors"),
578 _("There were errors during the build process."));
580 // FIXME: this should go out of here. For example, here we cannot say if
581 // it is a document (.lyx) or something else. Same goes for elsewhere.
582 Alert::error(_("Cannot convert file"),
583 bformat(_("An error occurred while running:\n%1$s"),
584 wrapParas(from_utf8(command))));
591 Converter const & conv = converterlist_[edgepath.back()];
592 if (conv.To()->dummy())
595 if (!conv.result_dir().empty()) {
596 // The converter has put the file(s) in a directory.
597 // In this case we ignore the given to_file.
598 if (from_base != to_base) {
599 string const from = subst(conv.result_dir(),
600 token_base, from_base);
601 string const to = subst(conv.result_dir(),
602 token_base, to_base);
603 Mover const & mover = getMover(conv.from());
604 if (!mover.rename(FileName(from), FileName(to))) {
605 Alert::error(_("Cannot convert file"),
606 bformat(_("Could not move a temporary directory from %1$s to %2$s."),
607 from_utf8(from), from_utf8(to)));
613 if (conversionflags & try_cache)
614 ConverterCache::get().add(orig_from, to_format, outfile);
615 return move(conv.to(), outfile, to_file, conv.latex());
620 bool Converters::move(string const & fmt,
621 FileName const & from, FileName const & to, bool copy)
626 bool no_errors = true;
627 string const path = onlyPath(from.absFileName());
628 string const base = onlyFileName(removeExtension(from.absFileName()));
629 string const to_base = removeExtension(to.absFileName());
630 string const to_extension = getExtension(to.absFileName());
632 support::FileNameList const files = FileName(path).dirList(getExtension(from.absFileName()));
633 for (support::FileNameList::const_iterator it = files.begin();
634 it != files.end(); ++it) {
635 string const from2 = it->absFileName();
636 string const file2 = onlyFileName(from2);
637 if (prefixIs(file2, base)) {
638 string const to2 = changeExtension(
639 to_base + file2.substr(base.length()),
641 LYXERR(Debug::FILES, "moving " << from2 << " to " << to2);
643 Mover const & mover = getMover(fmt);
644 bool const moved = copy
645 ? mover.copy(*it, FileName(to2))
646 : mover.rename(*it, FileName(to2));
647 if (!moved && no_errors) {
648 Alert::error(_("Cannot convert file"),
650 _("Could not copy a temporary file from %1$s to %2$s.") :
651 _("Could not move a temporary file from %1$s to %2$s."),
652 from_utf8(from2), from_utf8(to2)));
661 bool Converters::formatIsUsed(string const & format)
663 ConverterList::const_iterator cit = converterlist_.begin();
664 ConverterList::const_iterator end = converterlist_.end();
665 for (; cit != end; ++cit) {
666 if (cit->from() == format || cit->to() == format)
673 bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
674 FileName const & filename, ErrorList & errorList)
676 OutputParams runparams(0);
677 runparams.flavor = OutputParams::LATEX;
678 LaTeX latex("", runparams, filename);
680 int const result = latex.scanLogFile(terr);
682 if (result & LaTeX::ERRORS)
683 buffer.bufferErrors(terr, errorList);
692 : public boost::signals2::trackable {
694 ShowMessage(Buffer const & b) : buffer_(b) {}
695 void operator()(docstring const & msg) const { buffer_.message(msg); }
697 Buffer const & buffer_;
703 bool Converters::runLaTeX(Buffer const & buffer, string const & command,
704 OutputParams const & runparams, ErrorList & errorList)
706 buffer.setBusy(true);
707 buffer.message(_("Running LaTeX..."));
709 // do the LaTeX run(s)
710 string const name = buffer.latexName();
711 LaTeX latex(command, runparams, FileName(makeAbsPath(name)),
712 buffer.filePath(), buffer.layoutPos(),
713 buffer.lastPreviewError());
715 ShowMessage show(buffer);
716 latex.message.connect(show);
717 int const result = latex.run(terr);
719 if (result & LaTeX::ERRORS)
720 buffer.bufferErrors(terr, errorList);
722 if (!errorList.empty()) {
723 // We will show the LaTeX Errors GUI later which contains
724 // specific error messages so it would be repetitive to give
725 // e.g. the "finished with an error" dialog in addition.
727 else if (result & LaTeX::NO_LOGFILE) {
728 docstring const str =
729 bformat(_("LaTeX did not run successfully. "
730 "Additionally, LyX could not locate "
731 "the LaTeX log %1$s."), from_utf8(name));
732 Alert::error(_("LaTeX failed"), str);
733 } else if (result & LaTeX::NONZERO_ERROR) {
734 docstring const str =
735 bformat(_( "The external program\n%1$s\n"
736 "finished with an error. "
737 "It is recommended you fix the cause of the external "
738 "program's error (check the logs). "), from_utf8(command));
739 Alert::error(_("LaTeX failed"), str);
740 } else if (result & LaTeX::NO_OUTPUT) {
741 Alert::warning(_("Output is empty"),
742 _("No output file was generated."));
746 buffer.setBusy(false);
748 int const ERROR_MASK =
753 return (result & ERROR_MASK) == 0;
758 void Converters::buildGraph()
760 // clear graph's data structures
761 G_.init(formats.size());
762 // each of the converters knows how to convert one format to another
763 // so, for each of them, we create an arrow on the graph, going from
764 // the one to the other
765 ConverterList::iterator it = converterlist_.begin();
766 ConverterList::iterator const end = converterlist_.end();
767 for (; it != end ; ++it) {
768 int const from = formats.getNumber(it->from());
769 int const to = formats.getNumber(it->to());
770 LASSERT(from >= 0, continue);
771 LASSERT(to >= 0, continue);
772 G_.addEdge(from, to);
777 FormatList const Converters::intToFormat(vector<int> const & input)
779 FormatList result(input.size());
781 vector<int>::const_iterator it = input.begin();
782 vector<int>::const_iterator const end = input.end();
783 FormatList::iterator rit = result.begin();
784 for ( ; it != end; ++it, ++rit) {
785 *rit = &formats.get(*it);
791 FormatList const Converters::getReachableTo(string const & target,
792 bool const clear_visited)
794 vector<int> const & reachablesto =
795 G_.getReachableTo(formats.getNumber(target), clear_visited);
797 return intToFormat(reachablesto);
801 FormatList const Converters::getReachable(string const & from,
802 bool const only_viewable, bool const clear_visited,
803 set<string> const & excludes)
805 set<int> excluded_numbers;
807 set<string>::const_iterator sit = excludes.begin();
808 set<string>::const_iterator const end = excludes.end();
809 for (; sit != end; ++sit)
810 excluded_numbers.insert(formats.getNumber(*sit));
812 vector<int> const & reachables =
813 G_.getReachable(formats.getNumber(from),
818 return intToFormat(reachables);
822 bool Converters::isReachable(string const & from, string const & to)
824 return G_.isReachable(formats.getNumber(from),
825 formats.getNumber(to));
829 Graph::EdgePath Converters::getPath(string const & from, string const & to)
831 return G_.getPath(formats.getNumber(from),
832 formats.getNumber(to));
836 FormatList Converters::importableFormats()
838 vector<string> l = loaders();
839 FormatList result = getReachableTo(l[0], true);
840 vector<string>::const_iterator it = l.begin() + 1;
841 vector<string>::const_iterator en = l.end();
842 for (; it != en; ++it) {
843 FormatList r = getReachableTo(*it, false);
844 result.insert(result.end(), r.begin(), r.end());
850 FormatList Converters::exportableFormats(bool only_viewable)
852 vector<string> s = savers();
853 FormatList result = getReachable(s[0], only_viewable, true);
854 vector<string>::const_iterator it = s.begin() + 1;
855 vector<string>::const_iterator en = s.end();
856 for (; it != en; ++it) {
857 FormatList r = getReachable(*it, only_viewable, false);
858 result.insert(result.end(), r.begin(), r.end());
864 vector<string> Converters::loaders() const
869 v.push_back("textparagraph");
874 vector<string> Converters::savers() const
877 v.push_back("docbook");
878 v.push_back("latex");
879 v.push_back("literate");
880 v.push_back("luatex");
881 v.push_back("dviluatex");
883 v.push_back("xhtml");
884 v.push_back("pdflatex");
885 v.push_back("platex");
887 v.push_back("xetex");