Open plain text with double-spacing

Hi, I was wondering if it's possible to make LibreOffice Writer open a plain
text file with paragraph double-spacing already applied to all of it.

My aim is to be able edit plain text files in (i) serif fonts and (ii)
double-spaced paragraphs.

I keep my documents in plain text but find myself having to change the
entire formatting of the document every time I open a plain text file for
editing.

I managed to get (i) working by means of Tools: Options: LibreOffice: Fonts:
Replacement Table.

However, I couldn't get (ii). I tried to create a template in which the
"Preformatted Text" style looks the way I want it to be, and then I made this
template default. But LibreOffice Writer just ignores the default template
when opening plain text files.

Thank you.

Plain text files are files without formatting. That's what makes them "plain" text. I've never known a way to apply paragraph formatting to a plain text file and have it remain with the file for later use.

Virgil

Hi Nicolai,

nicolai.rostov@gmail.com schrieb:

Hi, I was wondering if it's possible to make LibreOffice Writer open a plain
text file with paragraph double-spacing already applied to all of it.

My aim is to be able edit plain text files in (i) serif fonts and (ii)
double-spaced paragraphs.

Plain text opens here in "preformatted text" and font "Liberation Mono". I see no option to change that behavior.

I keep my documents in plain text but find myself having to change the
entire formatting of the document every time I open a plain text file for
editing.

I managed to get (i) working by means of Tools: Options: LibreOffice: Fonts:
Replacement Table.

However, I couldn't get (ii). I tried to create a template in which the
"Preformatted Text" style looks the way I want it to be, and then I made this
template default. But LibreOffice Writer just ignores the default template
when opening plain text files.

I would expact that, because the default template is used for _new_ documents, and a file opened is not new.

You can make a template with the desired settings. Then do not open the plain text directly. But start with a new file based on your template and then use Insert > File to get the plain text. It will use the style of that paragraph where it is inserted.

Or don't care that it opens with the wrong font and spacing, and change it after opening. (1) When you once make a macro to change it and assign it to a button or to a shortcut, it will only be 1 click to convert the text. (2) Enable "Line Spacing : 2" in the Formatting toolbar or assign it to a short cut. Then you get it with actions: Ctrl+A (select all), Ctrl+0 (set TextBody style), and Click or shortcut for Line Spacing : 2. I think, that is not too long.

Kind regards
Regina

Yes. But the formatting is not supposed to remain. It's just for displaying
it on the screen. I just want to edit plain text in a more comfortable
environment, and still keep them as old plain text.

As far as I know, only LibreOffice can do both (serif and double-spaced
plain text), even if not automatically upon opening a file.

It's not saving but just opening with a particular style.

Thanks,
Nicolai

Hello Regina,

A macro is an excellent idea. Let me see how I can do that.

Thanks,
Nicolai

This reads like a bug behaviour; is it related to:
https://bugs.freedesktop.org/show_bug.cgi?id=54081

It might be related but I don't think my issue is a bug. As Regina has
pointed out, the default template is invoked only when creating new
documents. And I'm not creating new documents. I'm just opening old files.

nr

Hi Nicolai,

nicolai.rostov@gmail.com schrieb:

Hello Regina,

A macro is an excellent idea. Let me see how I can do that.

Of cause you can write a "true" macro, but the needed operations are also available by the macro recorder. So you can use that tool.

First you have to enable the macro recorder.
(1) Goto Tools > Options > LibreOffice > Advanced. Check "Enable macro recording (limited)". OK

Some preparations.
(2)Right click the formatting toolbar, click item "Visible buttons", click on item "Line Spacing :2". Later you can deactivate it the same way.
(3)Open such plain text document.

Now record your actions
(4)Tools > Macros > Record Macros. Notice, that you get a little floating toolbar, where you later on can stop the recording.
(5)Crtl+A, to select the whole text
(6)Select a paragraph style from the drop down list, which has a serif font as default, for example "Text Body" or "Default Style". You should use a predefined style, so that it is always available.
(7)Click on the button "Line Spacing : 2".
(8)Click on right arrow key in the navigation block. That will remove selection.
(9)Click on "Stop recording".

Next actions will save the macro to your user directory. You get a dialog for organization of macros. The part My Macros > Standard > Module should already be selected.
(10)In the field "Macro name" enter a name for the macro. This name is later on used as default label for the button.
(11)Click on button "Save".

Now we generate an easy access to the macro using a button.
(12) Right click the formatting toolbar, click item "Customize Toolbar". In the "Command" list click on that item, which you want to be left of the new button, click button "Add.."
(13) In the "Category" list scroll down to the end. Open the + "LibreOffice Macros", "My Macros", "Standard", and "Module".
(14) Now you should see your macros' name in the list "Commands". Click on it. Click button "Add". Click button "Close".
(15) Look whether the macro name is at the desired position; you can move it up or down with the arrow buttons. To use a different label click button "Modify" and then item "Rename". At last click OK.
(16) Close your document without saving the changes.

Test your macro.
(17) Open a plain text document.
(18) Click on the new macro button.
Does it work?

Alternative/ In addition you can assign a shortcut to the macro.
(19) Tools > Customize > Keyboard
(20)~(13) In the "Category" list scroll down to the end. Open the + "LibreOffice Macros", "user", "Standard", and "Module".
(21)~(14) Now you should see your macros' name in the list "Function". Click on it.
(22) In the "Shortcut keys" list click on the desired shortcut, and then on button "Modify". OK.

If you are curious, how the macro looks like: Tools > Macros > Organize Macros > LibreOffice Basic. Select your macro and click on button "Edit".

Kind regards
Regina

Hi all,

having an empty file properly formatted and import the text through
Menu/Insert/File, I think must work.

Regards.
Miguel Ángel.

Thanks, Regina! It works!

nr

Sometimes it's best to rethink your problem instead of trying to solve it.

o If you open each new file to edit it only once, it is hardly any problem to select all the text and apply a suitable paragraph style - just that once.

o If you need to open the same files repeatedly to edit them, the obvious solution is to save them in LibreOffice's native .odt format. So now we have to ask why you need plain text versions of the file. If you wish to print your edited files, you would not want to use plain text. If you wish to exchange your documents with others, you would want to use either word-processor formats (such as .odt or perhaps .doc) or perhaps PDFs. You'd need plain text output only if you were perhaps feeding your edited results to some other application which required this format - and in this case it would be a simple matter to save a plain text copy of your edited document when necessary.

I trust this helps.

Brian Barker

Exactly. As I said in my last message, I feed plain text into a LaTeX
compiler. I want to edit LaTeX files in an environment with both (i)
double-spaced lines, and (ii) serif fonts. No text editor I'm aware of can
do both. LibreOffice Writer can.

It's just awful to write prose in single-spaced lines and monospaced fonts.
Writer is way more readable.

Nicolai

Exactly. As I said in my last message, I feed plain text into a LaTeX
compiler. I want to edit LaTeX files in an environment with both (i)
double-spaced lines, and (ii) serif fonts. No text editor I'm aware of can
do both. LibreOffice Writer can.

You should be able to achieve this by configuration of default
settings in lyx, which in case you are unaware can compile latex also.

It's just awful to write prose in single-spaced lines and monospaced fonts.
Writer is way more readable.

If you really prefer a text-editor, jedit offers nice ways to make
text look nice, including choice of background colour.

Great! jedit offers both double-spaced lines AND serif fonts.
Thanks a lot!

Nicolai

Tried LO 4.2.1 this evening for the first time on my Mac with OSx 10.9.1. I
loaded a newsletter that I published last year because it was the type of
document that I often deal with. I found that the newsletter opens fine in LO
4.1.5, but does not load properly in 4.2.1 and also locks up when resizing a
frame. The Document is 2 columns with a Frame that goes across both columns
as well as a number of pictures in the columns.

Part of the issue is that the Calibre Light font in the frame that goes
partially across both columns is not found by LO as a separate font from
Calibre. For some reason LO after ver 4.0.5 does not parse the Calibre Light
font properly. I had this back in 4.1.3, 4.1.4 and now also 4.1.5. The
problem was discussed on this list back in November and a work around was
found, but that doesn't change the problem with 4.2.1. LO 4.1.5 handles the
unrecognized font just fine and the text still fits in the frame with the
substitution of what ever font LO comes up with, but 4.2.1 displays it larger
so it extends outside the frame and still has the problem with not
recognizing the font. I can make it fit by resizing the frame horizontally,
but then the other text is push around and doesn't fit properly on the page.
I was really hoping that the font recognizing problem would be fixed in
4.2.1, but obviously not. The problem is a known bug and I added my 2 cents
to it on the bugtracker back in November. It doesn't make sense to me that
the same document would load differently in the two versions since they use
the same user preferences.

Problem #2 is that when resizing the frame vertically LO 4.2.1 goes "bananas"
and makes the 3 page document a 5 page document and then locks up. I have to
"force quit" it to get out of it. This is a problem I've never seen before in
LO.

Has anyone seen either of these problems in 4.2.1? I know it is early in the
series so I expect some issues, but would like to know if they are only my
issues or what. Thanks.

Cliff

Hi Cliff,

Part of the issue is that the Calibre Light font in the frame that goes
partially across both columns is not found by LO as a separate font from
Calibre. For some reason LO after ver 4.0.5 does not parse the Calibre Light
font properly. I had this back in 4.1.3, 4.1.4 and now also 4.1.5. The
problem was discussed on this list back in November and a work around was
found, but that doesn't change the problem with 4.2.1. LO 4.1.5 handles the
unrecognized font just fine and the text still fits in the frame with the
substitution of what ever font LO comes up with, but 4.2.1 displays it larger
so it extends outside the frame and still has the problem with not
recognizing the font. I can make it fit by resizing the frame horizontally,
but then the other text is push around and doesn't fit properly on the page.
I was really hoping that the font recognizing problem would be fixed in
4.2.1, but obviously not. The problem is a known bug and I added my 2 cents
to it on the bugtracker back in November. It doesn't make sense to me that
the same document would load differently in the two versions since they use
the same user preferences.

The problem with font weight recognition in certain fonts is a known
bug, but I can't remember the issue number at the moment. I saw it being
discussed on one of the IRC channels the other day. No idea, when or
whether it will be fixed though.

Alex

** Reply to message from Alex Thurgood <alex.thurgood@gmail.com> on Tue, 25
Feb 2014 09:22:49 +0100

Hi Cliff,

> Part of the issue is that the Calibre Light font in the frame that goes
> partially across both columns is not found by LO as a separate font from
> Calibre. For some reason LO after ver 4.0.5 does not parse the Calibre Light
> font properly. I had this back in 4.1.3, 4.1.4 and now also 4.1.5. The
> problem was discussed on this list back in November and a work around was
> found, but that doesn't change the problem with 4.2.1. LO 4.1.5 handles the
> unrecognized font just fine and the text still fits in the frame with the
> substitution of what ever font LO comes up with, but 4.2.1 displays it larger
> so it extends outside the frame and still has the problem with not
> recognizing the font. I can make it fit by resizing the frame horizontally,
> but then the other text is push around and doesn't fit properly on the page.
> I was really hoping that the font recognizing problem would be fixed in
> 4.2.1, but obviously not. The problem is a known bug and I added my 2 cents
> to it on the bugtracker back in November. It doesn't make sense to me that
> the same document would load differently in the two versions since they use
> the same user preferences.

The problem with font weight recognition in certain fonts is a known
bug, but I can't remember the issue number at the moment. I saw it being
discussed on one of the IRC channels the other day. No idea, when or
whether it will be fixed though.

The really frustrating part is that ApacheOO handles the fonts just fine.
Even better than the older versions of LO. I can only assume that it was an
accidental result of some other change. I sure hope someone takes it on to
fix soon. LO is so much better than AOO that I don't want to go back.

Cliff

Maybe it's similar to Bug 68467? It's about Frutiger font, but have a look at the attachments, which show the faults.

Uli

Hi :slight_smile:
Both programs use the same default format and since both can be
installed alongside each othe (but you'll need the wiki guide to help
do so).

So it should be reasonably possible to use LibreOffice to write the
document and then OpenOffice to read and print it.

Also given the pace of development in LibreOffice it seem likely that
it could be fixed reasonably soon, especially if the bug-report makes
it clear it's something that is already fixed in AOO.
Regards from
Tom :slight_smile:

** Reply to message from Tom Davies <tomcecf@gmail.com> on Tue, 25 Feb 2014
18:26:54 +0000

Tom,

My main question originally was regarding why LO 4.1.5 opened the document
just fine and LO 4.2.1 didn't. Both installed on the same machine so using
identical preferences and both substituted a font for the "missing" font.
Something is different on 4.2.1 that makes the text take slightly more room
on the page. Which one is correct I don't know, but in that document LO 4.1.5
works and LO 4.2.1 doesn't.

As far as AOO goes the font parsing has always worked as far as I know.
Somehow LO broke it partially early on and really broke it after LO 4.0.5.

I would love to have it fixed soon, but it seems to me that when it gets
fixed is anyone's guess as it has been broken for some time now.

Cliff