[Tex/LaTex] Make your own .sty files

package-writing

Sorry to start a subjective question, but want to understand "own.sty" file.

Other than all \usepackage{} what sort of other commands can be added to the makeyourown.sty file.
Can you include \let command, and \newcommands in it.

What sort of precaution / structure newbies should follow.

Best Answer

Here is a skeleton for an own package:

% this is my first package
% 
% (c) Buffalo Bill
%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
% 
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{mypackage}
  [2011/01/11 v0.01 LaTeX package for my own purpose]

\RequirePackage{whateverwe need}
\newcommand{\hi}{Hello, this is my own package}
\let\myDate\date
\newcommand\GoodBye[1][\bfseries]{{#1Good Bye}}

\endinput
%%
%% End of file `mypackage.sty'.