TeX 版 (精华区)

发信人: TeX (把TeX进行到底), 信区: TeX
标  题: FAQ_by_aayong@smth
发信站: 哈工大紫丁香 (Sat Apr  2 20:28:39 2005), 转信

我没有记载 FAQ 的习惯,不过这里转一下 aayong@smth 在担任 TeX@smth 时记
下的一些东西吧。Thanks to aayong@smth.

SMTH TeX 版已经提过的问题及解答

1. 旋转和缩放命令为什么不产生效果? 按照《LaTeX插图指南》30页的讲解测试
几个旋转和缩放命令\scalebox, \resizebox 和\rotatebox,对象像示例一样选
了几个文字,但不知道为什么不产生效果,编译可以正常通过,graphicx宏包已
正确使用,后来使用了\frambox 命令发现刚才的几个旋转缩放命令在字的外面
加上了缩放的盒子,字却没有变化,不知道这是为什么?

答:dvi文件中没有效果,需要转成ps或pdf来看的.

2.  LaTeX初学,一个会议文章的模板中有如下一句:
    \documentclass[9pt,onecolumn]{scrartcl},
   编译出错如下:
   ! Class scrartcl Error: File `size9.clo' not found!
   (scrartcl)              This error is fatal!.
   请问这个问题如何解决?
   
答: 模版不全。上google找缺少的文件 size9.clo.

3. 请问是不是写中文用CTeX,英文用LaTeX?

答:见 CTeX-FAQ. CTeX 和 LaTeX 的关系。

4.  从MATLAB里直接得到的图形怎么嵌进TEX文件里去啊?

答:
        1. Open the figure by Matlab
        2. In the Figure Editor, Click "File" Menu
        3. Export...
        4. Save as type (choose .eps)
        5. Provide a file name, then the file will be save as *.eps,
           which can be used in LaTeX.

5. 每个 item 之间的那个距离在那里设置?

答:LaTeX manual 中文版第四章有详细介绍。

6. 请问英文字体大小怎么控制啊,各位大虾帮帮忙吧

答:见LaTeX manual 第八章3节及附录5.

7. 请问有没有表示正负离子的那个符号?用^+显得太大了,怎么在公式里改字
号?

答:见LaTeX manual 第五章.

8. 关于prosper裁边的问题

答:step1. 修改style文件。
        %%\PDFCroppingBox{10 40 594 820}
        \PDFCroppingBox{0 0 594 840}

    step2.不使用WinEdt上的ps2pdf,打开GSview浏览生成的ps文件,
        选择convert,按他的默认设置,转换成PDF,应该就可以了。
        四周的边都可以出来,没问题。
        至于footer, 如果有问题的话改一下prosper.cls文件就可以了。
        ……

    {\@colorFoot\tiny \@cartouche~--~p.~\thepage\ifallPages/%
\realpageref{last@page}在这里加入空格“~”\fi}%
         ……
         
9. 请教双栏文章中如何跨两栏写长公式

答:
      \begin{multicols}{2}
      Bla bla...
      \end{multicols}
      %
      \begin{equation}
           very long equation
      \end{equation}
      %
      \begin{multicols}{2}
      Bla bla...
      \end{multicols}

To help the reader to read the columns in the correct order you could
also add horizontal lines at the bottom of column 1 and at the top of
column 4:

         111111111111111111  2222222222222222222
        1111111111111111111  2222222222222.
        111111111111111.      222222222222222222
         111111111111111111  2222222222222222222
        1111111111111111111  2222222:
        --------------------

          equation too long to fit in one column

                             -------------------
        3333333333333333333  4444444444444444444
        33333333333.         44444444.
         333333333333333333   444444444444444444
        3333333333333333333  4444444444444444444


The horizontal lines can be created using the following macros 
(this is a quick hack; I'm sure that there are room for plenty
of improvements here...):

    \newlength{\halfpagewidth}
    \setlength{\halfpagewidth}{\linewidth}
    \divide\halfpagewidth by 2
    \newcommand{\leftsep}{%
    \noindent\raisebox{4mm}[0ex][0ex]{%
        \makebox[\halfpagewidth]{\hrulefill}\hbox{\vrule height 3pt}}%
        \vspace*{-2mm}%
    }
    \newcommand{\rightsep}{%
        \noindent\hspace*{\halfpagewidth}%
        \rlap{\raisebox{-3pt}[0ex][0ex]{\hbox{\vrule height 3pt}}}%
        \makebox[\halfpagewidth]{\hrulefill}%
    }
    
       Use them like:

       \begin{multicols}{2}
       Bla bla...
       \end{multicols}
       %
       \leftsep
       \begin{equation}
            very long equation
       \end{equation}
       \rightsep
       %
       \begin{multicols}{2}
       Bla bla...
       \end{multicols}

10. 我按照清泉的模版自定义一个列表。但是和我想要还有差距。附件有我编译
后的效果,但是对于第三个item,第二行竟然和“检测3”对齐,我想让它和
“:”后面的内容对齐,请问该怎么办?谢谢!
下面是自定义列表:
\newcounter{newlist} %自定义新计数器
\newenvironment{mylist}[1][可改变的列表题目]{%%%%%定义新环境
\begin{list}{\textbf{\hei #1} \arabic{newlist}:} %%标签格式
    {
    \usecounter{newlist}
     \setlength{\labelwidth}{22pt} %标签盒子宽度
     \setlength{\labelsep}{0cm} %标签与列表文本距离
     \setlength{\leftmargin}{22pt} %左右边界
     \setlength{\rightmargin}{0cm}
     \setlength{\parsep}{0.5ex plus0.2ex minus0.1ex} %段落间距
     \setlength{\itemsep}{0ex plus0.2ex} %标签间距
     \setlength{\itemindent}{22pt} %标签缩进量
   }}

{\end{list}}%%%%%

答: 看了一下 LaTeX companion 2ed 第三章,发现你的问题是由于没有
        弄清楚 \labelwidth \labelsep \itemindent 以及
        starting position of label 之间的关系.

                ------------->--------->
                |\labelwidth |\labelsep|
                           |----------->
         ----------------->|\itemindent
              \leftmargin  |

        可以知道 starting position of label 相对于页面的左边
        为: \leftmargin + \itemindent - (\labelsep + \labelwidth)
        及相对于列表第二行及其以下文字的左边为:
         \itemindent - (\labelsep + \labelwidth)

        算一下就知道你的结果在情理之中了.你只要把 \itemindent 改
        一下就可以了,它默认为零.

11. 问个origin做的图嵌到TeX里的问题

答:     你在export的时候,选择打开eps options
        然后在弹出的eps options窗口中有一个embedding选项
        选择use built-in fonts.

12. 如何使一些章节标题不在目录中出现?
几个\subsubsection{}生成的标题不想让它们在目录里出现,有办法吗??

答: \setcounter{tocdepth}{2}

13. 请问怎么把一个汉字旋转90度?

答:     \usepackage{graphicx}
        \rotatebox{90}{字}

14. 有么有LaTeX输入程序的模版?

答:     bbs.ctex.org上有清泉模板,里面有输入matlab 和c++的模版。
        其实就是用listlings宏包。一学就会。

15. 有没有比较方便的更改表格线宽的方法?TeX这方面好像挺弱啊.

答:     强烈推荐booktabs宏包,几乎一切都随你订制

16.  关于中文段首缩进
        我发现我文章里面的中文段首缩进不是两个汉字
        而是一个半,看上去比较别扭,可以调整吗?
        
答: CJK 环境中使用命令\CJKindent, 另外很多模板自己已经设置好了(如王磊
    模板等).


17. 如何剪裁eps图片?
答: PS to EPS,把自动计算boundbox前面的勾去掉就可以了

18. Photoshop等其他软件生成eps格式无Bounding Box的问题。

答:方法1. gsview再次转换到eps格式,生成Bounding Box.
    方法2. 在插入图形时使用参数定义Bounding Box:
    \includegraphics[bb=10 20 100 200 ]{file_converted_from_Photo.eps}
    bb的值从photoshop或gsview中可以读出来。

19. 请问怎么把excel里的图片弄成eps的

答: 虚拟打印.

20. 如何设置背景颜色?
比如黑底蓝字?

答:     \documentclass[11pt]{article}
        \usepackage[usenames]{color}
        \begin{document}
        \fcolorbox{Black}{Black}{\textcolor{Blue}{Blue words in Black
            Background!}}
        \end{document}

21. 怎么更改title和author的格式吗

答:

    \posttitle
    \authorfont
    \postauthor
    \datefont
    \postdate

The titling package provides a configurable \maketitle command. 
These commands control the typesetting of the document’s \maketitle 
command

. The \title is processed between the \titlefont and \posttitle 
commands; that is, like:
{\titlefont \title \posttitle}
and similarly for the \author and \date commands. The commands are 
initialised to mimic the normal result of \maketitle typesetting in 
the article/report classes.

For example, the default definitions of the \...title... and 
\...author...

commands are:
\newcommand{\titlefont}{\begin{center}\LARGE}
\newcommand{\posttitle}{\par\end{center}\vskip 0.5em}
\newcommand{\authorfont}{\begin{center}
\large \lineskip 0.5em%
\begin{tabular}[t]{c}}
\newcommand{\postauthor}{\end{tabular}\par\end{center}}

They can be renewed to obtain different effects, for instance removing
the center environment from \...title... will result in the title being 
typeset as a normal paragraph.

22. 关于行距,页边距等的调整

答:都有相关的命令
        行间距:baselinestretch、baselineskip
        页边距:leftmargin、rightmargin
        建议你找本书看一看,其实初学者的绝大部分问题在书里都讲过了。
        推荐lshort和manual of LaTeX

23. 第一页没有写完,后面接着一个比较长的公式,所以自动换了一页我觉得第
一页下面空着这么一截怪难看的,最好不要自动换页,还是接着写,然后到非换
不可的时候,在公式内部换如下面所示,我已经用公式为关键字在版内找过了,
但是不果不知哪位xdjm明示一下,谢谢了!!!

\begin{subequations}\label{Eq14}
    \begin{gather}
        \begin{split}
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        \end{split}\\
        \begin{split}
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        \end{split}\\
%%%  比如说在这里可以换页嘛,因为第一页剩下来的的地方其实还是写两行的
%%%  比如说在这里可以换页嘛,因为第一页剩下来的的地方其实还是写两行的
        \begin{split}
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        \end{split}\\
        \begin{split}
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        \end{split}
    \end{gather}
\end{subequations}

答:    在文档的导言部分加上:\allowdisplaybreaks[4]
        括号内的数字表示你希望换行的程度。
        0表示不要换行,1表示尽可能不换行
        4的换行程度最强。

24.   用\thanks 命令在文章左下方作者介绍,怎样能让文章题目下的作者名的
右上方不带星号?我表达清楚了吧?紧急求助。

答:    不用\thanks,就用\footnotetext,但是可能不能用在标题里,正文开
始用试试吧。

25.   [请教]itemize的缩进问题默认情况下
\begin{itemize}
        \item xxx
        \item yyy
\end{itemize}
xxx和yyy会相对于前面的正文有一段缩进,如何在整个文档中取消这样的缩进?

答:    LaTeX manual上有详细解释。现给出一个例子。
\newcounter{newlist} %自定义新计数器
\newenvironment{denselist}[1][可改变的列表题目]{%%%%%定义新环境
\begin{list}{\textbf{\hei #1} \arabic{newlist}:} %%标签格式
    {
    \usecounter{newlist}
     \setlength{\labelwidth}{22pt} %标签盒子宽度
     \setlength{\labelsep}{0cm} %标签与列表文本距离
     \setlength{\leftmargin}{0cm} %左右边界
     \setlength{\rightmargin}{0cm}
     \setlength{\parsep}{0ex} %段落间距
     \setlength{\itemsep}{0ex} %标签间距
     \setlength{\itemindent}{44pt} %标签缩进量
     \setlength{\listparindent}{22pt} %段落缩进量
    }}
{\end{list}}%%%%%

26 使用syntonly 宏包可以让LATEX 快速的检查你的文档:LATEX 浏览你的
文档,仅仅检查语法和所使用的命令是否正确,不会产生DVI 输出。在这
种模式下,LATEX 运行的非常快,可以节省可观的时间。使用方法非常简
单:
\usepackage{syntonly}
\syntaxonly


27 如何让第一页不显示日期?

答:\date{}

28 曾经有某位朋友我问如何将参考文献的格式[1],[2],[3],[4]变成[1]-[4]。
或把[1,2,3,4]变成[1-4]。

答: 可以用\usepackage{cite} or  \usepackage[sort&compress]{natbib}

29 请问如何写一个圈1,圈2之类的?

答:\testcircled{\scriptsize 1} == 圈1


30 竖排中文
\usepackage{ifthen,graphicx}
\begin{document}
  \newcommand{\verticle}{%
    \renewcommand{\CJKsymbol}[1]{%
    \setbox0=\hbox{\symbol{##1}}%
    \newcommand{\POS}{}%
    \ifthenelse{\lengthtest{\ht0<.39\wd0}}%
            {\renewcommand{\POS}{c}}{\renewcommand{\POS}{r}}%
    \makebox[\wd0][\POS]{\rotatebox[origin=lB]{90}{\symbol{##1}}}%
    \if CJK@bold@%
    \hbox to \CJKboldshift{\hss\makebox[\wd0][\POS]{%
        \rotatebox[origin=lB]{90}{\symbol{##1}}}}%
    \hbox to \CJKboldshift{\hss\makebox[\wd0][\POS]{%
        \rotatebox[origin=lB]{90}{\symbol{##1}}}}%
    \fi}}
\newsavebox{\saverotate}%
\newcommand{\shupai}[2][\textheitht]{%
    \savebox{\saverotate}{\parbox[t]{#1}{\verticle #2}}
    \hfill\rotatebox[origin=lt]{-90}{\usebox{\saverotate}}}
\verticle 话说当时住持真人对洪太尉说道:“太尉不知,此殿中当初是祖老天
师洞玄真人传下法符,嘱付道:`此殿内镇锁着三十六员天罡星,七十二座地煞
星,共是一百单八个魔君在里面。上立石碑,凿着龙章凤篆天符,镇住在此。若
还放他出世,必恼下方生灵。'如今太尉放他走了,怎生是好!他日必为后患。”
洪太尉听罢,浑身冷汗,捉颤不住;急急收拾行李,引了从人,下山回京。真人
并道众送官已罢,自回宫内修整殿宇,竖立石碑,不在话下。
\end{document}

31 首行缩进
\usepackage{indentfirst}

--

※ 来源:·BBS 大话西游站 wforum.zixia.net·[FROM: 202.119.32.*]

--

※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.119.32.121]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:219.170毫秒