Re: HTML rendering issue

Eberhard W Lisse <[email protected]>
Newsgroups gmane.editors.lyx.general
Message-ID <[email protected]>
A bit complicated, but one can get this to work.

Use an absolute path ie in my case (global) replace in LyX

	figures/

with

	/Users/el/Downloads/figures/

I put the lyx file into

	/Users/el/Downloads

by the way and could export a PDF, producing a directory

	/Users/el/Downloads/figure

Then (and I think this is important) exporting to HTML produced a
directory

	/Users/el/Downloads/TestHTML.html.LyXconv

and

	open TestHTML.html.LyXconv/TestHTML.html

(on my Mac) opened Chrome and showed the enclosed screen shot.

	grep Downloads TestHTML.html.LyXconv/TestHTML.html

shows

	src="/Users/el/Downloads/figure/unnamed-chunk-2-1.png" alt="PIC"
	src="/Users/el/Downloads/figure/unnamed-chunk-2-2.png" alt="PIC"
	src="/Users/el/Downloads/figure/unnamed-chunk-2-3.png" alt="PIC"

Then you copy the figure directory below

	/Users/el/Downloads/TestHTML.html.LyXconv/figure

and remove the absolute paths in the html src lines by way of something like

	perl -i -p -e 's+/Users/el/Downloads/figure/+figure/+g' TestHTML.html

so you get the relative paths, which you will need for your editors.

A little shell script or even a Makefile could semi-automagic all of the
above :-)-O

el

On 2025-12-03 18:06, Akhilesh Singh wrote:
> Dear Lyx,
> 
> I am using Lyx 2.4.4 on Opensuse Tumbleweed as well as on Windows 
> 10.
> 
> I have written and successfully rendered a book in pdf on
> Statistics containing a lot of data based examples and computations
> using R, with the help of 'knitr' modules.
> 
> While I sent the book for publication in pdf format, publishers are 
> also asking for the same in HTML format too, for their website.
> 
> However, the same book successfully rendered in pdf (luatex as well 
> as pdflatex) is not being rendered in HTML format. 
> 
> The problem that is shown, is that Lyx is not able to fetch the 
> figures created by 'knitr' modules, scattered all over the book, in 
> the figure/ subdirectory in the working directory automatically. 
> 
> While the Lyx is able to fetch these figures from the same sub- 
> directory successfully for the pdf format, but it CAN NOT fetch the 
> same for rendering into HTML format.
> 
> The same problem happens on Opensuse tumbleweed as well as on 
> Windows.
> 
> For reproducing the problem I am attaching below a minimal example 
> Lyx file from the same book.
>

-- 
lyx-users mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-users
Screenshot 2025-12-18 at 20.41.47.pdf (application/pdf, 224.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.