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

long text in pipe table does not wrap in pdf #4239

Closed
tewarid opened this issue Jan 10, 2018 · 4 comments
Closed

long text in pipe table does not wrap in pdf #4239

tewarid opened this issue Jan 10, 2018 · 4 comments

Comments

@tewarid
Copy link

tewarid commented Jan 10, 2018

Assuming

$ pandoc --version
pandoc 2.0.2
Compiled with pandoc-types 1.17.3, texmath 0.10, skylighting 0.4.3.2

A md document such as

| Name               | Value    | Description        | Additional Comment |
|--------------------|----------|--------------------|--------------------|
| SOME_LONG_VARIABLE_NAME | 00 (default) | Description of SOME_LONG_VARIABLE_NAME | Some additional comment about SOME_LONG_VARIABLE_NAME |

when rendered to pdf using

pandoc test.md -f markdown_github -o test.pdf

renders as

screen shot 2018-01-10 at 07 39 51

when rendered to PDF using

pandoc test.md -f gfm -o test.pdf

renders as (text off the page)

screen shot 2018-01-10 at 07 40 29

See also #2471.

@wilx
Copy link
Contributor

wilx commented Jan 10, 2018

It is the underscore that disables the line breaking algorithm in LaTeX. You can fix this by adding --include-in-header=table.header.tex to your command line, where the table.header.tex file contains just this line:

\usepackage{underscore}

@tewarid
Copy link
Author

tewarid commented Jan 10, 2018

@wilx That works. Thanks!

Any suggestion for camel case?

| Name               | Value    | Description        | Additional Comment |
|--------------------|----------|--------------------|--------------------|
| SomeLongVariableName | 00 (default) | Description of SomeLongVariableName | Some additional comment about SomeLongVariableName |

renders as

screen shot 2018-01-10 at 08 28 09

@wilx
Copy link
Contributor

wilx commented Jan 10, 2018

Who is generating the documentation/table? If you can insert soft hyphen (U+00AD) character to the right places, you could use my uspace LaTeX package. Alternatively, you could list all of these in the header like \hyphenation{Some-Long-Variable-Name} to let LaTeX know where to hyphenate.

@wilx
Copy link
Contributor

wilx commented Jan 10, 2018

Also, somebody has already asked this before and there is also a LaTeX solution (with some limitations): hyphenation - Automatic camel case breaking - TeX - LaTeX Stack Exchange

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