[vox-tech] latex sty

Peter Jay Salzman vox-tech@lists.lugod.org
Thu, 4 Mar 2004 15:17:36 -0800


On Thu 04 Mar 04,  2:43 PM, Jonathan Stickel <jjstickel@sbcglobal.net> said:
> Thanks Pete and Micah for responding:
> 
> Peter Jay Salzman wrote:
> >On Tue 02 Mar 04,  6:44 PM, Jonathan Stickel <jjstickel@sbcglobal.net> 
> >said:
> >
> >>I'm submitting a latex document to a journal, and I'm not supposed to 
> >>include any files other than my latex file and my eps figures.
> >
> >
> >have you written to them and said something like:
> >
> >   "is it OK to also send in a .sty file to conform to your bibliography
> >   format?  and if i can't, please tell me how to conform to your format"
> >
> >before giving up on that, you should definitely ask...
> >
> 
> Well, like many nerdy engineers, I tend to use real human interaction as 
> a last resort :-)  But I did do so now and am waiting for a response.
 
hee hee.  :)

> <snip>
> >>Is there any way to include that information in my latex file?  I 
> >>tried just pasting it in at the top of my document, but I get errors. 
> >>Clearly, there is syntax for sty files that is not permitted in latex. 
> >
> >
> >it's possible, but not that i know of.  my own pete_macros.sty is just a
> >bunch of macros i've written and placed in $TEXINPUTS so \usepackage can
> >find it.
> >
> >are you sure you pasted it after \documentclass but before
> >\begin{document}?
> 
> Most definitely, but my problem was with any \@[latex_command].  By 
> Micah's suggestion to look around on comp.text.tex, I found my answer 
> almost immediately in a tex-faq.  You have to wrap sections that contain 
> these commands with \makeatletter and \makeatother.  For example:
> 
> \makeatletter
> [pasted in from foo.sty]
> \makeatother
> 
> This is actually discussed in the "Latex Companion" on pages 15-16, but 
> I didn't realize it until now.  So my problem is solved!
> 
> Jonathan

aha.  i guess you could've emailed me your sty file and i would've
figured it out right away.

jon, there are no debuggers for latex (that i know of), so you often
have to resort to a binary search.

if anything like that happens in the future, comment out half your sty
file, and re-run your job.

if it ran successfully, uncomment half of what's commented out and
   re-run your job.

if it didn't run successfully, comment half of what's uncommented and
   re-run your job.

etc.  simple, yet effective.

every letter in your input has a catagory code (catcode) and a character
code.  the character code is like ebcidic or ascii.  the catcode is
assigned to the function of that particular letter.  you can reassign
the catcode of a particular character (like making the number 8 into the
"begin group" symbol instead of the opening french brace {, for example.

the makeatother / makeatletter is latex's way of being gentle.  the at
sign is given a catcode in latex's "mouth" that make it unavailable for
a control token.  so if you have it in a control word, you need to
redefine its catcode.

i'm at work right now, so i don't have my books in front of me and can't
give you specifics, but that's essentially what's going on.

pete

-- 
Make everything as simple as possible, but no simpler.  -- Albert Einstein
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D