Generalusing \newcommand with \include

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
nickd_1999
Posts: 1
Joined: Sat Feb 09, 2008 8:42 pm

using \newcommand with \include

Post by nickd_1999 »

Hi,
I'm trying to write a document (thesis) where I have defined lots of \newcommand shortcuts. Currently these are defined in the 'master' .tex file, however I use the \include command to add each chapter's .tex file. Unfortunately I'm having problems as when I try to use a shortcut defined in the \newcommand within each chapter the latex compiler doesn't seem to know about it!
Any help gratefully appreciated.
Thanks,
Nick

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

using \newcommand with \include

Post by localghost »

nickd_1999 wrote:[…] Any help gratefully appreciated. […]
You better define new commands and declare settings in the preamble of your master file to make them global. That also would be much more clear. Make sure that your new commands are not defined within an environment.


Best regards and welcome on Board
Thorsten
Post Reply