[Chugalug] Programmatically generating LaTeX

Dan Lyke danlyke at flutterby.com
Thu Aug 22 23:14:43 UTC 2013


On Thu, 22 Aug 2013 18:41:29 -0400
"Robert A. Kelly III" <bluethegrappler at gmail.com> wrote:
> What are the usual or recommended ways of handling this? I'm sure it
> is something that has been addressed before as I have heard many
> times of LaTeX being generated programmatically to generate PDF
> reports, by Emacs calendar and org-mode, etc.

I think a good portion of this is related to issues that come up
whenever someone tries to write a markdown-like processor. I've got
such a processor that makes a bunch of assumptions, I use similar code
on both Flutterby.com and Flutterby.net, but it occasionally gets
things wrong.

One of the problems is that I don't have explicit ways in the language
that gets parsed to override certain idioms. For instance, at some
point I put in a _underscore quoted_ string, which is great, things
which are underscore quoted get surrounded with the "<cite>" tag and
linked to a Wiki facility...

... except that if someone writes some C code that has an expression
that uses variables with leading and trailing underscores...

   int abc_ = 8;
   int _xyz = 4;
   a = _xyz - abc_

All of a sudden that's no longer code that can be copied and pasted,
'cause  some of those underscores disappear into <cite> tags.

On Flutterby.com, I give everyone the option of just using straight
HTML and not trying to interpret the text context stuff.

On Flutterby.net, I haven't figured out what to do yet. I want to do
more of this kind of thing (ie: No reason that I can't turn "4th" into
"4<sup>th</sup>"), but I need override tags, and the language starts to
get kinda complex, and...

If I were smart at the very least I'd offer up some sort of override
tag, but it also becomes hard to proof-read and notice that, for
instance, some of those dashes are a little narrow...

So this starts to become an "autocorrect" problem. Except that at least
there you get real-time feedback, on mine you wait 'til the page is
written and you mash "submit".

Another way to go about this, and probably a smarter one, is to promote
semantic tagging, ie: "<phonenumber>123-345-6789</phonenumber>" which
can then be rendered in a phone number style, with whatever that means
for dashes.

Personally based on all of the upside-down and contained-in-circles and
other variations on standard Latin alphabets I'm seeing, I think
Unicode is a step a few thousand years backwards to heiroglyphs, but
then most users are probably stuck at a pre-CE level of
sophistication...

Dan


More information about the Chugalug mailing list