Ping Services

Monday, November 8, 2010

Tips to get you started with Lyx

Here are some great tips to help you get started with Lyx.

Updated November 2011: Part 2 here

Tip 1: Getting a more beautiful output.
If you look at the PDF output first, you might notice that the fonts do not look very crisp. To get better quality fonts go to the LaTeX preamble by going to Documents>Settings>LaTeX Preamble and enter the following:

\usepackage[T1]{fontenc}
\usepackage{pslatex}

Click on Save as document defaults and restart Lyx. You will notice an improvement.
Tip 2: Margins
The default margins are quite large and waste quite a lot of paper. You can set the margins yourself by going to Document>Settings>Page margins and setting the margins yourself. Here are my margin settings, the content that I print is all within the printable space.



Tip 3: Page numbering. 
If you wish to have your page numbers in the format page x of y, go to the LaTeX preamble again and enter these lines:
\usepackage{lastpage}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{{Page} \thepage { of} \pageref{LastPage}}
\rfoot{}
\renewcommand{\headrulewidth}{0pt}
Then go to Page layout in the document settings and set the heading style to fancy.

Tip 4: Removing the date from the title
When you want to set the title, you may notice that the date is always present underneath. To remove this date, go to the LaTeX preamble and add the following line:
\date{}

Tip 5: Copying and pasting tables from Open/Libre office to Lyx.
If you are writing a scientific paper, then you may have to do calculations in a spreadsheet program. The extension Calc2LaTeX allows you to do just that (link provided at the bottom). After installing the extension,:
  1. Open Calc.
  2. Go to Tools>Customize.
  3. Click on Add.
  4. Expand Libreoffice Macros
  5. Expand My Macros
  6. Expand Calc2LaTeX
  7. Double click on main.
 Figure: Calc2LaTeX
    Now you have a menu option for copying tables. I recommend using the file output option. If you export it as a file. You only need to go to File>Import>Plain LaTeX on Lyx and import the table.

    Tip 6: Getting tables to fit to the width of the page
    When you use large tables, it can be difficult to get them to fit to the width of the page. Firstly, make sure that the text in the table heading is not underlined. Then right click on a cell that is in a column that you wish to resize, click on settings and set the width.

    Tip 7: Changing the paper size.
    By default, Lyx is set to letter size paper. You can change the paper size by going to Documents>Settings>Paper Layout.

    Enjoy!


    Links
    Lyx website www.lyx.org
    Calc2latex extension http://extensions.services.openoffice.org/en/project/Calc2LaTeX
    Introduction to Lyx http://www.tux-crazy.com/2010/11/lyx-best-way-to-write-your-documents.html




    No comments:

    Post a Comment