organizing modular packages

  • Follow


hi,
I have a collection of packages that I'm trying to organize. I have 3
book designs I need to support and so there is a lot of common code in
the packages that is needed by all docs, but also some custom code
that goes with each book design.

What I've done so far is use the common packages and one extra package
for each design. That specific package has a bunch of stuff in
\AtBeginDocument so it can override the common definitions where
needed.

Loading up AtBeginDocument like this is pretty ugly, though it *is*
working. I was wondering what other people do in this situation. I'm
toying with the idea to have two sets of packages: common_pkgname.sty
and a designA_pkgname.sty for all packages.

Anyone thought about this before?
thanks,
--Tim Arnold
0
Reply a_jtim (62) 6/15/2010 3:55:09 PM

Tim Arnold wrote:
> hi,
> I have a collection of packages that I'm trying to organize. I have 3
> book designs I need to support and so there is a lot of common code in
> the packages that is needed by all docs, but also some custom code
> that goes with each book design.
> 
> What I've done so far is use the common packages and one extra package
> for each design. That specific package has a bunch of stuff in
> \AtBeginDocument so it can override the common definitions where
> needed.
> 
> Loading up AtBeginDocument like this is pretty ugly, though it *is*
> working. I was wondering what other people do in this situation. I'm
> toying with the idea to have two sets of packages: common_pkgname.sty
> and a designA_pkgname.sty for all packages.
> 
> Anyone thought about this before?
> thanks,
> --Tim Arnold

how about

mycommonstuff.sty

designA.sty:

\RequirePackage{mycommonstuff}
followed by special stuff for designA

Then I don't see the need for the \AtBeginDocument, unless I know more 
about mycommonstuff.sty of course


-- 

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ:      http://www.tex.ac.uk/faq
LaTeX book:     http://www.imf.au.dk/system/latex/bog/    (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
0
Reply Lars 6/15/2010 3:58:37 PM


On Jun 15, 11:58=A0am, Lars Madsen <dal...@RTFMSIGNATUREimf.au.dk>
wrote:
> Tim Arnold wrote:
> > hi,
> > I have a collection of packages that I'm trying to organize. I have 3
> > book designs I need to support and so there is a lot of common code in
> > the packages that is needed by all docs, but also some custom code
> > that goes with each book design.
>
> > What I've done so far is use the common packages and one extra package
> > for each design. That specific package has a bunch of stuff in
> > \AtBeginDocument so it can override the common definitions where
> > needed.
>
> > Loading up AtBeginDocument like this is pretty ugly, though it *is*
> > working. I was wondering what other people do in this situation. I'm
> > toying with the idea to have two sets of packages: common_pkgname.sty
> > and a designA_pkgname.sty for all packages.
>
> > Anyone thought about this before?
> > thanks,
> > --Tim Arnold
>
> how about
>
> mycommonstuff.sty
>
> designA.sty:
>
> \RequirePackage{mycommonstuff}
> followed by special stuff for designA
>
> Then I don't see the need for the \AtBeginDocument, unless I know more
> about mycommonstuff.sty of course
>
> --
>
> /daleif (remove RTFSIGNATURE from email address)
>
> LaTeX FAQ: =A0 =A0 =A0http://www.tex.ac.uk/faq
> LaTeX book: =A0 =A0http://www.imf.au.dk/system/latex/bog/=A0 =A0(in Danis=
h)
> Remember to post minimal examples, see URL belowhttp://www.tex.ac.uk/cgi-=
bin/texfaq2html?label=3Dminxamplhttp://www.minimalbeispiel.de/mini-en.html

Thanks, that's what I was thinking too. That should take care of all
the AtBeginDocument ugliness.
thanks,
--Tim
0
Reply Tim 6/15/2010 6:35:58 PM

Tim Arnold wrote:
> On Jun 15, 11:58 am, Lars Madsen <dal...@RTFMSIGNATUREimf.au.dk>
> wrote:
>> Tim Arnold wrote:
>>> hi,
>>> I have a collection of packages that I'm trying to organize. I have 3
>>> book designs I need to support and so there is a lot of common code in
>>> the packages that is needed by all docs, but also some custom code
>>> that goes with each book design.
>>> What I've done so far is use the common packages and one extra package
>>> for each design. That specific package has a bunch of stuff in
>>> \AtBeginDocument so it can override the common definitions where
>>> needed.
>>> Loading up AtBeginDocument like this is pretty ugly, though it *is*
>>> working. I was wondering what other people do in this situation. I'm
>>> toying with the idea to have two sets of packages: common_pkgname.sty
>>> and a designA_pkgname.sty for all packages.
>>> Anyone thought about this before?
>>> thanks,
>>> --Tim Arnold
>> how about
>>
>> mycommonstuff.sty
>>
>> designA.sty:
>>
>> \RequirePackage{mycommonstuff}
>> followed by special stuff for designA
>>
>> Then I don't see the need for the \AtBeginDocument, unless I know more
>> about mycommonstuff.sty of course
>>
>> --
>>
>> /daleif (remove RTFSIGNATURE from email address)
>>
>> LaTeX FAQ:      http://www.tex.ac.uk/faq
>> LaTeX book:    http://www.imf.au.dk/system/latex/bog/   (in Danish)
>> Remember to post minimal examples, see URL belowhttp://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxamplhttp://www.minimalbeispiel.de/mini-en.html
> 
> Thanks, that's what I was thinking too. That should take care of all
> the AtBeginDocument ugliness.
> thanks,
> --Tim

Come to think of it, why use more than one package, make it depend on 
package options, and let those options control the parts that are 
different for each design.

-- 

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ:      http://www.tex.ac.uk/faq
LaTeX book:     http://www.imf.au.dk/system/latex/bog/    (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
0
Reply Lars 6/16/2010 8:03:54 AM

3 Replies
192 Views

(page loaded in 0.074 seconds)

Similiar Articles:








7/24/2012 6:17:16 PM


Reply: