General\input or \include question

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
purequaternion
Posts: 1
Joined: Mon Mar 09, 2009 6:25 pm

\input or \include question

Post by purequaternion »

Hi all-

I have a question about using \input or \include. Is there any way to specify to these commands (or similar ones using a custom package) to only include certain lines of the source .tex file?

The scenario for use is as follows. I'm working on a translation of some stuff, and have my translation in one file. However, when writing papers that involve the translation, it'd be nice to just use an \include[lines]{file}.

The only problem I can think of with this is that "line" ranges may change if I go back and modify things. Any suggestions?

-Colin

Recommended reading 2024:

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

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: \input or \include question

Post by Juanjo »

A different but simpler approach: each time you modify the file, write \endinput right after the last line you would like to include. The lines after \endinput will not be read, so not included in the document.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply