dandavison / xenops

An editing environment for LaTeX mathematical documents
MIT License
213 stars 12 forks source link

Images Failing with Yellow Triangle, Latex Errors #18

Open russphelan opened 3 years ago

russphelan commented 3 years ago

I'm getting the yellow triangle on all my images. preview-latex works normally, and xenops-doctor says everything is fine. Here is a paste of the error I get from the triangle. Any ideas? Am I lacking some latex packages here? Thanks.

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=latex) \write18 enabled. entering extended mode (/tmp/8972b5fbffa15b8cdb48da1caf9024a4e6c76990.tex LaTeX2e <2020-10-01> patch level 2 L3 programming layer <2020-12-07> xparse <2020-03-03> (/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls Document Class: article 2020/04/10 v1.4m Standard LaTeX document class (/usr/local/texlive/2020/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/color.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/dvips.def) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/dvipsnam.def)) (/usr/local/texlive/2020/texmf-dist/tex/latex/base/inputenc.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/enumitem/enumitem.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amssymb.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/was/upgreek.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/base/textcomp.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-generic. tex)) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st y)) (/usr/local/texlive/2020/texmf-dist/tex/latex/tikz-cd/tikz-cd.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te x (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-li sts.tex)) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def ) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/pgf.revision.tex))) (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.c ode.tex)) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.de f (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-p ostscript.def))) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath. code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol. code.tex)) (/usr/local/texlive/2020/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/color.cfg)) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex ) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code. tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic .code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigo nometric.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.rando m.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.compa rison.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base. code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round .code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc. code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integ erarithmetics.code.tex))) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex) ) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.co de.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconst ruct.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage .code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.co de.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicst ate.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransform ations.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.cod e.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.c ode.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathproce ssing.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.co de.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.cod e.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.cod e.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal. code.tex)) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.co de.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretranspare ncy.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns. code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code. tex))) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.cod e.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code. tex) (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version -0-65.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version -1-18.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex) ) (/usr/local/texlive/2020/texmf-dist/tex/latex/pgf/math/pgfmath.sty (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.cod e.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothan dlers.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.cod e.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie s/tikzlibrarytopaths.code.tex))) (/usr/local/texlive/2020/texmf-dist/tex/generic/tikz-cd/tikzlibrarycd.code.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie s/tikzlibrarymatrix.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie s/tikzlibraryquotes.code.tex) (/usr/local/texlive/2020/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows. meta.code.tex))) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsaddr/amsaddr.sty

! LaTeX Error: Command \email undefined.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

l.46 \renewcommand{\email} [2][]{ )

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

l.16 \textsl{}

! Undefined control sequence. l.17 \theoremstyle {definition} ! Undefined control sequence. l.19 \theoremstyle {plain} (/tmp//8972b5fbffa15b8cdb48da1caf9024a4e6c76990.aux) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] (/tmp//8972b5fbffa15b8cdb48da1caf9024a4e6c76990.aux) ) (see the transcript file for additional information) Output written on /tmp//8972b5fbffa15b8cdb48da1caf9024a4e6c76990.dvi (1 page, 1 1212 bytes). Transcript written on /tmp//8972b5fbffa15b8cdb48da1caf9024a4e6c76990.log.`

dandavison commented 3 years ago

Hi @russphelan, thanks for trying out Xenops; let's sort this out. I see a Missing \begin{document}. error. Are you working on a project with a "master file" (containing the \begin{document} which then \includes other .tex files? If so, have you set the variable TeX-master to the name of the master file?

Another question is, putting Xenops aside, are you able to compile the file using C-c C-c (TeX-command-master)? But if you don't usually compile LaTeX inside Emacs like that then don't worry if this is a distraction.

If you'd like to send your files to me at dandavison7@gmail.com then I'd be happy to poke around and get them working with Xenops, but no worries if you'd prefer not to share them; I'm sure we can figure this out.

russphelan commented 3 years ago

Thanks for the response. The document is a single file; no master file. The first error the compiler focuses on when Xenops runs is '! LaTeX Error: Command \email undefined.' I use Auctex and edit latex in Emacs normally, and C-c C-c does work on this document, so it isn't literally missing a `\begin{document}. I will send you the document. It's an amsart document with a few custom commands I use for typesetting math, and a couple examples I was using to test preview-latex, which also works fine in this document.

dandavison commented 3 years ago

OK, so I don't have a full explanation yet but I notice that if we comment out \usepackage{amsaddr} and run M-x xenops-clear-latex-preamble-cache then it works.

Btw, you probably saw the "Copy failing command" button (available with right-click on yellow triangle). It copies to the system clipboard the precise latex command that xenops was trying to run, which is helpful for debugging (in particular, the command contains the temp .tex file that xenops is using for that particular fragment).

So next we have to work out why the fragment-specific .tex file that xenops is constructing doesn't work with that \usepackage{amsaddr} line...

image
russphelan commented 3 years ago

Great! It also works for me after removing that line and refreshing. Yes, the "copy failing command" is great, the logs pasted above came from that feature. Does xenops create its own mini-document to compile fragments in? If so, maybe that mini-document doesn't have access to the same package collection the main command does, and when asked to look for amsaddr, fails.

dandavison commented 3 years ago

Does xenops create its own mini-document to compile fragments in?

Yes, it's the .tex file in the "copy failing command" contents, e.g. for me (MacOS) those contents are something like

latex -interaction nonstopmode -shell-escape -output-format dvi -output-directory /var/folders/p4/vqczr_z167s67yndpwkb2d8c0000gq/T/ /var/folders/p4/vqczr_z167s67yndpwkb2d8c0000gq/T/1c859c2a343f14b02a4ca2998c572983e77009db.tex

So that command does reproduce the ! LaTeX Error: \email undefined. bug, outside of Xenops, which is good. But when I look at /var/folders/p4/vqczr_z167s67yndpwkb2d8c0000gq/T/1c859c2a343f14b02a4ca2998c572983e77009db.tex, I don't see anything obviously wrong, but I haven't really dug in yet.

\documentclass{article}
\usepackage[usenames]{color}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{upgreek}
\usepackage{xfrac}
\usepackage{tikz-cd}
\usepackage{tikz}
\usepackage{amsaddr}
\pagestyle{empty}             % do not remove
% The settings below are copied from fullpage.sty
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-3cm}
\setlength{\oddsidemargin}{1.5cm}
\addtolength{\oddsidemargin}{-2.54cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-3cm}
\setlength{\topmargin}{1.5cm}
\addtolength{\topmargin}{-2.54cm}

\begin{document}
\definecolor{fg}{rgb}{0,0,0}
\definecolor{bg}{rgb}{1,1,1}

\pagecolor{bg}

{\color{fg}
$ a = 1 $
}