-.|.低﹎ 发表于 2013-1-12 16:25

Latex遇到麻烦了....

\documentclass{article}
\usepackage{amsmath}
\usepackage{fancyhdr}
\usepackage{lastpage}
\begin{document}
\setlength{\parindent}{0pt} \setlength{\parskip}{2ex plus 0.5ex
minus 0.2ex}

\title{Cardboard Comfortable When it Comes to Crashing}
\author{Team \# 24}
\date{April 16, 2003}

\maketitle

\fancyhead{} \pagestyle{fancy} \lhead{Team \# 24} \rhead{Page
\thepage\ of \pageref{LastPage}} \setlength{\headrulewidth}
\newpage
\end{document}

这个代码编译出来的结果怎么会出现“0.4pt”的文字?求大神解释,小弟刚学,不是很懂。
下面是我得到的结果:

-.|.低﹎ 发表于 2013-1-12 16:25

怎么把“0.4pt”去掉?

牛坤 发表于 2013-1-12 19:43

你的代码想输出什么 ?? 就是题目  作者 日期么

牛坤 发表于 2013-1-12 19:43

你的代码想输出什么 ?? 就是题目  作者 日期么

-.|.低﹎ 发表于 2013-1-12 20:38

牛坤 发表于 2013-1-12 19:43 static/image/common/back.gif
你的代码想输出什么 ?? 就是题目  作者 日期么

这个是美赛的论文封面,我复制过来运行后就得到上面的结果,第二页有一个“0.4pt”的数字和字母,怎么会有这个东西呢?{:3_49:}

っ成为你 发表于 2013-1-12 21:42

问题出在:
\setlength{\headrulewidth}
latex help e-book上的说明:
\setlength{\gnat}{length}
The \setlength command is used to set the value of a length command. The length argument can be expressed in any terms of length LaTeX understands, i.e., inches (in), millimetres (mm), points (pt), etc.

这条命令设置的一些了一些参数,这些参数的单位可以是inches (in), millimetres (mm), points (pt), etc.

但是\headrulewidth本身是一条命令,我google了一下通常的用法都是\renewcommand{\headrulewidth}{xxx}。据说是设置页眉页脚用的,应该在fancy包里。
后来我试了一下:
\renewcommand{\headrulewidth}{0.4ex}可以看到那根页眉的线明显比
\renewcommand{\headrulewidth}{0.1ex}的线要粗。

っ成为你 发表于 2013-1-12 21:43

我刚才的回复呢?

っ成为你 发表于 2013-1-12 21:48

再来一遍吧{:3_64:}
问题出在:
\setlength{\headrulewidth}
根据\setlength的latex help e-book中的说明:
\setlength{\gnat}{length}

The \setlength command is used to set the value of a length command. The length argument can be expressed in any terms of length LaTeX understands, i.e., inches (in), millimetres (mm), points (pt), etc.
这里setlength设置的是一些参数的值,单位必须是inches (in), millimetres (mm), points (pt), etc.
但是\headrulewidth本身是一条命令,所以这样用会错。
google了一下,一般是这样用的:
\renewcommand{\headrulewidth}{xxx}
renewcommand和newcommand的区别大家都清楚吧,不口水了。
试了一下后发现:
\renewcommand{\headrulewidth}{0.4ex}的页眉线明显比
\renewcommand{\headrulewidth}{0.1ex}的页眉线要粗。

我不是大神,只是一个Latex爱好者而已啦,真大神勿喷。

っ成为你 发表于 2013-1-12 21:49

回复怎么又没了……{:3_64:}

-.|.低﹎ 发表于 2013-1-12 22:23

っ成为你 发表于 2013-1-12 21:49 static/image/common/back.gif
回复怎么又没了……

不会吧,我没收到你的回复哦,会不会是系统自动屏蔽了哦,你帮我解决了吗?要是解决了,发到我的邮箱里行不?谢谢了!793050920@qq.com{:3_48:}
页: [1] 2
查看完整版本: Latex遇到麻烦了....