Closed yatesco closed 4 years ago
Thank you for raising this issue! I will take a look at the code responsible for image handling (1) and see where it's missing this case.
(1) https://github.com/lbeckman314/md2tex/blob/master/src/lib.rs#L258-L288
Hey - my pleasure! Let me know if I can help with a reproducible repo for example.
Thank you for your patience — I'm still working on this issue will provide updates in the days ahead.
I have this problem too... did you continue this? I think it might be good to copy the images to the bookdirectory and reference them. The same as the html renderer does. That way you would get an independent latex file that you can take and improve or render with external renderers.
I think the reason for the failing images is here:
You replace in content
and write to new_content
. Meaning any subsequent image removes the previous modification. So correctly this line should read:
new_content = new_content.replace(&path.into_string(), &new_path);
I went ahead and implemented my suggestion from above and copied over the images into the book directory unfortunately this requires changes in both md2tex and here. Pullrequests incomming.
Hi there - this might be an issue upstream!
I have the following structure:
and in
src\chapter-1\chapter.md\chapter.md
I include a relative link toa.png
.mdbook build
works fine and the generated HTML correctly links the images, however, when the generated markdown from this project doesn't take the fact they are relative (tochapter-1
) into account, nor does it copy the images to thebook
directory, resulting in the generated markdown containinga.png
instead ofchapter-1\a.png
.Same problem for the generated latex, resulting in errors because it can't find the images.
Help :-)