the use of Latex for paper writing

本文介绍了使用LaTeX进行文档排版的几个实用技巧,包括如何指定文档类型、生成EPS图形的方法、表格使用的资源链接以及设置文档尺寸的具体步骤。对于LaTeX用户来说,这些技巧能够帮助提高工作效率。

A latex file (.tex) need to have a document type, specified like this "/documentclass{myclass}". Each class has an associated *.cls file in the system directories which is read in at start-up time. If you use some default document class, you do not have to have a separete class file, as they are build-in in miktex (like article.cls in the folder C:/Program Files/MiKTeX 2.8/tex/latex/base).

 

 

1, A good software I am using: TeXnicCenter (http://www.texniccenter.org/)

2, To use the figures, one of the most trouble thing -- generating EPS figure!!!

 

I did the following steps:
1) paste the figures into an ppt file;
2) print this file directly into eps (remember to choose the layout to be landscape, and after you got the .prn file, you can rename it to be .eps);
3) use the following format:


/begin{figure}
/centering
/vspace{0.5in}
/epsfig{file=myfigure.eps, height=2.5in}
/vspace{-2.0in}
/caption{A test caption.}
/end{figure}

 

(notice that these steps are based on my own laptop, where there is such an option in the Print window "Print to EPS". I do not remember where it is from. maybe it is because I have installed "CutePDF Writer" or "Qicken PDF Printer", as there is no such an option in my desktop.)

 

this way of generating eps figure will not have any problems like reversed pictures which is hard to adjust -- it ever wasted me a lot of time. You just get what you see in the original figure file, and can use the command of {figure} in latex to reverse the figure any direction you want.


3, To use tables, 

Some useful latex table use:
    http://en.wikibooks.org/wiki/LaTeX/Tables#The_tabular.2A_environment_-_controlling_table_width
    http://www.artofproblemsolving.com/LaTeX/AoPS_L_GuideLay.php#boxes
    http://www.latex-community.org/forum/viewtopic.php?f=35&t=803

 

4, How to set the document size!!!

It is the problem I just understand today. By default, the generated pdf size could be either A4 (8.3*11.7) or Letter(8.5*11). From the conference template, I found my paper size is different from the sample pdf file's, although we are using the same tex file. The effect is, same latex file, but different margins in pdf. Mine does not look like all the others. I googled and find some solutions. This one is best which does not require to change your class file (like setting /pdfpagewidth=8.5in in .tex or .cls) -- http://people.engr.ncsu.edu/txie/publications/writingtools.html. I copy some text directly related here:

 

If I create a PDF file using PS2PDF or PDFLaTeX the paper size is changed to Letter instead of A4 (the generated PDF has a narrow top margin) (or the other way around when the prefered size is letter)
TeXnicCenter specific (1beta 6.31) :

  • You can configure the PS2PDF command line options at menu "Build->Define Output Profiles..." Click LaTeX=>PS=>PDF on the left-size list box, then click Postprocessor tag, click the "Ghostscript (ps2pdf)" entry in the list box on the right. The "Arguments" box on the bottom should be put with the following command line options:
    -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile="%bm.pdf" -c save pop -f "%bm.ps"
    where "-sPAPERSIZE=a4" specifies that A4 size is generated.
  • If your preferred size is letter instead of A4, you need to replace the " -sPAPERSIZE=a4" above with " -sPAPERSIZE=letter". In addition, add "-t letter" to the command line argument for dvips. Note that you don't need to put
    /pdfpagewidth=8.5in
    /pdfpageheight=11in
    to the document preamble as some guideline suggests.

 

 

### 解决LaTeX编译时因使用中文导致的'not set up for use with LaTeX'错误 当在LaTeX文档中使用中文字符时,可能会遇到`! LaTeX Error: Unicode character ... not set up for use with LaTeX.`这样的错误提示。这通常是因为默认的LaTeX设置不支持直接处理某些Unicode字符。 为了使LaTeX能够正确识别并渲染中文字符,建议采用XeLaTeX或LuaLaTeX作为编译引擎,并加载适合多语言支持的宏包。具体操作如下: #### 使用CTEX宏集 对于包含中文内容的文章编写来说,最简便的方法之一就是利用`ctex`宏集来创建文档类或是引入到现有的文档前导部分。该宏集内部已经包含了对多种字体的支持以及必要的配置选项,从而简化了中文环境下的排版工作流程[^4]。 ```tex \documentclass{article} % 加入以下两行之一即可启用中文支持 %\usepackage{ctex} % 如果希望保留原有文档类特性的同时增加中文功能,则推荐这种方式 \documentclass[UTF8]{ctexart}% 或者直接选用带有内置中文支持的新文档类 ... ``` #### 设置合适的输入编码方式 尽管现代版本的LaTeX默认是以UTF-8模式读取源文件,但在特定情况下仍需显式声明所使用的字符编码标准以避免潜在冲突。通过加入`\usepackage[utf8]{inputenc}`指令可确保系统按照预期解析含有特殊符号的数据流[^3]。 不过需要注意的是,在选择了上述提到过的XeLaTeX/LuaLaTeX之后就不必再单独指定此参数了,因为这两种引擎天然兼容更广泛的字符集而不依赖额外插件辅助转换。 #### 替换或移除不可见控制符 有时候复制粘贴过来的文字里会夹杂着一些看不见却能被计算机识别出来的格式化标记(如零宽空间U+200B),这些隐藏元素往往成为引发异常报告的主要原因。因此编辑过程中应当仔细检查文本质量,必要时借助专门工具清理不必要的空白字符[^2]。 #### 更新与维护本地TEXLive/MiKTeX库 保持软件处于最新状态有助于获得更好的稳定性和性能表现,同时也减少了由于过期组件引起的技术难题发生的可能性。定期执行官方渠道提供的升级程序可以有效预防此类问题的发生。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值