[Solved] Word wrapping on tabs

Discuss the word processor
Post Reply
Paula_Barr
Posts: 4
Joined: Wed Jun 14, 2017 12:08 am

[Solved] Word wrapping on tabs

Post by Paula_Barr »

Hello Everyone! :)

I'd like to paste in writer and print some notes I took on notepad++ and sublime text https://www.sublimetext.com/
original content in sublime text
original content in sublime text
Those programs are actually for coding, I just like using tabs alot to organize contents as text on screen resumes at the beginning of each tab automatically, which works just perfect and quickly while taking notes on realtime...
the same content as I paste it in writer
the same content as I paste it in writer
as you can see in the picture, I get all tabs from the original but paragraphs after those wrap back to the beginning of the page on left, resulting in a big mess.

I could then manually delete all tabs at once and then indent each block of text one by one accordingly to its section with the markers in the ruler but I got 160 pages of content arranged like that, it would take ages...

So is there any way to automatically have a code-like indentation as word wrapping to resume at the beginning of each tab, just like it is in sublime text/notepad++/etc?

Big Thank you!! :)

Pau
Last edited by Hagar Delest on Thu Jun 15, 2017 1:18 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 4.1.3 on Mac OS 10.12
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: word wrapping on tabs

Post by acknak »

Greetings and welcome to the community forum!

Sorry, I don't know of any simple way to handle such a conversion. The most straightforward process I can think of off the top of my head is to find a way to convert your tab-indented text to html. It seems there are some converters online, but I can't get any of them to do exactly what's required. You may have to look for some code to do it. Once you have a proper html list, you can import that into OO Writer.

Just FYI, Writer will do this as you type, once you have the list formatting set up the way you like. You could type directly in Writer, using tab/shift+tab to adjust the level (indent).
AOO4/LO5 • Linux • Fedora 23
Paula_Barr
Posts: 4
Joined: Wed Jun 14, 2017 12:08 am

Re: word wrapping on tabs

Post by Paula_Barr »

Thank you Acknak! :) glad to be here

Im trying to find a way to export/convert html trough sublime text to see what happens, as the converters I've found so far don't even catch tabs
but I'm afraid I'm not code-literated enoughto figure out how is that going to look like, perhaps some divs or tables wuold keep the text wrapped someway? also not sure how that is going to be adjustable after import that on writer for printing as If I need to change font size or adjust margins or something

feels weird tho that something apparently this simple which is just default in most code editors around isn't available in big office suites such as OO
just imagining at anyone in the need to attach chunks of source code to a document, being forced to use manual indentation for each line instead of just pasting it - can't think of any reason not to have something such as practical, perhaps 'tab-aligned indentation mode' would sound like as if it existed?
OpenOffice 4.1.3 on Mac OS 10.12
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: word wrapping on tabs

Post by RusselB »

You reference " perhaps 'tab-aligned indentation mode' would sound like as if it existed?", which to my mind sounds a lot like a hanging indent where the hang has been placed at the tab level.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Word wrapping on tabs

Post by keme »

Code editors like theones mentioned may mimic the tabbed/spaced indent from previous line. This makes sense for "neat coding". Word processing is more advanced, but I don't know of any wordprocessors that do this. Word processors should make indents by paragraph formatting, not by inserting characters (which is the only way to do it for plaintext editors).

Solutions (and non-solution)
  • Use paragraph indent.
  • To have this kind of indent available for fast typing (without needing to use a mouse or navigating menus), the only workaround I can see is to use a multilevel list. Start a numbered or bulleted list. When the insertion point (text cursor) is at the beginning of a list entry, hit tab or shift+tab to go to next/previous indent level. Press enter, and the next entry will "inherit" the level from previous entry.
  • When you insert text from a code editor into a wordprocessing document, it is going to be a mess. "Sublime text" tries to be a bit of both, it seems. A lot goes on "behind the scenes". That does not always make things simpler when you want compatibility with other software.
If you want to take notes with your computer, by all means do. Use the same software that you want to use for further work with your notes. Conversion between different storage formats will always require a bit of work to look right.
Bill
Volunteer
Posts: 8933
Joined: Sat Nov 24, 2007 6:48 am

Re: Word wrapping on tabs

Post by Bill »

Paula_Barr wrote:as you can see in the picture, I get all tabs from the original but paragraphs after those wrap back to the beginning of the page on left, resulting in a big mess.

I could then manually delete all tabs at once and then indent each block of text one by one accordingly to its section with the markers in the ruler but I got 160 pages of content arranged like that, it would take ages...
Don't manually delete all tabs. They can be used to cut the time down to just a few minutes by using Find & Replace. Start with the lowest level of the outline. Assuming that your lowest outline level has 5 tabs used to indent the first line of an item, open Find & Replace, select "More Options" and select "Regular Expressions". In the "Search for" box, type "^\t\t\t\t\t" (without the quotes). Leave the "Replace with" box empty. Click Find All. This will highlight all instances of 5 tabs at the beginning of a paragraph. On the Toolbar, click the Increase Indent icon 5 times, once for each tab. This will increase the indent of all paragraphs which have tabs selected. After the indent has been increased, you can click "Replace All" to remove all of the selected tabs. Repeat the process for levels 4, 3, 2 and 1, removing one instance of \t from the "Search for" box as you move up a level.

When you save the document, make sure that you use the ODT file format. The TXT format will not preserve the indents.
AOO 4.1.14 on Ubuntu MATE 22.04
Paula_Barr
Posts: 4
Joined: Wed Jun 14, 2017 12:08 am

Re: Word wrapping on tabs

Post by Paula_Barr »

Thank you Bill!!
I'm happy to say this method you suggested actually worked ^__^ :super:
fixed
fixed
I get to do some tricky stuff but eventually it's no more than 5 minutes procedure for hundreds of pages = way to go for me!!

btw what does "^" stands for in "^\t\t\t\t\t"? does it work the same if I dont use the "^" mark?

Big thank you! forever on debt :)
OpenOffice 4.1.3 on Mac OS 10.12
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Word wrapping on tabs

Post by RoryOF »

The "^" means "At the beginning of a line". and only works if "Regular expressions" is checked on the More Options screen.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Bill
Volunteer
Posts: 8933
Joined: Sat Nov 24, 2007 6:48 am

Re: Word wrapping on tabs

Post by Bill »

Paula_Barr wrote: btw what does "^" stands for in "^\t\t\t\t\t"? does it work the same if I dont use the "^" mark?
On the Find & Replace dialog, click the Help button. You should find a link "List of Regular Expressions" on the Help page. "^" and "\t" are explained in that list.
AOO 4.1.14 on Ubuntu MATE 22.04
Paula_Barr
Posts: 4
Joined: Wed Jun 14, 2017 12:08 am

Re: Word wrapping on tabs

Post by Paula_Barr »

Great Stuff. Thank you again and thank you everybody! :)
OpenOffice 4.1.3 on Mac OS 10.12
Post Reply