<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/" >
<channel>
<title>pages tagged latex</title>
<link>http://tychoish.com/tag/latex/</link>
<description>tychoish</description>
<item>
	
	<title>Build System for Novel Writing</title>
	
	
	  <guid>http://tychoish.com/code/novel-makefile/</guid>
	
	<link>http://tychoish.com/code/novel-makefile/</link>
	
	
	<category>/tag/build-engineering</category>
	
	<category>/tag/code</category>
	
	<category>/tag/latex</category>
	
	<category>/tag/software-development</category>
	
	
	<pubDate>Sun, 22 Jul 2012 21:43:35 -0400</pubDate>
	<dcterms:modified>2012-07-29T18:28:38Z</dcterms:modified>
	
	<description>&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;

&lt;p&gt;This makefile-based build system provides a bit of extra
gloss/configuration for using &lt;a href=&quot;http://sphinx.pocoo.org/&quot;&gt;Sphinx&lt;/a&gt; and
&lt;a href=&quot;http://pypi.python.org/pypi/sffms/&quot;&gt;sffms&lt;/a&gt; to build conventional
manuscripts and websites for novel-like hypertexts.&lt;/p&gt;

&lt;h2 id=&quot;usagenotes&quot;&gt;Usage Notes&lt;/h2&gt;

&lt;p&gt;This makefile is derives from the default
&lt;a href=&quot;http://sphinx.pocoo.org/&quot;&gt;Sphinx&lt;/a&gt; makefile, with a number of tweaks
that I&#39;ve been making to this configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The PDF build system is much abbreviated, and included in the main
makefile. This is a bit less conservative than the default for this
file, but it works just as well in most situations. The output is
also much less verbose.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The build is a lot less noisy. Errors are still printed, which makes
it great for automated build systems (i.e. continuous integration.)  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sphinx will build two sites, one, in an  &lt;code&gt;outline/&lt;/code&gt; directory would
store the outline and working notes of a story, while the other in a
&lt;code&gt;source/&lt;/code&gt; directory would store the actual text of the novel. *In
practice, I also seem to keep another &lt;code&gt;notes/&lt;/code&gt; directory around for
less formal and more early stage note taking.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There&#39;s a post-processing script for sffms that makes section
headers &lt;em&gt;work right&lt;/em&gt; for my usual structure. Tweak or remove at your
discretion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You must install &lt;a href=&quot;http://sphinx.pocoo.org/&quot;&gt;Sphinx&lt;/a&gt; and
&lt;a href=&quot;http://pypi.python.org/pypi/sffms/&quot;&gt;sffms&lt;/a&gt; and have them accessible
to the build process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;code&quot;&gt;Code&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;File:&lt;/strong&gt; &lt;code&gt;makefile&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; SPHINXOPTS    = -c ./
 SPHINXBUILD   = sphinx-build
 PAPER        =
 BUILDDIR      = build
 SFFMS_CLEANUP = bin/sffms-cleanup
 TITLE = name.title-of-book.pdf

 # Internal variables.
 PAPEROPT_a4    = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
 ALLSPHINXOPTS  = -q -d &amp;#036;(BUILDDIR)/doctrees &amp;#036;(PAPEROPT_&amp;#036;(PAPER)) &amp;#036;(SPHINXOPTS)

 .PHONY: html sffms dirhtml singlehtml ms outline outline-single outline-pdf help
 .DEFAULT_GOAL = help

 help:
    @echo &quot;A build system for generating novels and outlines using &#39;Sphinx&#39; and &#39;sffms.&#39;&quot;
    @echo &quot;All build products are located within &#39;&amp;#036;(BUILDDIR).&#39; Some related scritps are in,&quot;
    @echo &quot;&#39;bin/&#39;. See &amp;lt;http://tychoish.com/code/novel-makefile/&amp;gt; for more information.&quot;
    @echo &quot;&quot;
    @echo &quot;Targets:&quot;
    @echo &quot;&quot;
    @echo &quot;  outline - builds an html website of the outline.&quot;
    @echo &quot;  outline-single - builds a single html page version of the outline.&quot;
    @echo &quot;  outline-pdf - builds a pdf of the outline using Sphinx&#39;s LaTeX builder.&quot;
    @echo &quot;&quot;
    @echo &quot;  html - builds a html site of the text, with each page in its own file.&quot;
    @echo &quot;  dirhtml - builds a html site with each page an index.html, in a directory.&quot;
    @echo &quot;  singlehtml - builds the text in a single page.&quot;
    @echo &quot;&quot;
    @echo &quot;  ms - builds an sffms styled manuscript PDF named &amp;#036;(TITLE)&quot;
    @echo &quot;  ms-tex - builds and processes a sffms TeX file.&quot;
    @echo &quot;&quot;
    @echo &quot;  clean - removes &amp;#036;(BUILDDIR)/&quot;

 #
 # Outline Generation
 #

 outline:
    &amp;#036;(SPHINXBUILD) -b html &amp;#036;(ALLSPHINXOPTS) outline &amp;#036;(BUILDDIR)/outline
    @echo &quot;[OUTLINE] (html) build complete.&quot;
 outline-single:
    &amp;#036;(SPHINXBUILD) -b singlehtml &amp;#036;(ALLSPHINXOPTS) outline &amp;#036;(BUILDDIR)/outline-single
    @echo &quot;[OUTLINE] (single-html) build complete.&quot;
 outline-pdf:
    &amp;#036;(SPHINXBUILD) -b latex &amp;#036;(ALLSPHINXOPTS) outline &amp;#036;(BUILDDIR)/outline-pdf
    @echo &quot;[OUTLINE] pdf build complete.&quot;

 #
 # Sphinx (HTML) Build System - Novel
 #

 html:
    &amp;#036;(SPHINXBUILD) -b html &amp;#036;(ALLSPHINXOPTS) source &amp;#036;(BUILDDIR)/html
    @echo &quot;[HTML] build complete.&quot;
 dirhtml:
    &amp;#036;(SPHINXBUILD) -b dirhtml &amp;#036;(ALLSPHINXOPTS) source &amp;#036;(BUILDDIR)/dirhtml
    @echo &quot;[DIR] build complete.&quot;
 singlehtml:
    &amp;#036;(SPHINXBUILD) -b singlehtml &amp;#036;(ALLSPHINXOPTS) source &amp;#036;(BUILDDIR)/singlehtml
    @echo &quot;[SINGLE] build complete.&quot;

 #
 # Manuscript Build System - Novel
 #
 SFFMS_CLEANUP = bin/sffms-cleanup

 &amp;#036;(BUILDDIR)/sffms/index.tex:sffms
    @&amp;#036;(SFFMS_CLEANUP) &amp;#036;(BUILDDIR)/sffms/*tex
    @echo &quot;[SFFMS] tex santized.&quot;
 &amp;#036;(BUILDDIR)/sffms/&amp;#036;(TITLE):&amp;#036;(BUILDDIR)/sffms/index.pdf
    @mv &amp;#036;&amp;lt; &amp;#036;@
    @echo &quot;[SFFMS] pdf renamed. See: &amp;#036;@&quot;
 sffms:
    &amp;#036;(SPHINXBUILD) -b sffms &amp;#036;(ALLSPHINXOPTS) source &amp;#036;(BUILDDIR)/sffms
    @echo &quot;[SFFMS] tex generated.&quot;

 ms:&amp;#036;(BUILDDIR)/sffms/&amp;#036;(TITLE)
 ms-tex:&amp;#036;(BUILDDIR)/sffms/index.tex

 #
 # PDF Build System
 #

 PDFLATEXCOMMAND = TEXINPUTS=&quot;.:&amp;#036;(BUILDDIR)/sffms/:&quot; pdflatex --interaction batchmode --output-directory &amp;#036;(BUILDDIR)/sffms/

 %.pdf:%.tex
    @&amp;#036;(PDFLATEXCOMMAND) &amp;#036;(LATEXOPTS) &#39;&amp;#036;&amp;lt;&#39; &amp;gt;|&amp;#036;@.log
    @echo &quot;[PDF]: (1/3) pdflatex &amp;#036;&amp;lt;&quot;
 #  @makeindex -s &amp;#036;(BUILDDIR)/latex/python.ist &#39;&amp;#036;(basename &amp;#036;&amp;lt;).idx&#39; &amp;gt;&amp;gt;&amp;#036;@.log 2&amp;gt;&amp;amp;1
 #  @echo &quot;[PDF]: (2/3) Indexing: &amp;#036;(basename &amp;#036;&amp;lt;).idx&quot;
    @&amp;#036;(PDFLATEXCOMMAND) &amp;#036;(LATEXOPTS) &#39;&amp;#036;&amp;lt;&#39; &amp;gt;&amp;gt;&amp;#036;@.log
    @echo &quot;[PDF]: (2/3) pdflatex &amp;#036;&amp;lt;&quot;
    @&amp;#036;(PDFLATEXCOMMAND) &amp;#036;(LATEXOPTS) &#39;&amp;#036;&amp;lt;&#39; &amp;gt;&amp;gt;&amp;#036;@.log
    @echo &quot;[PDF]: (3/3) pdflatex &amp;#036;&amp;lt;&quot;
    @echo &quot;[PDF]: see &#39;&amp;#036;@.log&#39; for a full report of the pdf build process.&quot;

 #
 # Meta
 #

 clean:
    rm -rf build
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The following file, used above, does a little bit of post-processing
that makes using sffms with longer more structured works &lt;em&gt;possible.&lt;/em&gt;
Use, or not, as you wish:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File:&lt;/strong&gt; &lt;code&gt;bin/sffms-cleanup&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; #!/bin/zsh

 if [ &quot;`uname`&quot; = &quot;Linux&quot; ]; then
    SED_ARGS=&#39;-i -r&#39;
 elif [ &quot;`uname`&quot; = &quot;Darwin&quot; ]; then
    SED_ARGS=&#39;-i &quot;&quot; -E&#39;
 else
    echo &quot;You&#39;re probably using an unsupported system. Do some testing, edit this file, and try again.&quot;
    exit 1
 fi

 SFFMS_FILE=&amp;#036;1

 while [ `pcregrep -c -M &quot;^.chapter(.*)\{(.*)\}\n+.newscene&quot; &amp;#036;SFFMS_FILE` -gt 0 ]; do
     sed &amp;#036;SED_ARGS &#39;:a;N;&amp;#036;!ba;s@(.)chapter.*\{(.*)\}\n{2}.newscene@\1chapter{\2}@m&#39; &amp;#036;SFFMS_FILE
 done
&lt;/code&gt;&lt;/pre&gt;
</description>
	
	
</item>
<item>
	
	<title>A LaTeX Build System</title>
	
	
	  <guid>http://tychoish.com/latex-system/</guid>
	
	<link>http://tychoish.com/latex-system/</link>
	
	
	<category>/tag/latex</category>
	
	<category>/tag/productivity</category>
	
	
	<pubDate>Sat, 14 May 2011 13:18:20 -0400</pubDate>
	<dcterms:modified>2012-06-23T15:21:32Z</dcterms:modified>
	
	<description>&lt;p&gt;I&#39;ve been throwing around the idea of creating a LaTeX-based document
production service for people and work groups that produce a lot of
paper documents. I think lawyers, academics, and PR-types are ideal
examples, but I think the basic approach could be extrapolated to
other kinds of work. The core of this proposal is that it takes a
traditionally unstructured domain (document editing and generation,)
and adds structure and infrastructure to provide software and service &lt;/p&gt;

&lt;p&gt;LaTeX is a great system for making great documents: they look great
and it&#39;s easy to build templates and styles so that your documents
always look consistent. These features are the result of LaTeX&#39;s
structure. The downside is the LaTeX tool chain is pretty big and
editing is in a source format which may be a bit complicated for the
uninitiated. &lt;/p&gt;

&lt;h2 id=&quot;components&quot;&gt;Components&lt;/h2&gt;

&lt;p&gt;Each of the following sections explain one of the basic components of
such a system, along with a basic idea for a solution, and some
rationale of why I propose each aspect of the &quot;system.&quot; &lt;/p&gt;

&lt;p&gt;To be fair, I envision this as a lose collection of associated tools,
rather than a single application. &quot;Unix-like&quot; or &quot;modular&quot; as you
please. &lt;/p&gt;

&lt;h3 id=&quot;buildsystem&quot;&gt;Build System&lt;/h3&gt;

&lt;p&gt;As a web service, you need something that will take input files that
include bibliographies or citation lists, auxiliary style
specifications, and source files, and output PDFs (and possibly HTML.)
One of the ways to make LaTeX usable, I think, is to take out all of
the idiosyncrasies around the build process and have a stable,
and consistent build environment. This gets rid of weird situations
where you have to intuitively know when you have to run LaTeX four
times. Between cutting out the lengthy installation and configuration
process, and simplifying the build workflow, the win is enormous. &lt;/p&gt;

&lt;p&gt;While there&#39;s no reason that one couldn&#39;t develop such a tool to run
on a single machine, the dependencies would be complicated, and if you
were deploying this for a company (say,) it makes sense to centralize
the build process (and templates) and as long as the build
service/infrastructure is freely available, there&#39;s no functional
reason to &lt;em&gt;not&lt;/em&gt; have it as a service.&lt;/p&gt;

&lt;p&gt;In terms of implementation, I think there needs to be two main
interfaces. The first is a website that has a box that you drag files
onto, and then generates a PDF and lets you download that as a
file. The second is a RESTful-style interface that can be easily
integrated with text editors so that you can issue a command and have
a PDF open a few moments later as if you ran &lt;code&gt;pdflatex&lt;/code&gt; locally. I can
imagine other nifty extensions of this basic &quot;pipe&quot;
framework. LaTeX-by-email, document sharing, personal document
libraries, and so forth. &lt;/p&gt;

&lt;p&gt;Also, I think it ought to go without saying that the system should use
&lt;a href=&quot;http://pybtex.sourceforge.net/&quot;&gt;pybtex&lt;/a&gt; and YAML formating. The
source files themselves should &lt;em&gt;basically&lt;/em&gt; be standard LaTeX, but I
think each document should have a YAML header for configuration
information for the build process. With some optional flags in the
header, one could also configure the server provide some level of
pre-processing to make the LaTeX a bit easier to manage. &lt;/p&gt;

&lt;h3 id=&quot;editingenvironment&quot;&gt;Editing Environment&lt;/h3&gt;

&lt;p&gt;A great editing environment for LaTeX (and really anything,) can make
all the difference in the world between a good editing
experience. While I envision the basic files to be basic LaTeX files
with a YAML header (possible providing a user-configurable level of
pre-processing, to make some mundane aspects of LaTeX easier to
handle,) I think that it&#39;d be best if the system included a
pre-configured editing system. &lt;/p&gt;

&lt;p&gt;My inclination is to use emacs as a basic framework or foundation for
the editing platform. Take the basic emacs that we all know and love,
and wrap it all up with an installer, some basic AUCTeX,
&lt;a href=&quot;http://www.gnu.org/software/auctex/&quot;&gt;configuration&lt;/a&gt;, yasnippet, some glue
for the build service, and a few commands and menu-bar items and
bundle it all together. The end result is an editing environment that
is potentially really powerful and pretty easy to customize for specific
uses. The best part is that all of the hard work of making an editor
is done. How cool is that?&lt;/p&gt;

&lt;h3 id=&quot;temptingstructure&quot;&gt;Tempting Structure&lt;/h3&gt;

&lt;p&gt;The thing I learned from using LaTeX was how to create an use
templates to achieve more consistent products with less work all
around. The first document you produce with LaTeX takes forever and
can be pretty painful. Every document thereafter is perfectly
identical and delightfully simple to produce. By controlling the build
system and the editing environment, it becomes &lt;em&gt;crazy&lt;/em&gt; easy to do
awesome things with templates. In addition to simplifying some
syntactic forms with the build system, the build system can become a
platform for offering access to templates. Providing and managing
templates in this way is really the crown of the whole system,
because: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;templates allow users, primarily organizations, to produce highly
consistent documents. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;templates allow document creators to focus on content rather than
format. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;templates allow edits to existing documents to be made more quickly
and cleanly without affecting document style.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;templates allow content to be re-purposed into multiple forms
easily. The same content can form a memo or letter and a
presentation, which further reduces the amount of work required to
produce collateral.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;value&quot;&gt;Value&lt;/h2&gt;

&lt;p&gt;In general the value can be summarized as: better looking documents,
more coherent workflows, with less work per-document, after a
reasonable learning curve. Information workers in some industries and
professions will find more value from systems like these: media, law,
public relations, and academia spring to mind as fertile grounds for
this kind of technology. At the same time, every industry produces
documents and collateral of some kind and having better publication
tools is useful everywhere.&lt;/p&gt;

&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;

&lt;p&gt;I&#39;ve compiled a few links &lt;a href=&quot;http://tychoish.com/tag/latex/../../latex-system/links/&quot;&gt;links&lt;/a&gt; to projects that are doing
complementary and related work.&lt;/p&gt;
</description>
	
	
</item>
<item>
	
	<title>Covered In LaTeX</title>
	<dcterms:creator>tycho garen</dcterms:creator>
	
	
	  <guid>http://tychoish.com/rhizome/covered-in-latex/</guid>
	
	<link>http://tychoish.com/rhizome/covered-in-latex/</link>
	
	
	<category>/tag/cyborg</category>
	
	<category>/tag/latex</category>
	
	<category>/tag/productivity</category>
	
	
	<pubDate>Tue, 31 Aug 2010 00:00:00 -0400</pubDate>
	<dcterms:modified>2012-06-23T15:21:32Z</dcterms:modified>
	
	<description>&lt;p&gt;Although I haven&#39;t used LaTeX much in the past few years, it was one
of the primary tools that hastened my shift to using GNU/Linux full
time. Why? I&#39;d grown sick of fighting with document preparation and
publishing systems (e.g. Microsoft Word/Open Office), and had started
using LaTeX on my Mac to produce all of my papers and documents that
needed to be output to paper-formats. Why switch?  Because after a
certain point of having every tool you use be Free software (because
it&#39;s better!), it becomes easier and more cost effective to just jump
the gun and by commodity hardware and use a system that&#39;s designed to
support this kind of software (managing a large selection lots of free
software packages on OS X can become cumbersome). &lt;/p&gt;

&lt;p&gt;So why LaTeX? What&#39;s the big deal? Why do I care now? Well... &lt;/p&gt;

&lt;p&gt;LaTeX is a very usable front-end/set of macros for the TeX typesetting
engine. Basically, you write text files in a particular way, and then
run LaTeX (or &lt;code&gt;pdflatex&lt;/code&gt;) and it generates the &lt;em&gt;best&lt;/em&gt; looking PDF in
the world of your document. You get full control over things that
matter (layout, look and feel) and you don&#39;t have to worry about
things that ought to be standard (titles, headlines, citations with
BibTeX, page numbering, hyphenation). The best part, however, is that
once you figure out how to generate a document correctly once, &lt;em&gt;you
never have to figure it out again.&lt;/em&gt; Once you realize that most of the
things you need to output to paper are in the same format, you can use
the same template and be able to generate consistently formated
documents automatically. There&#39;s a &quot;compile&quot; step in the document
production process, which means changes aren&#39;t often immediately
recognizable, but I don&#39;t think this is a major obstacle. &lt;/p&gt;

&lt;p&gt;Word processing and document preparation is a critical component of
most common computer users. At least, I&#39;d assume so, though I don&#39;t
have good numbers on the subject. In any case, I think it might be an
interesting project to see how teaching people how to use LaTeX might
both improve the quality of their work, and also the way that they&#39;re
able to work. It&#39;s advanced, and a bit confusing at first, but I&#39;d
suspect that once you got over the initial hump LaTeX presents a more
simple and consistent interface: you only get what you tell it to give
you and you only see the functionality that you know about. This might
make the discovery of new features more difficult, but it doesn&#39;t
limit functionality. &lt;/p&gt;

&lt;p&gt;I&#39;m not sure that this post is the right space to begin a lesson or
series on getting started with LaTeX, but I think as a possible teaser
(if there&#39;s interest) that the proper stack for getting started with
LaTeX would consist of: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A TeXlive distribution. You need the basic tool kit including
pdflatex, TeX, Metafont, LaTeX, and BibTeX. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Text Editor with LaTeX support: emacs, TextMate, etc. Plain text
can be difficult and cumbersome to edit unless you have the right
tools for the job, which include a &lt;em&gt;real&lt;/em&gt; text editor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some sort of macro or snippet expansion system. TeX is great. But
it&#39;s also somewhat verbose, and having an easy way to insert text
into your editing environment, both for templates but also for
general operations (emphasis, notes, etc.) is incredibly useful, and
reduces pain greatly. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A template management system. This probably needn&#39;t be a formal
software system, but just something to organize and store the basic
templates that you will use. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the rest is just learning curve and practice. Onward and Upward!&lt;/p&gt;
</description>
	
	
</item>

</channel>
</rss>
