I have tried to insert my Mathematica notebook into LaTeX by converting it as a PDF file and then using \includepdf[pages=1-4]{blablabla.pdf}
. However, there are now two problems I faced:
- This code sample should be in the beginning of an Appendix chapter. But when I use the code
\chapter{blablabla}
and then the above command\includepdf
, the code automatically starts from another page. Thus, an unwanted one page break occurs in my document and I don't know how to solve this. - Although all the numbers in my documents are numbered in order, these pages inserted from PDF appears without numbers. This again breaks my usual layout in the document. So what is the proper way of numbering pages in that case?
Besides these problems, for future reference, I want to know the most reliable way of inserting a Mathematica code in LaTeX.
\includepdf
? That's what I am actually looking for. – sahin May 10 '15 at 20:27\includepdf
does is insert the whole page(s) of the specified PDF literally into the document. This necessitates a page break before the pages are inserted. The defaultpagecommand
(pagecommand={\thispagestyle{empty}}
) causes no page numbers on the inserted pages; you can change this key if you want numbers. But I posted those links because I think those methods are really better than this method. With\includepdf
, the style of the included code will not match the rest of your document, so IMO these other methods are "more reliable". – Paul Gessler May 10 '15 at 20:44