Trouble with figures not in the root folder
Closed this issue · 4 comments
Considering the following latex script:
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{array}
\usepackage[francais,bloc,correc]{automultiplechoice}
\usepackage{multicol}
\usepackage{subfig}
\usepackage{graphics}
\newcommand{\vect}[1]{\overrightarrow{#1}}
\graphicspath{{figures/}}
\begin{document}
\element{cinematique}{
\begin{question}{graphestructure}
So
\begin{center}
\includegraphics[width=0.5\textwidth]{graphe_structure.pdf}
\end{center}
\begin{reponses}
\bonne{aa}
\end{reponses}
\end{question}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\exemplaire{1}{
\restituegroupe{cinematique}
\AMCcleardoublepage
}
\end{document}
graphe_structure.pdf
is not on the root folder but in figures
.
amc2moodle is not working. See below:
(Digesting TeX debug...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/eTeX.pool.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/pdfTeX.pool.ltxml... 0.00 sec) 0.11 sec)
(Processing content ZZZZ/amc2moodle/debug.tex...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/LaTeX.pool.ltxml... 0.14 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/article.cls.ltxml... 0.01 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/inputenc.sty.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/utf8x.def.ltxml... 0.00 sec) 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/fontenc.sty.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/t1enc.def.ltxml...
Warning:missing_file:t1enc Can't find definitions t1enc
at t1enc.def.ltxml; line 24
Anticipate undefined macros or environments
search paths are ZZZZ/amc2moodle, ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle
In Core::Gullet[@0x7f910d25dc78] /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/t1enc.def.ltxml; line 24
0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/t1.fontmap.ltxml... 0.00 sec) 0.01 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amsmath.sty.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amsbsy.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amstext.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amsopn.sty.ltxml... 0.00 sec) 0.02 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/array.sty.ltxml... 0.00 sec)
(Loading ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/automultiplechoice.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/multicol.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/subfig.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/graphics.sty.ltxml... 0.01 sec)
Warning:expected: Missing number, treated as zero.
at debug.tex; line 25 col 0 - line 25 col 17
while processing \textwidth
In Core::Gullet[@0x7f910d25dc78] ZZZZ/amc2moodle/debug.tex; from line 25 col 0 to line 25 col 17
0.23 sec) 0.34 sec)
(Building...
(Loading compiled schema /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/resources/RelaxNG/LaTeXML.model... 0.01 sec). 0.04 sec)
(Rewriting... 0.00 sec)
(Finalizing... 0.00 sec)
Conversion complete: 2 warnings; 1 missing file[t1enc.def].
processing finished Tue Jun 30 22:08:31 2020
Running Python conversion...
Traceback (most recent call last):
File "ZZZZ/Anaconda3/bin/amc2moodle", line 111, in
run()
File "ZZZZ/Anaconda3/bin/amc2moodle", line 102, in run
indentXML=indentFlag, usetempdir=tempDir)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 142, in init
self.runBuilding()
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 227, in runBuilding
deb=self.deb)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 331, in to_moodle
Ii = encodeImg(Ii, pathin, wdir)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 93, in encodeImg
img_path)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 49, in init
self.convertImage(fileIn, fileOut)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 55, in convertImage
im = wandImage(filename=fileIn)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/wand/image.py", line 8294, in init
units=units)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/wand/image.py", line 8774, in read
self.raise_exception()
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/wand/resource.py", line 243, in raise_exception
raise e
wand.exceptions.BlobError: unable to open image 'graphe_structure.pdf': No such file or directory @ error/blob.c/OpenBlob/3496
</details>
[Archive.zip](https://github.com/nennigb/amc2moodle/files/4854166/Archive.zip)
Making some modification on the test suite (ex QCM_wo-tikz.tex
), I would like to add something
% add test for graphic path
\graphicspath{{Figures/other/}}
...
\includegraphics[height=16pt]{4r.png} or \includegraphics[height=16pt]{4r.png} (or with a pdf file)
to avoid regression on the bugs you have found.
LaTeXML doesn't complain but the candidates
attributes is not present. But, in the header of tex2xml.xml
there is
<?latexml graphicspath="pathto/Figures/other"?>
and the graphics element is
<graphics graphic="4r" options="height=16.0pt" xml:id="p4.g2"/>
I try it on last version of LaTeXML. Do I miss something ?
But It works on your example..., although a test should be added to check there is only one candidate...
I will have a look on my example.
OK, it seems related to a too old version of LaTeXML (shipped with ubuntu 16.04).
candidate
disappears if graphicspath
. The problem is mainly solved with the last version of the lib but remains remains sensitive to relative path resolution when invoked from another folder like in automatic test.
Do you have idea on which version of LaTeXML the change has been made?
In the case of many proposition of pictures for one choice in includegraphics, candidates
includes all corresponding solutions separated with a ','...