Word – Making a sidebar in LibreOffice writer

libreoffice-writermicrosoft wordopenoffice-writer

I'm trying to make a sidebar in a Libreoffice writer document, exactly like in the following template.

The sidebar should have a different background color and a separate text section, but vertically aligned with the content on the right (the sidebar will be used for headings, while the right section will be used for actual content).

A two column table seems appropriate for this, the left column holds the headings and the right one holds the content, but the sidebar's background color should fill the whole left part of the document (a vertical strip) without any margins, so I should set the margins to zero. The problem is, I need the margins for the text, and I somehow need the table's background color to ignore them.

I understand this may not be a good fit for Writer (and I can make the same document without any issues in HTML/CSS or a graphics editor like Photoshop), but I really need it in writer (the document is for someone else who won't accept an HTML or Photoshop version).

Best Answer

Here's a solution for LibreOffice:

I recommend to put a text frame (LibreOffice 4.4) or a LibreOffice Draw OLE object (rectangle) into the header of the very first page. You can resize the rectangle or the text frame so it covers the complete left page margin area, and you can assign a custom color to it. Since the rectangle / text frame is located in the header, it will appear automatically on every new page.

To put content into that margin area, i recommend to insert text frames into the main content area, anchored to a certain paragraph (so they stay aligned with the content), and move the text frames to the left into the margin area. You can even create a frame style based on the first, manually created text frame, so you add styles to all the frames in one single step.

I've just noticed that LO 4.4 seems to behave buggy when trying to set a background color for a Draw OLE object; as workaround, you may use a text frame instead.

  1. In a new document, insert a default header;
  2. Insert the "margin object":

    • For LibreOffice 4.4:

      • click into the header, select Insert -> Frame...;
      • apply the following settings (most important is anchoring the frame to the paragraph, so it appears on every page; also, take care that AutoSize is disabled; you may set the width / height according to your needs or resize the margin afterwards using the mouse):

        enter image description here

    • for LibreOffice with version < 4.4:

      • click into the header, select Insert -> Object -> OLE Object -> LibreOffice 4.4 Drawing, click OK;

      • A drawing window appears; don't edit it, just leave it using the ESC key.

        Now, the screen looks like this:

        enter image description here

      • Move the drawing area using the little green rectangles so it covers the complete left margin (first, set the width; afterwards, move it to the margin of the page):

        enter image description here

    Notice that in the main area, the content will automatically recognize the header's drawing area, so you don't even have to adjust the page margins (you may do so to have some padding between the margin area and the content).

  3. Fill the margin area with any color

    • for a text frame:
      • select the frame
      • enable the Drawing Object properties toolbar (using Menu View -> Toolbars) or right-click -> Frame... -> Area;
      • select the background color;
    • for a Draw OLE object:
      • select the OLE object so the little green rectangles are visible;
      • right-click anywhere inside the OLE object
      • select Object... from the context menu, select Background;
  4. Click into the main content area, add some text, and insert a text frame (i've set the left page margin to 8 cm to separate the content from the margin - you'll have to adjust the margins' position since it moves when changing the page margin):

    enter image description here

  5. Now, if you enter additional content before the text frame, it will stay next to the paragraph it's anchored to:

    enter image description here

Related Question