2

I'm trying to add sample content to my document, but it seems like whenever I use \texttt or \lstinline tags my content still goes out of the margin. Is there any suggestions ?

enter image description here

John J
  • 21
  • Check out the url package. – John Kormylo May 20 '23 at 23:59
  • So the issue is I need to add inline code, not just the URls – John J May 21 '23 at 00:04
  • 1
    Please show the code that gives rise to the scrreenshot you posted. – Mico May 21 '23 at 00:20
  • @Mico I have attached the screenshot. – John J May 21 '23 at 03:44
  • 1
    Welcome to TeX.SE! W need to see the code (copy from your editor) of small, but complete document, which produce showed compilation result, which we can test as it is. In its preamble should be loaded only to your problem relevant packages. – Zarko May 21 '23 at 04:58
  • 2
    you should show code as text but as commented above the url package would help here (these are not url but the typesetting issues are the same) – David Carlisle May 21 '23 at 05:47
  • I suggest you load the xurl package and replace, say, \texttt{spring.datasource.driverClassName} with \path{spring.datasource.driverClassName}. – Mico May 21 '23 at 06:18
  • The url package has been used for many things bsdies URLs. See https://tex.stackexchange.com/questions/551389/how-to-prevent-biburlnumpenalty-to-create-orphans-in-doi and https://tex.stackexchange.com/questions/15950/hyphenation-of-long-java-identifiers for example. – John Kormylo May 21 '23 at 14:31

0 Answers0