⬆️ ⬇️

How to make friends MS Office and LibreOffice

image

Hello, reader! Have you ever transferred your office / school / institute / friends to Linux? Remember how long and hard you argued that this is the path of goodness and light? Do you remember the first problem, because of which you had to bring everything back? Let me guess. The first document created in LibreOffice or OpenOffice refused to open correctly in MS Office? Tears, snot and pleas leave Linux to nothing lead? Wipe your nose, reader! Under the cut - how to make friends with LibreOffice 3.5 and MS Office 2010 so that everything opens the same way everywhere.





Root of all evil



If I didn’t go right away, I very quickly got to the point that working with well-structured documents makes it possible in the future to avoid many problems with their use. All these heaps of spaces for shifting text to the right and using the Fat button instead of using styles were alien to me. Unlike many of my colleagues, I spent more time preparing the structure of the document than on its contents, but all my documents were neat and it was a pleasure to change them.



When that wonderful day came, when I moved from MS Office to LibreOffice, I noticed that the contents of many of my documents remained intact and just as neatly formatted. Even then, I knew that the documents should be distorted and broken during the transition, but this concerned only some of my documents (as a rule, with vector graphics inside). My internal programmer required to explore this successful experience. It turned out that if you follow some rules when formatting a document, it will be completely portable between LibreOffice and MS Office.

')

Unit tests



To find out which elements of formatting “fly off” during the transfer, I divided everything into minimal parts and groups. So, for the beginning it was necessary to consider formatting whole pages, then paragraphs, then letters, tables, lists, images, and so on. In total there were 10 groups, namely:



Each group contains several tested components. So, in a page group, these elements are: format, width, height, orientation, margins, etc. Each component is tested separately from the previous one, with the hope that if each individual passes the test, then together they will be displayed correctly.



Testing took place as follows. For each component, a separate file is created in LibreOffice 3.5, in which this component is set to some known value. For example, for testing page formats, four files were created with the values ​​of this component: A6, A5, A4, A3 - for testing the width, one file with a width of 10 cm. Each file had a unique name - a numeric identifier. A test log was also created - a spreadsheet listing all tested components, their identifiers (this identifier is recorded as a file name) and flags: whether or not it was tested in LibreOffice and MS Office. Then each file was opened first in LibreOffice, then transferred to a Windows machine and opened in MS Office. All changes in component values ​​were studied and recorded.



Looking ahead



The results were extremely interesting. It turns out both of these editors get along well. With their help, you can create not only unpretentious documents with a whipping using spaces, but also whole contracts with chapter numbering and automatic numbering of contract clauses. I also learned that if you set a value for a specific component in LibreOffice, save the document in doc, exit and reopen the document, this value can be reset to zero. This means that LibreOffice disables this component due to the fact that it is not implemented in MS Office! So, for example, if you specify overline text and save the document in doc, then after re-opening it in LibreOffice this formatting will be simply reset. This is because in MS Office there is no overline text.



About everything



Now briefly about each group and design rules to ensure portability.



Pages


All main page formats (A6-3) are perfectly transferred between editors, but since the A6 and A5 formats are not defined in MS Office, the page simply has a “Special Size” corresponding to these formats.

The width, height and orientation are as well tolerated as the page margins, which isn’t the color background, and it’s not at all in MS Office (it displays the background color of the page selected in LibreOffice perfectly), strangely enough the first one refuses to paint page in the desired color!

If you want to draw the page borders, there will be no problems with portability, but you will not be able to use the indents, it is better to replace them with fields.

Need to mix in one document portrait and landscape orientation? Dare! Use for this page break and no problems with portability you will not have!



Footers


Nothing complicated if you follow four simple rules:

  1. Always include footers in your document, even if they are empty.
  2. The height should always be set to 0.10 cm; use the Spacing component to specify the height of the footer.
  3. Real page margin = margins + footer spacing + 0.10 cm
  4. Do not use borders and fields in the footers


Tables and numbering in headers and footers are well tolerated.



Columns


There are no problems with this, any number of columns, their width and the interval between them are transferred without problems.



Paragraphs


Indents, spacing, margins, colors, alignment and borders are portable, vertical alignment is not (alignment of the line relative to the central axis of the sentence), because MS Office does not have it.



Characters


Overlining does not work from font formatting and ... nothing else! Everything else is well tolerated.



Lists


The most difficult. Here the correct structure is extremely important and the easiest way to achieve it is in LibreOffice. Bulleted and numbered lists are transferred normally, the problem arises with the levels of the list, they are simply reset when transferred. The way out is to use the Level Down and Level Up commands in LibreOffice, as well as the correct use of the Markers and Numbering window. A bit of “white magic” and lists are transferred perfectly.



Images


Absolutely no difficulties, it is only important to remember that the binding is possible only to a symbol or as a symbol, and it’s better to leave one blank line in front of the image (otherwise they will be swapped). I strongly advise against using the built-in vector editors, better pictures;)



Tables


No problems at all, are tolerated cleanly.



Review


Notes, deleting text, and adding text work fine for the transfer. Also, both editors normally handle undo and accept changes.



Fields


I was able to create the Date field in a specific format, and I finished it.



Time to say good-bye



Finally, the most important thing. A good document structure is a guarantee of its portability! And some important tips:





useful links



All tests and examples on Github . Here you will find (in perspective) also ready-made templates of various documents and contracts, tested and guaranteed to be portable. Join now!

Source: https://habr.com/ru/post/214543/



All Articles