Mailing List Archive


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

Re: [tlug] Poll: OpenOffice or LibreOffice?



On 2014年05月21日 11:14, Raymond Wan wrote:
> TeX is really troublesome ... no arguments there!  Maybe because of
> the existence of LaTeX, documentation of TeX on the Internet is
> minimal (in comparison).

The definitive TeX documentation is The TeXbook [1].

> Honestly, I don't know what is so special about haiku.  I would guess
> that a haiku is a small part of a larger document.  As a result, it
> would probably be more of a package and not a class.  Would the verse
> package [1] be good enough, I wonder?

I think that haiku is a pretty good first exercise because it is not so
difficult.  There are many ways to format a haiku using standard LaTeX
classes, and there are packages such as "verse" that might prove useful as
well, but the point of the exercise is to learn how to control layout oneself.

In LibreOffice, one can create a haiku document template that has page
parameters configured and styles prepared for formatting the content.  The
LaTeX equivalent would be to create a haiku document class that configures
the document parameters and provides environments/commands for formatting
the content.

Cutting one's teeth on such small exercises is preparation for tackling
real-world projects for which document classes are not already available.

> Yes -- I've used it for many years, but I wouldn't even know where to
> begin writing a class or package.  I wonder if this is related to my
> comment about TeX?  There are more web pages and books about using
> LaTeX but not much on writing a class or package.  (There is, but the
> former has a lot more information.)  As such, most people don't know
> what's going on under the hood...

There are many people who use LaTeX in this way.  It some senses, it is a
success: experts create packages that others can use without worrying
about what is going on under the hood.  In other senses, however, it is a
failure: many people never graduate to creating their own packages due to
the steep learning curve, and instead use a WYSIWYG application for
documents that do not readily fit into an existing document class.

> Completely unrelated, but one thing that LaTeX is good as is with
> packages like biocon for writing names of species.  (i.e., Homo
> sapiens)  Rather trivial and you could do it with macros but
> apparently in a document, the first time it appears, you are suppose
> to write it out in full.  The second time, you are suppose to
> abbreviate it as H. sapiens .  I'm not sure how strictly these rules
> are followed in biology, but I can't imagine doing this without LaTeX.
>  Imagine moving paragraphs around the document, etc.

This is a great example!

I cannot think of a way to [systematically] do this in LibreOffice either.

How about HTML and CSS?  One would need a separate class for each genus
(example: "genus_homo").  CSS could be used to abbreviate the genus by
default (by hiding all but the first letter and appending a "." using an
::after pseudo-element), and that formatting can be reset in the first
instance of each genus (using a :first-of-type pseudo-class).  While CSS
provides a way to select the first letter of text (using the
::first-letter pseudo-element), I do not know of a way to hide the rest
without inserting a span.  Unless there is a trick that is escaping me,
making this work in HTML and CSS would therefore entail marking up each
genus with a separate class as well as a span just for selecting the text
to be hidden when abbreviating.

Adding JavaScript would allow for more concise markup.  Each genus could
be given a general class (example: "genus"), and JavaScript could be used
to walk the DOM, changing each general genus class to a specific genus
class as well as inserting the span required to hide text for
abbreviation.  Use of a programming language adds a lot of power.

The task can be easily done in (La)TeX because TeX is a programming
language.  If anybody is interested in seeing how such a straightforward
task is implemented in LaTeX, see the 150-line source [2]. ;)  (I smile
because I see some of my beloved \relax commands in it!)

I have a good friend who is a biologist, by the way, and she claims that
very few biologists use LaTeX, as the journals accept/expect Word. :|

Cheers,

Travis

[1] The TeXbook
---------------

* PDF: http://web.mit.edu/jgross/www/LaTeX/texbook.pdf
* Dead tree: http://www.amazon.co.jp/dp/0201134489
* Source: http://www.ctan.org/tex-archive/systems/knuth/dist/tex

[2] http://mirrors.ctan.org/macros/latex/contrib/biocon/biocon.sty


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links