From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel Goldin" Subject: Re: Latex exporting Date: Wed, 6 Aug 2008 21:08:39 -0700 Message-ID: References: <20080729234636.GA9366@thinkpad.adamsinfoserv.com> <20080806213241.GG24521@thinkpad.adamsinfoserv.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1414185305==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQwnr-0006yH-9B for emacs-orgmode@gnu.org; Thu, 07 Aug 2008 00:08:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQwnq-0006vz-KY for emacs-orgmode@gnu.org; Thu, 07 Aug 2008 00:08:42 -0400 Received: from [199.232.76.173] (port=40656 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQwnq-0006vu-98 for emacs-orgmode@gnu.org; Thu, 07 Aug 2008 00:08:42 -0400 Received: from rv-out-0708.google.com ([209.85.198.244]:10467) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KQwnp-0005sA-MM for emacs-orgmode@gnu.org; Thu, 07 Aug 2008 00:08:42 -0400 Received: by rv-out-0708.google.com with SMTP id k29so255804rvb.6 for ; Wed, 06 Aug 2008 21:08:39 -0700 (PDT) In-Reply-To: <20080806213241.GG24521@thinkpad.adamsinfoserv.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1414185305== Content-Type: multipart/alternative; boundary="----=_Part_9217_2393797.1218082119363" ------=_Part_9217_2393797.1218082119363 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you so much for sharing this! d. On Wed, Aug 6, 2008 at 2:32 PM, Russell Adams wrote: > On Tue, Jul 29, 2008 at 06:46:37PM -0500, Russell Adams wrote: > > I've finally embarked upon a journey of exploration, attempting to > > publish quality PDF's via org and latex. > > > > As a follow up to my command line tricks, I want to share how to get > headers and footers into Latex exports. > > First, the default latex exporter uses A4 paper, I need letter. To > change that I use the following in my .emacs to add a custom export > type, "myarticle". > > This includes expanding the default margins via the geometry package, > and sets up packages I will use later like fancyhdr and lastpage. I > also include a default footer on my work, which includes the filename > and date, page numbering, and copyright statement with current year. > > ~/.emacs ------------------------------------------------------------ > > (setq org-export-latex-classes (cons '("myarticle" > "% BEGIN My Article Defaults > \\documentclass[10pt,letterpaper]{article} > > \\usepackage[letterpaper,includeheadfoot,top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry} > \\usepackage[utf8]{inputenc} > \\usepackage[T1]{fontenc} > \\usepackage{hyperref} > \\usepackage{lastpage} > \\usepackage{fancyhdr} > \\pagestyle{fancy} > \\renewcommand{\\headrulewidth}{1pt} > \\renewcommand{\\footrulewidth}{0.5pt} > > % Default footer > \\fancyfoot[L]{\\small \\jobname \\\\ \\today} > \\fancyfoot[C]{\\small Page \\thepage\\ of \\pageref{LastPage}} > \\fancyfoot[R]{\\small \\copyright \\the\\year\\ Me} > % END My Article Defaults > > " > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}") > ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) > > org-export-latex-classes)) > > ------------------------------------------------------------ > > To use this custom type I add this as the first line in my Org file: > > #+LaTeX_CLASS: myarticle > > Further customization is easy using a local variables block at the end > of my file. > > End of file.org -------------------------------------------------- > > #+ Local Variables: > #+ org-export-latex-title-command: "" > #+ org-export-latex-append-header: "\ > #+ \\usepackage{graphicx} > #+ \\usepackage{multicol} > #+ \\geometry{headheight=47pt} > #+ \\fancyhead[L]{\\LARGE This is the header title} > #+ \\fancyfoot[L]{\\small Overridden filename\\\\ \\today} > #+ " > #+ End: > ------------------------------------------------------------ > > Changing the title command means no title page is created, so I must > make my own. Omitting that line will create the normal title page. > > Other packages I include via the append header variable are graphicx > for PNG support, multicol for two columns, overriding the page header > height in case I get a warning its too tall, and new headers to > override the defaults (ie: I want something better than a filename). > > I'm exporting to latex via a Makefile, using the command line tricks I > posted earlier. The Makefile is attached. > > I've attached a sample org file and its output PDF using these > settings, because one of my frustrations learning latex has been the > lack of finished output for examples. ;] > > Enjoy! > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEARECAAYFAkiaGHkACgkQEVTgGBFg3LPwcQCeJMBRNJhDujh1f8HIt0x+3jY2 > A58AoMjnNFTPvjzU7xYRj+lAtqymxB7J > =9EH5 > -----END PGP SIGNATURE----- > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > -- Daniel Goldin 213.926.1960 ------=_Part_9217_2393797.1218082119363 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Thank you so much for sharing this!

d.

On Wed, Aug 6, 2008 at 2:32 PM, Russell Adams <RLAdams@adamsinfoserv.com> wrote:
On Tue, Jul 29, 2008 at 06:46:37PM -0500, Russell Adams wrote:
> I've finally embarked upon a journey of exploration, attempting to
> publish quality PDF's via org and latex.
>

As a follow up to my command line tricks, I want to share how to get
headers and footers into Latex exports.

First, the default latex exporter uses A4 paper, I need letter. To
change that I use the following in my .emacs to add a custom export
type, "myarticle".

This includes expanding the default margins via the geometry package,
and sets up packages I will use later like fancyhdr and lastpage. I
also include a default footer on my work, which includes the filename
and date, page numbering, and copyright statement with current year.

~/.emacs ------------------------------------------------------------

(setq org-export-latex-classes (cons '("myarticle"
    "% BEGIN My Article Defaults
\\documentclass[10pt,letterpaper]{article}
\\usepackage[letterpaper,includeheadfoot,top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{hyperref}
\\usepackage{lastpage}
\\usepackage{fancyhdr}
\\pagestyle{fancy}
\\renewcommand{\\headrulewidth}{1pt}
\\renewcommand{\\footrulewidth}{0.5pt}

% Default footer
\\fancyfoot[L]{\\small \\jobname \\\\ \\today}
\\fancyfoot[C]{\\small Page \\thepage\\ of \\pageref{LastPage}}
\\fancyfoot[R]{\\small \\copyright \\the\\year\\  Me}
% END My Article Defaults

"
    ("\\section{%s}" . "\\section*{%s}")
    ("\\subsection{%s}" . "\\subsection*{%s}")
    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
    ("\\paragraph{%s}" . "\\paragraph*{%s}")
    ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
                                                                        org-export-latex-classes))

------------------------------------------------------------

To use this custom type I add this as the first line in my Org file:

#+LaTeX_CLASS: myarticle

Further customization is easy using a local variables block at the end
of my file.

End of file.org --------------------------------------------------

#+ Local Variables:
#+ org-export-latex-title-command: ""
#+ org-export-latex-append-header: "\
#+ \\usepackage{graphicx}
#+ \\usepackage{multicol}
#+ \\geometry{headheight=47pt}
#+ \\fancyhead[L]{\\LARGE This is the header title}
#+ \\fancyfoot[L]{\\small Overridden filename\\\\ \\today}
#+ "
#+ End:
------------------------------------------------------------

Changing the title command means no title page is created, so I must
make my own. Omitting that line will create the normal title page.

Other packages I include via the append header variable are graphicx
for PNG support, multicol for two columns, overriding the page header
height in case I get a warning its too tall, and new headers to
override the defaults (ie: I want something better than a filename).

I'm exporting to latex via a Makefile, using the command line tricks I
posted earlier. The Makefile is attached.

I've attached a sample org file and its output PDF using these
settings, because one of my frustrations learning latex has been the
lack of finished output for examples. ;]

Enjoy!

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkiaGHkACgkQEVTgGBFg3LPwcQCeJMBRNJhDujh1f8HIt0x+3jY2
A58AoMjnNFTPvjzU7xYRj+lAtqymxB7J
=9EH5
-----END PGP SIGNATURE-----

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




--
Daniel Goldin
213.926.1960
------=_Part_9217_2393797.1218082119363-- --===============1414185305== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1414185305==--