inserting contents of .sty file inside latex .tex file

Viewed 227

I want to know if there is a way to put the contents of a .sty file directly into a latex .tex file. I have a small number of (TeX?) macro definitions inside a file myfile.sty that I would prefer to just integrate into my latex file instead of keeping them in a separate package and loading them using \usepackage{myfile}. Is there a way to do this?

1 Answers

Normally you can simply copy the content of your .sty file to your document.

  • Comment out anything package specific like \ProvidesPackage{myfile}

  • if your package use @ in macro names, you have to wrap it in \makeatletter ... \makeatother

\documentclass{article}

\makeatletter

%\ProvidesPackage{myfile}

\newcommand{\foo}{bar}

\makeatother


\begin{document}

\foo

\end{document}
Related