Underlining not exported to Word docs

Windows 10 Home Build: 19041.746
Scrivener 3 Beta Release Candidate 16

A simple test line with a word underlined for example: “This is a test line with underlining” and the word “with” underlined and then compiled with Default format for microsoft word the resulting document does not have the word “with” underlined.

Compile same but for rtf and the word “with” is underlined in the resulting document.

I tried on Win 10 using a new blank project, default Scrivener settings, and compiling to DOCX with the Default format (with the document assigned to the “Text Section” layout, which uses the formatting from the editor) to open in Word 2016; underline (and italic) carried over without issue. Switching to the alternative DOCX export converter (Microsoft Office 2007-2016) produced the same result. So this seems to have some other variable that’s affecting the formatting.

What version of Word do you have installed? What font are you using in the editor? When you open the compiled document in Word, is it using that same font? The default should be Sitka Text for the main editor.

In the Sharing tab of File > Options, select the Conversion tab, then click Exporter converters. If DOCX is available from the dropdown on the left, select it and note what it is currently set to, then try selecting another option from the dropdown on the right. Does that make any difference to your results?

That’s interesting.

I am opening the .docx in LibreOffice 7.0.4.2(x64)
The font in the Scrivener Editor is the default: Sitka Text Regular 12.
Yes when opening in Libreoffice it uses the same font.- Sitka regular 12.

I have compiled for the following:-
pdf - works correctly
rtf - works correctly
open office(.odt) - works correctly
Microsoft Word (.docx) - doesn’t work
Microsoft Word (97-2004) (.doc) - works correctly

In the export conversions there is no “docx” just Doc, HTML, ODT and PDF.
With DOC the conversion options are “Aspose” and “rtf-based” and the default is Aspose.

When I switch to “rtf-based” there is no underlining in the resulting .docx file.
I was going to attach the files but the “Add Files” option rejects all file extensions except .doc so I cannot.

I have attached the .docx file as .doc because .docx is rejected by the upload. You can always add the “x” back to the extension if you want. You will see there is no underlining in the docx file.

This is the line used in the scrivener editor for the test:

This is a test line with underlining.

Ah, interestingly, the test file you uploaded opens in Word 2016 with the underline intact. It looks like this is more a compatibility issue with LibreOffice. For the time being, I think your best option is probably just using one of the other compile formats that does retain the formatting when opened there, and resaving from within LibreOffice to DOCX if that’s the final format you need. We use a third-party tool (Aspose) to generate the DOCX file, and I don’t think there’s anything we can do directly to alter how it encodes that; it will probably need an update from them.

The option only appears if you have certain versions of Microsoft Office installed, as Scrivener is then able to use the MS Office converters for creating the DOCX files. The options for the DOC conversion won’t affect DOCX.

I opened the sample document in Word 365 and the underlining is there. Converted to DOCX and still there in Word 365.
LibreOffice 7.1 - The .DOC doesn’t show the underlining but the DOCX does.

Are you using the latest version of LibreOffice?
[attachment=0]Libreoffice.png[/attachment]

LibreOffice 7.0.4.2
I’ll update to latest.
I’ll use the workaround.
Thanks for the replies.