Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Graphics convert to absolute path and expand ~. #295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tpapp
Copy link
Collaborator

@tpapp tpapp commented May 2, 2022

Fixes #283.

@tpapp
Copy link
Collaborator Author

tpapp commented May 2, 2022

These is the cleanest way I found to fix #283. Alternatives include adding the current directory to the path somehow, either via enviroment variables (TEXINPUTS) or inside the preamble (\graphicspath). I don't think those are very robust across various operating systems and LaTeX engines.

The solution above fails if the user changes the current directory between creating the image and running Graphics, but at least in that case the error message is informative.

@KristofferC
Copy link
Owner

Hm, I am not sure this should be done unconditionally. For example, when you export to a .tex file you probably want to use a relative path if that is what you gave. It is only when previewing a file (and we use a temp folder) that the relative -> absolute translation should happen.

There could be some global flag that says whether we are currently previewing and print_tex could look at that for Graphics and decide to print the absolute path or the path as given there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Showing a figure with a Graphics entry with a relative path fails
2 participants