Edit
I was thinking about some automation of your request. With the the following approach you
can create a new notebook, show your tables and graphs and save a new notebook as PDF.
SetDirectory@NotebookDirectory[];
some Code
...
some Code
List all global variables, see here:
names = Select[Names["Global`*"], Head@Symbol[#] =!= Symbol && Head@Symbol[#] =!= Function &]
(*
{"a0", "a1", "a2", "plo1", "plo2", "plo3", "plo4", "plo5", "plo6", "plo7", "tab1", "tf1"}
*)
You can then select the variables and reuse with ToExpression as Language input.
print = names[[4 ;; Length[names]]] // ToExpression // TableForm;
Use CreateDocument to open a document notebook and pass “print” as expression to that file.
nb = CreateDocument[print];
Then you can export the document created, as usual to PDF
Export["printPDF.pdf", %]
The result with my settings:
Say you have two notebooks open, one named Work.nb, the other Print.nb, on a fresh Kernel of course. With Work.nb you do all your graphs and tables. All required elements must have a unique variable name:
tab1 = Text[
Grid[Table[
With[{n = n},
With[{u = HoldForm[\[Integral]1/(x^n - 1) \[DifferentialD]x]},
TraditionalForm /@ {u, ReleaseHold[u]}]], {n, 4}], Frame -> All,
ItemSize -> Automatic, Background -> LightYellow]]
plo1 = Plot[{f[x], g[x]}, {x, -π, π}, Frame -> True,
FrameTicks -> {Range[-π, π, π/2], Automatic}]
plo2 = Plot[1/2 x^3 - 7 x + 4, {x, -5, 6}]
Because all kind variables are available in all open notebooks, you can also recall it in the notebook Print.nb. In the first line you can query the variables you need;
tab1
GraphicsGrid[{{plo1, plo2}}]
f[5] + f[π]
g[x + 1]
plo2
The result might look like this:
Done so, it will be easy to save Print.nb as PDF.
NotebookFind[EvaluationNotebook[], "Output", All, CellStyle];
and thenSave Selection As...
. I hope someone remember how to do it fully automatically. $\endgroup$