Images not exported to docx

50 views
Skip to first unread message

Laércio Marques

unread,
Apr 21, 2024, 11:55:08 AMApr 21
to yWriter
Hi, Simon 

I hope this email finds you well.

I'm writing to you today to inquire about the functionality of inserting images into yWriter projects and exporting them to DOCX format. I'm currently working on a novel and I'm using yWriter as my primary writing tool. I've been trying to incorporate images into my project using HTML tags, but I'm encountering an issue where the images are not being exported to the final DOCX file.

I understand that yWriter doesn't have native support for directly embedding images within the text, so I've been using HTML tags to define the image placement and formatting. However, when I export the project to DOCX, the images are not included in the resulting file.

I've tried various methods, including:

Enclosing the image path within<HTM <center><img src="Fig1.png" alt="image" /></center> /HTM>  tag.
Despite this attempt, the images remain absent from the exported DOCX file. I'm wondering if there's a specific approach or workaround that I'm missing to successfully embed images using HTML within yWriter projects and export them to DOCX format.

I would greatly appreciate any guidance or insights you can provide on this matter. I'm thoroughly impressed with yWriter's capabilities and its role in facilitating my writing process. Thank you for your continued dedication to developing such a valuable tool.

Sincerely,

Laercio

Peter T.

unread,
Apr 21, 2024, 1:39:16 PMApr 21
to yWriter
On Sunday, April 21, 2024 at 5:55:08 PM UTC+2 Laércio Marques wrote:
I understand that yWriter doesn't have native support for directly embedding images within the text, so I've been using HTML tags to define the image placement and formatting. However, when I export the project to DOCX, the images are not included in the resulting file.

I've tried various methods, including:

Enclosing the image path within<HTM <center><img src="Fig1.png" alt="image" /></center> /HTM>  tag.
Despite this attempt, the images remain absent from the exported DOCX file. I'm wondering if there's a specific approach or workaround that I'm missing to successfully embed images using HTML within yWriter projects and export them to DOCX format.

 Hi Laércio, 
 
I suspect that HTM-tagged text is not taken into account in the  DOCX  export.
What does work for me, however, is to export the whole thing as HTML and then convert it to  DOCX with Pandoc.

The command is like so:
pandoc my-project.html -o my-project.docx

Simply make sure that the path to the images is correct. The images will then be included in the DOCX file. 

I hope this helps. 
Cheers, 
Peter
 

Ljmnunes

unread,
Apr 21, 2024, 6:53:43 PMApr 21
to ywr...@googlegroups.com
Thanks!
I will try to convert to html first.

Laércio J M Nunes


--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ywriter/f19a4ccd-98ff-4806-8c06-2eb4bde818a8n%40googlegroups.com.

Simon Haynes

unread,
Apr 21, 2024, 9:03:14 PMApr 21
to ywr...@googlegroups.com
yWriter has export to LaTeX (which can be converted to PDF). This is what is intended for use with images, different font styles, layouts, etc for eventual print formats.



--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.


--

--
Visit Spacejock Software, the home of yWriter, FCharts and more
Visit spacejock.com.au for my articles on writing and publishing novels.

Ljmnunes

unread,
Apr 22, 2024, 7:41:11 AMApr 22
to ywr...@googlegroups.com
Ideally, I would position images directly within the text for uninterrupted workflow. Post-editing works, but it's quite time-consuming. Perhaps future versions of the editor could consider image integration, as it's becoming an increasingly important feature.

Thanks

Laércio J M Nunes


Ljmnunes

unread,
Apr 22, 2024, 7:45:14 AMApr 22
to ywr...@googlegroups.com
I discovered that the editor that I use is able to read HTML directly.

Laércio J M Nunes


Em dom., 21 de abr. de 2024 às 14:39, Peter T. <peter.pape...@gmail.com> escreveu:
--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.

Simon Haynes

unread,
Apr 22, 2024, 8:33:47 AMApr 22
to ywr...@googlegroups.com
Normally, an ebook doesn't have images, or if it does there is no way to specify where they appear (so just including them in the html is fine)

In a professionally produced print book, images are positioned precisely with margins, alignment and text flow. The Microsoft Rich Text control (which is what yWriter uses) supports none of this. Therefore, there's no way to export to DocX or RTF with proper layout.

However, LaTeX does support this, and that's why LaTeX is preferred for outputting to PDF for printing.

yWriter was originally designed just to write the text of a novel. Then, in 2010 (10 years after yWriter was designed), ebooks started to gain traction so I added export to ebook.  Export to print was never going to be a thing, but then print on demand came along, so I added the LaTeX export for precise formatting, inclusion of images, text flow, headers, footers, footnotes, etc. (All via codes and the latex header file, not visual wysiwyg).

Not only that, but using global and project variables means you can reuse elements throughout your novel and change them all in one place, instead of (e.g.) resizing dozens or hundreds of photos in a document by 5% one by one.


Ljmnunes

unread,
Apr 22, 2024, 8:55:35 AMApr 22
to ywr...@googlegroups.com
Understood!

Attached is a sample lesson plan I use for my electricity classes, which I teach to people with low incomes who cannot afford a technical course. I've been volunteering my time for the past 6 years and have helped over 50 individuals gain essential electrical skills. (sorry it is in Portuguese)

Thanks again!

Laércio J M Nunes


M0-A07 Teoria - Apostila de Lei de Ohm.pdf

Simon Haynes

unread,
Apr 22, 2024, 8:57:01 AMApr 22
to ywr...@googlegroups.com

Peter T.

unread,
Apr 22, 2024, 9:45:57 AMApr 22
to yWriter
This looks like a classic use case for LaTeX. Wouldn't it be easier to base your training materials on LaTeX templates from the beginning? If necessary with Lyx, or something?
Both handouts and presentations could be derived from this.
Reply all
Reply to author
Forward
0 new messages