emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Matt Price <moptop99@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: letterhead and signature in odt export
Date: Tue, 30 Oct 2018 08:31:00 +0100	[thread overview]
Message-ID: <875zxjevrf.fsf@christianmoe.com> (raw)
In-Reply-To: <CAN_Dec-L-mEq1JUnzkn0ZMF=Tff03xShC2bDugX+x5tkTbqrJQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]


You should be able to make a letterhead template by placing the
letterhead in the header, saving it as an ODT styles file and
specifically referencing any images in a list in the ODT_STYLES_FILE
header. See the manual 12.12.5, "Applying custom styles".

When I try it, though, Org fails to parse the odt_styles_file list.

I attach my test files - I'd be obliged if someone else could take a
look, maybe it's just my setup.

Yours,
Christian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: odt-styles-test.org --]
[-- Type: text/x-org, Size: 1001 bytes --]

#+title: ODT styles test
#+ODT_STYLES_FILE: ("odt-test-styles.odt" ("styles.xml" "Pictures/10000201000000A2000000B0A7D655E3F0A97ECF.png"))



Place this Org file in the same directory as the
accompanying file odt-test-styles.odt and export it to ODT.

Expected result: the exported document has a picture of the Org
unicorn in the header.

What I see:

  OpenDocument export failed: Invalid specification of styles.xml
  file: "(\"odt-test-styles.odt\" (\"styles.xml\"
  \"Pictures/10000201000000A2000000B0A7D655E3F0A97ECF.png\"))"

  Use M-x make-directory RET RET to create the directory and its
  parents

The ODT_STYLES_FILE option is set correctly according to
[[info:org#Applying%20custom%20styles][info:org#Applying custom styles]] (info "org#Applying custom styles").
It references another ODT document providing the custom styles to
apply to this document, including an image to be used in the header.

However, it seems the value of ODT_STYLES_FILE is not being parsed
correctly as a list.


[-- Attachment #3: odt-test-styles.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 25920 bytes --]

[-- Attachment #4: Type: text/plain, Size: 6465 bytes --]




Matt Price writes:

> in North America it's letter-of-reference season for professors, and I am
> writing a lot of them. These are some of the only documents I still compose
> in libreoffice, because I need to use a letterhead that contains both image
> and text, and I need to insert a .png of my signature near the bottom.  I
> would much prefer to compose these letter in org and them export. In order
> to so I would need to preserve the letterhead and the signature somehow.
> Both these sections in my current letters occur within the
> <office:text>
> </office:text>
>
> section which I guess is always replaced by org on export.  My immediate
> question: Is there a way to preserve some of these contents? More
> generally: do people have template files they are very satisfied with? I
> would be happy to go straight to pdf via latex, if it were easy to
> accomplish the same effect that way I don't use latex at all myself so it
> might not be so easy for me :-/.
>
> For completeness, here is the xml for my letterhead (sorry it's rather
> long):
>
> ---------
> <office:body><office:text><text:sequence-decls><text:sequence-decl
> text:display-outline-level="2" text:separation-character="."
> text:name="Illustration"/><text:sequence-decl
> text:display-outline-level="2" text:separation-character="."
> text:name="Table"/><text:sequence-decl text:display-outline-level="2"
> text:separation-character="." text:name="Text"/><text:sequence-decl
> text:display-outline-level="0" text:name="Drawing"/><text:sequence-decl
> text:display-outline-level="0" text:name="Figure"/><text:sequence-decl
> text:display-outline-level="2" text:separation-character="."
> text:name="Equation"/><text:sequence-decl text:display-outline-level="2"
> text:separation-character="."
> text:name="Listing"/></text:sequence-decls><text:h text:style-name="P6"
> text:outline-level="1"/><table:table table:name="Table1"
> table:style-name="Table1"><table:table-column
> table:style-name="Table1.A"/><table:table-column
> table:style-name="Table1.B"/><table:table-row
> table:style-name="Table1.1"><table:table-cell table:style-name="Table1.A1"
> office:value-type="string"><text:p text:style-name="P5"><draw:frame
> draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char"
> svg:width="1.857cm" svg:height="3.025cm" draw:z-index="0"><draw:image
> xlink:href="Pictures/100041D600001B2F00002FDA8AF7D675B9CA7740.wmf"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
> loext:mime-type="image/x-wmf"/><draw:image
> xlink:href="Pictures/1000020100000107000001CF636AB597708AB63A.png"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
> loext:mime-type="image/png"/></draw:frame></text:p></table:table-cell><table:table-cell
> table:style-name="Table1.A1" office:value-type="string"><text:p
> text:style-name="P5"><text:span text:style-name="T1">University of
> Toronto<text:tab/><text:tab/></text:span><text:span text:style-name="T2">
> <text:s text:c="2"/></text:span></text:p><text:p
> text:style-name="P5"><text:span text:style-name="T3">dept. of
> history</text:span><text:span text:style-name="T4">
> <text:s/></text:span></text:p><text:p text:style-name="P4"><text:span
> text:style-name="T5">Rm-2074 sidney smith, 100 st. george street, TORONTO,
> ONTARIO <text:s/>M5S 3G3 <text:s/>CANADA</text:span></text:p><text:p
> text:style-name="P4"><text:span text:style-name="T5">Telephone 416-978-3363
> <text:s text:c="3"/>Fax 416-978-4810
> <text:s/></text:span></text:p></table:table-cell></table:table-row></table:table><text:h
> text:style-name="P7" text:outline-level="1"><text:bookmark
> text:name="org54567cc"/>
> ------
>
> and here is my signature:
>
> --------
> <office:body><office:text><text:sequence-decls><text:sequence-decl
> text:display-outline-level="2" text:separation-character="."
> text:name="Illustration"/><text:sequence-decl
> text:display-outline-level="2" text:separation-character="."
> text:name="Table"/><text:sequence-decl text:display-outline-level="2"
> text:separation-character="." text:name="Text"/><text:sequence-decl
> text:display-outline-level="0" text:name="Drawing"/><text:sequence-decl
> text:display-outline-level="0" text:name="Figure"/><text:sequence-decl
> text:display-outline-level="2" text:separation-character="."
> text:name="Equation"/><text:sequence-decl text:display-outline-level="2"
> text:separation-character="."
> text:name="Listing"/></text:sequence-decls><text:h text:style-name="P6"
> text:outline-level="1"/><table:table table:name="Table1"
> table:style-name="Table1"><table:table-column
> table:style-name="Table1.A"/><table:table-column
> table:style-name="Table1.B"/><table:table-row
> table:style-name="Table1.1"><table:table-cell table:style-name="Table1.A1"
> office:value-type="string"><text:p text:style-name="P5"><draw:frame
> draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char"
> svg:width="1.857cm" svg:height="3.025cm" draw:z-index="0"><draw:image
> xlink:href="Pictures/100041D600001B2F00002FDA8AF7D675B9CA7740.wmf"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
> loext:mime-type="image/x-wmf"/><draw:image
> xlink:href="Pictures/1000020100000107000001CF636AB597708AB63A.png"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
> loext:mime-type="image/png"/></draw:frame></text:p></table:table-cell><table:table-cell
> table:style-name="Table1.A1" office:value-type="string"><text:p
> text:style-name="P5"><text:span text:style-name="T1">University of
> Toronto<text:tab/><text:tab/></text:span><text:span text:style-name="T2">
> <text:s text:c="2"/></text:span></text:p><text:p
> text:style-name="P5"><text:span text:style-name="T3">dept. of
> history</text:span><text:span text:style-name="T4">
> <text:s/></text:span></text:p><text:p text:style-name="P4"><text:span
> text:style-name="T5">Rm-2074 sidney smith, 100 st. george street, TORONTO,
> ONTARIO <text:s/>M5S 3G3 <text:s/>CANADA</text:span></text:p><text:p
> text:style-name="P4"><text:span text:style-name="T5">Telephone 416-978-3363
> <text:s text:c="3"/>Fax 416-978-4810
> <text:s/></text:span></text:p></table:table-cell></table:table-row></table:table><text:h
> text:style-name="P7" text:outline-level="1"><text:bookmark
> text:name="org54567cc"/>
> --------------------
>
> As you can see, one occurs at the beginning of the <office:text> element,
> and the other at the end. Can I somehow insert them on export?
>
> Thanks as always for your help.

      parent reply	other threads:[~2018-10-30  7:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30  5:55 letterhead and signature in odt export Matt Price
2018-10-30  6:54 ` Eric S Fraga
2018-10-30 12:34   ` Matt Price
2018-10-30 13:28     ` Eric S Fraga
2018-10-30 14:29       ` Jeff Filipovits
2018-10-30 15:56         ` ckelty ckelty
2018-10-31  1:26           ` Matt Price
2018-10-31  1:30             ` Matt Price
2018-10-31  3:04               ` Alan L Tyree
2018-10-31  3:50             ` ckelty ckelty
2018-11-01 12:47               ` getting close on latex letterheads [was: letterhead and signature in odt export] Matt Price
2018-11-01 13:58                 ` Eric S Fraga
2018-11-02  2:28                   ` Matt Price
2018-10-31 14:53             ` letterhead and signature in odt export John Kitchin
2018-10-30 21:41         ` Tim Cross
2018-10-31  1:21           ` Matt Price
2018-11-01 21:11             ` Tim Cross
2018-10-30  7:31 ` Christian Moe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zxjevrf.fsf@christianmoe.com \
    --to=mail@christianmoe.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).