Lodahl's blog

08 July 2015

Something about styles in LibreOffice

Styles are much more than defining the look and feel of text in a paragraph. Its almost everything about how paragraphs behave in the context. A Paragraph style for example defines how words are hyphenated and in what language the text in the paragraph should be spell checked.

Remember also to take advantage of the benefits of Page styles and Frame styles.

Page styles are mostly used to setup the general design of how the page is looking, but its also very convenient when it comes controlling the overall document pagination.

Frame styles is not commonly used (at least i think) witch is actually a pity. Especially if you use templates to control you document layouts it gives you rather comprehensive methods to control the look and feel when it comes to consistency. If you create new frame styles for different purposes, you can completely control the layout of the content in the documents. For example you can define two or three different image styles (one for small logo'ish images, a second for photos and a third for drawings and illustrations). Each type can have different behaviors regarding anchor point, size and even position. Also you can control how text wraps around each type. The same is relevant for OLE objects and frames.

Only remember that new custom styles doesn't have any effect unless the user manually assigns them to the objects.

List styles

Yes but avoid using it. It doesn't work! According to the documentation its possible to design and setup custom bullets and numbering styles but this area of the software is so buggy that its completely useless. Sorry to say that but thats how it is.

16 February 2015

Spelling in Malawi

This weekend I was contacted by my good friend Ove Larsen, from the organization FAIR, that are currently working in Malawi to prepare computers for use in high schools. Computers that are disposed in Denmark, but which can easily be used by students in the third world. The message was about compiling a spellchecker in LibreOffice for the language Chichewa, which is the main language in Malawi. Malawi is on the UN top-10 list of least developed countries, and there exists no official dictionary.

The starting point was an old American priest who many years ago manually typed 50,000 words into an RTF-file.

Benjamin Bach, who is also in Malawi on behalf of FAIR, first made a prototype, as Esben Aaberg quickly formed into a useful dictionary.

Dictionaries are parts of the efforts to make information technology more relevant and accessible. Open source is absolutely fundamental, and schools in the projects enjoying the results and expressed great enthusiasm for, among many others; Ubuntu, Wikipedia and LibreOffice. The latter is now officially supported in the examination at secondary schools.

The inquiry from Malawi was passed to our local expert, Esben Aaberg, who after a few hours of work got the dictionary to work. Unfortunately dictionaries can not be registered without the language been known by LibreOffice. Instead, Esben "cheated" by using a language code from another language. Of course we need the language Chichewa registered, but here and now, it works after all.

About FAIR

Every year hundreds of thousands of computers are discarded here in Denmark. Computers that are discarded because they are not fast enough, don't have enough capacity etc. We buy new computers because we want something that is faster and more modern, with new features and functions. And they are rarely broken ... In the third world such a computer is as good as a new one!

Schools, educational institutions, health care, etc. in developing countries have a great need for this technology to become part of the information society globally. Information technology is an important prerequisite for development within democracy, education and health.

About FAIR: http://www.fairdanmark.dk/en/
About Malawi: http://en.wikipedia.org/wiki/Malawi
About Chichewa (Nyanja): http://en.wikipedia.org/wiki/Chewa_language

09 February 2015

Is LibreOffice better than the competitor?


One of the most common objections to open source applications such as LibreOffice is that there may not be quite the same features in open source programs. They are simply not good enough - it is said.

Let's have a look at some of the areas where LibreOffice is actually BETTER than the competitor Microsoft Office.

PDF

PDF is one of LibreOffice's very strong areas. Here are a few examples:
  • With LibreOffice you can create PDF-files of very high quality. In fact, such high quality that they live up to most government requirements for PDF files for document exchange. It's the special document format called PDF/A-1a. PDF/A-1a has two particular advantages: they can be read by machines, so for example a screen reader (used primarily by blind people) and that they are self-explanatory, making them completely independent of software from one vendor. The latter is important for documents that are to be long time archived. In a 100 years from now, it is not certain that [insert a product name here] exists.
  • With LibreOffice you can (with the drawing application Draw) make corrections to existing PDF files. For instance you can do what is normally called merge-and-split (e.g., you can pick a single page from one PDF file and paste thar page into another PDF). You can actually do minor changes to the content itself.
  • It is possible to export to PDF with comments (comments are converted to PDF comments).
  • With LibreOffice, you can save the editable ODF file as part of the PDF file. The result is a rather large PDF file, but you can open it with LibreOffice and edit the content. This also applies if it is a spreadsheet.
  • With LibreOffice, you can create PDF forms with input fields.
  • With LibreOffice you can sign PDF files digitally if you have a digital signature.

Import filters

Another of LibreOffice's very powerful features is all import filters. LibreOffice can open virtually all relevant file types, including old Microsoft file types, that even Microsoft Office can't open.
Here are some examples:
  • LibreOffice supports the SVG-formatet. Inserted SVG-images can be ediited directly from e.g., Incskape through the contect emnu "edit with external tools...". After editing the image with Inkscape you can save the changes back directly to the LibreOffice document.
  • Import of graphic formats: DXF, MET, PBM, PCD, PCX, PGM, PPM, PPM, RAS, SGF, SVM, TGA, XBM, XPM.
  • Import of MacOS older vector and bitmap graphics formats: Beagle Works, ClarisWorks, Great Works, MacPaint, MacWorks, Super Paint, MacDraw, MacDraw II, ragtime for Mac 2-3.
  • Importing video and audio formats FLAC Audio flac, Flash Video (flv), Matroska Media (MKV), OGG Audio, Ogg Video, Quicktime Video, WebM Video, Real Audio (.ra), RealMedia (.rm), Digital video (.dv) Audio Codec (.ac3) and Ogg Opus (.opus).
  • Older Mac OS word processing documents: MS Word for Mac (1 to 5.1), MS Works for Mac (1-4), ClarisWorks / AppleWorks, Write Now, MacWriteII / MacWritePro, DOCMaker 4 FullWrite Professional, HanMac Word-K / J, LightWayText for Mac 4.5, Mariner Write Mac Classic 1.6 to 3.5, MindWrite Document, Nisus Writer Classic Mac 3.4 to 6.5, TeachText / SimpleText 1, Tex-Edit 2 Writer Plus, Z-Write 1.3, eDOC 2 Acta Mac Classic, Beagle Works / WordPerfect Works 1, Great Works, MacDoc 1 MoreMac 2-3, ragtime for Mac 2-3
  • Older DOS / Windows word processing documents: Microsoft WinWord 5, Microsoft Word 6.0 / 95, Hangul WP97 and Text 602 (T602), Lotus WordPro.
  • Import of e-book formats: Fiction Book 2.0, Broadband, Plucker (Palm) eReader (Palm), zTXT (Palm), TealDoc (Palm), PalmDOC (Palm), AbiWord files.
  • DocBook import and export.
  • Import of MS Visio files.
  • Import and export AportisDoc (Palm), Pocket Word documents.

Specific features

You can use color palettes from GIMP as palettes in LibreOffice.

Writer works almost as a DTP-program with frames, styles and conditional formatting.

In Calc you can format celles with styres and conditional formatting.

With Draw you can edit and manage your diagrams, show them in Writer, Calc or Impress; Draw is a small «Corel Draw» with underestimated power; use it to annotate bitmaps too, bitmaps that can be enhanced with filters directly in Draw.

Impress has a built in "Presentation console", that gives the presenter access to his notes, the outline of the presentation and a preview of the next slide. All at the same time as the current slide is on the main monitor or projector.

The Navigator

The so called Navigator in LibreOffice is a unique feature that is not available in MS Word. With the Navigator you can always get an overview of your document, and everything the document contains.
The Navigator shows among other things an overview of all the headings, and you can click on the headings and jump directly to that location in the document. You can also move around the headings and change heading level. The text in that section follows the heading. You can thus move around the chapters and sections in one simple process.
At the same time, you have an overview of all your tables, text frames, pictures, bookmarks, etc.

Frequent updates

LibreOffice is released with new versions every six months. Between versions, is published on a monthly basis bug-fixing versions for the last two or three main versions. The frequent updates may seem like an inconvenience to end users, but you don't necessarily have to upgrade every time. It is perfectly possible to upgrade once or twice per year.
The advantage of the frequent updates is that the development of e.g., the user interface is ongoing, and you will experience only small improvements in each version. Often brand new features are not mandatory to use in the first few versions. This is unlike proprietary products, which often takes several years between updates, and you will therefore experience major changes every time. The advantage for users is that you, the user does not experience going through a period of learning each time the application is upgraded.
One can explain it in the way that LibreOffice is evolutionary, whereas MS Office develops revolutionary.

Free support

Most home users and small business users can easily use the free support that can be found on the Internet. There are user forums in many native languages, and on the international level, there are a number of places where users help users – this applies to both beginners and advanced users.
If you use LibreOffice professionally, you may need professional support through a consultancy company that offers such support.
Similarly, you have the opportunity to submit bug reports and ideas for new features. If you are not qualified for this, you can get help from local companies or consultants who are better qualified. I have reported a number of major and minor bugs and got most of them corrected in subsequent versions.

Working across computer types

You can run LibreOffice on Windows, Mac, Linux and BSD and Documents can move freely between these environments without any problems.
LibreOffice can both open and save OOXML and Microsoft XML formats. The opposite is unfortunately not the case to the same extent. LibreOffice even supports the "clean" OOXML format, namely OOXML Strict, which Microsoft Office do not. LibreOffice is also found in a "portable" version, which you can run from a Windows computer without first installing the program.

Enhancing with plug-ins

LibreOffice can be enhanced with extensions e.g., containing images, templates, special settings or code. The code can be Basic, Python, Java, JavaScript, or C ++. Such extensions are normally also usable across computer systems.

Other functions

Writer supports complex spreadsheet calculations in text tables.
Writer supports master documents.

Open source

You get a wide range of advantages as a result of the open source license.

Openness

With LibreOffice, you are not bound by specific, often quite expensive, cloud solutions, that a particular supplier has chosen for you. You are not bound by anything, simply because you have the right to change the program's source code. LibreOffice already supports a variety of standards and protocols, including CMIS and WebDAW, which makes it possible to work directly from document management systems, such as Alfresco, Google Drive, Nuxeo, MS SharePoint, MS OneDrive, IBM FileNet LotusLive Files, Lotus Quickr Domino, Open Data Space or OpenText ELS.
LibreOffice uses a file format which is an open standard - not only by name. In fact it has been instrumental, so that other office applications use the same file format. For example, WebODF an editor for websites, where you can edit text files and get the result as odt-files. And it means that the application Calibre can convert ODF-files to a wide range of e-book formats.

Transparency

Although only very few people care about it, you have as user the opportunity to look the project over the shoulder. You can improving the code, and even that fewest people have resources to proofread the source code, the possibility is there. You can see both the source code, but also follow the bug list and the internal mailing lists. There are professional consultants who specialize in this kind of work like the company Coverty who have machine analyzed the source code in LibreOffice, and reported a number of potential errors. Most of these errors has subsequently been corrected by the community. The latest statistics from Coverty suggests an error density of 0.02 defects per thousand lines of code. Commercial software vendors probably implement similar analysis, but the results will not be published.

Free as in free speech

One of the basic advantages of open source is the right and the opportunity to develop new features or fix bugs in the program. This is a possibility which is certainly not found in Microsoft Office. It may well be that you don't have such skills to hack the code you self, but you might find a freelance consultant or a local company who can do it for a fee. And maybe there are others who have the same needs as you have, and so you can team up to pay the consultant. A good example of this, is a group of German and Swiss authorities who together made a public tender to improved implementation of OOXML in LibreOffice.
It is also the same "freedom to improve the program" that enables us to translate LibreOffice into Danish and many other languages. LibreOffice comes in more than 100 different languages, including some of the "narrow" language that Microsoft Office doesn't support. If you need additional languages, you can download them for free.

Free as in free beer

LibreOffice is free and you are under no obligation to buy expensive subscriptions from a particular supplier. You are welcome to make a donation, but it is optional whether to pay or perhaps help us translate the next version. At the same time you risk nor the supplier suddenly change the license terms.
Free applies as mentioned before, if you need additional language packs or dictionaries. You can get lots of dictionaries for spell checking, but also grammar of English – and its all for free.

17 December 2014

Fuzz about Google supporting odf

Since Google announced their new so called support for the open standard for documents; odf, there has been a lot of fuzz. And yesterday when the new version of Google Docs and Drive, there has been even more fuzz.




I'm happy that Google is finally implementing support for odf BUT... and there is a but:

Honestly I'm not impressed. I'm very disappointed.

First of all because the support comes way too late. Secondly because its not even close to be good.

Back several years ago Google was politically supporting the process of getting odf approved as an open standard but they never really bothered. The business was clearly to keep both odf and ooxml/docx out of their products and keep their own proprietary document format.

Implementing good and solid interoperability is actually not difficult but it is a huge task. Google could have done this three or four years ago if they wanted to. But they didn't. Both proprietary software vendors has been busy making interoperability difficult while the providers of true open standards has been improving interoperability month by month. 

What about the implementation?
I'm not impressed by the implementation. Not at all. First of all because it works differently between different browsers and computers. If you are running a computer with chromium OS or is using a Chrome browser you get the best result. You will experience pretty good results besides the lack of collaboration features like comments and change tracking. One would think that collaborative tools would be obvious for Google to implement as the first. Collaboration between users are one of Googles advantages over local installed software.

If you are using another browser (I have tried with Firefox) the core functionality works completely different. If you have odf-files in you Google Drive and opens them with Google Docs, you are actually not editing you odf-document, but a converted Google Docs document. And now you have two versions of the same document. Both claiming to be the same file because the new Google Docs document is claiming to be an odf-document (the name is still xyz.odt) but now in Google Docs format. And as a consequence the default download format is ... docx.

Please try again Google. And this time please support odf in stead of stealing documents from odf. And don't force users to use a specific operating system or browser. You make me think of the browser war between Netscape and Internet Explorer when websites was "Optimized for [insert browser brand here]".

09 December 2014

Making good and solid templates


When your organization is migrating from Microsoft Office to LibreOffice its important that you provide the users with some good and robust templates. If your users are using LibreOffice in parallel with Microsoft Word or if your users are collaborating with other users outside the organization, then your templates must take this into consideration. The templates must in this case be extra robust when it comes to interoperability.

Why not just open your old .DOT or .DOTX templates in LibreOffice and save the result at .OTT?

Well this is exactly one of the most common mistakes. Making templates for Writer is NOT converting Word templates. Its building new templates from scratch using the best tool for it: LibreOffice. If you choose the short cut and converts Word templates to LibreOffice templates, you will get into trouble. Big trouble.

Experience show that lack of interoperability often comes down to poor quality templates.

Another advise: Don't try to make LibreOffice look like Word and don't try to make your templates look like Word templates. You can't fool the users.

If you are the expert in Word you might not be the right person to develop LibreOffice templates. Use LibreOffice as LibreOffice and don't pretend its Word.

Before you begin

Try to work smart - not hard. Analyze the existing Word templates into categories of logically connected templates. Does any of the templates have common properties? Identify the commons and put the templates into categories or “families”. For examples if you have several letter templates with different content or in different languages, they are most likely using the same font types and sizes. Identify these common properties and take notes.

Also try to get your hands on the company design strategy or design guidelines if they exist. Large organizations often have something in the communication department. Best case is if you can find a design and style guide for letter with precise measurements and color identification.

Ask the provider of the original Word templates to also give you a PDF-version of each template. That give both you and the owner of the templates a baseline reference for the layout and you can avoid later discussions about pixel precise position of an object somewhere. You can make the reference PDF your self, but its better and more correct if you can get it from the owner of the templates.

Think of who the users are

Don't believe that the IT department is qualified to define the requirements. First of all because this group of people in general has a higher understanding of how IT works and as a consequence of that are actually too high qualified. The average user should be setting requirement for the functionality while the department in charge of communication (who ever they are) should set requirements for the look and feel of the templates.

Users are different. Some users are very well educated and has a master in text editing. Others are just office clerks and has no idea of how text editing and office automation works. Your templates should be possible to operate by the people using them. Some templates can be very sophisticated and with a high level of automation while others - letter templates for example - should be as simple as possible to use.

Create the master

From there you can create what I use to call the master template. This template will actually not be used by any one else than template developers and it contains only the common styles and measurements. Only what can be defined in styles should be part of the master. In the future when you start creating new templates you can use the master template as the template. And when you need to make adjustments to the common properties, you can do it once in the master template and load the changes into all other templates.

Logo and objects

Always try to get the original source files in stead of trying to pick from the Word templates. When you resize images - and even if you are using high quality tools for it - will loose quality. If possible you should get the logos in some vector format like SVG or a Photoshop source file. Then you can compile image versions in the exact size and quality that you need. A logo compiled for the web site is normally compressed and optimized for smaller file size and is not good enough quality for a printed letter.

Interoperability

Making templates that are interoperable with Word is not easy. It requires a lot of work and a lot of testing. And one thing you must remember, is the fact that LibreOffice and Microsoft Office are two different applications with two different file formats. Conversion between the two are getting better for each version of LibreOffice, but its not perfect and it will most likely never become perfect. Document conversion is therefore to be considered a deviation from the normal. A special situation that should be taken special care of.

And round trip conversion? Forget it. It doesn't work.

Cross platform templates

LibreOffice is a cross platform application and it is possible to develop templates that works on multiple platforms. Most organizations has policies for this, but its a good idea to take the issue into consideration anyway. It might turn out that there actually are a few Mac computers even if the policy says the opposite. And it doesn't require much more than a thought now and then.

Cross platform templates has in general higher quality than templates that only works on one platform.

The dilemma

Do we want the LibreOffice templates to look pixel to pixel as the Word templates does?
Most would say yes, but I say no. I agree that it helps people to understand how it works if it works the same today than it did yesterday. But this pixel precise requirement is a misunderstanding. For more than two reasons.

First of all: Is our Word templates as good as we think? Perhaps they are but they might have been developed many years ago. So if we create new templates as exact copies of the existing ones we might inherit some legacy misunderstandings and lack of quality. So lets take the opportunity to make even better, more modern and robust templates now we are migrating. We might never get this opportunity again.

One of the main rules to remember while it comes to interoperability is, that the more you customize the less interoperable the template will be. So while you are trying to make them look exactly equal, you will loose the interoperability.

Try to stick to the defaults.
An example:
Footnotes in Writer looks pretty different from similar footnotes in Word. But they are quite easy to make interoperable if you leave them with the default settings. You can though make footnotes in Writer look precisely as they does in Word. But if you do, they will not survive a round trip conversion.

Same thing can be said about indexes and other advanced office automation features.

Making templates that are interoperable doesn't mean they look like the Word templates. It means that they can work across the two applications.

Images and objects

Images like the company logo and objects like a text box with the company contact information and information about the sender of a letter are central to any templates. These things are on the other hand rather difficult to make in a way, that are acceptable after conversion to lets say Microsoft Word. The key problem is not the positioning (the exact place on the paper) but to what they are positioned. Its the anchor that matters. The reason for this problem is that Word and Writer has two different ways of thinking when it comes to this anchoring problem. The main rule is to use the same anchoring for objects that are placed together. If the text box with the address information is anchored "to page" then the logo just above should not be anchored "to paragraph". Use the same anchor method for all objects that are grouped together and you will make things much easier to develop, maintain and use.

In general you should ask you self if the object is to be positioned on a specific position on the page or at a position relative to something. A company logo on a letter template or a text box with the senders address is to be positioned at a specific position on the page and therefor anchored "to page". In case the object are supposed to be repeated on several pages it should be anchored “to paragraph” in the page header or footer but with measurement relative to the page.

Macros

Try to avoid using macros. Many templates developed for MS Office 2003 has embedded or referenced macros to obtain some advanced functionality. Using macros implies a risk that the document in special situations doesn't react as expected simply because the macro is not available or macro execution is disabled for security reasons. Using macros should not be necessary with modern office applications.

In case you have systems of macros running and being dependent on other macros being available, you should consider how to obtain the same functionality without using an office suite at all. Such systems of several macros are not suitable for business environments and should in most cases be developed as part of a document management system or similar. Putting business logic into a complex system of templates and macros is risky.

Tools

Generate content

When you design templates its important that you test the template with some content. For that purpose I have developed an extension to LibreOffice Writer that can generate large amounts of Lorem ipsum text. You can pick the extension for free here:
As an alternative you can use the built in dummy text (writer dt and hit F3).

Word

Use word to see how the original templates works, looks and reacts.
Export the resulting document to PDF for comparison.

LibreOffice

Use LibreOffice to develop new templates. But before you begin; learn to use it. You will discover that the first three or four attempts to make a good template fails. But during the work you will learn from experience and your failures.
I recommend that you use the same operating system while developing the templates as the regular users of the templates will be using. LibreOffice is independent from platform but there are some minor differences from OS to OS. The safest approach is to use the same OS.

Compare result

Compare the result (PDF) with reference output from Word with diff-pdf. 
Compare output

With this nifty tool you can merge two PDF files as overlay and compare pixel precise position of e.g., the logo and margins. Get it here: https://github.com/vslavik/diff-pdf