[OS X TeX] writing sty files

Themis Matsoukas matsoukas at psu.edu
Wed Nov 22 16:10:54 CET 2006


On Nov 22, 2006, at 8:01 AM, Themis Matsoukas wrote:

> On Nov 21, 2006, at 5:37 PM, Maarten Sneep wrote:
>>>
>>> \@ifpackageloaded{<package name>}{<then part>}{<else part>}
>>
>> In addition to that: there is a comment.sty, which probably allows  
>> you to define similar behaviour in the else part.
>
> The memoir class implements the package comments.sty (or some  
> modification of it). However, the command \newcomment{} that I need  
> is defined in memoir, not in comments.sty. As you say, I should  
> probably be able to accomplish what I want using the original  
> comment.sty instead of memoir's implementation of it; nevertheless,  
> I use memoir quite a bit, so this is not a limitation for me right  
> now.

Let me elaborate a bit, since I did a couple tests: What I wanted to  
do was to include or exclude text from being printed depending on a  
switch (for example, print problem statement and solution, or only  
problem statement). This can be done using either the package  
comment.sty, or the class memoir.cls, which implements the  
functionality of comment. If you use comment.sty, every time you  
include optional test the package first writes it to a file, then it  
inputs it. On the other hand, memoir does it without writing to  
external files. That's a cleaner approach because it does not  
generate any new files in your working directory.

Themis

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list