Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4581116
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:52:45+00:00 2026-05-21T20:52:45+00:00

I work on a huge script in \latex. I want to be able to

  • 0

I work on a huge script in \latex.

I want to be able to compile each of the chapters as stand-alone, because it is easier for hacking sessions with Latex.

On the other hand, I would like to maintain a document which encompasses the whole script so far written.

I do not know how to maintain both these documents without permanently annoying overhead, as a tex-file can either be written stand-alone or to be included.

It would be great help to have something a Latex-preprocessor available that is capable of C-like #define and #ifdef-#else-#endif statements. This would facilitate writing to a great extent. Do you know whether something like this exists in latex, or how can you do something equivalent? Google hasn’t supplied me with a satisfying answer to this.

EDIT:
Some remarks in order to avoid misunderstandings: I am aware of the very simple built-in TEX-preprocessor, but these commands don’t work properly as I expected. Hence a reference to these will not help me out.

The chapters in my script shall look something like this (Pseudo-Code)

IF being_just_included defined
   %No header here, and document has already begun
ELSE
\input{common_header.tex} %Header things all my documents use
\begin{document}
ENDIF

%%% Lots of stuff

IF being_just_included defined
   %Nothing to do here
ELSE
   \end{document}
END IF

In contrast, my complete script source file should look like this

\input{common_header.tex}
DEFINE being_just_included
\begin{document}
\input{preamble.tex}
\input{first_chapter.tex}
\input{second_chapter.tex}
\input{third_chapter.tex}
\end{document}

Could you post a code which performs something like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T20:52:46+00:00Added an answer on May 21, 2026 at 8:52 pm

    One way of doing this is to use the standalone package, intended for this specific purpose.

    You may also care to browse through, and perhaps join, TeX and Friends.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I work on project where is huge Nant build script. Could you advise free
Let's say you work for a huge company which suddenly decides to do custom
I'm trying to work out how to efficiently sort a huge dataset that won't
At work we've got a roster that's historically been maintained in a huge Excel
We're having problem with a huge number of legacy stored procedures at work. Do
work on asp.net vs 05 C#.Master page header contain the bellow code <script type=text/javascript
work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job
am wondering if I'm doing this right. I want to split a huge py
So, I got to work on this huge project. And the is this HUGE
So, for some reason my script refuses to work, although it seems to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.