5
$\begingroup$

I have a demonstration notebook with a code development chapter and a demonstration chapter with a manipulate environment, like this depicted minimal example

Demonstration notebook

I know how to export a cdf but is there any command to export the whole notebook without a specific section/chapter? I have been playing around with Cells[CellStyle->"Chapter"] , SelectionMove[] and NotebookSelection[] but without any luck. At the end I would like to have a cdf file only with the title, lecture information and the demonstration, i.e., without the code development chapter, like this

What I want at the end

Here you can get the notebook, if it is easier to test for you

Google drive link

Naturally, I know I can just create a copy file of the notebook, erase the code part and then manually create the cdf. But may be there is a command in order to avoid that procedure and do everything within one notebook using CDFDeploy[]. Thanks!

$\endgroup$
  • 3
    $\begingroup$ If there is no pattern of what you want to skip, I'd use CellTags to mark what is meant for deployment. Then you can automatically create duplicate output NotebookLocate + NotebookDelete + Deploy + delete parent notebook or something. $\endgroup$ – Kuba Dec 9 '15 at 14:59
  • $\begingroup$ Thanks, the tags and NotebookLocate do the job without the need to delete anything. I will post the answer in a sec. $\endgroup$ – Mauricio Fernández Dec 9 '15 at 15:16
  • $\begingroup$ Even better, great ;) $\endgroup$ – Kuba Dec 9 '15 at 15:27
3
$\begingroup$

With Kuba's comment you can do what I wanted by selecting all cells but the ones that should be excluded, give them a tag with Ctrl+J, e.g., dep and use the following lines

NotebookLocate["dep"]
CDFDeploy[dir <> "demo2.cdf", NotebookSelection[], Method ->"Standalone"];

With that NotebookLocate["dep"] locates and selects all tagged cells, which are then used in CDFDeploy[] with NotebookSelection[]. You will see this in your current notebook like in this picture

Selection of tagged cells

and you will get a cdf only with the selected cells.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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