From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Org-mode extensions used to publish a dissertation Date: Wed, 06 Aug 2014 07:38:44 -0400 Message-ID: <87r40tj15a.fsf@gmail.com> References: <87y4v3yeap.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEzbW-0007mK-Ji for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 07:42:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEzbR-0001rw-Oz for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 07:42:02 -0400 Received: from mail-ob0-x22a.google.com ([2607:f8b0:4003:c01::22a]:49362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEzbR-0001rj-Fy for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 07:41:57 -0400 Received: by mail-ob0-f170.google.com with SMTP id wp4so1683658obc.15 for ; Wed, 06 Aug 2014 04:41:57 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Joseph Vidal-Rosset Cc: Org Mode Mailing List --=-=-= Content-Type: text/plain Joseph Vidal-Rosset writes: > Many thanks Eric for this email and the attachment. > > Of course it is very useful. > > 2014-08-05 2:23 GMT+02:00 Eric Schulte : > >> Hi List, >> >> I thoroughly enjoyed using Org-mode to write my dissertation. I was >> happy to be able to export (mostly) equivalent versions of the document >> to HTML and PDF. I'd recommend using Org-mode for such a complex >> writing task to those who are either willing to hack the exporter, or >> are willing to accept an Org-mode document with inline LaTeX which only >> /really/ works with the LaTeX backend. >> >> As I fall in the former category, here are the small extensions to the >> Org-mode exporter which I found necessary. Thanks to the new exporting >> backend they were uniformly easy to implement. They are included in the >> attached elisp file. Each pagefeed (^L) in the file marks a new section >> of functionality, the sections are as follows... >> >> 1. Ignore Headlines and keep content (discussed here recently) >> 2. Multi-column Table Cells >> 3. Wide tables extend into the margins. >> 4. Wide tables squeezed within the margins >> 5. "sc" links for the \sc{} latex command >> 6. "gls" links for the \gls{} family of Glossary commands >> 7. color links >> 8. TIKZ figure links >> 9. Tie certain latex commands to the preceding word. >> 10. Fix emphasis in text export >> >> A simplified version of my Makefile is also attached. I hope someone >> finds this useful. >> >> Best, >> Eric >> > > Can you tell us how using the Makefile in order to test all these functions > for a dissertation? The Makefile and the code do not need to be used together. > I am especially interested by points 2 and 8. > For point 2 try adding the following above a wide table in an Org-mode document (after evaluating the code). #+ATTR_LaTeX: :environment wide On export this should allow your table to cut into the page margins (note: for my school I later had to undo this as there were strict rules about margins in dissertations). Point 8 is a little more involved. I prefer to convert my TIKZ figures to svg for HTML export, and keep them as raw tikz for LaTeX export. I found that the easiest way to do this (for me at least), was to keep the figures in external .tex files. I would then manually generate an svg version of these files using the tex2svg script (attached). With these files on hand, the code in Point 8 will export Org-mode text like the following. #+name: llvm-mutation #+Caption[LLVM Transformations]: Illustration of transformations over LLVM IR. These transformations require that the SSA data dependency graph be repaired after each mutation. #+TIKZ_Figure: llvm-mutation so that the file llvm-mutation.tex is included in LaTeX export wrapped in a figure, and the file llvm-mutation.svg is included as an image in HTML export. Best, Eric --=-=-= Content-Type: text/x-sh Content-Disposition: inline; filename=tex2svg #!/bin/bash # # Usage: tex2svg [source.tex] # # Generate an SVG file from a snippet of LaTeX source code. # The tex source should not be wrapped in begin/end{document}. # # Example Usage: # # $ cat tree.tex # \usetikzlibrary{trees} # \begin{tikzpicture} # \node [circle, draw, fill=red!20] at (0,0) {1} # child { node [circle, draw, fill=blue!30] {2} # child { node [circle, draw, fill=green!30] {3} } # child { node [circle, draw, fill=yellow!30] {4} }}; # \end{tikzpicture} # # $ ./tex2svg tree.tex # # $ file tree.svg # tree.svg: SVG Scalable Vector Graphics image # PACKAGES=('[usenames]{color}' '{tikz}' '{color}' '{listings}' '{amsmath}' '{fancyvrb}' '{soul}') PREAMBLE=$(cat < $TMPFILE $PREAMBLE $(cat $FIG|sed 's/\\subcaption{.*}//') $POSTAMBLE EOF htlatex $TMPFILE && rm $TMPFILE if [ -f $TMPBASE-1.svg ];then # scour -i $TMPBASE-1.svg -o $BASE.svg \ # || cp $TMPBASE-1.svg $BASE.svg cp $TMPBASE-1.svg $BASE.svg echo $BASE.svg else cp $TMPBASE.html $BASE.html echo $BASE.html fi --=-=-= Content-Type: text/plain > Best wishes , > > Jo. -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D (see https://u.fsf.org/yw) --=-=-=--