# TeXmacs to LaTeX: figures

In name.tm file I included figure f1.pdf. When I export tm to Latex \includegraphics{name-1.pdf} appears but file name-1.pdf was no produced. In manual is written that new files must appears. What I do wrong?

You need to provide a minimal working example, so was imposed by TeX Stackexchange, at least including a tm file which will produce such an error. Further, it is better to include the TeXmacs version that you are running, and the OS.

Ok. Step by step.

1. I made tex file ex.tex :
\documentclass[aps,reprint]{revtex4-1}
\usepackage{graphicx}
\begin{document}
\section{Introduction}
Blah-blah.
\begin{figure}[ht]
\includegraphics[width=8 cm ]{f1}
\end{figure}
\end{document}

2. Then I opened it by TeXmacs and saved as ex.tm.

3. Then I made export to latex ex1.tex and obtained the following file:
\documentclass[aps]{revtex4-1}
\usepackage[english]{babel}
\usepackage{graphicx}
\begin{document}
\section{Introduction}
Blah-blah.
\begin{figure}[h]
\resizebox{8cm}{!}{\includegraphics{ex1-1.pdf}}
\caption{}
\end{figure}
\end{document}

4. You see that in this file the ex1-1.pdf appears instead of f1.pdf. But file ex1-1.pdf has no created. The file f1.pdf is here

So first, it is better to add  before and after the quoted codes like


\begin{figure}
\end{figure}


will be rendered as

\begin{figure}
\end{figure}


which has a better visual effect.

The simplest solution of the issue is to replace f1 by f1.pdf in the LaTeX code imported, or edit it after importation. In fact, in general, it is deprecated to re-export to LaTeX a document imported from LaTeX. For this specific issue, the problem is that TeXmacs has a different approach from graphicx to treat the files without extensions, the case of which does not appear if you import the file in GUI. If I understand correctly, this is the code treating the linked images, and you see that it only tries to add the extensions eps and pdf` to detect the files, although I cannot pinpoint why it will produce incorrect results to LaTeX.

Thank you. It really works. I suppose that the community of TeXmacs maybe much larger if export/import Latex will works better. The point is that the majority of papers are made as a joint work. We send each to other the tex file only and we use different programs to work with tex file. I like TeXmacs but I have to send to colleagues the tex file which is written in special style as revtex, for example. The apsrev4-1.bst is not supported which is additional problem. In this style we can collect multiple references in single item.

Personally, I tend to believe that more users might be attracted by the usage of TeXmacs in “new” fields such as remote conferences and teaching (possibly boosted by the unfortunate pandemic) instead of fields like paper writing in which people are more-or-less satisfied with the status quo. I think that people are even reluctant to switch LaTeX to ConTeXt, which is also based on TeX (I heard that there are less conflicts of packages in ConTeXt), let alone TeXmacs, no matter how good the conversion is.