7

I'm trying to improve the answers to my other question to create my personal package which provides some commands, like \alert to write in red color, or some options like lineno to turn on line numbering.

But what should I do when I send the tex file to someone who don't have the my personal style package?

Looking for a solution I tried to check before the document class if my package file exists. If yes, great, load it.

But the problem is in negative case. I should to redefine all personal commands or clean all of them to avoid errors.

What is the better way to do this?

  • 4
    Have a look at pstool github version which uses filecontents i suppose. May be change title to represent content of Q as : Make a single LaTeX file including a personal.sty with its de­pen­den­cies. Just incase Yiannis's Answer to "Best practice on organising your preamble" – texenthusiast Apr 26 '13 at 2:43
  • 2
    If you really must only send one file (and don't want to include all you style files via filecontents) then you can add user level macros in the .tex file you send such as \providecommand{\alert}[1]{#1}. This way the .tex file can be compiled without having access to your personal .sty files. I do this for the case where I do not load the lineno package, but don't want to test everyplace where I need to use the related commands. So, for the case where I do not load that package I have a \providecommand to define the usual lineno macros to have no effect. – Peter Grill Apr 26 '13 at 6:38
9

You can use snapshot and bundledoc to bundle all necessary files to compile your document.

1

Why not just send them the package with all of the other .tex files and images that you will send them?

Or, use a site like writelatex.com, where you can share all of your files online with collaborators?

  • Some people don't like to work with more than one file, specially if they are from old school. – Sigur Apr 26 '13 at 1:49
  • I wrote that and then realised I had spectacularly failed to answer the question. Ho hum. – Andy Clifton Apr 26 '13 at 1:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.