* org-mode -> latex
@ 2016-04-10 10:58 Sharon Kimble
0 siblings, 0 replies; only message in thread
From: Sharon Kimble @ 2016-04-10 10:58 UTC (permalink / raw)
To: org-mode-email
[-- 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 --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-10 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-10 10:58 org-mode -> latex Sharon Kimble
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.