Finding directly formatted text in specific type size

I received a ginormous ODT document to work on, and regrettably, lots of direct formatting is applied. Is there a way to find all text in a specific type size when relying on styles is not an option?

The type size in the main text is 11 pt, but there are parts in 10 pt. (And yes, the difference is hard to distinguish.) I need to find the parts in 10 pt.

I tried Find and Replace > Format…, and selected “10 pt” from Size, but this does not seem to work (Writer simply finds everything, regardless of type size).

I also tried saving the ODT as FODT and using a text editor to locate the passages in 10 pt, but this proved unfeasible.

LO 7.2.6.2
macOS

I tested with Writer and LibreOffice 7.1.0.3 and it seems to work flawless, regadless of using an empty search-box or regular expression .*

Check if the format “10 pt” is shown below the search box. At my first attempts with this feature some years ago I sometimes activated the format for the wrong box (replace vs search) and had to start again.

And check, if it is really 10, not 10.5 as size.

Thanks. Yes, the format below the search box is set correctly, but what is found (here: “11 pt”) does not seem to honour this setting.

The only difference between our settings is the checkmark at diacritic, but it doesn’t matter. I’ll try your version later on another computer (I don’t have a Mac - but this shouldn’t be OS-related).

I also tried without the checkmark at Diacritic-sensitive, but the result was the same – each paragraph is found.

No change with “your” 7.2.6 on Win10 simply works here.

Can you upload a small part of your text (copy file, then delete most, leaving some of the 10pt places in, save). Actually I have no clue, why it is not working on your text… You may try the usual blind shot and use “safe mode” as a corrupted profile can have various effects, but this sounds not convincing for me…)

There are 7 paragraphs in “findtypesize.odt”.

Text type size:

  • 10 pt in paragraphs no. 3, no. 4, no. 5
  • 11 pt in paragraphs no. 1, no. 2, no. 6, no. 7

If I search for text in 10 pt, LO Writer finds all paragraphs except for no. 4 (which happens to be the longest paragraph in 10 pt).

If I search for text in 11 pt, LO Writer finds nothing (“Search key not found”).
findtypesize.odt (21.0 KB)

Try activating the checkbox “including styles”

Finds 11pt immediately. Will check the other size now.

Tried to make the differnc more visible and changed the Style “standard” to 7pt + italics.
The middle block stays at 10pt.

For the test-file you can just use Ctrl-A, Ctrl-M to remove all hard-formatting. But maybe your complete document has other “hard formatting” you have to convert first.

@ajlittoz I agree completely, and this is basically what I tell authors. But only few authors follow these rules, and then it’s up to me to clean up their files. I usually do the cleaning up in typesetting software, but it would be nice to be able to properly style-format authors’ files in LibreOffice so that I can further work within LibreOffice (and use Track Changes, for example).

It happens you bumped into a Writer limitation I was not aware of.

You may have noticed the Find & Replace can find paragraph styles but has no tool to find character styles. Usually, to compensate for this, you click on Attributes or Format buttons.

It seems that this search is also made in the formatting “paragraph” layer and not in the “character” layer.

Formatting in your sample file is heterogeneous. Size 10pt has been manually forced in the paragraph settings for para. 3 and 5 while it was forced as a character direct formatting in para. 4. As such, the size is not found for para. 4.

Ask the author to be consistent.

A document maintained on the long term or participating in collaborative work should be exclusively style-formatted with no direct formatting. This means designing a set of styles or, better, customizing built-in styles. Using the character layer must be reserved to the case where it is relevant. I.e. if the whole paragraph receives an attribute, then this attribute must be set in a dedicated paragraph style. Applying a character style to a full paragraph does not make sense. A paragraph style exists only for the purpose of changing properties for a word inside a paragraph.

Last but not least, Default Paragraph Style is a “technical” style which must not be used for any text in the document. The “standard” style for text is Text Body. Default Paragraph Style is the ancestor of all other styles which inherit attributes from it. Its purpose is then to set defaults shared by all others. If you don’t follow this rule, you may get unexpected format effects in other paragraphs.

1 Like

If AltSearch.oxt works on your macOS it could solve your problem.

See screenshot: In a 12p text I had hard formatted 3 little areas on 11p. I searched them and reformatted the 11p text parts into 22p hard formatted text. Search code see screenshot, use the question mark between Replace all and Batch>> for the manual.
Of course AltSearch.oxt could find and replace the hard formatted parts in your sample file… :wink:

1 Like

Great, thank you!

Testing with version 7.1.8.1:

It is apparent that the file was created with MS Word.

If do you copy all, and paste it in a new document, there is no more problem.

In the shared file, paragraphs 1-3, and 5-7 are selected.
In the pasted-content file, paragraphs 3-5 are selected (as expected).

Macro addicts may consider to do it by user code the way demonstrated in the attached example.
It uses two annotations (“comments”) per found text range having the attribute searched for, and is this way very clear.
As with any macros (except sometimes in Calc) the passing of parameters is a problem. If related suggestions are wanted, I may be able to help.
disask76187CharHeightRevision.odt (54.5 KB)