+ if (buffer && buffer->params().use_minted
+ && lyxrc.pygmentize_command.empty() && conv.latex()) {
+ bool dowarn = false;
+ // Warn only if listings insets are actually used
+ for (Paragraph const & par : buffer->paragraphs()) {
+ InsetList const & insets = par.insetList();
+ pos_type lstpos = insets.find(LISTINGS_CODE, 0);
+ pos_type incpos = insets.find(INCLUDE_CODE, 0);
+ if (incpos >= 0) {
+ InsetInclude const * include =
+ static_cast<InsetInclude *>
+ (insets.get(incpos));
+ if (include->params().getCmdName() !=
+ "inputminted") {
+ incpos = -1;
+ }
+ }
+ if (lstpos >= 0 || incpos >= 0) {
+ dowarn = true;
+ break;
+ }
+ }
+ if (dowarn) {
+ Alert::warning(_("Pygments driver command not found!"),
+ _("The driver command necessary to use the minted package\n"
+ "(pygmentize) has not been found. Make sure you have\n"
+ "the python-pygments module installed or, if the driver\n"
+ "is named differently, to add the following line to the\n"
+ "document preamble:\n\n"
+ "\\AtBeginDocument{\\renewcommand{\\MintedPygmentize}{driver}}\n\n"
+ "where 'driver' is name of the driver command."));
+ }
+ }
+