2

I'm new here so I'll probably ask a naive question. Please let me know if an dhow I can improve my question.

I have written a long Latex document and I have split the chapters into different tex files, which are included in the final documents using \input{}.

Now I want to write an executive summary of the whole document, which should include only some sentences from each chapter. Is there a smart way to do that?

I'm naively thinking of "marking" somehow the sentences that I want in the executive summary and then automatically get the "marked" sentences.

As an example, you can have a look at the following:

Chapter1.tex

\marked{I want this sentence in the executive summary.}
I don't want this sentence in the executive summary.

Document.tex

\input{Chapter1.tex, onlyMarkedText=False}

ExecutiveSummary.tex

\input{Chapter1.tex, onlyMarkedText=True}

So that when I compile the Document I get

I want this sentence in the executive summary. 
I don't want this sentence in the executive summary.

and when compiling the ExecutiveSummary I get

I want this sentence in the executive summary. 

Any suggestion would be really appreciated! Thanks, Matteo

2 Answers2

0

With packages version or versions you can define some emvironmemts that will or will not be typeset depending on a global variable. This provides a solution to your problem. You could either toggle this variable in your main file according to the targeted document, or use another main specifically for the summary.

Jhor
  • 4,179
0

I would suggest to reverse the markup in your Chapter1.tex:

I want this sentence in the executive summary.
\marked{I don't want this sentence in the executive summary.}

Then you just need to put \long\def\marked#1{#1}\input{Chapter1.tex} in your Document.tex and \long\def\marked#1{}\input{Chapter1.tex} in your other document. No extra packages needed.

Lupino
  • 2,772