2010年9月26日星期日

【收藏】LyX中IEEEtran中Figure变Fig.的方法

LyX中提供的IEEEtran模 板为向IEEE投稿提供了便利。但使用过程中发现图片和表格的Caption与期刊要求的不一致,期刊要求的格式为 Fig. 1. 和 TABLE I等,但用IEEEtran模板写成的论文输出(DVI或PDF)后显示的却是 Figure 1 和 Table 1。经过网络搜索(这里)和向CTEX论坛的高手请教终于找的了解决的办法:

第一种方法:

LyX-Tools-Preferences-Language Settings,取消选中 Use babel

第二种方法:

    1. 在光标定位于用IEEEtran模板建立的文档最前端,Insert-Tex code 或者直接按快捷键Ctr+L;
    2. 将下列代码粘贴进去

% Redefine string definitions overwritten by babel (maybe not all are used)
\def\contentsname{Contents}
\def\listfigurename{List of Figures}
\def\listtablename{List of Tables}
\def\refname{References}
\def\indexname{Index}
\def\figurename{Fig.}
\def\tablename{TABLE}
\def\partname{Part}
\def\appendixname{Appendix}
\def\abstractname{Abstract}


上面两种方法可以任选一种。应用上述方法后,虽然在LyX中图片和表格的Caption仍显示为Figure和Table,但此时输出后的文档中已经可以正确显示了。

2010年9月22日星期三

Lyx layout problem

在使用lyx的时候,经常会碰到document class unavailable的情况。以前要写Springer LCNS 的文章的时候,就发现Springer的layout svjour3不能使用。今天晚上睡不着,跑起来尝试解决这个问题,居然把这个一直头疼的问题给解决了。方法如下:
1. 当想使用svjour3 template的时候lyx提示找不到svjour3.cls和svglov3.clo。上google找到下载到用户文件夹。这里要注意,这个用户文件夹的路径如下:
  • Linux and other Unix-like systems: usually found at ~/.lyx, where ~ is your home directory.
  • Mac OS X: ~/Library/Application Support/LyX-/
  • Windows Vista / Windows 7: usually at C:\Users\[your username]\AppData\Roaming\lyx\ (note: this is if you installed LyX for all users)
  • Windows 2000/XP: usually at C:\Documents and Settings\[your username]\Application Data\lyx\
  • Windows 95/98/ME: C:\Program Files\lyx\Resources\lyx\ (note: needs to be confirmed - this looks a bit like the SystemDir)
我用的是XP,所以路径是C:\Documents and Settings\Yi\Application Data\lyx20,找到后将svjour3.cls和svglov3.clo这两个文件拷入。

2. 生成svjour3.layout。 因为系统中没有svjour3.layout文件,所以我们要自己做一个。在lyx的安装路径下找到..\LyX 2.0\Resources\layouts 文件夹。可以找到一个svjour.inc的文件,如果找到了,就按照步骤3生成。

3. 在\LyX 2.0\Resources\layouts中找到一个article.layout文件,用notepad将其打开,在Input stdclass.inc下加入Input svjour.inc,另存为svjour3.layout。

4. 将新生成的svjour3.layout 和 svjour3.inc这两个文件一起拷入到用户文件夹。

5. 在lyx中,Tools>Reconfigure。重启lyx后就可以在Lyx->Document->Document Setting->Layout>Document>Document-Class drop-down list中找到了。

6. 有时候在生成文档的时候,lyx还会提示找不到svjour3.cls和svjour3.clo文件,这个时候只要将这两个文件拷到文档所在的文件夹即可。

2010年9月9日星期四

How to connect Lyx and SumatraPDF

Sumatra PDF is a lightweight and open source PDF reader. Lyx is a good Latex editor and easier to use.

To connect Lyx and Sumatra, the processes is as follows:
1. Open Lyx, Tools-->Preferences-->File Handling-->File formats-->Format-->PDF (pdflatex)-->Viewer-->Custom, paste the path of SumatraPDF into the textbox (e.g., "D:\Program Files\SumatraPDFPortable\SumatraPDFPortable.exe"). Note that "" is very important on the path.