Re: LyX -> word.doc via Libreoffice -> smashwords "paragraph marks"
reposting because it seams posting with my current email in from address still fails to post. May be an issue with gmane gateway... -- Reposted message -- It would appear that on Sep 6, Joe did say: > LyX -> word.doc via Libreoffice -> smashwords "paragraph marks" > > I can't begin to list all the reasons why I want to write with LyX. > I can't begin to describe how messed up my 'work' would be if I had > to create and/or edit the text with ANY standard word processor. > > So what I'm doing is writing in LyX, *exporting {sort of} to the word.doc* **that smashwords wants me to upload my work as... I say sort of: I'm going with a hands on manual conversion process. That is at least repeatable. Which matters to me in case I decide to self publish more of them this way. > When I export to plain text, LyX adds all those extra carriage returns, like > I'd need if I wanted to read the exported text with something that doesn't > wrap the text, such as leafpad. And the thing I most want to preserve is the exact position of the paragraph marks, so I don't want the LyX to assume that the only way I want plain text output, is to send it to an old dot matrix printer that doesn't know how to word wrap. > I came up with a partial workaround. As long as there aren't any comment or > ert > boxes etc...: I open the .lyx file with LyX: {ctrl+a}{ctrl+c} > open a blank leafpad doc: {ctrl+v} > *find a way to strip out all those blank lines caused by LyX effectively using > double CRs as paragraph markers. I couldn't think of the syntax to strip > them out with sed, did a web search for it and came up with the answer to that part: code === sed '/^$/d' input.txt > output.txt or grep -v '^$' input.txt > output.txt /code === Now the problem with this resulting output is the lack of a TOC. So What I'm doing is exporting one copy to plain text in spite of all those pesky line feeds. I truncate the exported file right below the TOC listing. Then I apply the above workaround. Append the results to the first file. Open it for editing with my chosen text editor. And delete one or the other of the duplicated 'front-matter' lines. Then I copy the entire text file to the clipboard. Open a copy of the blank word.doc I'm using for a template with libreoffice. This "blank" file does have all the custom paragraph styles I need to reformat the final result to resemble how LyX would have formatted a pdf. But first I need to paste all that text from that text file into the "word.doc" So that I can start at the top, and apply the paragraph styles as needed. When I get to the TOC I use the list of chapters as a source for search strings that let me find the corresponding line in the text body that needs to have my custom "chapter header" style applied to it. And while I'm at it, I set an appropriately named bookmark to it. Reuse the search string to get back to the correct TOC entry, and make the hyperlink. Then I start on the text of each chapter. The majority of which is to simply select the first paragraph, apply a style I call MyIndent1st. And select the following paragraphs. to which I apply MyIndentSTD I also have MyDreamSequence1st and MyDreamSequenceSTD styles, among others. So I do have to pay attention as I apply the paragraph styles. But I'm not having much trouble with that part. You can tell me that I'm doing this the hard way if you want. But I'll get consistent results, every time I do it this way. So If I should decide to write a series of Ebooks, I'll get consistent results every time I self publish one. Of course I doubt this would work so good if I was writing something that needed tables, or other constructs that wouldn't make it through smashwords so called meat-grinder. But I'm writing fiction. So this will work for me, until I find a better way. If anyone knows of a better way to get the resulting word.doc, formatted to the exacting standards described in the smashwords style guide. And still look like the output LyX thought I meant when I composed with LyX. So that it could keep me from fat fingering extra spaces, and all the other formatting mistakes that would creep in to my work, if I tried to compose with a mere word processor. Then please give me a clue. Cause this repeatable kludge is a real PITA! Thank you! -- JtWdyP
Re: LyX -> word.doc via Libreoffice -> smashwords "paragraph marks"
On 24/09/2015 3:36 a.m., Joe wrote: Of course I doubt this would work so good if I was writing something that needed tables, or other constructs that wouldn't make it through smashwords so called meat-grinder. But I'm writing fiction. So this will work for me, until I find a better way. If anyone knows of a better way to get the resulting word.doc, formatted to the exacting standards described in the smashwords style guide. And still look like the output LyX thought I meant when I composed with LyX. So that it could keep me from fat fingering extra spaces, and all the other formatting mistakes that would creep in to my work, if I tried to compose with a mere word processor. Then please give me a clue. Cause this repeatable kludge is a real PITA! Thank you! Have you considered exporting to rich text format and opening the resulting rtf document in LibreOffice? I'm on windows, but I've found the program latex2rtf does a pretty good job of handling even quite complicated LyX objects (like tables, simple equations, footnotes). For straightforward text (section headings, paragraphs, emphasised text etc.) it could save you a *lot* of effort. The main problem for me was setting the thing up. You need to ensure the rich text format is defined in Tools > Preferences > File Handling > File Formats and then set up a converter from latex to rtf. In my windows set up this is c:/PROGRA~2/latex2rtf/latex2rt.exe -P c:progra~2/latex2rtf/cfg $$i In linux, the paths will obviously be different. The critical part was the -P option which points latex2rtf to its cfg file. Andrew --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: LyX -> word.doc via Libreoffice -> smashwords "paragraph marks"
It would appear that on Sep 24, Andrew Parsloe did say: > Have you considered exporting to rich text format and opening the resulting > rtf document in LibreOffice? I'm on windows, but I've found the program > latex2rtf does a pretty good job of handling even quite complicated LyX > objects (like tables, simple equations, footnotes). For straightforward text > (section headings, paragraphs, emphasised text etc.) it could save you a *lot* > of effort. Actually no, I hadn't considered that. Probably because I didn't know how. And if I needed tables, footnotes etc... I'd be all over that like white on rice. Might try it anyway. Though I doubt it would save me as much effort as you think. Because the smashwords meatgrinder is very picky about how things are formatted. And leaving the tables and stuff out of it, almost all formatting needs to be defined in paragraph styles. Any direct formatting, aside from toggling italics, boldface, and underlining, that isn't done with a paragraph style will cause errors. For the kind of books that need tables and footnotes, there is another process. But it's a lot more work, to manually make all the output epub, mobi, etc... file formats that the meatgrinder would create. At least to make them to the exacting standards that I'd need, if smashwords is going to submit them to all those ebook retailers for me. So I would most likely need to mark the entire mainmatter, and clear all formatting, and then apply my carefully defined paragraph styles anyway. But it would probably save me from having to manually create a working TOC. And even if it doesn't save me any work on my smashwords submissions. Sooner or later the ability to export to RTF will come in handy. So I thank you very much for the suggestion. > The main problem for me was setting the thing up. You need to ensure the rich > text format is defined in Tools > Preferences > File Handling > File Formats > and then set up a converter from latex to rtf. > > In my windows set up this is > > c:/PROGRA~2/latex2rtf/latex2rt.exe -P c:progra~2/latex2rtf/cfg $$i > > In linux, the paths will obviously be different. The critical part was the -P > option which points latex2rtf to its cfg file. Yeah, the paths would certainly be different. But Your post will get saved to my linux-clues folder, so that I can find your helpful instructions when I get around to setting that up. Thanks -- JtWdyP
Re: LyX -> word.doc via Libreoffice -> smashwords "paragraph marks"
On 24/09/2015 3:08 p.m., Joe wrote: It would appear that on Sep 24, Andrew Parsloe did say: Have you considered exporting to rich text format and opening the resulting rtf document in LibreOffice? I'm on windows, but I've found the program latex2rtf does a pretty good job of handling even quite complicated LyX objects (like tables, simple equations, footnotes). For straightforward text (section headings, paragraphs, emphasised text etc.) it could save you a *lot* of effort. Actually no, I hadn't considered that. Probably because I didn't know how. And if I needed tables, footnotes etc... I'd be all over that like white on rice. Might try it anyway. Though I doubt it would save me as much effort as you think. Because the smashwords meatgrinder is very picky about how things are formatted. And leaving the tables and stuff out of it, almost all formatting needs to be defined in paragraph styles. Any direct formatting, aside from toggling italics, boldface, and underlining, that isn't done with a paragraph style will cause errors. The particular point about exporting to rtf is that it spares you all those one line paragraphs. A paragraph in LyX is a paragraph in rtf. It isn't exported to a sequence of one-line paragraphs. I should have emphasised that. Andrew --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
LyX -> word.doc via Libreoffice -> smashwords "paragraph marks"
I can't find my post... Lets see if the old email address still works. Though if that were the problem, then I'd have expected to see a bounce notice from either the list server, or gmane's NTTP portal... -- Forwarded message -- -> Newsgroups: gmane.editors.lyx.general -> Message-ID: <alpine.DEB.2.11.1509042208260.3095@antiXme2012> -> From: Joe <jtw...@gmx.com> -> Date: Sat, 5 Sep 2015 00:02:32 -0400 -> Subject: LyX -> word.doc via Libreoffice -> smashwords "paragraph marks" LyX -> word.doc via Libreoffice -> smashwords "paragraph marks" I can't begin to list all the reasons why I want to write with LyX. I can't begin to describe how messed up my 'work' would be if I had to create and/or edit the text with ANY standard word processor. So what I'm doing is writing in LyX, And washing the formatting with a plain text file, which gets pasted into an Libreoffice "blank" document with preconfigured paragraph styles, consistently named, so that all I should need do, is start at one end of the document. Mark blocks of text, and apply the style that best emulates how LyX formatted it. And of course insert supporting bookmark and TOC hyperlinks... I don't do this until I'm done editing the words, Because if I decided to make any changes, I would want to make them in my .lyx source document. And repeat the above steps... That part is working for me. Except for the problem with paragraph marks. When I export to plain text, LyX adds all those extra carriage returns, like I'd need if I wanted to read the exported text with something that doesn't wrap the text, such as leafpad. I already tried exporting to the various other formats that I should be able to import into Libreoffice. But none of them import to Libreoffice cleanly. And I can't get export as *.odt to work at all. Exporting as html(word) almost worked once. But somehow a bunch of apostrophes got converted to single close quotes. Then when I tried again after a few updates (whether it was a change in Lyx or in Libreoffice I couldn't say) it didn't work the same way. And I need to be able to get it there cleanly. Every time, with consistent results. Washing the formatting with a version of the nuclear option as described in Mark Coker's "Smashwords Style Guide" is a good way to get consistent results. So I'm partial to a clean plain text output. I came up with a partial workaround. As long as there aren't any comment or ert boxes etc...: I open the .lyx file with LyX: {ctrl+a}{ctrl+c} open a blank leafpad doc: {ctrl+v} *find a way to strip out all those blank lines caused by LyX effectively using double CRs as paragraph markers. I couldn't think of the syntax to strip them out with sed, so I opened the file with vim and: /^$ :map t ddn t {repeat until not found} Then I opened it in leafpad again: {ctrl+a}{ctrl+c} opened the above described blank Libreoffice doc {ctrl+v} And apply the paragraph formats etc... as described above. Now I need to work on cover art and other background stuff. But I think the output.doc file itself, will make it through, what Smashwords describes as their meat grinder. If I'm right. And if the ebook is well received, There may well be sequels... My kludge is repeatable. But it would be so much easier if I knew how to get LyX to export a plain text version, without all the extra linefeeds. What am I missing here??? -- JtWdyP