Install style files in LyX

Sep 19, 2009

LyX is a frontend to LaTeX and so installation of any style file in LyX essentially mean: (1) installation of that style file in underlying LaTeX; and then (2) getting that style file work in LyX (using LyX layout files). Installation method for different types of style files are given below:

Install LaTeX class (.cls)
  1. create new directory with name <your-class-name> under /usr/share/texmf-texlive/tex/latex/
  2. copy <your-class-name>.cls file (& other files, if present) in the new directory
  3. sudo texhash
  4. create  a file <your-class-name>.layout in ~/.lyx/layouts
  5. edit the layout file according to the instructions given in Chapter 5 of "Customizing LyX: Features for the Advanced User" (Help->Customization in LyX).
  6. open LyX and click 'tools -> Reconfigure' and restart LyX when done. The new Document Class should be available now.
For Example, to install IEEEconf class file, download the zip files from here. Create .cls file by executing 'latex IEEEconf.ins'. Copy the folder IEEEconf to /usr/share/texmf-texlive/tex/latex/. Run sudo texhash. Find IEEEtran.layout file & copy it to a new file named IEEEconf.layout in ~/.lyx/layouts (IEEEconf and IEEEtran are very similar, so IEEEtran-layout file can be used as layout file for IEEEconf). Edit the the second line in IEEEconf.layout from
# \DeclareLaTeXClass{article (IEEEtran)}
to
# \DeclareLaTeXClass{article (IEEEconf)}
and it should turn up when you reconfigure LyX.
Install LaTeX style (.sty)

Style file (.sty) is an addition to class files (.cls) files and they provides special formatting rules which overrides the similar rules in class  files, if present. So each style file must be associated with a class file. Installation process is similar to that of class files (see previous section of this post). Layout files (step 5 above) have different format. Instructions are given in Chapter 5 of "Customizing LyX: Features for the Advanced User" (Help->Customization in LyX).

For Example, to install ACRA style file, download the files from here. Copy the file acra.sty to /usr/share/texmf-texlive/tex/latex/ACRA/. Run sudo texhash. Find article.layout file & copy it to a new file named acra.layout in ~/.lyx/layouts (acra.sty uses "article" class). Edit the the second line in acra.layout from
#  \DeclareLaTeXClass{article}
to
#  \DeclareLaTeXClass[article, acra.sty]{article (ACRA)}
Then add in next line

Preamble
    \usepackage{acra}
EndPreamble


and it should turn up when you reconfigure LyX.

Install BibTeX Style (.bst)
  1. create new directory with name <your-bib-style-name> under /usr/share/texmf-texlive/bibtex/bst/
  2. copy <your-bib-style-name>.bst file (& other files, if present) in the new directory
  3. sudo texhash
  4. open LyX and click 'tools -> Reconfigure' and restart LyX when done.
  5. open LyX and click 'tools -> TeX Information' and choose BibTex Styles. Click 'Rescan' The new BibTeX should be available now.

Read more ...

Useful applications in Ubuntu

Sep 16, 2009

Read more ...

Disable Autorun & Autoplay in Xp

Sep 16, 2009
Prevents the spread of autorun.inf viruses from flash drives (or any kind of removable drives.
  • Autoplay: Download disable_autoplay.reg and double click to run. Accept yes to all dialog boxes. Restart your computer.
  • Autorun: Download disable_autorun.reg and double click to run. Accept yes to all dialog boxes. Restart your computer.
[ Reference(s): Link1, Link2, Link3, Link4 ]
Read more ...

Emacs Cheat Sheet

Sep 11, 2009
C-x is same as Ctrl-x
M-x is same as Alt-x
<#> represents a numeric value

FILE
   Open    C-x C-f
   Save    C-x C-s
   Save As    C-x C-w
   Save All    C-x s
   Close Buffer    C-x k
   Quit    C-x C-c
EDIT
   Undo    C-_
   Begin Selection    C-space
   Cancel Selection    C-g
   Cut Selection    C-w
   Cut Line (text on right side of the cursor)    C-k
   Paste / Yank    C-y
   Copy Selection to Numbered Clipboard    C-x r s <#>
   Paste from Numbered Clipboard    C-x r i <#>
   Forward Delete    Delete
   C-d
   Forward Delete Word    M-d
   Backward Delete    Backspace
   Backward Delete Word    C-Backspace
   M-Backspace
   M-Delete
   Complete word (based on words in open buffers)    M-/
Rectangle Edits
   Copy rectangle    C-x r r
   Cut / kill rectangle    C-x r k
   Paste / Yank rectangle    C-x r y
   Create blank rectangle    C-x r o
SEARCH
   Search / Move to next search hit    C-s
   Search / Move to previous search hit    C-r
   Regexp Search / Move to next hit    M-C-s
   Regexp Search / Move to previous hit    M-C-r
   Search and Replace    M-% then y for each replacement
                    ! to replace all
   Goto Line Number    M-x goto-line <#>
   M-g g <#>
   Move to previous matching bracket    M-C-b
   Move to next matching bracket    M-C-f
WINDOW
   Move to & fro in buffers    C-x right-arrow-key
   C-x left-arrow-key
   Choose Window    C-x, C-b
   Move to top of page    C-Home-key
   Move to bottom of page    C-End-key
   Move to beginning of current line    C-a
   Home-key
   Move to end of current line    C-e
   End-key
   Maximize / Display only one buffer    C-x 1
   Split Horizontal    C-x 2
   Split Vertical    C-x 3
   Switch Focus Between Windows    C-x o
   Activate Menu Bar     M-`
FORMATTING
   Indent Selection    M-C-\
   Convert to uppercase (till end of current word)    M-u
   Convert to lowercase (till end of current word)    M-l
   Capitalize Word
   (Convert 1st letter of word to uppercase)
   M-c
   Uppercase Selection    C-x, C-u
   Lowercase Selection    C-x, C-l


Other useful cheat sheets:

Emacs configuration files:
Read more ...