From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: getting close on latex letterheads [was: letterhead and signature in odt export] Date: Thu, 1 Nov 2018 08:47:42 -0400 Message-ID: References: <87r2g7rkkw.fsf@gmail.com> <877ehzpnrv.fsf@gmail.com> <6EFB79F4-F86A-4544-A10B-C8546E649EAE@gmail.com> <2FD78D67-FE7A-4114-BE48-0DCE7F435E35@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006862e8057999d124" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gICNZ-0007o1-59 for emacs-orgmode@gnu.org; Thu, 01 Nov 2018 08:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gICNX-0004UW-F6 for emacs-orgmode@gnu.org; Thu, 01 Nov 2018 08:47:17 -0400 Received: from mail-it1-x12e.google.com ([2607:f8b0:4864:20::12e]:40915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gICNX-0004Tg-6r for emacs-orgmode@gnu.org; Thu, 01 Nov 2018 08:47:15 -0400 Received: by mail-it1-x12e.google.com with SMTP id i191-v6so1799289iti.5 for ; Thu, 01 Nov 2018 05:47:14 -0700 (PDT) In-Reply-To: <2FD78D67-FE7A-4114-BE48-0DCE7F435E35@gmail.com> 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: ckelty ckelty Cc: Org Mode --0000000000006862e8057999d124 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable OK, so I'm getting close to being able to do this. My almost-working example doc is at the bottom of this email, I have a question about suppressing the headline text. On Tue, Oct 30, 2018 at 11:50 PM ckelty ckelty wrote: > 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 fil= e > with the Latex Headers at the top=E2=80=A6 or you can do what Tim suggest= ed and put > it in org-latex-classes variable (but I don=E2=80=99t know how to do that= ). > > I think I may actually understand this now. See my example below, which almost works. > > > > > 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 u= se > it, after years of resisting :-/ > > > > Ahhh=E2=80=A6 that way lies madness. Welcome. I would learn as little L= aTeX as > necessary and allow org to do the rest. ShareLatex, Overleaf, and > StackExchange are all fine starting points > > I'm definitely learning something, though yes, I feel a bit like the Mad Hatter. So I am pretty close. As you suggested, turns out I can put almost all the latex in the document header. The only thing that still needs to go into the letter body is the \mysig command that I have defined in the header. This works fine if I have no headlines in the letter text, but if I try to export a subtree, then I guess the headline gets read as a title, and either org or latex inserts it immediately after my custom \maketitle command. It seems to me then that I either have to always set the export_title property of subheadings to the empty string; add a temporary filter to ox-latex; or just write my own derived backend that does al lthis work for me, and maybe add a keybinding for that to make it easier to access (my export dispatcher is getting pretty crowded...). Setting #+OPTIONS: title:nil does not seem ot have any effect :-( Still, maybe some of y'all have ideas on how to improve what I've already got, which is below. Thanks again! #+STARTUP: indent #+LANGUAGE: en #+OPTIONS: num:nil toc:nil ':t #+AUTHOR #+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.0in,right=3D1.0in]{geometry} #+LATEX_HEADER: \setlength{\parskip}{1em} #+LATEX_HEADER: \setlength{\parindent}{0pt} #+LATEX_HEADER: \newenvironment{temphelvet}{\fontfamily{phv}\selectfont}{\par} #+LATEX_HEADER: \makeatletter #+LATEX_HEADER: \def\@maketitle{ #+LATEX_HEADER: \begin{minipage}{0.14\textwidth} #+LATEX_HEADER: \includegraphics[width=3D1.8cm]{./Pictures/1000020100000107000001CF636AB597= 708AB63A.png} #+LATEX_HEADER: \end{minipage} #+LATEX_HEADER: \begin{minipage}{0.86\textwidth} #+LATEX_HEADER: \begin{temphelvet} #+LATEX_HEADER: {\huge University of Toronto} #+LATEX_HEADER: \vspace{-2pt} #+LATEX_HEADER: \hrule #+LATEX_HEADER: \vspace{3pt} #+LATEX_HEADER: \textbf{\textsc{dept. of history}} \newline #+LATEX_HEADER: {\small \textsc{ Rm. 2074 sidney smith, 100 st. george street}, TORONTO, ONTARIO M5S 3G3 CANADA \newline #+LATEX_HEADER: \textsc{Telephone 416-978-3363 Fax 416-978-4810} } #+LATEX_HEADER: \end{temphelvet} #+LATEX_HEADER: \end{minipage} #+LATEX_HEADER: \hfill} #+LATEX_HEADER: \makeatother #+LATEX_HEADER: \newcommand{\mysig}{ #+LATEX_HEADER: Please do not hesitate to contact me with any questions or concerns.\\ #+LATEX_HEADER: Sincerely,\\ #+LATEX_HEADER: \fromsig{\includegraphics[scale=3D1]{my-sig.png}} \\ #+LATEX_HEADER: \fromname{Matt Price} #+LATEX_HEADER: } # #+LATEX_HEADER_EXTRA: \maketitle # #+LATEX_HEADER_EXTRA: \onehalfspacing * Frankie I had the pleasure of teaching Frankie Goes To Hollywood in my 4th year seminar in Spring of 1987. Frankie stood out then as now as one of the loudest students I had ever encountered. At the same time, Frankie's work forced me to confront my own inability to *relax*. After years of psychotherapy, I now believe that that seminar was one of the best parts of my life. All the "trauma" Frankie caused me turn out to have been excellent learning experiences. It is thus with great pleasure that my therapist, I mean I, recommend Frankie for your stupid fellowship. \mysig * Joey Joey Ramone was a student in my class "School's out for Summer" at /Rock and Roll High School/ some time in the late 1970's, I can't remember the year exactly. Since the students burned the school down, and left me without a job, I really can't see why the would have asked me for a letter of reference, but I'm so alone and desolate that I agreed to write him one. However, I really don't have a single good thing to say about him. I know you're not reading these letters anyway, though, so I suppose I can say whatever I want here. That Long Island school board still owes me money! \mysig --0000000000006862e8057999d124 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
OK, so I'm getting close to being abl= e to do this. My almost-working=C2=A0 example doc is at the bottom of this = email, I have a question about suppressing the headline text.

<= div class=3D"gmail_quote">
On Tue, Oct 30, 2018 at 11:50 PM= ckelty ckelty <ckelty@gmail.com= > wrote:
Matt= ,


> On Oct 30, 2018, at 6:26 PM, Matt Price <moptop99@gmail.com> 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 vers= ion requires a fair amount of latex in every subtree.

Unless I am misunderstanding, you should be able to restrict what you expor= t 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=E2=80=A6 or you can do what Tim suggested and = put it in org-latex-classes variable (but I don=E2=80=99t know how to do th= at).

I think I may actually understand this now.=C2=A0 See= my example below, which almost works.

>
> Also... where should I go to learn more about latex (I have beengoogli= ng, 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, aft= er years of resisting :-/
>

Ahhh=E2=80=A6 that way lies madness.=C2=A0 Welcome.=C2=A0 I would learn as = little LaTeX as necessary and allow org to do the rest.=C2=A0 ShareLatex, O= verleaf, and StackExchange are all fine starting points

I'm definitely learning something, though yes, I = feel a bit like the Mad Hatter.

So I am prett= y close.=C2=A0 As you suggested, turns out I can put almost all the latex i= n the document header.=C2=A0 The only thing that still needs to go into the= letter body is the \mysig command that I have defined in the header.
=

This works fine if I have no headlines in the letter te= xt, but if I try to export a subtree, then I guess the headline gets read a= s a title, and either org or latex inserts it immediately after my custom \= maketitle command.=C2=A0=C2=A0

It seems to me then= that I either have to always set the export_title property of subheadings = to the empty string; add a temporary filter to ox-latex; or just write my o= wn derived backend that does al lthis work for me, and maybe add a keybindi= ng for that to make it easier to access (my export dispatcher is getting pr= etty crowded...).=C2=A0 Setting #+OPTIONS: title:nil does not seem ot have = any effect :-(

Still, maybe some of y'all = have ideas on how to improve what I've already got, which is below. Tha= nks again!

#+STARTUP: indent
#+LANGUAGE: en=
#+OPTIONS: num:nil=C2=A0 toc:nil ':t
#+AUTHOR
#+EMAIL: Your = Email Here
#+LATEX_HEADER: \usepackage[utf8]{inputenc}
#+LATEX_HEADER= : \usepackage[T1]{fontenc}
#+LATEX_HEADER: \usepackage{graphicx}
#+LA= TEX_HEADER: \usepackage{float}
#+LATEX_HEADER: \usepackage{wrapfig}
#= +LATEX_HEADER: \usepackage{rotating}
#+LATEX_HEADER: \usepackage[normale= m]{ulem}
#+LATEX_HEADER: \usepackage{hyperref}
#+LATEX_HEADER: \usepa= ckage{setspace}
#+LATEX_HEADER: \usepackage{libertine}
#+LATEX_HEADER= : \usepackage[left=3D1.0in,right=3D1.0in]{geometry}
#+LATEX_HEADER: \set= length{\parskip}{1em}
#+LATEX_HEADER: \setlength{\parindent}{0pt}
#+L= ATEX_HEADER: \newenvironment{temphelvet}{\fontfamily{phv}\selectfont}{\par}=
#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER: \def\@maketitle{
#+= LATEX_HEADER: \begin{minipage}{0.14\textwidth}
#+LATEX_HEADER: \includeg= raphics[width=3D1.8cm]{./Pictures/1000020100000107000001CF636AB597708AB63A.= png}
#+LATEX_HEADER: \end{minipage}
#+LATEX_HEADER: \begin{minipage}= {0.86\textwidth}
#+LATEX_HEADER: \begin{temphelvet}
#+LATEX_HEADER: {= \huge University of Toronto}=C2=A0=C2=A0=C2=A0
#+LATEX_HEADER: \vspace{= -2pt}
#+LATEX_HEADER: \hrule
#+LATEX_HEADER: \vspace{3pt}
#+LATEX= _HEADER: \textbf{\textsc{dept. of history}}=C2=A0 \newline
#+LATEX_HEAD= ER: {\small \textsc{ Rm. 2074 sidney smith, 100 st. george street}, TORONTO= , ONTARIO=C2=A0 M5S 3G3=C2=A0 CANADA \newline
#+LATEX_HEADER: \textsc{Te= lephone 416-978-3363=C2=A0=C2=A0=C2=A0 Fax 416-978-4810} }
#+LATEX_HEADE= R: \end{temphelvet}
#+LATEX_HEADER: \end{minipage}
#+LATEX_HEADER: \h= fill}
#+LATEX_HEADER: \makeatother
#+LATEX_HEADER: \newcommand{\mysig= }{
#+LATEX_HEADER: Please do not hesitate to contact me with any questio= ns or concerns.\\
#+LATEX_HEADER: Sincerely,\\
#+LATEX_HEADER: \froms= ig{\includegraphics[scale=3D1]{my-sig.png}} \\
#+LATEX_HEADER: \fromname= {Matt Price}
#+LATEX_HEADER: }
#

#+LATEX_HEADER_EXTRA:=C2=A0 = \maketitle
# #+LATEX_HEADER_EXTRA: \onehalfspacing


* Frankie<= br>I had the pleasure of teaching Frankie Goes To Hollywood in my 4th year = seminar in Spring of 1987. Frankie stood out then as now as one of the loud= est students I had ever encountered. At the same time, Frankie's work f= orced me to confront my own inability to *relax*. After years of psychother= apy, I now believe that that seminar was one of the best parts of my life.= =C2=A0 All the "trauma" Frankie caused me turn out to have been e= xcellent learning experiences.

It is thus with great pleasure that = my therapist, I mean I, recommend Frankie for your stupid fellowship.
<= br>\mysig=C2=A0

* Joey
Joey Ramone was a student in my class &qu= ot;School's out for Summer" at /Rock and Roll High School/ some ti= me in the late 1970's, I can't remember the year exactly. Since the= students burned the school down, and left me without a job, I really can&#= 39;t see why the would have asked me for a letter of reference, but I'm= so alone and desolate that I agreed to write him one. However, I really do= n't have a single good thing to say about him.=C2=A0 I know you're = not reading these letters anyway, though, so I suppose I can say whatever I= want here. That Long Island school board still owes me money!

\mysi= g



--0000000000006862e8057999d124--