For our bachelor project, we are implementing an encryption algorithm. Our implementation is of course explained in a report written with LaTeX.

The encrypted cyphertext is a very long hexadecimal value. Just using \lstinputlisting[title=ciphertext]{encrypted_cyphertext.txt} will result in the text running off the right side of the page, as listings will only break on word separators; a hexadecimal value is treated as a single (very long) word.

Is there any way to break inside of words using the listings package?

  • Please add a small compilable LaTeX document that illustrates your problem and that allows us to propose solutions. Just use the edit button left below your question. – gernot Sep 19 '16 at 12:34
 {morekeywords=X, %one keyword is needed ...


enter image description here

  • Is there a way to break on all characters? Something similar to minted's breakanywhere option. – TakingItCasual Aug 5 '20 at 11:03

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.