LyXHow to insert new line inside table cell? (wrap text)

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
steve_656525
Posts: 4
Joined: Fri Mar 25, 2011 9:31 am

How to insert new line inside table cell? (wrap text)

Post by steve_656525 »

Hello,
I am new to Lyx (just started using it today).
But I know how to program in Latex a little.

I create a table, and I want to add large text
into one cell of a table, but I want to be able
to hit carriage return and have a new line
added automatically inside the same cell.

I read that I can add \linebreak, which I tried,
but when I continue to type, the text remained on
the same line, and did not wrap around.

I am trying to add large amount of text and
want to be able to add more lines to same cell.

Is there a way to do this in Lyx?

thanks
steve

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to insert new line inside table cell? (wrap text)

Post by localghost »

The standard tabular environment allows »p{‹width›}« column types of a certain width. If that's not sufficient, try packages like tabu or tabularx. But I can't advice how to include packages in LyX.


Best regards and welcome to the board
Thorsten
steve_656525
Posts: 4
Joined: Fri Mar 25, 2011 9:31 am

How to insert new line inside table cell? (wrap text)

Post by steve_656525 »

localghost wrote:The standard environment allows »p{‹width›}« column types of a certain width.
Thanks, yes, I know in Latex how to do it. I use
p{3in} as example.

But in Lyx, it is a GUI thing, and when I hit the
carriage return, I wanted it to start a new line
inside the table cell.

Isn't that the whole point of using a GUI? :)

I also tried to change the table preferences
to use p{} but do not know how yet.

thanks
steve
dschneiderch
Posts: 22
Joined: Thu Mar 31, 2011 10:41 pm

Re: How to insert new line inside table cell? (wrap text)

Post by dschneiderch »

I would also like to know how to do this! \linebreak as ERT doesn't seem to do anything. Is there a way to incorporate p{} as ERT to adjust the column width?? Sorry new to latex/lyx
Lyx 2.0RC2
Perhaps a bug in 2.0? Might try 1.6
dschneiderch
Posts: 22
Joined: Thu Mar 31, 2011 10:41 pm

Re: How to insert new line inside table cell? (wrap text)

Post by dschneiderch »

And if anyone is reading, I was using TexLive2009 but just updated to 2010 and it still doesn't work :(
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to insert new line inside table cell? (wrap text)

Post by localghost »

dschneiderch wrote:And if anyone is reading, I was using TexLive2009 but just updated to 2010 and it still doesn't work :(
This is a LyX problem thus not related to the TeX distribution.
dschneiderch
Posts: 22
Joined: Thu Mar 31, 2011 10:41 pm

Re: How to insert new line inside table cell? (wrap text)

Post by dschneiderch »

but this is the lyx forum, right?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to insert new line inside table cell? (wrap text)

Post by localghost »

dschneiderch wrote:but this is the lyx forum, right?
The quoted statement could be misleading to a problem with the TeX distribution. Therefore my remark.
dschneiderch
Posts: 22
Joined: Thu Mar 31, 2011 10:41 pm

Re: How to insert new line inside table cell? (wrap text)

Post by dschneiderch »

For what it's worth, I was able to insert a 2x1 table in my cell and turned off the borders so I could "wrap" the text.
Post Reply