I am trying to insert a script (bash shell code) to the appendix of my document. I am trying to import the script from separate file. The script file name is Event_Db_BckUp_Script.als. The problem is that the code is very long and it requires to be split into multiple pages. When I use the following code, it is only shown in single page and cut the rest of the code. How can I display the whole script in multiple pages?

Here is what I am doing right now:

\caption{IDSaaS initialization Script} 

I would prefer the listings package. I've made several documents, also with very long listings with it and it worked fine. You can also include files without copying them to your TeX-Code.

A minimal example would look like this, for more options please consult the documentation of the package.:

|improve this answer|||||

When using listings, the default is to allow breaking of code across page boundaries (source code taken from Selection Sort in C):

enter image description here

\usepackage{listings}% http://ctan.org/pkg/listings
% Just for this example, reduce the page height...
\usepackage[paperheight=10\baselineskip]{geometry}% http://ctan.org/pkg/geometry
\lstinputlisting[language=C,caption={Selection Sort in C},label=selection-sort]{selection_sort.c}

However, boxing occurs when adding the float key since a float requires collecting the contents to float, which imposes a single-page restriction. This does not seem to be needed in your case, since it seems like you're using a newly defined environment Listing with the [H] float specifier (provided by float).

Referencing is done by use the label key-value, which would allow referencing the listing number. If the label is not required nor the number, you can use the title key-value.

|improve this answer|||||

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.