Go to page:

Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

LyXWinTips

<< | Page list | >>

Tweaking LyX on Windows

Create a Bibliography

To edit the reference list used by LyX you need a separate program.

  • BibEdit is a very simple but capable bibliography editor. Unfortunatelly can't be used with non-latin1 encodings.
  • JabRef is a more advanced alternative which can search online databases (CiteSeer and PubMed), import and export to Endnote, and link to a PDF database.
  1. Once you have installed a reference manager, open it, create some bibliographical entries, and save the file as mythesis.bib.
  2. Create a document and select Document->Settings->Bibliography and check Natbib.
  3. Now click Insert->List & TOC->BibTeX Reference. Add your database mythesis.bib and enter the style file plainnat.
  4. Now insert a citation (Insert->Citation Reference) and view it (View->View PDF (pdflatex)).

If you want other citation styles, you will find some in your LaTeX tree under ...\texmf\bibtex\bst\. You will find other style files on CTAN and some style examples here: Styles distributed with MikTeX and Some other examples. A collection of BibTeX style files for various journals can be found at the LaTeX Bibliography Styles Database. If you want to design your own style file, you may try the LaTeX package MakeBst, see Changing reference list to another format.

It is quite easy to create BibTeX entries for books available at Amazon: Amatex. You search the book you are looking for, copy the BIB entry (BIB Daten), open BibEdit and select Record->Paste. Many scientific databases (like CiteSeer or RepEc) offer similar possibilities.


Using True-Type Fonts in LyX documents

Works with earlier MiKTeX versions, but not with MiKTeX 2.5. Maybe someone can figure out how to adapt this to MiKTeX 2.5?

Try providing all paths without spaces i.e. using the old DOS 8.3 style names so that "C:\Program Files\MikTeX 2.8\" becomes "C:\PROGRA~1\MIKTEX~2.8" and "C:\Documents and Settings\Administrator\Local Settings\Application Data\MiKTeX\2.8\" becomes "C:\DOCUME~1\ADMINI~1\LOCALS~1\APPLIC~1\MiKTeX\2.8\".

You might want to be able to the TTF fonts on your system in your LyX documents. The following procedure works fine with MiKTeX and pdflatex. For other combinations, you need to make adjustments.

The installation program MTFI ver. 0.6 needs some tweaking which is done by the batch wrapper importttf.bat. As an example, take the TTF Verdana (not because it is particularly beautiful, rather because it will be found on most Windows installations).

Do this only once:
  • For Windows XP create an environment variable "miktexdir". First open the "My Computer" properties dialog. ( Windows-key + Pause/Break key; or Start->Right-click My Computer->Properties). Then ->Advanced->Environment variables->System variables->New. Fill in miktexdir=<Path to Miktex>, i.e. the folder containing the directories \texmf and \localtexmf ->OK
  • Check for a file updmap.cfg in ..\localtexmf\miktex\config. If it exists, add
     map winfonts.map
as the last line; if it does not exist, create updmap.cfg containing this single line.
  • Check ..\texmf\pdftex\config\pdftex.cfg If it contains a line with map winfonts.map, delete the line (including possibly a "+").
  • Run Miktex Options Refresh File name database and roots.
  • Download and install MTFI
  • create a file importttf.bat containing
     @echo off
     call mtfi.exe
     if not exist %miktexdir%\texmf\pdftex\config\pdftex.cfg.mtfi_backup goto :go
     del %miktexdir%\texmf\pdftex\config\pdftex.cfg
     ren %miktexdir%\texmf\pdftex\config\pdftex.cfg.mtfi_backup pdftex.cfg
     initexmf -u
     initexmf --mkmaps
     goto :finish
     :go
     echo .
     echo .
     echo             *********************************************
     echo             *                                           *
     echo             *    no pdftex.cfg.mtfi_backup file found.  *     
     echo             *                                           *
     echo             *    run importttf.bat first!               *
     echo             *                                           *
     echo             *********************************************
     echo .
     pause
     :finish
in the MTFI directory.
  • Restart computer   .
Do this every time you install a new font (Verdana as an example):
  • Create a temporary directory, e.g. C:\Temp
  • Open a command window in your Windows\Fonts directory
  • Issue the command copy verdana*.* C:\temp
  • Close the command window
  • Run importttf.bat Next
  • Go to the normal font ... button and navigate to C:\Temp
  • Select verdana.ttf. The other shapes will show up automatically as Bold: verdanab.ttf, Italic: verdanai.ttf, Bold&Italic: verdanaz.ttf
  • Next, check the Miktex\texmf and ~\localtexmf directories if necessary.
  • Next, name of the font: verdana
  • Select an output directory, e.g. C:\Temp
  • Next, Next, Finish, Close
  • Open LyX, create a new document
  • Layout -> Document ->Praeamble
  • insert \newfont{\verdana}{ecverdana}
  • Close

Now write some text. If you insert an ERT (TeX insert) [ \verdana ] (with a blank after the last character!) and write some text, verdana will be used until you insert an ERT [ \normalfont ] (again with a trailing blank). If you want to use verdana for section headings, for example, put

      \usepackage{sectsty}
      \sectionfont{\verdana}

in the praeamble.

The font name for verdana (ecverdana) generated by MTFI and used in the \newfont command is the name you have chosen, prepended by "ec". So the regular shape is ecverdana in this case. The bold variant is appended by "b", the italic by "i" and the bold italic by "bi", that is ecverdanai, ecverdanab, and ecverdanabi. You can build a font family from these, but this is not covered here. (It is not advisable, therefore, to use verdana as a standard font without such adjustments.) Your new fonts are to be found in ..\localtexmf\fonts.) Be aware that other LaTeX installations don't have your new True-Type fonts, so don't use them if the LyX document is to be portable.

As Verdana has the ligatures fi and fl, LyX will produce them, although Microsoft Word doesn't!


Tag me Windows Tip

Making LyX files portable

To want to work with your LyX file on different computers (office and laptop), always use "relative" paths. This is done by keeping all the necessary files in the same folder or some subfolders of that folder. If your paper mythesis.lyx is in the folder C:\Documents\Mythesis, for instance, keep the bibliography mythesis.bib is the same folder or in C:\Documents\Mythesis\Bib, for example. Copy the Latex and Bibtex files that are not standard (unusual stylefiles such as mythesis.sty, mentioned in Layout -> Document -> Praeamble as \usepackage{mythesis} or unusual bibtex styles such as mythesis.bst mentioned in the Bibtex window) into C:\Documents\Mythesis, and figures in C:\Documents\Mythesis\images, etc.


Restoring last view location when opening PDF

Users of Windows Vista and Windows 7 have reported that Adobe Acrobat does not remember the location in the PDF document. Every time you let LyX build a new PDF, Acrobat resets to the start of the document. There are two ways to fix this:

  1. In Acrobat 8 (but not in Acrobat 9) you can change Edit -> Preferences -> Document:
    1. DISABLE "Show each document in its own window"
    2. ENABLE "Restore last view settings when reopening documents"
  2. Alternatively use Sumatra PDF to view LyX generated PDF's. This works alongside all versions of Acrobat:
    1. Download and install Sumatra PDF.
    2. In LyX go to Tools→Preferences→Paths and add the install location to PATH prefix. Most likely this is "C:\Program Files\SumatraPDF".
    3. In File formats select "PDF (pdflatex)" and change Viewer to SumatraPDF.
    4. Restart LyX.

Alternate icon set for Windows

If you aren't happy with the included document icons, another set is available that is a more consistent with the Windows look and feel. It includes all common sizes up to 48x48 and multiple color depths, all in a single multipart ico file. To change the icon associated with a .lyx file, open an Explorer window, go to Folder Options -> Tools -> File Types, find LYX on the list, click Advanced and then Change Icon.

Windows Icon Preview

Download the icon set here http://www.smallfiles.org/download/210/lyx_icons_for_windows_1.0.zip.html(approve sites)

Some further toolbar icons can be found at UserInterface.

You can grab a dock icon here.


Printing from within LyX

From a technical point of view, printing from within LyX is not more difficult on Windows than it is on Unix if you have Cygwin. Indeed the cygutils package contains an lpr command which can spool files to a Windows printer. The only tricky part is how to specify the printer in the LyX "Print Document" dialog. This should be the same argument as the -d switch of lpr.

However, on Windows people are accustomed to using a print dialog from which a printer can be selected (and I must say that it is very convenient). If you have ghostscript and gsview installed, this dream can become reality, as gsview includes a utility (gsprint) which brings a print dialog allowing you to select the desired printer. I have written a small program which uses gsprint for this purpose.

Download this zip archive lp.zip and put lp.exe somewhere in the PATH (a very good choice is to put it in the same folder where you have the LyX executable). Then start LyX and reconfigure it (Tools->Reconfigure). If you do it from the command line, you should see that lp.exe is spotted (this works even if you have Cygwin, as lp is looked for before lpr). Now quit and restart LyX, open a document and choose "File->Print". You don't need to specify a printer in the LyX "Print Document" dialog (it does not harm if you do, it is simply ignored), simply hit the Print button and wait for the gsprint printer dialog to appear, then select the desired printer and hit the OK button.

Happy printing with LyX!


Could someone translate this into something usable please? As a more-or-less permanent captive "Windows people" the direction to "put lp.exe somewhere into the PATH" is less than helpful.

Default language for spellchecker

To change the language or dialect used for all new documents (e.g. instead of using American-English you would prefer the spellchecker to use British-English) the "default language" must be changed. Go to Tools -> Preferences -> Language Settings -> Languages and from the drop down menu labelled "Default Language" change to the language you wish (i.e from "English" to British). The spellchecker will use the dictionary list for the default language when checking new documents.

To change the language or dialect used for an existing document, go to Document -> Settings -> Language -> Language from the drop down menu choose the language or dialect you wish the spellchecker to use for that specific document.

Note: The "English" default language in LyX is General American, not the standard English (Present day English) used in Britain and the European Union.

Trouble Configuring LyX (missing classes) with MikTeX

MiKTeX can cause problems with the configure script in LyX if the "Install missing packages on-the-fly" option is checked. If you find that only a few classes are available in LyX under Windows, try disabling this option in the MiKTeX general options (mo.exe) and re-configuring LyX.

TrueType Fonts Bibliography

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2012-03-25 03:41 CEST