Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not respect linewidth #46

Open
KronosTheLate opened this issue May 17, 2022 · 9 comments
Open

Does not respect linewidth #46

KronosTheLate opened this issue May 17, 2022 · 9 comments

Comments

@KronosTheLate
Copy link

I frequently have the problem that jlinl text at the end of lines does not break or move, but completely ignores the linewidth:
image

That does not look great, and requires manual fiddling to make right. Would it be possible to fix?

@wg030
Copy link
Owner

wg030 commented May 17, 2022

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.

@KronosTheLate
Copy link
Author

Is this a know issue within listings? Or should this issue be raised over there?

@wg030
Copy link
Owner

wg030 commented May 30, 2022

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?

@KronosTheLate
Copy link
Author

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.

@wg030
Copy link
Owner

wg030 commented Jun 27, 2022

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.

@KronosTheLate
Copy link
Author

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.

@wg030
Copy link
Owner

wg030 commented Jun 28, 2022

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.

@KronosTheLate
Copy link
Author

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 ^_^

@wg030
Copy link
Owner

wg030 commented Jun 29, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants