From: Sharon Kimble <boudiccas@skimble.plus.com>
To: org-mode-email <emacs-orgmode@gnu.org>
Subject: org-mode -> latex
Date: Sun, 10 Apr 2016 11:58:09 +0100 [thread overview]
Message-ID: <8737qtn326.fsf@skimble.plus.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3186 bytes --]
For a long time I've wanted to write in org-mode and export it to latex,
but I've never been successful until now. So here is a yasnippet that
allows you to do it -
--8<---------------cut here---------------start------------->8---
# -*- mode: snippet -*-
# name: org2latex
# key: org2latex
# --
#+TITLE: foobar
#+LaTeX_HEADER: \usepackage[utf8]{inputenc}
#+LaTeX_HEADER: \usepackage[T1]{fontenc}
#+LaTeX_HEADER: \usepackage{palatino}
#+LaTeX_HEADER: \usepackage{fixltx2e}
#+latex_header: \usepackage[backend=biber,style=philosophy-modern,doi=true,hyperref=true,backref=true,backrefstyle=two,date=year,maxcitenames=3]{biblatex}
#+LATEX_HEADER: \addbibresource{~/foo/foo/foo.bib}
#+LATEX_HEADER: \usepackage{makeidx}
#+latex_header: \makeindex
#+latex_header: \usepackage[acronym]{glossaries}
#+latex_header: \makeglossaries
#+latex_header: \usepackage[unhide]{todo}
#+latex_header: \usepackage{everypage}
#+latex_header: \usepackage{draftwatermark}
#+latex_header: \usepackage{hyperref}
#+latex_header: \hypersetup{colorlinks,linkcolor={red},citecolor={magenta},urlcolor={blue}}
# #+options: num:nil
#+OPTIONS: toc:2
\clearpage
\renewcommand{\thesection}{}
\renewcommand{\thesubsection}{}
\renewcommand{\thesubsubsection}{}
\input{foo.glos}
\input{foo.acro}
/foo/ Your main text goes here /foo/
'glos' is your glossary file, and 'acro' is your acronyms file, and 'bib' is your biblatex references.
'foo.glos' ;; needs to be a proper latex glossary file
'foo.acro' ;; needs to be a proper latex acronym file
'foo.bib' ;; needs to be a proper latex bib file, I'm using 'JabRef' for it.
This file will accept a 'cite:foo' for biblatex references, and also '\gls{foo}' for glossary and
acronym entries, and '\index{foo}' for index entries.
You *must* give the complete path of your 'foo.bib' file as it sets up where every other file can be
found.
This works with a complete setup of 'TexLive 2015'.
\todo{This is how your 'TODO' items should appear}
\clearpage
\addcontentsline{toc}{chapter}{Glossary}
\printglossaries
\clearpage
\addcontentsline{toc}{chapter}{References}
\printbibliography
\clearpage
\addcontentsline{toc}{chapter}{Index}
\printindex
\todos
\end{document}
--8<---------------cut here---------------end--------------->8---
If you don't like something, then comment it out and do a rebuild to see
if your modification works.
To use -
a - 'C-c C-e l l' to get a latex tex file
b - Then use your favourite tex command to build it into a PDF file. I
use my 'pdfbuild' file which I've uploaded to my blog "A taste of linux".
The above template will give you a nice PDF file with a table of
contents, every page with a watermark on saying 'DRAFT', the ability to
put '\todo{comments}' in to show you what needs to be done at that
point. And if you've set them up, a bibliography, glossary and acronyms
and an index.
As they say in Parliament "I commend it to the house." :)
And I hope its useful for you?
Sharon.
--
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.92
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
reply other threads:[~2016-04-10 10:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8737qtn326.fsf@skimble.plus.com \
--to=boudiccas@skimble.plus.com \
--cc=emacs-orgmode@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.