# How to rotate a large matrix in Lyx?

I have a large adjacency matrix in LyX.

How can I rotate it to fit the page?

Alternative: you see that the commands such as the \begin{landscape}...\end{landscape} are not interpreted as commands in Lyx. How to type them in Lyx?

• Are you asking what needs to be done to display the object in landscape more rather than in portrait mode?
– Mico
Mar 12 '16 at 16:51
• @Mico whatever works. Both should work but unable to get any working, an instruction here but not able to type the \begin{landscape}...\end{landscape} in Lyx that it would interpret it as a command, see the photo.
– hhh
Mar 13 '16 at 21:34

Right-click on "Float: Table", click on "Settings", and check "Rotate sideways".

To insert custom LaTeX code in LyX (where you mention \begin{landscape}), go to Insert > TeX Code (ctrl + L on Ubuntu). This is referred to as "ERT".

The bottom page in the top picture (big table going over margins in sideways) is made with Lyx's option: click Float: Table, click on Settings and check Rotate sideways as instructed by scottkosty.

However I was not able to align the table properly with the default method so I ended up to the below method to manually specify the size that corresponds to the top page in the top picture.

P.s. If you know how to encapsulate the handwritten code and the table block nicely in Lyx in its GUI, please let me know. This curiosity moved here.

• For your "P.s.", it is possible to create a new (local) layout, see the Customization manual (or maybe open a new question for more details).
– G.M.
Mar 14 '16 at 15:16
• @G.M. Thank you, moved the question and curiosity here.
– hhh
Mar 15 '16 at 14:21