1

This question already has an answer here:

I pre-apologize for any stupid questions here. I'm still very beginner in LaTeX and trying to learn how to use it efficiently.

I have certain commands and basic setup that I use for all the documents I write. It includes ams symbol, tikz-cd setting, font setting and many personal commands that I use (like \Q for rational number). However, I change them sometimes and I wish that change goes into all of my documents uniformly.

So here is what I think, if I write these setup in one document and modify it whenever necessary, can I bring this to other documents using something like \bring{mysetup}? Or do you just copy & paste your format all the time whenever you write a new one?

Thanks in advance.

marked as duplicate by campa, CarLaTeX, Cragfelt, David Carlisle macros Nov 8 at 19:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Maybe create a separate file mysetup.tex where you write all your definitions like \Q, then include that file in the preamble of your main tex file with \input{mysetup.tex}, with correct path to the file in case it is not in the same folder – Luis Turcio Nov 8 at 17:08
  • @LuisTurcio thanks! this is exactly what I wanted! – HLEE Nov 8 at 17:12
1

Create a separate file mysetup.tex where you write your definitions, like \Q for rational numbers. Then load the file in the preamble of your main tex file with \input{mysetup.tex} if mysetup is not in the same folder, make sure to write the correct path to it.

  • 1
    I would use .sty not .tex and \usepackage not \input and put the file in the input path so you never need to use a local path in the document. – David Carlisle Nov 8 at 18:45
  • @DavidCarlisle Nice! That’s significant improvement that I didn’t take in to account. – Luis Turcio Nov 8 at 18:56

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