MikTeX, Anki e Latex no Windows 10. Erro ao executar dvipng. Desculpe, mas o dvipng não teve sucesso

MikTeX, Anki e Latex no Windows 10. Erro ao executar dvipng. Desculpe, mas o dvipng não teve sucesso

Instalei o Anki e o MikTeX no Windows 10 para criar flashcards anki com LaTeX. Instalei o MikTeX porque li que é a melhor maneira de instalar o dvipng e o dvisvgm.

Depois de criar um exemplo de flashcard, recebi o seguinte erro quando o programa tentou compilá-lo. Não tenho ideia de como resolver isso. Alguma sugestão?

Error executing dvipng.
Generated file: C:\Users\Victor\AppData\Local\Temp\anki_temp\tmp.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6930 64-bit)
entering extended mode
(tmp.tex
LaTeX2e <2018-12-01>
("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex/latex/base\size12.clo"))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\inputenc.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\amssymb.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\amsfonts.sty"))
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsmath.sty"
For additional information on amsmath, use the `?' option.
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amstext.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsgen.sty"))
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsbsy.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsopn.sty"))
No file tmp.aux.
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\umsa.fd")
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\umsb.fd") [1] (tmp.aux) )
Output written on tmp.dvi (1 page, 268 bytes).
Transcript written on tmp.log.
This is dvipng 1.15 Copyright 2002-2015 Jan-Ake Larsson

Sorry, but dvipng did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\Victor\AppData\Local\MiKTeX\2.9\miktex\log\dvipng.log

Aqui está o conteúdo de dvipng.log:

2019-02-24 12:47:26,503+0100 INFO  dvipng - starting with command line: dvipng -D 200 -T tight tmp.dvi -o tmp.png
2019-02-24 12:47:26,517+0100 INFO  dvipng - running 'initexmf' to refresh the file name database
2019-02-24 12:47:29,551+0100 INFO  dvipng - running 'initexmf' to create font map files
2019-02-24 12:47:31,582+0100 FATAL dvipng - GUI framework cannot be initialized.
2019-02-24 12:47:31,583+0100 FATAL dvipng - Info: 
2019-02-24 12:47:31,583+0100 FATAL dvipng - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2019-02-24 12:47:31,583+0100 FATAL dvipng - Line: 77
2019-02-24 12:47:31,584+0100 INFO  dvipng - finishing with exit code 1
2019-02-24 12:47:37,285+0100 INFO  dvipng - starting with command line: dvipng -D 200 -T tight tmp.dvi -o tmp.png
2019-02-24 12:47:37,301+0100 INFO  dvipng - running 'initexmf' to refresh the file name database
2019-02-24 12:47:40,429+0100 INFO  dvipng - running 'initexmf' to create font map files
2019-02-24 12:47:42,378+0100 FATAL dvipng - GUI framework cannot be initialized.
2019-02-24 12:47:42,378+0100 FATAL dvipng - Info: 
2019-02-24 12:47:42,378+0100 FATAL dvipng - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2019-02-24 12:47:42,378+0100 FATAL dvipng - Line: 77
2019-02-24 12:47:42,379+0100 INFO  dvipng - finishing with exit code 1
2019-02-24 12:51:12,899+0100 INFO  dvipng - starting with command line: dvipng -D 200 -T tight tmp.dvi -o tmp.png
2019-02-24 12:51:13,009+0100 FATAL dvipng - GUI framework cannot be initialized.
2019-02-24 12:51:13,009+0100 FATAL dvipng - Info: 
2019-02-24 12:51:13,009+0100 FATAL dvipng - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2019-02-24 12:51:13,009+0100 FATAL dvipng - Line: 77
2019-02-24 12:51:13,010+0100 INFO  dvipng - finishing with exit code 1
2019-02-24 12:51:13,575+0100 INFO  dvipng - starting with command line: dvipng -D 200 -T tight tmp.dvi -o tmp.png
2019-02-24 12:51:13,597+0100 FATAL dvipng - GUI framework cannot be initialized.
2019-02-24 12:51:13,597+0100 FATAL dvipng - Info: 
2019-02-24 12:51:13,597+0100 FATAL dvipng - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2019-02-24 12:51:13,597+0100 FATAL dvipng - Line: 77
2019-02-24 12:51:13,598+0100 INFO  dvipng - finishing with exit code 1

Responder1

Eu tive exatamente o mesmo problema, tente abrir MikTeX console> Settingse verifique se você verificou o arquivo Never install missing packages on the fly. Funcionou para mim.

Responder2

Execute dvipng -D 200 -T tight tmp.dvi -o tmp.pngno prompt de comando dentro do diretório dvi.pngque contém o arquivo tmp.tex. A mensagem de erro no Anki dirá onde está. No seu caso é isso C:\Users\Victor\AppData\Local\Temp\anki_temp\. Este é o mesmo comando que Anki executa, mas falha, como você pode ver no arquivo dvipng.log. Para mim, uma janela apareceu dizendo que faltavam bibliotecas e precisava instalá-las. Depois de instalados, a janela não apareceu na próxima vez que executei o comando. Isso significa que quando o Anki tentar executá-lo, dvipngele não falhará porque dvipngnão tentará abrir uma janela informando ao Anki para instalar bibliotecas.

informação relacionada