LyXImage path when exporting from Lyx

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
muzzle
Posts: 2
Joined: Tue Jan 21, 2020 5:37 pm

Image path when exporting from Lyx

Post by muzzle »

I am trying to setup LyX to export directly to the reStructuredText format. I adapted these instructions https://lemmster.de/lyx-export-to-markdown.html just replacing markdown with reStructuredText.

Unfortunately LyX changes the path of every image.

e.g. the figure in the attached example becomes
.. figure:: 0_home_muzzle_Nextcloud_Stuff_Stuff_documentation_source_img_pressure.jpg
:alt: Pressure
:width: 80.0%

Pressure
but it should be
.. figure:: img/pressure.jpg
:alt: Pressure
:width: 80.0%

Pressure
LyX replaces the image path with that of the copy of the image created to allow the converter to do its job. This is the correct behavior if the output format will somehow embed the image in the document, but that is not the case for reStructuredText (or for markdown, for that matter).

If I export the lyx file as latex from the GUI, and then convert it to reStructuredText using the command

Code: Select all

pandoc --wrap=none -f latex -t rst -o file.rst file.tex
the image path is correct, is there a way to obtain the same effect from the UI conversion and export system?
Attachments
pulxar.lyx
(3.87 KiB) Downloaded 289 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Image path when exporting from Lyx

Post by scottkosty »

Cross-posted here: https://tex.stackexchange.com/questions ... g-from-lyx
and also on the LyX mailing list.

Please always reference your cross-posts.
muzzle
Posts: 2
Joined: Tue Jan 21, 2020 5:37 pm

Image path when exporting from Lyx

Post by muzzle »

Hello, I have partially solved the issue https://tex.stackexchange.com/questions ... 722#552722.

The one problem I have left is that lyx removes the image extension when exporting to latex; this forces me to specify the image extension in the pandoc command which is not very flexible. Do you have any idea how to force lyx to output the image file name including the extension?
Post Reply