[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more LaTeX (was: Re: emacs and beginning of lines)

From: Marcin Borkowski
Subject: Re: more LaTeX (was: Re: emacs and beginning of lines)
Date: Wed, 10 Sep 2014 02:12:17 +0200

Dnia 2014-09-09, o godz. 22:02:02
Emanuel Berg <address@hidden> napisaƂ(a):

> Marcin Borkowski <address@hidden> writes:
> >>> If you use a VCS and look at a diff from time to >
> >>> time, filling might be a bad idea. (Though >
> >>> visual-line-mode is not helpful then, either.)
> >> Indeed, there are many times - notably all
> >> programming and configuration modes - where you
> >> don't want filling and absolutely not automatically
> >> so.
> >
> > Is LaTeX mode a programming one? ;-)
> LaTeX is definitely programming, but it is not
> general-purpose programming (like C), or data-oriented
> programming (like SQL), or anything like that.
> I think the term is "domain-specific" and the domain is
> typesetting documents and arranging material in
> structured ways.
> When I wrote what you quote, I meant general-purpose,
> like C. But now that you say it, LaTeX offers a
> borderline case: the programming parts of it, I don't
> want to be filled, but I want the text part of it to be
> (perhaps with the modification I suggested).

How do you decide which is which?

> HTML on the other hand, I don't consider
> programming but as with LaTeX, the text parts of an
> .html file I would like filled, but not the tags that
> set (and should so reflect) structure.


Doesn't the difference between TeX and HTML you mean here lie in the
fact that TeX is Turing-complete and HTML is not?

See here (when you run out of real problems, that is;-)):

Also, search for "basix" on that very page.  (Only for people with
strong nerves.)

And there are a few numerical engines, a few drawing libraries, one
regex library and *a lot* of other things /programmed/ in TeX.  (I
read an article about some LaTeX code generating tests in differential
equations.  With solutions.  Though it didn't actually solve them, it
first chose the solutions (pseudo-randomly) and then generated an
equation with that very solution.)  So while it is indeed a
domain-specific language, it /can/ be coerced to doing really strange
things.  (Also, as a side-note for Lispers: TeX has macros which are
"expanded", but it doesn't have functions which would be "called".
This means in particular that you don't need loops in the language -
you can /implement/ them.  And you can change the order of expansion,
which is left-to-right by default, to a right-to-left one, though only
temporarily, for the next two tokens.  Actually, this is extremely
useful.  And btw: macro expansion happens at a different moment than
/assignments/, that is, state changes.  And writing to external files
happens at yet another moment (at least usually, it doesn't have to if
you explicitly demand that it doesn't).  And due to the catcode
mechanism you can pretty much redefine all of TeX syntax on the fly.
One guy used this to build an XML parser /entirely in TeX/.  Yes, TeX
is /not/ a "normal" programming language.)

> > And Org's tables - exportable to LaTeX & HTML - are
> > really, really great. One time I had a table in LaTeX
> > - two rows and lots of columns - and needed to
> > transpose it. Good luck, unless you convert it to
> > Org-mode (manually, but fast due to string
> > replacing), then transpose it in Org (one command)
> > and export back to LaTeX's tabular.
> Stuff like that is great - when they work :)

Also true.

Marcin Borkowski
Adam Mickiewicz University

reply via email to

[Prev in Thread] Current Thread [Next in Thread]