1

I am using git to sync my project between a local version and an overleaf project. In this project, I am using the minted package to display code snippets. However, on my machine I need to specify the outputdir in order to compile:

\usepackage[outputdir=out]{minted}

whereas on overleaf, using a sub directory out does not work:

! Package minted Error: Missing Pygments output; \inputminted was
probably given a file that does not exist--otherwise, you may need 
the outputdir package option, or may be using an incompatible build tool,
or may be using frozencache with a missing file.

but simply \usepackage{minted} does.

How can I specify different package option between overleaf and my local project?

I tried creating a separate file in my local repo with \usepackage[outputdir=out]{minted} and adding it to the .gitignore, and another one on overleaf with \usepackage{minted} but it gets automatically added to git so I cannot pull anymore.

1
  • 3
    Hi there, Tom from Overleaf Support here. Can you please try creating the folder out in the file tree on the left and placing any dummy file into it (any empty file will do)? If that doesn't help, you can reach me on Overleaf support email address including the project URL and we can see what's going on there. Then if it's something worth sharing with others, I will make an answer here.
    – yo'
    Apr 14, 2021 at 14:04

1 Answer 1

0

I solved the problem by creating a file minted_configuration.tex in my local project that contains the line \PassOptionsToPackage{outputdir=out}{minted}, and added it to .gitignore. That way it won't be pushed to Overleaf, and

\IfFileExists{minted_configuration.tex}{\input{minted_configuration.tex}}{}
\usepackage{minted}

works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.