LyX ⇒ code list exceeds page dimension
code list exceeds page dimension
I'm using lyx for my documents and I have to insert some code.
So I've used the floating Algorithm object, added the code list inside, and wrote my code on the code list.
Generating the pdf document I can see the code that exceeds the dimension of the page but, instead of going on a new page it's cut at the page end.
I've used formatting tools like page break, page end, new page and so on but without any changes.
Can anyone help me?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Re: code list exceeds page dimension
I recommend the verbatim package, which includes the \verbatiminput command. This includes an entire file, as if within \begin{verbatim}...\end{verbatim}, and allows the resulting text to break across pages.
If you really want it to float, you have three options: (1) make the font smaller so more lines fit on one page, (2) remove blank lines and/or concatenate several lines together, sacrificing vertical space for horizontal space, and (3) write shorter code.

Re: code list exceeds page dimension
I've searched in te web without success. I'll try with verbatim and i'll make you know if it works!
(I can't use a smaller code because my thesis is all about this

-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
code list exceeds page dimension
Code: Select all
\usepackage{verbatim}
.
.
.
\let\verbinput\verbatiminput
\newenvironment{verbquote}{
\list{}{
\listparindent 0pt%
\leftmargin \parindent%
\itemindent \listparindent%
\rightmargin \leftmargin
}%
\small
\item[]%
}
{\endlist}
\renewcommand{\verbatiminput}[1]{%
\begin{verbquote}
\verbinput{#1}
\end{verbquote}
}
.
.
.
\section{scriptname}
This script does everything blah blah blah.
\verbatiminput{$HOME/bin/scriptname}