minted icon indicating copy to clipboard operation
minted copied to clipboard

breaklines does not work #2

Open damnms opened this issue 2 years ago • 4 comments

Unfortunately, i am facing again a problem with breaklines and breakanywhere. I have "Hello world \mintinline{bash}|openwrt-22.03.0-rc1-mvebu-cortexa9-cznic_turris-omnia-sysupgrade.img.gz|" and use \setminted[bash]{breaklines, breakanywhere}, but unfortunately that mintinline goes way over the page. Anyone an idea what to do, so it is broken anywhere?

damnms avatar May 11 '22 08:05 damnms

According to the doc, breakanywhere does not apply to \mintinline. Related: #31

https://github.com/gpoore/minted/blob/d46f1ba2d248f2f3504bcc795dd39c613bd3c5a0/source/minted.dtx#L1024-L1025

muzimuzhi avatar May 11 '22 11:05 muzimuzhi

thanks for that information. any idea how to workaround that? can i somehow specify a "breakafter='*' ", like "break on each char" or so? i tested the #31 hint from one person but unfortunately, it did not act like he mentioned.

damnms avatar May 11 '22 11:05 damnms

@damnms For a case like this, I'd suggest \Verb from fvextra, which minted loads internally:

Hello world \Verb[breaklines,breakanywhere]|openwrt-22.03.0-rc1-mvebu-cortexa9-cznic_turris-omnia-sysupgrade.img.gz|

\Verb has some capabilities that currently don't exist with \mintinline.

gpoore avatar May 11 '22 12:05 gpoore

@gpoore can I assign specific languages, such as python or cpp with \Verb and get the correct syntax highlighting? Also can I assign a bgcolor using a command similar to \setmintedinline{bgcolor=bg}?

amine-aboufirass avatar Aug 23 '22 12:08 amine-aboufirass