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(_("Requested operation needs use of converter '%1$s' from %2$s to %3$s, "
287 "which is tagged with the 'needauth' option. This is an external program normally acting as a picture/format "
288 "converter, but which is known to be able to execute arbitrary actions on the system on behalf of the user, "
289 "including dangerous ones such as deleting files, if instructed to do so by a maliciously crafted .lyx document."),
290 from_utf8(conv.command()), from_utf8(conv.from()), from_utf8(conv.to()));
291 if (lyxrc.use_converter_needauth_forbidden) {
292 frontend::Alert::warning(_("Launch of external converter is forbidden"), security_warning + _("\n\n"
293 "This is forbidden by default. In order to unlock execution of these converters, please, go to\n"
294 "Preferences->File Handling->Converters and uncheck Security->Forbid needauth converters."), true);
297 if (!lyxrc.use_converter_needauth)
299 static const docstring security_title = _("Launch of external converter needs user authorization");
301 const docstring security_warning2 = security_warning + _("\n\nWould you like to run the converter?\n\n"
302 "ANSWER RUN ONLY IF YOU TRUST THE ORIGIN/SENDER OF THE LYX DOCUMENT!");
303 if (!doc_fname.empty()) {
304 LYXERR(Debug::FILES, "looking up: " << doc_fname);
305 std::set<std::string> & auth_files = theSession().authFiles().authFiles();
306 if (auth_files.find(doc_fname) == auth_files.end()) {
307 choice = frontend::Alert::prompt(security_title, security_warning2,
308 0, 0, _("Do &NOT run"), _("&Run"), _("&Always run for this document"));
310 auth_files.insert(doc_fname);
315 choice = frontend::Alert::prompt(security_title, security_warning2,
316 0, 0, _("Do &NOT run"), _("&Run"));
322 bool Converters::convert(Buffer const * buffer,
323 FileName const & from_file, FileName const & to_file,
324 FileName const & orig_from,
325 string const & from_format, string const & to_format,
326 ErrorList & errorList, int conversionflags)
328 if (from_format == to_format)
329 return move(from_format, from_file, to_file, false);
331 if ((conversionflags & try_cache) &&
332 ConverterCache::get().inCache(orig_from, to_format))
333 return ConverterCache::get().copy(orig_from, to_format, to_file);
335 Graph::EdgePath edgepath = getPath(from_format, to_format);
336 if (edgepath.empty()) {
337 if (conversionflags & try_default) {
338 // if no special converter defined, then we take the
339 // default one from ImageMagic.
340 string const from_ext = from_format.empty() ?
341 getExtension(from_file.absFileName()) :
342 formats.extension(from_format);
343 string const to_ext = formats.extension(to_format);
344 string const command =
346 quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) +
347 ' ' + from_ext + ' ' +
348 quoteName(from_file.toFilesystemEncoding()) +
350 quoteName(to_file.toFilesystemEncoding());
351 LYXERR(Debug::FILES, "No converter defined! "
352 "I use convertDefault.py:\n\t" << command);
354 one.startscript(Systemcall::Wait, command,
355 buffer ? buffer->filePath() : string(),
356 buffer ? buffer->layoutPos() : string());
357 if (to_file.isReadableFile()) {
358 if (conversionflags & try_cache)
359 ConverterCache::get().add(orig_from,
365 // only warn once per session and per file type
366 static std::map<string, string> warned;
367 if (warned.find(from_format) != warned.end() && warned.find(from_format)->second == to_format) {
370 warned.insert(make_pair(from_format, to_format));
372 Alert::error(_("Cannot convert file"),
373 bformat(_("No information for converting %1$s "
374 "format files to %2$s.\n"
375 "Define a converter in the preferences."),
376 from_ascii(from_format), from_ascii(to_format)));
380 // buffer is only invalid for importing, and then runparams is not
382 OutputParams runparams(buffer ? &buffer->params().encoding() : 0);
383 runparams.flavor = getFlavor(edgepath, buffer);
386 runparams.use_japanese =
387 buffer->params().bufferFormat() == "latex"
388 && buffer->params().encoding().package() == Encoding::japanese;
389 runparams.use_indices = buffer->params().use_indices;
390 runparams.bibtex_command = (buffer->params().bibtex_command == "default") ?
391 string() : buffer->params().bibtex_command;
392 runparams.index_command = (buffer->params().index_command == "default") ?
393 string() : buffer->params().index_command;
394 runparams.document_language = buffer->params().language->babel();
397 // Some converters (e.g. lilypond) can only output files to the
398 // current directory, so we need to change the current directory.
399 // This has the added benefit that all other files that may be
400 // generated by the converter are deleted when LyX closes and do not
401 // clutter the real working directory.
402 // FIXME: This does not work if path is an UNC path on windows
404 string const path(onlyPath(from_file.absFileName()));
405 // Prevent the compiler from optimizing away p
409 // empty the error list before any new conversion takes place.
412 bool run_latex = false;
413 string from_base = changeExtension(from_file.absFileName(), "");
414 string to_base = changeExtension(to_file.absFileName(), "");
416 FileName outfile = from_file;
417 for (Graph::EdgePath::const_iterator cit = edgepath.begin();
418 cit != edgepath.end(); ++cit) {
419 Converter const & conv = converterlist_[*cit];
420 bool dummy = conv.To()->dummy() && conv.to() != "program";
422 LYXERR(Debug::FILES, "Converting from "
423 << conv.from() << " to " << conv.to());
426 outfile = FileName(conv.result_file().empty()
427 ? changeExtension(from_file.absFileName(), conv.To()->extension())
428 : addName(subst(conv.result_dir(),
429 token_base, from_base),
430 subst(conv.result_file(),
431 token_base, onlyFileName(from_base))));
433 // if input and output files are equal, we use a
434 // temporary file as intermediary (JMarc)
435 FileName real_outfile;
436 if (!conv.result_file().empty())
437 real_outfile = FileName(changeExtension(from_file.absFileName(),
438 conv.To()->extension()));
439 if (outfile == infile) {
440 real_outfile = infile;
441 // when importing, a buffer does not necessarily exist
443 outfile = FileName(addName(buffer->temppath(), "tmpfile.out"));
445 outfile = FileName(addName(package().temp_dir().absFileName(),
449 if (!checkAuth(conv, buffer->absFileName()))
454 string command = conv.command();
455 command = subst(command, token_from, "");
456 command = subst(command, token_latex_encoding, buffer ?
457 buffer->params().encoding().latexName() : string());
458 LYXERR(Debug::FILES, "Running " << command);
459 if (!runLaTeX(*buffer, command, runparams, errorList))
462 if (conv.need_aux() && !run_latex) {
464 switch (runparams.flavor) {
465 case OutputParams::DVILUATEX:
466 command = dvilualatex_command_;
468 case OutputParams::LUATEX:
469 command = lualatex_command_;
471 case OutputParams::PDFLATEX:
472 command = pdflatex_command_;
474 case OutputParams::XETEX:
475 command = xelatex_command_;
478 command = latex_command_;
481 if (!command.empty()) {
482 LYXERR(Debug::FILES, "Running "
484 << " to update aux file");
485 if (!runLaTeX(*buffer, command,
486 runparams, errorList))
492 string const infile2 =
493 to_utf8(makeRelPath(from_utf8(infile.absFileName()), from_utf8(path)));
494 string const outfile2 =
495 to_utf8(makeRelPath(from_utf8(outfile.absFileName()), from_utf8(path)));
497 string command = conv.command();
498 command = subst(command, token_from, quoteName(infile2));
499 command = subst(command, token_base, quoteName(from_base));
500 command = subst(command, token_to, quoteName(outfile2));
501 command = subst(command, token_path, quoteName(onlyPath(infile.absFileName())));
502 command = subst(command, token_orig_path, quoteName(onlyPath(orig_from.absFileName())));
503 command = subst(command, token_orig_from, quoteName(onlyFileName(orig_from.absFileName())));
504 command = subst(command, token_encoding, buffer ? buffer->params().encoding().iconvName() : string());
506 if (!conv.parselog().empty())
507 command += " 2> " + quoteName(infile2 + ".out");
509 // it is not actually not necessary to test for buffer here,
510 // but it pleases coverity.
511 if (buffer && conv.from() == "dvi" && conv.to() == "ps")
512 command = add_options(command,
513 buffer->params().dvips_options());
514 else if (buffer && conv.from() == "dvi" && prefixIs(conv.to(), "pdf"))
515 command = add_options(command,
516 dvipdfm_options(buffer->params()));
518 LYXERR(Debug::FILES, "Calling " << command);
520 buffer->message(_("Executing command: ")
521 + from_utf8(command));
526 res = one.startscript(Systemcall::DontWait,
527 to_filesystem8bit(from_utf8(command)),
528 buffer ? buffer->filePath() : string(),
529 buffer ? buffer->layoutPos() : string());
530 // We're not waiting for the result, so we can't do anything
533 res = one.startscript(Systemcall::Wait,
534 to_filesystem8bit(from_utf8(command)),
535 buffer ? buffer->filePath()
537 buffer ? buffer->layoutPos()
539 if (!real_outfile.empty()) {
540 Mover const & mover = getMover(conv.to());
541 if (!mover.rename(outfile, real_outfile))
544 LYXERR(Debug::FILES, "renaming file " << outfile
545 << " to " << real_outfile);
546 // Finally, don't forget to tell any future
547 // converters to use the renamed file...
548 outfile = real_outfile;
551 if (!conv.parselog().empty()) {
552 string const logfile = infile2 + ".log";
553 string const command2 = conv.parselog() +
554 " < " + quoteName(infile2 + ".out") +
555 " > " + quoteName(logfile);
556 one.startscript(Systemcall::Wait,
557 to_filesystem8bit(from_utf8(command2)),
559 buffer->layoutPos());
560 if (!scanLog(*buffer, command, makeAbsPath(logfile, path), errorList))
566 if (conv.to() == "program") {
567 Alert::error(_("Build errors"),
568 _("There were errors during the build process."));
570 // FIXME: this should go out of here. For example, here we cannot say if
571 // it is a document (.lyx) or something else. Same goes for elsewhere.
572 Alert::error(_("Cannot convert file"),
573 bformat(_("An error occurred while running:\n%1$s"),
574 wrapParas(from_utf8(command))));
581 Converter const & conv = converterlist_[edgepath.back()];
582 if (conv.To()->dummy())
585 if (!conv.result_dir().empty()) {
586 // The converter has put the file(s) in a directory.
587 // In this case we ignore the given to_file.
588 if (from_base != to_base) {
589 string const from = subst(conv.result_dir(),
590 token_base, from_base);
591 string const to = subst(conv.result_dir(),
592 token_base, to_base);
593 Mover const & mover = getMover(conv.from());
594 if (!mover.rename(FileName(from), FileName(to))) {
595 Alert::error(_("Cannot convert file"),
596 bformat(_("Could not move a temporary directory from %1$s to %2$s."),
597 from_utf8(from), from_utf8(to)));
603 if (conversionflags & try_cache)
604 ConverterCache::get().add(orig_from, to_format, outfile);
605 return move(conv.to(), outfile, to_file, conv.latex());
610 bool Converters::move(string const & fmt,
611 FileName const & from, FileName const & to, bool copy)
616 bool no_errors = true;
617 string const path = onlyPath(from.absFileName());
618 string const base = onlyFileName(removeExtension(from.absFileName()));
619 string const to_base = removeExtension(to.absFileName());
620 string const to_extension = getExtension(to.absFileName());
622 support::FileNameList const files = FileName(path).dirList(getExtension(from.absFileName()));
623 for (support::FileNameList::const_iterator it = files.begin();
624 it != files.end(); ++it) {
625 string const from2 = it->absFileName();
626 string const file2 = onlyFileName(from2);
627 if (prefixIs(file2, base)) {
628 string const to2 = changeExtension(
629 to_base + file2.substr(base.length()),
631 LYXERR(Debug::FILES, "moving " << from2 << " to " << to2);
633 Mover const & mover = getMover(fmt);
634 bool const moved = copy
635 ? mover.copy(*it, FileName(to2))
636 : mover.rename(*it, FileName(to2));
637 if (!moved && no_errors) {
638 Alert::error(_("Cannot convert file"),
640 _("Could not copy a temporary file from %1$s to %2$s.") :
641 _("Could not move a temporary file from %1$s to %2$s."),
642 from_utf8(from2), from_utf8(to2)));
651 bool Converters::formatIsUsed(string const & format)
653 ConverterList::const_iterator cit = converterlist_.begin();
654 ConverterList::const_iterator end = converterlist_.end();
655 for (; cit != end; ++cit) {
656 if (cit->from() == format || cit->to() == format)
663 bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
664 FileName const & filename, ErrorList & errorList)
666 OutputParams runparams(0);
667 runparams.flavor = OutputParams::LATEX;
668 LaTeX latex("", runparams, filename);
670 int const result = latex.scanLogFile(terr);
672 if (result & LaTeX::ERRORS)
673 buffer.bufferErrors(terr, errorList);
682 : public boost::signals2::trackable {
684 ShowMessage(Buffer const & b) : buffer_(b) {}
685 void operator()(docstring const & msg) const { buffer_.message(msg); }
687 Buffer const & buffer_;
693 bool Converters::runLaTeX(Buffer const & buffer, string const & command,
694 OutputParams const & runparams, ErrorList & errorList)
696 buffer.setBusy(true);
697 buffer.message(_("Running LaTeX..."));
699 // do the LaTeX run(s)
700 string const name = buffer.latexName();
701 LaTeX latex(command, runparams, FileName(makeAbsPath(name)),
702 buffer.filePath(), buffer.layoutPos(),
703 buffer.lastPreviewError());
705 ShowMessage show(buffer);
706 latex.message.connect(show);
707 int const result = latex.run(terr);
709 if (result & LaTeX::ERRORS)
710 buffer.bufferErrors(terr, errorList);
712 if (!errorList.empty()) {
713 // We will show the LaTeX Errors GUI later which contains
714 // specific error messages so it would be repetitive to give
715 // e.g. the "finished with an error" dialog in addition.
717 else if (result & LaTeX::NO_LOGFILE) {
718 docstring const str =
719 bformat(_("LaTeX did not run successfully. "
720 "Additionally, LyX could not locate "
721 "the LaTeX log %1$s."), from_utf8(name));
722 Alert::error(_("LaTeX failed"), str);
723 } else if (result & LaTeX::NONZERO_ERROR) {
724 docstring const str =
725 bformat(_( "The external program\n%1$s\n"
726 "finished with an error. "
727 "It is recommended you fix the cause of the external "
728 "program's error (check the logs). "), from_utf8(command));
729 Alert::error(_("LaTeX failed"), str);
730 } else if (result & LaTeX::NO_OUTPUT) {
731 Alert::warning(_("Output is empty"),
732 _("No output file was generated."));
736 buffer.setBusy(false);
738 int const ERROR_MASK =
743 return (result & ERROR_MASK) == 0;
748 void Converters::buildGraph()
750 // clear graph's data structures
751 G_.init(formats.size());
752 // each of the converters knows how to convert one format to another
753 // so, for each of them, we create an arrow on the graph, going from
754 // the one to the other
755 ConverterList::iterator it = converterlist_.begin();
756 ConverterList::iterator const end = converterlist_.end();
757 for (; it != end ; ++it) {
758 int const from = formats.getNumber(it->from());
759 int const to = formats.getNumber(it->to());
760 LASSERT(from >= 0, continue);
761 LASSERT(to >= 0, continue);
762 G_.addEdge(from, to);
767 FormatList const Converters::intToFormat(vector<int> const & input)
769 FormatList result(input.size());
771 vector<int>::const_iterator it = input.begin();
772 vector<int>::const_iterator const end = input.end();
773 FormatList::iterator rit = result.begin();
774 for ( ; it != end; ++it, ++rit) {
775 *rit = &formats.get(*it);
781 FormatList const Converters::getReachableTo(string const & target,
782 bool const clear_visited)
784 vector<int> const & reachablesto =
785 G_.getReachableTo(formats.getNumber(target), clear_visited);
787 return intToFormat(reachablesto);
791 FormatList const Converters::getReachable(string const & from,
792 bool const only_viewable, bool const clear_visited,
793 set<string> const & excludes)
795 set<int> excluded_numbers;
797 set<string>::const_iterator sit = excludes.begin();
798 set<string>::const_iterator const end = excludes.end();
799 for (; sit != end; ++sit)
800 excluded_numbers.insert(formats.getNumber(*sit));
802 vector<int> const & reachables =
803 G_.getReachable(formats.getNumber(from),
808 return intToFormat(reachables);
812 bool Converters::isReachable(string const & from, string const & to)
814 return G_.isReachable(formats.getNumber(from),
815 formats.getNumber(to));
819 Graph::EdgePath Converters::getPath(string const & from, string const & to)
821 return G_.getPath(formats.getNumber(from),
822 formats.getNumber(to));
826 FormatList Converters::importableFormats()
828 vector<string> l = loaders();
829 FormatList result = getReachableTo(l[0], true);
830 vector<string>::const_iterator it = l.begin() + 1;
831 vector<string>::const_iterator en = l.end();
832 for (; it != en; ++it) {
833 FormatList r = getReachableTo(*it, false);
834 result.insert(result.end(), r.begin(), r.end());
840 FormatList Converters::exportableFormats(bool only_viewable)
842 vector<string> s = savers();
843 FormatList result = getReachable(s[0], only_viewable, true);
844 vector<string>::const_iterator it = s.begin() + 1;
845 vector<string>::const_iterator en = s.end();
846 for (; it != en; ++it) {
847 FormatList r = getReachable(*it, only_viewable, false);
848 result.insert(result.end(), r.begin(), r.end());
854 vector<string> Converters::loaders() const
859 v.push_back("textparagraph");
864 vector<string> Converters::savers() const
867 v.push_back("docbook");
868 v.push_back("latex");
869 v.push_back("literate");
870 v.push_back("luatex");
871 v.push_back("dviluatex");
873 v.push_back("xhtml");
874 v.push_back("pdflatex");
875 v.push_back("platex");
877 v.push_back("xetex");