WordPress.org

Ready to get started?Download WordPress

Forums

automatic word wrapping (3 posts)

  1. Pospiech
    Member
    Posted 6 years ago #

    I write my code usually without manual word wrapping (in this case LaTeX).
    If I post these with wp-syntax nearly all the code is hidden because it is not wrapped inside the available space.

    Is there any possibility to enable word wrapping ?

    Matthias

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    If I post these with wp-syntax

    Well, you could post them without using wp-syntax.

    wp-syntax is using <pre> tags, which is what's preventing automatic word wrapping. WordPress is happiest when you write your posts as plain text. No formatting. If you need to add formatting, do it in HTML.

    Of course, if you're posting actual code, then the word wrapping actually matters, doesn't it? In which case you don't want the page to add its own word wrap.

    The short of it is that you can't have it both ways. If you use <pre>, then you're expected to add your own word wrap, along with everything else.

  3. rmm5t
    Member
    Posted 6 years ago #

    Pospiech, If you really want your LaTeX to wrap, you can change the behavior of the white space wrapping of the <pre> tag with a little bit of CSS magic. Here are some resources that might benefit you:

    Making preformatted text wrap
    CSS: white-space

    Also, this page has some wp-syntax styling guidelines that will style your code snippets to automatically add horizontal scroll bars where necessary. I don't know if this helps your situation or not.

Topic Closed

This topic has been closed to new replies.

About this Topic