Re: [O] letterhead and signature in odt export

2018-11-01 Thread Tim Cross


Matt Price  writes:

> On Tue, Oct 30, 2018 at 5:41 PM Tim Cross  wrote:
>
>>
>> I've never delved into the XML nightmare that is ODT and stick with
>> latex/PDF export.
>>
>> Here is how I handled needing to have a logo and banner at the top of my
>> documents. Essentially, it involves using the Latex 'minipage'
>> environment to setup the layout and the xcolor package to handle
>> colours. Getting it working is somewhat trial and error, but once you
>> have it, it is pretty much set and forget.
>>
>> The below is an early version. I later refined it and put it into my
>> org-latex-classes variable, but removed it when I left the University
>> for a new employer. It should be fairly straight-forward to adapt to a
>> letter head. The only challenge will be if your Uni Marketing/PR are
>> very rigid re: format. In particular, fonts can be a challenge if they
>> have selected something unusual.
>>
>
> whew, OK, this is interesting. I guess you have written your own class
> somewhere, is that right? And even though your header is defined in
> latex_header it still somehow is included inside of \begin{document}?
>

Essentially, yes. I defined a new org-latex-class where all the
LATEX_HEADER_EXTRA lines below were put into the [EXTRA] section of the
org-latex-class definition. I then only needed to add the LATEX_CLASS
header line in my document and all would work. Note that there is an
order to how the elements in org-latex-class are processed and you do
have to get that correct - for example,  the LATEX_HEADER line needs to
go into the [PACKAGES] section and the rest in the [EXTRA] section to
ensure things are put in the right order. 

It will likely take some trial and error to get things correct and it
can be a little fragile i.e. if you had a long title/heading/author etc,
things may not wrap/align correctly. I'm sure someone with even more
Latex experience could do a better definition, but I found it worked
really well for me.

My suggestion would be to use a org template/skeleton file initially so
that it is easier to tweak and then once you have it nailed down, look
at defining a new org-latex-class entry.

I do recall it took me a few goes to really understand the
org-latex-class definition - but that could just be me being a bit slow!

> ... and if I turn this into an org latex class, then am I right that I an
> simply set that latex_class header at the top of a document and all of this
> will be handled for me autmagically on export? That would be fantastic.
>


> Gonna follow up some more in response to ckelty, whose stuff I've been
> working with thus far.
>
>>
>> #+TITLE: X
>> #+AUTHOR: XXX
>> #+DATE: \today
>> #+SUBTITLE: IAM Use Case
>> #+OPTIONS: ^:nil num:nil toc:nil tags:nil |:t
>> #+LATEX_CLASS: une-article
>> #+LATEX-OPTIONS: 12pt,a4paper
>> #+LATEX_HEADER: \usepackage{xcolor}
>> #+LATEX_HEADER_EXTRA: \definecolor{unegreen}{HTML}{7AB800}
>> #+LATEX_HEADER_EXTRA: \definecolor{Black}{HTML}{00}
>> #+LATEX_HEADER_EXTRA: \definecolor{White}{HTML}{FF}
>> #+LATEX_HEADER_EXTRA: \definecolor{dimgrey}{HTML}{696969}
>> #+LATEX_HEADER_EXTRA: \makeatletter
>> #+LATEX_HEADER_EXTRA: \def\@maketitle{
>> #+LATEX_HEADER_EXTRA:  \noindent \begin{minipage}[c][4cm][t]{\linewidth}
>> #+LATEX_HEADER_EXTRA:\colorbox{Black}{%
>> #+LATEX_HEADER_EXTRA:  \begin{minipage}[t][4cm][c]{4cm}
>> #+LATEX_HEADER_EXTRA:  \flushleft
>> #+LATEX_HEADER_EXTRA:  \includegraphics{~/Pictures/unelogo_medium.png}
>> #+LATEX_HEADER_EXTRA:\end{minipage}}
>> #+LATEX_HEADER_EXTRA:\colorbox{unegreen}{%
>> #+LATEX_HEADER_EXTRA:  \begin{minipage}[t][4cm][c]{10cm}
>> #+LATEX_HEADER_EXTRA:\flushright
>> #+LATEX_HEADER_EXTRA:\Large \textbf{\color{White}{\@title}} \\
>> #+LATEX_HEADER_EXTRA: \vspace{4pt}
>> #+LATEX_HEADER_EXTRA:\small \color{White}{\@author} \\
>> #+LATEX_HEADER_EXTRA:\small \color{White}{\@date}
>> #+LATEX_HEADER_EXTRA:  \end{minipage}}
>> #+LATEX_HEADER_EXTRA:\end{minipage}}
>> #+LATEX_HEADER_EXTRA: \makeatother
>>
>>
>>
>> Jeff Filipovits  writes:
>>
>> > Would you mind sharing them? This is a problem I am trying to figure out
>> as
>> > well.
>> >
>> > On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga  wrote:
>> >
>> >> Matt,
>> >>
>> >> I've replied directly to you with some files.
>> >> --
>> >> Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
>> >>
>> >>
>>
>>
>> --
>> Tim Cross
>>


-- 
Tim Cross



Re: [O] letterhead and signature in odt export

2018-10-31 Thread John Kitchin
I went down the path of a custom latex style, with custom exporter some
years ago. At the time, I was head of our undergrad committee, and I had
to write a lot of memo style documents on department letterhead. This
setup allowed me to quickly write memos and export them to pdfs. I also
use this for other things like letters of recommendation these days. I
put each one in a separate file.

I defined this skeleton (which you run by typing M-x memo) that makes it
easy to get a memo started:

(define-skeleton memo
  "CMU memo template"
  nil
  "#+LATEX_CLASS: cmu-memo
#+CC:
#+DEPARTMENT: Department of Chemical Engineering
#+FROM: John Kitchin
#+FROMNAME: John Kitchin
#+SIGNATURE-LINES: nil
#+SUBJECT: "_"
#+TO: "@"
#+latex_header: \\usepackage{setspace}
#+latex_header: \\doublespacing

Sincerely,



John Kitchin

* build :noexport:
[[elisp:(cmu-memo-export-to-pdf-and-open)]]
")

Other solutions include a yasnippet, tempo, ...

I wrote an exporter you can find at
https://github.com/jkitchin/scimax/blob/master/ox-cmu/ox-cmu-memo.el
that uses the keywords to fill in parts of the document template.
Finally, I adapted
http://pi.math.cornell.edu/ADMIN/Computers/latex-letterhead/culetter.sty
to put all the header/logo info in and made it into a latex package. The
main reason for this is that the logo file is in the package, so I don't
have to know its path, worry about moving it, etc.

Knowing what I know now, and now my needs are a little simpler, I guess
you could avoid the sty file and achieve this via the exporter. It
mostly depends on where you want the information to get from org to
latex. Since I have some information in org-format, the exporter is
needed I think.

Regarding where to learn LaTeX, https://en.wikibooks.org/wiki/LaTeX
seems pretty good, but probably it won't help you understand that sty
file! That is written in tex.

There are many ways to get something suitable, I hope this helps!





Matt Price  writes:

> Hi again Chris!
>
> OK, so I understand a little bit of this. I would like to keep all my
> letters in subheadings in a single org doc, and just export once. This
> version requires a fair amount of latex in every subtree. It would be nicer
> if the exporter just took care of the latex for me and I didn't have to
> look at it while I'm composing (I know that's not an issue for you,
> Chris).
>
> Is my best option to create an export-derived-backend based on latex (I see
> that's what John K has done in scimax)? Or is the preferred method to
> create a new latex class (whatever that is -- really I have no idea) and
> add the header and closing lines to that?
>
> Also... where should I go to learn more about latex (I have beengoogling,
> I've found some places, am wondering what the *best* place is)? It appears
> I am approaching adulthood and am ready to learn how to use it, after years
> of resisting :-/
>
> m
>
> On Tue, Oct 30, 2018 at 11:56 AM ckelty ckelty  wrote:
>
>> I don’t mess around with LibreOffice, but if you want to do it in Org,
>> this is what I do and it works fine. Some of the preamble is superfluous—
>> for various letters I’ve had to add other LaTeX packages….
>>
>> ck
>>
>>
>> >
>> >
>> >
>>
>> #+STARTUP: indent
>> #+LANGUAGE: en
>> #+OPTIONS: num:nil  toc:nil ':t
>> #+AUTHOR: Your Name Here
>> #+EMAIL: Your Email Here
>> #+LATEX_HEADER: \usepackage[utf8]{inputenc}
>> #+LATEX_HEADER: \usepackage[T1]{fontenc}
>> #+LATEX_HEADER: \usepackage{graphicx}
>> #+LATEX_HEADER: \usepackage{float}
>> #+LATEX_HEADER: \usepackage{wrapfig}
>> #+LATEX_HEADER: \usepackage{rotating}
>> #+LATEX_HEADER: \usepackage[normalem]{ulem}
>> #+LATEX_HEADER: \usepackage{hyperref}
>> #+LATEX_HEADER: \usepackage{setspace}
>> #+LATEX_HEADER: \usepackage{libertine}
>> #+LATEX_HEADER: \usepackage[left=1.5in,right=1.5in]{geometry}
>> #+LATEX_HEADER: \setlength{\parskip}{1em}
>> #+LATEX_HEADER: \setlength{\parindent}{0pt}
>>
>> # Insert your graphic here-- getting the scale right can take some work
>> \includegraphics[scale=0.145]{Your LetterHead PNG/JPG}
>>
>> \hfill \today
>>
>> [ Greeting Here ]
>>
>> # I use setspace and onehalfspacing to control line spacing
>> \onehalfspacing
>>
>> [ Insert Inflated Rhetoric About Here ]
>>
>> Yours sincerely,\\
>>
>> # Insert your sig here... ditto on scale.
>> \includegraphics[scale=0.4]{Your Sig PNG/JPG}
>>
>> \textbf{Your Name}\\
>> Illustrious Title\\
>> Second Illustrious Title\\
>> Etc.\\
>>
>>
>> <
>> <
>> <
>>
>> > On Oct 30, 2018, at 7:29 AM, Jeff Filipovits 
>> wrote:
>> >
>> > Would you mind sharing them? This is a problem I am trying to figure out
>> as well.
>> >
>> > On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga  wrote:
>> > Matt,
>> >
>> > I've replied directly to you with some files.
>> > --
>> > Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
>> >
>>
>>


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin

Re: [O] letterhead and signature in odt export

2018-10-30 Thread ckelty ckelty
Matt,


> On Oct 30, 2018, at 6:26 PM, Matt Price  wrote:
> 
> Hi again Chris!
> 
> OK, so I understand a little bit of this. I would like to keep all my letters 
> in subheadings in a single org doc, and just export once. This version 
> requires a fair amount of latex in every subtree.

Unless I am misunderstanding, you should be able to restrict what you export to 
your subtree with a C-s (C-c C-e C-s l o) and just have one file with the Latex 
Headers at the top… or you can do what Tim suggested and put it in 
org-latex-classes variable (but I don’t know how to do that). 

> It would be nicer if the exporter just took care of the latex for me and I 
> didn't have to look at it while I'm composing (I know that's not an issue for 
> you, Chris).  
> 
> Is my best option to create an export-derived-backend based on latex (I see 
> that's what John K has done in scimax)? Or is the preferred method to create 
> a new latex class (whatever that is -- really I have no idea) and  add the 
> header and closing lines to that? 


You don’t need a new class— everything can be done in article or letter, which 
are standard LaTeX classes.  But if you want to control formatting to any 
extent, you can’t escape having to learn a bit of LaTeX. Stick with the 
standard stuff and you won’t have trouble.  

> 
> Also... where should I go to learn more about latex (I have beengoogling, 
> I've found some places, am wondering what the *best* place is)? It appears I 
> am approaching adulthood and am ready to learn how to use it, after years of 
> resisting :-/
> 

Ahhh… that way lies madness.  Welcome.  I would learn as little LaTeX as 
necessary and allow org to do the rest.  ShareLatex, Overleaf, and 
StackExchange are all fine starting points

ck





Re: [O] letterhead and signature in odt export

2018-10-30 Thread Alan L Tyree



WARNING: Not entirely on point

You might want to look at exporting to HTML and then using something 
like weasyprint to produce the PDF.


I only mention this because I have been helping a friend produce ebooks 
using markdown, pandoc and weasyprint. Using a modest amount of CSS 
gives very good PDF results.


I haven't tried it with letterheads, but I'm sure it would work well.

Why markdown? It was hard enough getting my friend away from Word!! 
Maybe I can get him onto emacs in a year or two.


Alan


--
Alan L Tyreehttp://www2.austlii.edu.au/~alan




Re: [O] letterhead and signature in odt export

2018-10-30 Thread Matt Price
Oh shoot, I meant to include my sort-of working org text. Not sending the
image file, so you will I guess need to supply your own image in the
corner  -- oh, and also the signature file! - but this is what I have. It
sorta works OK and looks at least a little bit like the History Department
letterhead. Which, I realize, is just a bunch of words written i nHelvetica
with a picture of a beaver next to it.

#+STARTUP: indent
#+LANGUAGE: en
#+OPTIONS: num:nil  toc:nil ':t
#+AUTHOR: Matt Price
#+EMAIL: Your Email Here
#+LATEX_HEADER: \usepackage[utf8]{inputenc}
#+LATEX_HEADER: \usepackage[T1]{fontenc}
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{float}
#+LATEX_HEADER: \usepackage{wrapfig}
#+LATEX_HEADER: \usepackage{rotating}
#+LATEX_HEADER: \usepackage[normalem]{ulem}
#+LATEX_HEADER: \usepackage{hyperref}
#+LATEX_HEADER: \usepackage{setspace}
#+LATEX_HEADER: \usepackage{libertine}
#+LATEX_HEADER: \usepackage[left=1.0in,right=1.0in]{geometry}
#+LATEX_HEADER: \setlength{\parskip}{1em}
#+LATEX_HEADER: \setlength{\parindent}{0pt}
#+LATEX_HEADER:
\newenvironment{temphelvet}{\fontfamily{phv}\selectfont}{\par}

# Insert your graphic here-- getting the scale right can take some work
\begin{minipage}{0.14\textwidth}
\includegraphics[width=1.8cm]{./Pictures/1201010701CF636AB597708AB63A.png}
\end{minipage}
\begin{minipage}{0.86\textwidth}
\begin{temphelvet}
{\huge University of Toronto}
\vspace{-2pt}
\hrule
\vspace{3pt}
\textbf{\textsc{dept. of history}}  \newline
{\small \textsc{ Rm. 2074 sidney smith, 100 st. george street}, TORONTO,
ONTARIO  M5S 3G3  CANADA \newline
\textsc{Telephone 416-978-3363Fax 416-978-4810} }
\end{temphelvet}
\end{minipage}
\hfill \today

[ Greeting Here ]

# I use setspace and onehalfspacing to control line spacing
\onehalfspacing

[ Insert Inflated Rhetoric About Here ]

Yours sincerely,\\

# Insert your sig here... ditto on scale.
\includegraphics[scale=1.0]{/home/matt/Pictures/my-sig-black.png}

\textbf{Your Name}\\
Illustrious Title\\
Second Illustrious Title\\
Etc.\\

* build :noexport:
  :PROPERTIES:
  :CUSTOM_ID: build
  :END:
  #+begin_src emacs-lisp
  (find-file (org-latex-export-to-pdf))
  #+end_src


Re: [O] letterhead and signature in odt export

2018-10-30 Thread Matt Price
Hi again Chris!

OK, so I understand a little bit of this. I would like to keep all my
letters in subheadings in a single org doc, and just export once. This
version requires a fair amount of latex in every subtree. It would be nicer
if the exporter just took care of the latex for me and I didn't have to
look at it while I'm composing (I know that's not an issue for you,
Chris).

Is my best option to create an export-derived-backend based on latex (I see
that's what John K has done in scimax)? Or is the preferred method to
create a new latex class (whatever that is -- really I have no idea) and
add the header and closing lines to that?

Also... where should I go to learn more about latex (I have beengoogling,
I've found some places, am wondering what the *best* place is)? It appears
I am approaching adulthood and am ready to learn how to use it, after years
of resisting :-/

m

On Tue, Oct 30, 2018 at 11:56 AM ckelty ckelty  wrote:

> I don’t mess around with LibreOffice, but if you want to do it in Org,
> this is what I do and it works fine. Some of the preamble is superfluous—
> for various letters I’ve had to add other LaTeX packages….
>
> ck
>
>
> >
> >
> >
>
> #+STARTUP: indent
> #+LANGUAGE: en
> #+OPTIONS: num:nil  toc:nil ':t
> #+AUTHOR: Your Name Here
> #+EMAIL: Your Email Here
> #+LATEX_HEADER: \usepackage[utf8]{inputenc}
> #+LATEX_HEADER: \usepackage[T1]{fontenc}
> #+LATEX_HEADER: \usepackage{graphicx}
> #+LATEX_HEADER: \usepackage{float}
> #+LATEX_HEADER: \usepackage{wrapfig}
> #+LATEX_HEADER: \usepackage{rotating}
> #+LATEX_HEADER: \usepackage[normalem]{ulem}
> #+LATEX_HEADER: \usepackage{hyperref}
> #+LATEX_HEADER: \usepackage{setspace}
> #+LATEX_HEADER: \usepackage{libertine}
> #+LATEX_HEADER: \usepackage[left=1.5in,right=1.5in]{geometry}
> #+LATEX_HEADER: \setlength{\parskip}{1em}
> #+LATEX_HEADER: \setlength{\parindent}{0pt}
>
> # Insert your graphic here-- getting the scale right can take some work
> \includegraphics[scale=0.145]{Your LetterHead PNG/JPG}
>
> \hfill \today
>
> [ Greeting Here ]
>
> # I use setspace and onehalfspacing to control line spacing
> \onehalfspacing
>
> [ Insert Inflated Rhetoric About Here ]
>
> Yours sincerely,\\
>
> # Insert your sig here... ditto on scale.
> \includegraphics[scale=0.4]{Your Sig PNG/JPG}
>
> \textbf{Your Name}\\
> Illustrious Title\\
> Second Illustrious Title\\
> Etc.\\
>
>
> <
> <
> <
>
> > On Oct 30, 2018, at 7:29 AM, Jeff Filipovits 
> wrote:
> >
> > Would you mind sharing them? This is a problem I am trying to figure out
> as well.
> >
> > On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga  wrote:
> > Matt,
> >
> > I've replied directly to you with some files.
> > --
> > Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
> >
>
>


Re: [O] letterhead and signature in odt export

2018-10-30 Thread Matt Price
On Tue, Oct 30, 2018 at 5:41 PM Tim Cross  wrote:

>
> I've never delved into the XML nightmare that is ODT and stick with
> latex/PDF export.
>
> Here is how I handled needing to have a logo and banner at the top of my
> documents. Essentially, it involves using the Latex 'minipage'
> environment to setup the layout and the xcolor package to handle
> colours. Getting it working is somewhat trial and error, but once you
> have it, it is pretty much set and forget.
>
> The below is an early version. I later refined it and put it into my
> org-latex-classes variable, but removed it when I left the University
> for a new employer. It should be fairly straight-forward to adapt to a
> letter head. The only challenge will be if your Uni Marketing/PR are
> very rigid re: format. In particular, fonts can be a challenge if they
> have selected something unusual.
>

whew, OK, this is interesting. I guess you have written your own class
somewhere, is that right? And even though your header is defined in
latex_header it still somehow is included inside of \begin{document}?

... and if I turn this into an org latex class, then am I right that I an
simply set that latex_class header at the top of a document and all of this
will be handled for me autmagically on export? That would be fantastic.

Gonna follow up some more in response to ckelty, whose stuff I've been
working with thus far.

>
> #+TITLE: X
> #+AUTHOR: XXX
> #+DATE: \today
> #+SUBTITLE: IAM Use Case
> #+OPTIONS: ^:nil num:nil toc:nil tags:nil |:t
> #+LATEX_CLASS: une-article
> #+LATEX-OPTIONS: 12pt,a4paper
> #+LATEX_HEADER: \usepackage{xcolor}
> #+LATEX_HEADER_EXTRA: \definecolor{unegreen}{HTML}{7AB800}
> #+LATEX_HEADER_EXTRA: \definecolor{Black}{HTML}{00}
> #+LATEX_HEADER_EXTRA: \definecolor{White}{HTML}{FF}
> #+LATEX_HEADER_EXTRA: \definecolor{dimgrey}{HTML}{696969}
> #+LATEX_HEADER_EXTRA: \makeatletter
> #+LATEX_HEADER_EXTRA: \def\@maketitle{
> #+LATEX_HEADER_EXTRA:  \noindent \begin{minipage}[c][4cm][t]{\linewidth}
> #+LATEX_HEADER_EXTRA:\colorbox{Black}{%
> #+LATEX_HEADER_EXTRA:  \begin{minipage}[t][4cm][c]{4cm}
> #+LATEX_HEADER_EXTRA:  \flushleft
> #+LATEX_HEADER_EXTRA:  \includegraphics{~/Pictures/unelogo_medium.png}
> #+LATEX_HEADER_EXTRA:\end{minipage}}
> #+LATEX_HEADER_EXTRA:\colorbox{unegreen}{%
> #+LATEX_HEADER_EXTRA:  \begin{minipage}[t][4cm][c]{10cm}
> #+LATEX_HEADER_EXTRA:\flushright
> #+LATEX_HEADER_EXTRA:\Large \textbf{\color{White}{\@title}} \\
> #+LATEX_HEADER_EXTRA: \vspace{4pt}
> #+LATEX_HEADER_EXTRA:\small \color{White}{\@author} \\
> #+LATEX_HEADER_EXTRA:\small \color{White}{\@date}
> #+LATEX_HEADER_EXTRA:  \end{minipage}}
> #+LATEX_HEADER_EXTRA:\end{minipage}}
> #+LATEX_HEADER_EXTRA: \makeatother
>
>
>
> Jeff Filipovits  writes:
>
> > Would you mind sharing them? This is a problem I am trying to figure out
> as
> > well.
> >
> > On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga  wrote:
> >
> >> Matt,
> >>
> >> I've replied directly to you with some files.
> >> --
> >> Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
> >>
> >>
>
>
> --
> Tim Cross
>


Re: [O] letterhead and signature in odt export

2018-10-30 Thread Tim Cross


I've never delved into the XML nightmare that is ODT and stick with
latex/PDF export.

Here is how I handled needing to have a logo and banner at the top of my
documents. Essentially, it involves using the Latex 'minipage'
environment to setup the layout and the xcolor package to handle
colours. Getting it working is somewhat trial and error, but once you
have it, it is pretty much set and forget. 

The below is an early version. I later refined it and put it into my
org-latex-classes variable, but removed it when I left the University
for a new employer. It should be fairly straight-forward to adapt to a
letter head. The only challenge will be if your Uni Marketing/PR are
very rigid re: format. In particular, fonts can be a challenge if they
have selected something unusual.  

#+TITLE: X
#+AUTHOR: XXX
#+DATE: \today
#+SUBTITLE: IAM Use Case
#+OPTIONS: ^:nil num:nil toc:nil tags:nil |:t
#+LATEX_CLASS: une-article
#+LATEX-OPTIONS: 12pt,a4paper
#+LATEX_HEADER: \usepackage{xcolor}
#+LATEX_HEADER_EXTRA: \definecolor{unegreen}{HTML}{7AB800}
#+LATEX_HEADER_EXTRA: \definecolor{Black}{HTML}{00}
#+LATEX_HEADER_EXTRA: \definecolor{White}{HTML}{FF}
#+LATEX_HEADER_EXTRA: \definecolor{dimgrey}{HTML}{696969}
#+LATEX_HEADER_EXTRA: \makeatletter
#+LATEX_HEADER_EXTRA: \def\@maketitle{
#+LATEX_HEADER_EXTRA:  \noindent \begin{minipage}[c][4cm][t]{\linewidth}
#+LATEX_HEADER_EXTRA:\colorbox{Black}{%
#+LATEX_HEADER_EXTRA:  \begin{minipage}[t][4cm][c]{4cm}
#+LATEX_HEADER_EXTRA:  \flushleft
#+LATEX_HEADER_EXTRA:  \includegraphics{~/Pictures/unelogo_medium.png}
#+LATEX_HEADER_EXTRA:\end{minipage}}
#+LATEX_HEADER_EXTRA:\colorbox{unegreen}{%
#+LATEX_HEADER_EXTRA:  \begin{minipage}[t][4cm][c]{10cm}
#+LATEX_HEADER_EXTRA:\flushright
#+LATEX_HEADER_EXTRA:\Large \textbf{\color{White}{\@title}} \\
#+LATEX_HEADER_EXTRA: \vspace{4pt}
#+LATEX_HEADER_EXTRA:\small \color{White}{\@author} \\
#+LATEX_HEADER_EXTRA:\small \color{White}{\@date}
#+LATEX_HEADER_EXTRA:  \end{minipage}}
#+LATEX_HEADER_EXTRA:\end{minipage}}
#+LATEX_HEADER_EXTRA: \makeatother



Jeff Filipovits  writes:

> Would you mind sharing them? This is a problem I am trying to figure out as
> well.
>
> On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga  wrote:
>
>> Matt,
>>
>> I've replied directly to you with some files.
>> --
>> Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
>>
>>


-- 
Tim Cross



Re: [O] letterhead and signature in odt export

2018-10-30 Thread ckelty ckelty
I don’t mess around with LibreOffice, but if you want to do it in Org, this is 
what I do and it works fine. Some of the preamble is superfluous— for various 
letters I’ve had to add other LaTeX packages…. 

ck


>
>
>

#+STARTUP: indent
#+LANGUAGE: en
#+OPTIONS: num:nil  toc:nil ':t
#+AUTHOR: Your Name Here
#+EMAIL: Your Email Here
#+LATEX_HEADER: \usepackage[utf8]{inputenc}
#+LATEX_HEADER: \usepackage[T1]{fontenc}
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{float}
#+LATEX_HEADER: \usepackage{wrapfig}
#+LATEX_HEADER: \usepackage{rotating}
#+LATEX_HEADER: \usepackage[normalem]{ulem}
#+LATEX_HEADER: \usepackage{hyperref}
#+LATEX_HEADER: \usepackage{setspace}
#+LATEX_HEADER: \usepackage{libertine}
#+LATEX_HEADER: \usepackage[left=1.5in,right=1.5in]{geometry}
#+LATEX_HEADER: \setlength{\parskip}{1em}
#+LATEX_HEADER: \setlength{\parindent}{0pt}

# Insert your graphic here-- getting the scale right can take some work
\includegraphics[scale=0.145]{Your LetterHead PNG/JPG} 

\hfill \today

[ Greeting Here ]

# I use setspace and onehalfspacing to control line spacing
\onehalfspacing

[ Insert Inflated Rhetoric About Here ]

Yours sincerely,\\

# Insert your sig here... ditto on scale. 
\includegraphics[scale=0.4]{Your Sig PNG/JPG}

\textbf{Your Name}\\
Illustrious Title\\
Second Illustrious Title\\
Etc.\\


<
<
<

> On Oct 30, 2018, at 7:29 AM, Jeff Filipovits  wrote:
> 
> Would you mind sharing them? This is a problem I am trying to figure out as 
> well. 
> 
> On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga  wrote:
> Matt,
> 
> I've replied directly to you with some files.
> -- 
> Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
> 




Re: [O] letterhead and signature in odt export

2018-10-30 Thread Jeff Filipovits
Would you mind sharing them? This is a problem I am trying to figure out as
well.

On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga  wrote:

> Matt,
>
> I've replied directly to you with some files.
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
>
>


Re: [O] letterhead and signature in odt export

2018-10-30 Thread Eric S Fraga
Matt,

I've replied directly to you with some files.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4



Re: [O] letterhead and signature in odt export

2018-10-30 Thread Matt Price
On Tue, Oct 30, 2018 at 2:54 AM Eric S Fraga  wrote:

> On Tuesday, 30 Oct 2018 at 01:55, Matt Price wrote:
> > in North America it's letter-of-reference season for professors, and I am
> > writing a lot of them.
>
> I sympathise fully :)
>
> > 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.
>
> The documentation for odt export suggests that you can specify a style
> file.  If you create this file in libreoffice with your letterhead &
> image, it should work.  I've not tested this, mind you.
>
> I use LaTeX, specifically the komascript letter style, but it does
> require LaTeX knowledge to create the basic template.
>

If you have a template, I'd appreciate seeing it! I had hoped maybe I could
add a filter for these xml fragments, but I don't see wwhich filter would
be relevant!

>
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4
>


Re: [O] letterhead and signature in odt export

2018-10-30 Thread Christian Moe

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

#+title: ODT styles test
#+ODT_STYLES_FILE: ("odt-test-styles.odt" ("styles.xml" "Pictures/120100A200B0A7D655E3F0A97ECF.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/120100A200B0A7D655E3F0A97ECF.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.



odt-test-styles.odt
Description: application/vnd.oasis.opendocument.text



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
> 
> 
>
> 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):
>
> -
>  text:display-outline-level="2" text:separation-character="."
> text:name="Illustration"/> text:display-outline-level="2" text:separation-character="."
> text:name="Table"/> text:separation-character="." text:name="Text"/> text:display-outline-level="0" text:name="Drawing"/> text:display-outline-level="0" text:name="Figure"/> text:display-outline-level="2" text:separation-character="."
> text:name="Equation"/> text:separation-character="."
> text:name="Listing"/> text:outline-level="1"/> table:style-name="Table1"> table:style-name="Table1.A"/> table:style-name="Table1.B"/> table:style-name="Table1.1"> office:value-type="string"> draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char"
> svg:width="1.857cm" svg:height="3.025cm" draw:z-index="0"> xlink:href="Pictures/100041D61B2F2FDA8AF7D675B9CA7740.wmf"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
> loext:mime-type="image/x-wmf"/> xlink:href="Pictures/1201010701CF636AB597708AB63A.png"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
> loext:mime-type="image/png"/> table:style-name="Table1.A1" office:value-type="string"> text:style-name="P5">University of
> Toronto
>  text:style-name="P5">dept. of
> history
>  text:style-name="T5">Rm-2074 sidney smith, 100 st. george street, TORONTO,
> ONTARIO M5S 3G3 CANADA text:style-name="P4">Telephone 416-978-3363
> Fax 416-978-4810
>  text:style-name="P7" text:outline-level="1"> text:name="org54567cc"/>
> --
>
> and here is my signature:
>
> 
>  text:display-outline-level="2" text:separation-character="."
> text:name="Illustration"/> text:display-outline-level="2" text:separation-character="."
> text:name="Table"/> text:separation-character="." text:name="Text"/> text:display-outline-level="0" text:name="Drawing"/> text:display-outline-level="0" text:name="Figure"/> text:display-outline-level="2" text:separation-character="."
> text:name="Equation"/> text:separation-character="."
> text:name="Listing"/> text:outline-level="1"/> table:style-name="Table1"> table:style-name="Table1.A"/> table:style-name="Table1.B"/> table:style-name="Table1.1"> office:value-type="string"> draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char"
> svg:width="1.857cm" svg:height="3.025cm" draw:z-index="0"> xlink:href="Pictures/100041D61B2F2FDA8AF7D675B9CA7740.wmf"
> xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"

Re: [O] letterhead and signature in odt export

2018-10-30 Thread Eric S Fraga
On Tuesday, 30 Oct 2018 at 01:55, Matt Price wrote:
> in North America it's letter-of-reference season for professors, and I am
> writing a lot of them. 

I sympathise fully :)

> 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.

The documentation for odt export suggests that you can specify a style
file.  If you create this file in libreoffice with your letterhead &
image, it should work.  I've not tested this, mind you.

I use LaTeX, specifically the komascript letter style, but it does
require LaTeX knowledge to create the basic template.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4