Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

verb/lstinline text flows out of the line margins without line break in Latex

The listings package supports line breaks inside lstlisting environment. But it doesn't produce automatic line breaks for lstinline environment. For example, in the following paragraph the first line flows out of the margins:

The parameters \lstinline|base_rmr_brain|, \lstinline|base_rmr_fat|, and \lstinline|baseline_basal_rmr_of_lean_tissues| are metabolic rates of brain, fat, and lean tissues in kcal/(kg*day). The parameter \lstinline|mass_brain| denotes the mass of the brain in gram.

Is there any solution for this problem?

like image 708
Mert Nuhoglu Avatar asked Oct 06 '09 08:10

Mert Nuhoglu


1 Answers

The literate feature of listings could be helpful, e.g. to introduce linebreaks at underscores:

\lstset{
  literate={\_}{}{0\discretionary{\_}{}{\_}}%
}
like image 173
rcs Avatar answered Nov 07 '22 15:11

rcs