From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sharon Kimble Subject: org-mode -> latex Date: Sun, 10 Apr 2016 11:58:09 +0100 Message-ID: <8737qtn326.fsf@skimble.plus.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apD4Q-0000AN-9x for emacs-orgmode@gnu.org; Sun, 10 Apr 2016 06:58:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apD4N-0006nf-3o for emacs-orgmode@gnu.org; Sun, 10 Apr 2016 06:58:22 -0400 Received: from avasout05.plus.net ([84.93.230.250]:40107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apD4M-0006nB-UF for emacs-orgmode@gnu.org; Sun, 10 Apr 2016 06:58:19 -0400 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: org-mode-email --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 - =2D-8<---------------cut here---------------start------------->8--- # -*- mode: snippet -*- # name: org2latex # key: org2latex # -- #+TITLE: foobar #+LaTeX_HEADER: \usepackage[utf8]{inputenc} #+LaTeX_HEADER: \usepackage[T1]{fontenc}=20 #+LaTeX_HEADER: \usepackage{palatino} #+LaTeX_HEADER: \usepackage{fixltx2e} #+latex_header: \usepackage[backend=3Dbiber,style=3Dphilosophy-modern,doi= =3Dtrue,hyperref=3Dtrue,backref=3Dtrue,backrefstyle=3Dtwo,date=3Dyear,maxci= tenames=3D3]{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=3D{red},citecolor=3D{magen= ta},urlcolor=3D{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' i= s 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 wher= e every other file can be found. This works with a complete setup of 'TexLive 2015'.=20 \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} =2D-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. =2D-=20 A taste of linux =3D http://www.sharons.org.uk TGmeds =3D http://www.tgmeds.org.uk Debian 8.4, fluxbox 1.3.7, emacs 25.0.92 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJXCjHCAAoJEDaBgBkK+INbXZAP/iqVV5IyGeizafPy6X0T7uwc lbANziD6mo9EBitwcVV4Z8GA4OtaWH555IepzMqY6CqAkcREDdMhkcdG21/FxDbQ vS0BPOvzuXe4VnVA+oLG52k4WZDY328JCh/VkbnamIlXJl9TF9Cl4E2NS/FimuOZ oTz9vdphd0tu0Y3E+87BWJ8u+PXWjYB6DII3E1VblLlVsST9p6lIoUPFzI335J+R 5UryB4mWeZt/KgmSjdSKR6cWyg/AH/NBbpZT7QcJlP9oTZlFoYeBRkWdKel4cJAw 2LUuPlxsI8VQta8IesAUf2q7lADluCV72Zudip41ZjBy0R/dbWsKG1z2bxzKPUQk SRN1Q+/VCbIU+HmXySYNRY6apEsRHLFvTxdTeBzbU02zLG0ZlggjvodkLZWDuvgn ph2nc9vZ+Ud4t3EYjGxuR0O3NQcZW92/Z5MkEYq4J2rWII2ImwQSIPeRUQoSa4hD iNPII0OHjQzJ3SzEUeuj4r+ZaDZbXsARzxHdiGa98FHfyWI861AXkOCdMBwmR7dM R5CMP6+Oc/Vf+KjZO/3ecFKjtmwpDxShHUvSmJvg57yZ5E5qxgm1N8TxuGm37D1o Z+mLKnd9arrDGZnlcjwoMCDiYVN+fYWeYFYfk/fcecGiWt/KkjsjDKOR4X6qyMwM jl3FBEs+mk3H8wYKpEMx =QRE+ -----END PGP SIGNATURE----- --=-=-=--