Odt to docs drops underline

mresolve.odt (15.9 KB)
mresolve.docx (15.9 KB)
I have an odt document which has some words underlined and mono-spaced (generated from .org). Save-as docx drops the underline (maintains the mono-spaced)

Has anyone seen this?

ODT version 7.4.5
I can’t find word version. Machine is a year old
“C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE”

Cannot include .org in upload. Not an allowed extension. Can paste as text if required.

Please upload your sample files here.

I’m sorry, I cannot get the upload button (of the reply tool) to take my file!

Edit your original question (by usage the pencil icon), and use the Upload button:

The characters appear to have two character styles applied OrgCode and Underline. From content.xml:
Are any of the <text:span text:style-name="Underline"> <text:span text:style-name="OrgCode">Resolve</text:span> </text:span> stored procedures used in other code? Or does any other code use <text:span text:style-name="Underline">Resolve.APIDs</text:span> </text:p>
Does docx support two character styles? If I open the .odt in Word 365 there is no underlining.

In this case the character style OrgCode is defined without underline but if you want to have it sometimes underlined and sometimes not then best to have two character styles, e.g. OrgCode (as is without underline) and OrgCodeXX (replace XX with intended function, e.g. Title, and add underlining). In that case the character style Underline can be left to use for Text Body.
Or, if OrgCode is always underlined, then Modify the style of OrgCode to include single underline.

Yes, my intent was to distinguish two separate realms: c# code in monospace and database references in underlined monospace. so ~name~ for the former and =name= for the latter. See the “Typography:” statement on the first page (fourth paragraph).

But my point is that ODT displays it correctly but the underline is lost after save as docx (or even opening the .odt with Word directly).

I’ve had to retreat from using monospace for the database refs. Now using underline+bold with base font. Tex export loses track of the right margin when a monospace value should wrap to the next line. I add this in part to confess that I cannot easily send the .org file under those two files uploaded.

Thanks,
rjs

I do not know .org or Tex so I will leave this to better informed contributors other than to say that the character style for C# code snippets should have a different name than the character style for database components. Cheers, Al

Yeah, I’ll take up the right-margin overshoot in a separate context.

You could separate the character styles by:

  • Creating a new character style for references to database components, say OrgDBcomponent which is the same as OrgCode but has single underline
  • Click Edit > Find and Replace and in the dialogue
    • Tick the box Including Styles
    • Click Format button and under Font tab select Courier New, under Font Effects tab, Underlining, select Single. OK
    • Click button Find All
    • Close
  • Still with the selection, in the sidebar under Styles > Character Styles double-click your new style, OrgDBcomponent

With the styles separated the document will export to .docx and the underlining will be kept for the references to database components. Any subsequent changes are easily done by modifying the relevant style.
mresolveEANewCharStyle.docx (16.0 KB)