From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: letterhead and signature in odt export Date: Wed, 31 Oct 2018 10:53:21 -0400 Message-ID: References: <87r2g7rkkw.fsf@gmail.com> <877ehzpnrv.fsf@gmail.com> <6EFB79F4-F86A-4544-A10B-C8546E649EAE@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHrsN-000358-BC for emacs-orgmode@gnu.org; Wed, 31 Oct 2018 10:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHrsD-0006wY-Mp for emacs-orgmode@gnu.org; Wed, 31 Oct 2018 10:53:41 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:36074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHrs8-0006v1-Vi for emacs-orgmode@gnu.org; Wed, 31 Oct 2018 10:53:31 -0400 Received: by mail-ed1-x52c.google.com with SMTP id x2-v6so13875201eds.3 for ; Wed, 31 Oct 2018 07:53:26 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Matt Price Cc: jrfilipovits@gmail.com, Org Mode , ckelty@gmail.com 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 nic= er > 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 s= ee > 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 yea= rs > of resisting :-/ > > m > > On Tue, Oct 30, 2018 at 11:56 AM ckelty ckelty wrote: > >> I don=E2=80=99t mess around with LibreOffice, but if you want to do it i= n Org, >> this is what I do and it works fine. Some of the preamble is superfluous= =E2=80=94 >> for various letters I=E2=80=99ve had to add other LaTeX packages=E2=80= =A6. >> >> 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=3D1.5in,right=3D1.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=3D0.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=3D0.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 o= ut >> 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 http://kitchingroup.cheme.cmu.edu