Re: package the right way?



On Aug 7, 8:41 pm, danmc91 <s...@xxxxxxxxxxxx> wrote:
I've been a user of LaTeX for many years and am looking at doing
something a bit more structured than I have in the past and want to
see if I'm thinking about things correctly.

I'm compiling a bunch of notes I have on various plants.  For each
species, I'll have things listed like scientific name, common name(s),
leaf type, leaf shape, etc.  I hope to grow the # of species to a
moderately large number over several years but want to maintain
consistent formatting.

So, is the right approach here to create a new package, say "plants"
and for each chapter or section in my notes I'd have something like:

\begin{species}{Acer negundo}

% list of common names
\cname{boxelder}
\cname{ashleaf maple}
\cname{Manitoba maple}

% list of identifying attributes.  Not all may be listed
\leaftype{pinnately compound}
\leafmargin{lobed}
\leafscar{.....}
\stipularscar{....}
\description{\species\ is a species of maple native to North
America.   More detailed description here}

\end{species}

Then my species package would spit out all the information in the
order and formatting I want.

Is this the "right" way or best practices way to go about this (write
a package and define a new environment to let me identify data as
being of a particular type)?  If not, is there a better way?  Any good
pointers to a nice "starter" package to look at to learn from?

My goal is to spend time on compiling the information and not a lot of
time reformatting things manually to maintain consistency.

This seems to me like a perfectly good way to go about this. If
you're following this sort of markup strictly then just about anything
should work, and it would be easy to write a perl script to reformat
things if you needed to change at a later time. You could also even
export to XML and use some sort of XSLT to change it into any other
sort of format, but I don't know anything about that (beyond the
discussion going on in a nearby thread).

Maybe you're already thinking of this, but in case you weren't, it
would certainly be a piece of cake to have \species defined here as
\textit{A. negundo} by simply grabbing the first letter and then using
a delimited argument to discard everything up to the first space.

But since LaTeX is supposed to be a markup language, I would say
you're definitely on the right track in designing your own markup to
fit in with it. Oh, and be careful with spaces in that sort of thing
- all the close-braces can cause lots of unwanted space, and I've seen
some horrible hacks to deal with it when usually something more like
\ignorespaces would have worked a lot better.

Cheers,
steve
.



Relevant Pages

  • Can I update all combo boxes on all loaded forms?
    ... I found this code that uses a pretty interesting approach of bookmarking all ... adding a new product they find they also need to add a new package code, ... I was thinking some sort of combination of a function that lists all open ... forms and then a function that requeries them all. ...
    (microsoft.public.access.forms)
  • Re: Can I update all combo boxes on all loaded forms?
    ... What I do is to create a single function that handles the updating of any combos that are open on screen. ... I found this code that uses a pretty interesting approach of bookmarking all ... adding a new product they find they also need to add a new package code, ... I was thinking some sort of combination of a function that lists all open ...
    (microsoft.public.access.forms)
  • death by affluence
    ... What are examples of species ... humanity becomes powerful enough to attract the attention ... avoid the cliche of the robot saying how illogical all that is; ... extreme ennui, sort of like the Shaa, only much worse. ...
    (rec.arts.sf.written)
  • Re: [fw-wiz] Securing a Linux Firewall
    ... > sort of thing is always a pain -regardless- of what your typical machine ... The amount of churn in what is required between Solaris ... Solaris 9 is supposed to be better about package granularity, ... My assertion is that the maintenance cost of maintaining a "minimal" build, ...
    (Firewall-Wizards)
  • package the right way?
    ... species, I'll have things listed like scientific name, common name, ... So, is the right approach here to create a new package, say "plants" ... \cname{Manitoba maple} ... time reformatting things manually to maintain consistency. ...
    (comp.text.tex)