1

I have been trying to use the embedall package for latex but in overleaf I get...

Package embedfile Error: File `output.tex' not found.

The MWE for this is...

\documentclass{article}
\usepackage{embedall}

\begin{document}

hello

\end{document}

On my local machine, I am playing around with emacs org mode and use...

\usepackage[main,include]{embedall}
\IfFileExists{./\jobname.org}{\embedfile[desc=The original file]{\jobname.org}}{}

in my document preamble, while compiling w/

LC_ALL=en_US.UTF-8 latexmk -%latex -pdf -f %f -shell-escape -interaction=nonstopmode -emulate-aux-dir -aux-directory='/tmp/latexmk' -output-directory='.'

but I get the error...

Package embedfile Error: File `7acc1fb581a8a02455fd651925e667d405d48d8a.tex' not found.

If I compile tex on my local machine using the latexmkrc...

$pdf_mode = 1;
$pdflatex = 'pdflatex --shell-escape -interaction=nonstopmode'; 
$emulate_aux = 1;
$out_dir = '.';
$aux_dir = '/tmp/latexmk';

I do not get errors.

How can I get my tex source embedded in my pdf file in overleaf and for org mode?

UPDATE

For overleaf, I tried redefining the jobname...

\documentclass{article}

\begingroup\escapechar=-1 \xdef\jobname{\expandafter\string\csname main\endcsname} \endgroup

\usepackage[main,include]{embedall} \begin{document}

hello

\end{document}

which worked. For org mode, I think this means I will just need to set the jobname to the current file's name without the extension.

user41177
  • 375

0 Answers0