Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr1819 :: LibreOffice Tips: Horizontal Lists and Headless Operation

A workaround to create horizontal ordered lists in LibreOffice and run LO headless to convert files

<< First, < Previous, , Latest >>

Thumbnail of Jon Kulp
Hosted by Jon Kulp on Thursday, 2015-07-23 is flagged as Clean and is released under a CC-BY-SA license.
LibreOffice, horizontal list, headless. (Be the first).
The show is available on the Internet Archive at: https://archive.org/details/hpr1819

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:11:15

LibreOffice.

In this in-depth series on LibreOffice we examine Writer, Calc and Impress

LibreOffice Tips: Horizontal Lists

One of these things is how to create horizontal lists in LibreOffice. This is something that I wanted to do, I think it was maybe a year ago that I was really trying to find out how to do this. What I mean by that is I wanted to be able to do in LibreOffice the equivalent of an in-line list in HTML and CSS. There's a way in CSS to tell the browser to display a series of list items in-line rather than vertically—and this is used all the time for footers and headers and things of that sort—and I wanted to be able to do that in LibreOffice because it would ease the process of creating the exams that I make in my classes, where I have a numbered list for all of the questions, and the answers for each question are also done in a numbered list but at the 2nd level—usually done with a, b, c and d, whereas the numbers of the questions are 1, 2, 3, 4, and so forth. What I wanted to be able to do was have the ordered list a, b, c, d spread out horizontally across the page without having to do it manually. So in other words I wanted to be able to type a word for an answer and then press enter, and instead of having it go into a new line, have it simply move over to the right a little bit with a new letter in place for the next item in the ordered list. I hope it's clear what I'm after here.

Anyway I never did find a way to do this. I searched online and there were a couple of other people who were interested in doing the same thing but they were all told this is impossible. Well, sort of. I found a workaround for this and it's not all that elegant but in a pinch it could work, and I don't think I would want to do it for an entire test but I thought it was kind of a cool way to do it.

So what you do his make up the ordered list just like usual. I have here on my computer right now opened a document with a single question, question no. 1. And then it has at the 2nd level of ordered list a series of 4 options: red, purple, green, and blue. And each one of these is in a font color of the same name, so that the word "Red" is red, the word "Purple" is in purple, "green" is in green. I do this because it makes it easier to see how these things move up and down. There are little buttons down at the bottom of the screen where if you click on the arrow up or the arrow down, it will move the list item up or down. So right now red is in the 1st position, but if I click the down arrow it will go down to the 2nd position and the one that was formally 2nd is now 1st. So purple and red have switched places.

I want to have this kind of flexibility going horizontally as well, and the way I found to do this was to use columns. I select the 4 items and then under the Format menu choose Columns and tell it I want 4 columns because I have 4 items, and I click OK and suddenly these things are distributed across the screen horizontally. Now if I click the up arrow, the item moves left and right!

The bad thing about using columns is that the columns are of uniform width, so they do not dynamically change according to the number of characters that are in the word the way it would do in HTML with CSS.

Headless Operation

To convert a Word .docx file to HTML, run the following command (LibreOffice must not be open in a graphical environment when you try to do this):

libreoffice --headless --convert-to html foobar.docx

To convert the same document to .odt format, run this command.

libreoffice --headless --convert-to odt foobar.docx

Links


Comments

Subscribe to the comments RSS feed.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
Who is the host of this show?
What does HPR mean to you?