-
Notifications
You must be signed in to change notification settings - Fork 23
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
Properly Break Long Lines with Long and Short Words and breaknonspaceingroup
/breakline
Options
#26
Comments
Found it's only reproducible with initial settings
State of Lines 1609 to 1630 in 6717547
|
@muzimuzhi, thank you for your response and pointing to the Solution:The following options were necessary to display the output as expected:
Revision:markdown.md: ---
header-includes:
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{
breaklines=true,
breakanywhere=true,
breaknonspaceingroup=true,
breakcollapsespaces=false,
commandchars=\\\{\}}
---
```bash
sha512sum <<<"string"
346254a332b819b42186a57d6f31fc8fdb9ce81ec89c613f7331a434e73a8acfc7c53db66dc44d8dee65cccd6ea6a911e2638a2e5eed1ee2a4527325d8a29d41 -
``` pandoc markdown.md -o markdown-md.pdf Thanks again! |
I still don't get why there would be line breaks at the spaces right before the trailing |
Maybe the reason is that the hash is processed separately from the line as a whole. Because the hash doesn't fit on a line by itself, it is split as a token and then the dash is also split off because it didn't fit on the line either initially. I've been thinking about it and this behavior might make more sense if you're trying to visually separate the breaks at spaces and breaks that split words. ---
header-includes:
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{
breaklines=true,
breakanywhere=true,
breaknonspaceingroup=true,
commandchars=\\\{\}}
---
```bash
sha512sum <<<"string"
346254a332b819b42186a57d6f31fc8fdb9ce81ec89c613f7331a434e73a8acfc7c53db66dc44d8dee65cccd6ea6a911e2638a2e5eed1ee2a4527325d8a29d41 -
```
```bash
3.1415926535897932384626433832795028841971693993751058209749445923078164062820 3.1415926535897932384626433832795028841971693993751058209749445923078164062820 3.1415926535897932384626433832795028841971693993751058209749445923078164062820 3.1415926535897932384626433832795028841971693993751058209749445923078164062820
```
```bash
346254a332b819b42186a57d6f31fc8fdb9ce81ec89c613f7331a434e73a8acfc7c53db66dc44d8dee65cccd6ea6a911e2638a2e5eed1ee2a4527325d8a29d41 - 346254a332b819b42186a57d6f31fc8fdb9ce81ec89c613f7331a434e73a8acfc7c53db66dc44d8dee65cccd6ea6a911e2638a2e5eed1ee2a4527325d8a29d41 - 346254a332b819b42186a57d6f31fc8fdb9ce81ec89c613f7331a434e73a8acfc7c53db66dc44d8dee65cccd6ea6a911e2638a2e5eed1ee2a4527325d8a29d41 -
``` The second example there shows more clearly when a break is being put in between words vs when a break splits words in general, and that might be useful, but the last example doesn't make a lot of sense to me because it seems like the last line is treated differently than the other ones. I'll reopen the issue to see if this is something that needs to be addressed further. |
This is due to how LaTeX handles hyphenation. With Fixing this involves modifying hyphenation penalties/demerits. Reference: https://tex.stackexchange.com/a/51264/10742. One of the interesting things about the original example of the hash followed by the hyphen is that if you replace
Breaks at spaces have much higher precedence than You can experiment with this by using I think |
The unnecessary line break is now fixed in the development version on GitHub. You can download the new I also added a new option |
Issue:
If there is a long line where the first "word" is longer than the line length and there is a short word at the end of the line, the short word will be put on its own line instead of going after the split long word. Is this intended behavior?
Inputs:
markdown.md
markdown.tex
Commands:
Outputs:
Markdown PDF Output:
![image](https://private-user-images.githubusercontent.com/47089358/358860939-2f8d307b-3c5d-4af5-be63-c9e3b30198ed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDAxMTQsIm5iZiI6MTczOTU5OTgxNCwicGF0aCI6Ii80NzA4OTM1OC8zNTg4NjA5MzktMmY4ZDMwN2ItM2M1ZC00YWY1LWJlNjMtYzllM2IzMDE5OGVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2MTAxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlYjEwOTNlODc2NGM2YTEzOTZmNjg5NDU3OTRmNzVjNzdlYzY3OGU0ZThlMDFiNWI5NWJhODY4MjNiNWFiNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._VnPCJIGL5a5R78z_S7t6PokULgzO4E24qOY5hcvVeA)
Latex PDF Output:
![image](https://private-user-images.githubusercontent.com/47089358/358860856-4eb25070-72da-4428-a725-3ccf5ebd3c39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDAxMTQsIm5iZiI6MTczOTU5OTgxNCwicGF0aCI6Ii80NzA4OTM1OC8zNTg4NjA4NTYtNGViMjUwNzAtNzJkYS00NDI4LWE3MjUtM2NjZjVlYmQzYzM5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2MTAxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc2MGUxNWU4M2ZjZWE1ZWEwYjY3MzU1NjAwYWZhMDYxNjYzNWZiZWVjOGRmMTYwZDc0YzY0ZDNlMjVjMzkzZWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3FHOc0YzWJJDjFW7BOzGGmfebw09hsx3xz-c_EJI_eo)
Both the markdown and latex files produce similar PDFs, but I wanted to show this probably isn't a Pandoc issue. This issue is very similar to #11, except using the
breaknonspaceingroup
option does not seem to have the intended effect on the output.Expected Results:
The line at the end with the single dash
-
character should not be split onto its own line. It should remain with the previous line because the previous line is not too long. Is there an option that I have missed in the documentation which provides this behavior?Software Versions:
Pandoc Version:
fvextra version:
fvextra was downloaded from the GitHub releases because the version provided by Debian was a little dated (1.5) and I wanted to see if that was the issue, but it was not. The log file produced by latex and pandoc indicate that the fvextra file being used is the one in my home directory and not the one in the system directory.
OS:
Linux Mint Debian Edition 6 (Faye)
Please let me know if there is any other information I should provide.
Thank you
The text was updated successfully, but these errors were encountered: