jlcode
jlcode copied to clipboard
Does not respect linewidth
I frequently have the problem that jlinl text at the end of lines does not break or move, but completely ignores the linewidth:

That does not look great, and requires manual fiddling to make right. Would it be possible to fix?
Unfortunately I don't think that this can be fixed easyily because jinln is mainly just the command \lstinline from the listings pakcage itself. So what you experience here is what being prodced due to the nature of the listings package and it implementation and not due to the implementation of this package.
"Manual fiddling" is likely the best we can do here as far as I can see right now.
Is this a know issue within listings? Or should this issue be raised over there?
Is this a know issue within
listings? Or should this issue be raised over there?
Well, I don't really know. But honestly, I would assume that the do not really consider this to be an issue at all.
I mean the problem here is that your expression n_inital and especially sample_n_ANNS are coherent, long expressions that you would normally not want to be split. So latex tries it's best under the assumption that this expression needs to be coherent, which means you will either create an overfull box and have a line longer than the textwidth or an underfull box and have a line with a lot of whitespace and your expressions starting at the next line. There is no way of having a coherent expression, no underfull box and no overfull box at the same time. See what I mean?
Absolutely. The way I would fix this for text is to put it inside a \hbox{}, which ends up filling all lines from left to right, without going into the page margin. This would be the preferred behaviour IMO.
This would be the preferred behaviour IMO.
Could you show me a picture of how your example looks when you do it like that? I am not so sure if I could agree here on that being the preferred behaviour because I would expect to have a lot of white space in the text. But then again, if one does or cannot change the forumlation of the text, this might be the best solution indeed.
I don't have time right now, but I commonly use it to keep e.g. an inline equation on the same line. Yes, there is extra whitespace, but it looks way better than breaking into the margin. Feel free to try including more and more of a text in the \hbox{}, to get a feel for the behaviour. I have always liked the output from it "in the wild", e.g. in real use.
Ah, I see.
I never really work with \hbox{} because I personally prefer changing some words or the order of words in a setence in theses cases.
When I have some more time I might go for some testing here, but right now I am busy, too.
Conributing to open source stuff is always a guilty pleasure to me - there is never time, and never anything forcing it to get done.
Thanks for being so responsive, and thanks for the amazing package. I have now used it A LOT for several important reports, including my bachelor thesis ^_^
Conributing to open source stuff is always a guilty pleasure to me - there is never time, and never anything forcing it to get done.
That's a great attitude, which I do share. If one profits from a project and can somehow contribute to it one should feel obligated to do so imho.
Thanks for being so responsive, and thanks for the amazing package. I have now used it A LOT for several important reports, including my bachelor thesis ^_^
You are very welcome and it makes me happy to hear that this package is so useful for you!