由买买提看人间百态

topics

全部话题 - 话题: setlength
1 (共1页)
z***i
发帖数: 8285
1
来自主题: TeX版 - tex问题
\documentclass[a4paper,11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[colorlinks=true]{hyperref}
\usepackage{colortbl}
\usepackage{hyperref}
\usepackage{extramarks}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{eso-pic}
\usepackage{ifpdf}
\usepackage{svgcolor}
\usepackage{booktabs}
\usepackage{amssymb}
\pagenumbering{arabic}
\hypersetup{urlcolor=blue}
\definecolor{light-gray}{gray}{0.86}
\setlength{\paperwidth}{597pt}
\setlength{\paperh... 阅读全帖
m***e
发帖数: 4
2
修改一下,大概就可以了:
\setlength{\topmargin}{-2cm}
\setlength{\headsep}{2.2cm}
\setlength{\evensidemargin}{.7cm}
\setlength{\oddsidemargin}{.7cm}
\setlength{\textheight}{22.5cm}
\setlength{\textwidth}{15.2cm}
m**w
发帖数: 29
3
来自主题: Faculty版 - (急!) NSF proposal type font
This is part of the new requirements.
I have also used the following commands.
\setlength\topmargin{0in} % 1 inch
\setlength\headheight{0in}
\setlength\headsep{0in}
\setlength\textheight{8.7in}
\setlength\textwidth{6.5in}
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\abovedisplayshortskip=2pt
\belowdisplayshortskip=2pt
l*****i
发帖数: 3929
4
来自主题: TeX版 - 可不可以改Margin
For example:
\setlength{\oddsidemargin}{0.55in}
\setlength{\textwidth}{5.85in}
\setlength{\textheight}{7.75in}
\setlength{\topmargin}{0.7in}
T*******n
发帖数: 493
5
\usepackage{array}
\newcolumntype{I}{!{\vrule width 1pt}}
\newcommand*{\Hline}[0]{%
\noalign{\global\setlength{\arrayrulewidth}{1pt}}%
\hline
\noalign{\global\setlength{\arrayrulewidth}{0.4pt}}%
}
\newcommand*{\Cline}[1]{%
\noalign{\global\setlength{\arrayrulewidth}{1pt}}%
\cline{#1}%
\noalign{\global\setlength{\arrayrulewidth}{0.4pt}}%
}
\begin{tabular}{Ic|c|cI}
\Hline
x & x & x \\
\cline{1-1}\Cline{2-2}\cline{3-3}
x & \multicolumn{1}{IcI}{x} & x \\
\cline{1-1}\Cline{2-2}\cline{3-3}
n*******l
发帖数: 2911
6
来自主题: Mathematics版 - 在latex中......
\setlength{\topmargin}{-5mm}
\setlength{\textheight}{210mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\textwidth}{150mm}
l****u
发帖数: 4
7
多谢版主提示!
我把class文件删减了一下,以下是可以编译但仍存在问题的部分
问题可能在List of References部分
还请麻烦帮忙看一下,多谢!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Defining Class options and loading required packages %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{ifthen}[1996/08/02 v1.0m Standard LaTeX ifthen package (DPC)]
%% Declaring Options \& Initializing Flags
\newcommand{\QZ@ptsize}{}%%define a null command for font-size
\newcounter{QZ@ptcnt}%%define a ... 阅读全帖
x***h
发帖数: 6
8
是这些了:
This is TeX, Version 3.14159 (MiKTeX 1.20b)
(fen-four.tex
! Undefined control sequence.
l.1 \documentclass
[12pt,a4paper,dvips]{article}
?
! Undefined control sequence.
l.2 \usepackage
{graphicx}
?
! Undefined control sequence.
l.3 \usepackage
{epsfig}
?
! Undefined control sequence.
l.5 \setlength
{\oddsidemargin}{0.2in} \setlength{\evensidemargin}{0.2in}
?
! Undefined control sequence.
l.5 \setlength{\oddsidemargin
p*l
发帖数: 1359
9
我的模版
\ProvidesPackage{beamerthemeclassnote}
\mode
\setbeamertemplate{caption}[numbered]
\setlength\parindent{28pt}
\setlength{\parskip}{0.75\baselineskip}
\setbeamersize{text margin left=0.5in,text margin right=0.5in}
\setbeamercolor{structure}{fg=black}
\setbeamercolor{palette primary}{fg=black,bg=white}
\setbeamertemplate{section in toc}{\vspace{12pt}\textbf{\inserttocsection}\}
\setbeamertemplate{subsection in toc}{\vspace{12pt}\hspace{18pt}\textbf{\
inserttocsubsectionnumber.}~... 阅读全帖
x****a
发帖数: 1229
10
作业,创建rectangle class, 要求 throw exceptions, 我的code如下:
public class rectangle extends Shape{
public Rectangle ()
{
this(Shape.DEFAULT_SIZE, Shape.DEFAULT_SIZE);
}

public Rectangle (double newLength, double newWidth)
{
this(Rectangle.RECTANGLE_NAME, newLength, newWidth);
}
protected Rectangle (String newName, double newLength, double newWidth)
{
super (newName);

try
{
this.setLength (newLength);
... 阅读全帖
l**b
发帖数: 457
11
Exception本身就是implements了Throwable了的,你extends和implements达到的效果
都是一样的。
我试了你的code,没有你说的问题啊?
Shape.java:
public class Shape {

public static final double DEFAULT_SIZE = 1.0;

private String name;

public Shape(String name) {
this.name = name;
}
}
Rectangle.java:
public class Rectangle extends Shape {

public static final String RECTANGLE_NAME = "Rectangle";

private double length;
private double width;

public Rectangle ()
{
this(S... 阅读全帖
T*******n
发帖数: 493
12
来自主题: TeX版 - 怎么控制表格里行的高度?
Each cell in the table has its own vertical alignment reference point,
and all the cells in the same row have their vertical alignment reference
points aligned with each other. The vertical alignment of these cells
work the same way as \parbox's.
Maybe this helps illustrate the alignment mechanism?
\documentclass[landscape]{article}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{9in}
\begin{document}
\makebox[0pt][l]{\rule{\textwidth}{0.2pt}}
\ignorespaces
vertical alignment reference l
T*******n
发帖数: 493
13
Vertical spacing between text and floating environments such as the
"table" environment are controlled through parameters such as
\setlength{\textfloatsep}{...}
\setlength{\intextsep{...}
See the first few pages of Chap. 6 in TLC for details.
If you are not using floats, then try \addvspace{0.5in}.
\addvspace{0.5in} should give you a 0.5 inch space, even
if there are other hidden internal LaTeX vertical spaces added.
\vspace{0.5in} will add 0.5 inch to whatever amount of
space that may already b
T*******n
发帖数: 493
14
来自主题: TeX版 - About text width for one page

Try the minipage environment (you can optionally specify the
height), followed by a \clearpage if needed.
Try either minipage or \parbox, or define your own environment
using something like the following to make the special paragraph
indented 0.5 inch on both left and right sides (negative length will
make the paragraph wider than normal text width):
\newenvironment{specialpar}%
{\list{}{\setlength{\leftmargin}{0.5in}\setlength{\rightmargin}{0.5in}}\item
}%
{\endlist}
\begin{specialpar}
tex
T*******n
发帖数: 493
15
来自主题: TeX版 - 如何自定义INDEX的列数?
Look in the .cls and you should find the definition of an
environment called "theindex". This is where the page
layout of the index is usually defined.
You can try the following, add before \begin{document}:
\usepackage{makeidx}
\usepackage{multicol}
\makeatletter
\newcommand{\startindex}[0]{%
\chapter*{\indexname\@mkboth{\indexname}{\indexname}}%
\addcontentsline{toc}{chapter}{\indexname}%
}
\renewenvironment{theindex}{%
\par
\setlength{\columnseprule}{\z@}%
\setlength{\columnsep}{12
t**i
发帖数: 688
16
我想调整一下Description List里面各个item之间的行间距,但是试了如下的参数没反
应。也是了负值和小数值比如3ex,也没变化。看log的话也没什么相关的错误、警告信
息。
\begin{description}{}{\setlength{\itemindent}{0ex}
\setlength{\itemsep}{0ex}}
\end{description}
a**e
发帖数: 5794
17
来自主题: TeX版 - Shaded Box Around Text
我看不懂你的例子,就自己写了一个。
\documentclass{article}
\usepackage{color,calc}
\definecolor{demo@bgcolor}{gray}{.8}
\let\oldfboxsep\fboxsep
\newsavebox{\mybox}
\newenvironment{shadedbox}{
\noindent
\begin{lrbox}{\mybox}
\begin{minipage}[c]{.945\textwidth}
}{
\end{minipage}
\end{lrbox}%
\setlength{\fboxsep}{8pt}
\colorbox{demo@bgcolor}{\usebox{\mybox}}
\setlength{\fboxsep}{\oldfboxsep}
}
\begin{document}
\begin{shadedbox}
blar
\end{shadedbox}
\end{document}
g*********r
发帖数: 124
18
来自主题: TeX版 - 如何改变段落缩进?
\setlength\parindent{0pt} % 首句没有缩进
\setlength\parskip{\baselineskip} % 段落之间有空行
s*****g
发帖数: 5159
19
Try overwrite these in preambles.
\setlength{\abovecaptionskip}{10pt}
\setlength{\belowcaptionskip}{10pt}
b***k
发帖数: 2673
20
来自主题: TeX版 - LaTeX中参数改变的命令
为什么有的变量用setlength,有的必须要用renewcommand,
而计数器都是用setcounter,
这个东西有规律可循吗?否则记起来有点麻烦。
比如\parindent, \pariskip,\floatsep用\setlength
而\baselinestretch, \floatpagefraction, \topfraction必须用\renewcommand
d*****y
发帖数: 140
21
用letter paper或者
\setlength{\paperwidth }{8.5in}%
\setlength{\paperheight}{11in}%
但是->dvi->pdf以后,出来的大小和letter paper差那么一点点,是11.7*8.3
这是咋回事?
m*******r
发帖数: 339
22
来自主题: JobHunting版 - 贡献今天facebook电面 一道题
我练练手,试着写了下:
public class StringPath {
public static boolean stringMatch(char[][] m, String s) {
StringBuffer sb = new StringBuffer();
boolean visited[][] = new boolean[m.length][m[0].length];
boolean found = false;
for (int i=0;i for (int j=0;j if (searchDFS(m, i, j, s, 0, visited, sb)) found = true;
}
}
return found;
}
public static boolean searchDFS(char[][] m, int x, int y, String s, int pos, boolean[][] v, S... 阅读全帖
c********p
发帖数: 1969
23
来自主题: JobHunting版 - 请教 怎样存下这个string
leetcode permutation sequence
先谢谢各位大牛!
我知道这个问题有更好的解法,但我想知道:
我想把第k个permutation存在result中, 无论我result是否设为全局的,它都存不下。
当时读到的时候,有存进去,可是接着run之后就没有了。我要怎么保存它呢?
int count;
StringBuffer result = new StringBuffer();
public String getPermutation(int n, int k) {
// Start typing your Java solution below
// DO NOT write main() function
count = 0;
if(n == 0 || k == 0){
return "";
}

StringBuffer sol = new StringBuffer();
permute... 阅读全帖
S*******C
发帖数: 822
24
我已经写了一个,请大家看一下还有什么可以改进的地方
package design_a_pizza_maker;
/*
* @ServiceNow onsite
*/
import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;
public class PizzaMaker extends Stopwatch{
public static void main(String[] args) {
PizzaMaker pizzamaker = new PizzaMaker();
Scanner sc = new Scanner(System.in);
System.out.println("Input a to add 30 seconds to current baking
schedule");
System.out.println("Input c to cancel current baking schedule");... 阅读全帖
c********p
发帖数: 1969
25
leetcode permutation sequence
先谢谢各位大牛!
我知道这个问题有更好的解法,但我想知道:
我想把第k个permutation存在result中, 无论我result是否设为全局的,它都存不下。
当时读到的时候,有存进去,可是接着run之后就没有了。我要怎么保存它呢?
int count;
StringBuffer result = new StringBuffer();
public String getPermutation(int n, int k) {
// Start typing your Java solution below
// DO NOT write main() function
count = 0;
if(n == 0 || k == 0){
return "";
}

StringBuffer sol = new StringBuffer();
permute... 阅读全帖
T*******n
发帖数: 493
26
来自主题: TeX版 - 怎么控制表格里行的高度?
Also try
\usepackage{array}
\setlength{\extrarowheight}{3pt}
but this will only add space to the top, which I don't think is what you want.
T*******n
发帖数: 493
27
来自主题: TeX版 - 关于表格内的间隙问题
There are a few things you can try:
1. The row breaking \\ can take an optional argument,
i.e., \\[6pt] will add 6pt to the bottom of the row.
2. If you \usepackage{array} or \usepackage{longtable},
You can say \setlength{\extrarowheight}{3pt} to add
some extra vertical space at the top of a row.
3. My preferred solution is to \usepackage{array} and
do something like this (when you want to add the
same amount of space to all rows at once and all
the rows have the same height):
T*******n
发帖数: 493
28
来自主题: TeX版 - A quick question about page margin
Check it again. Using the same LaTeX you posted, I get
1.5 inch bottom margin on US letter paper, but about 5.5 cm
bottom margin on A4 paper. Check both the PS file and PDF
file to find out where things went wrong.
If you are not using page footers (I see you are using the
empty page style), you should add \setlength{\footskip}{0pt}
before \usepackage{geometry} to get the bottom margin
closer to 1 in.
T*******n
发帖数: 493
29
\setlength{\parskip}{...}
T*******n
发帖数: 493
30
来自主题: TeX版 - 【求助】some common problems

{\raggedright Text.\par}
or
\begingroup\raggedright Text.\par\endgroup
Note that the flushleft environment is basically
\raggedright surrounded by group delimiters, as I
showed above.
If you need a blank line between paragraphs, try
\begin{flushleft}
\setlength{\parskip}{\bigskipamount}
% or try \medskipamount, \smallskipamount or actual dimension
Paragraph 1.
Paragraph 2.
\end{flushleft}
m******e
发帖数: 212
31
来自主题: TeX版 - 怎么调节item的indentation?
用\setlength{\leftmargini}{0.5em} 好像可以
T*******n
发帖数: 493
32
Put this
\setlength{\parskip}{\bigskipamount}
just before \begin{document}
h**k
发帖数: 48
33
来自主题: TeX版 - 用res.cls写resume求助
知道了,在前面设置
\setlength\{sctionskip}{xxx cm}
T*******n
发帖数: 493
34
% try with and without array, look carefully at corners of the table
\usepackage{array}
\setlength{\arrayrulewidth}{1pt}
g*********r
发帖数: 124
35
\setlength{\intextsep}{3\baselineskip plus 0.1\baselineskip minus 0.1\
baselineskip}
g*********r
发帖数: 124
36
来自主题: TeX版 - book里如何公式左对齐?
\usepackage[fleqn]{amsmath}
\makeatletter
\setlength{\@mathmargin}{1em}
\makeatother
T*******n
发帖数: 493
37

Leave a blank line in your LaTeX source file, or say \par.
\setlength{\parskip}{\bigskipamount}
This will automatically add a \bigskip between paragraphs.
b*******h
发帖数: 56
38
这个也不行,但是我发现了http://www.tug.org/TeXnik/mainFAQ.cgi?file=space/space
的一处错误,校正后现在我能够修改章节标题上下边距了,但是我还是不能修改table
of contents,list of figure,list of table 这几个标题的上下边距!!!
还请指点
附上正确的程序
其实网上的程序只是缺了一个%。。。
\makeatletter
\usepackage{calc}
\newlength{\topspace}
\setlength{\topspace}{-1in% <---- the whole vertical space
-\topmargin% <--- predefined
-\headheight% ...
-\headsep% ...
-\topskip}% ...
\def\@makechapterhead#1{%
\vspace*{\topspace}% <---- the spac
T*******n
发帖数: 493
39
来自主题: TeX版 - 问两个footnote的问题

To control space between footnotes:
\setlength\footnotesep{10pt} % might need larger number
doublespace.sty is really bad code, and its replacement setspace.sty doesn't
change footnotes and captions. What you can do is copy size10.clo (or
size11.clo
or size12.clo) into your own directory, and modify the \@setfontsize
commands.
For example in size10.clo, make these changes:
in \normalsize: \@setfontsize\normalsize\@xpt{20}%
in \small: \@setfontsize\small\@ixpt{18}%
in \footnotesize: \@
g*********r
发帖数: 124
40
来自主题: TeX版 - 最后一页的图如何置顶
在导言区加入,
\makeatletter
\setlength\@fptop{0\p@}
\makeatother
t****e
发帖数: 69
41
来自主题: TeX版 - 在margin上怎么写字?
我自己来回答吧,解决方案是fancyhdr + pictrue environment.
\usepackage{fancyhdr}
\usepackage{rotating}% to place text sideways
\setlength{\unitlength}{1in}
\fancyfoot[R]{%
\begin{picture}(0,0)
\put(0.5,5){\begin{sideways}My Text\end{sideways}}
\end{picture}%
}

比如
k*****o
发帖数: 1972
42
比如,我想把title的字体控制的大一点然后又要在一行里放下所有的文字,但是现在
一行放不下,老是有一个单词换行到第二行,现在我是想办法要把行的宽度拉大,不过
不改变文章整体的文字宽度,只拉大放题目的那页行宽,大家有什么经验和方法?
例如,
现在是
题目: “ sample of
latex” 这里,latex跑到第二行了,第一行放不下,我又不想缩小字体
(大字体看着好看)
然后我想改成 “sample of latex” 题目在一行上
我现在的想法是改变这一页的行宽,不过我现在一改就改变整个文档的行宽了。
用\setlength{parameter}{length},\addtolength{parameter}{length}命令改了的整
个文档的宽度,现在有什么办法只改变第一页题目的宽度,其他的不改变呢?
谢谢
S**I
发帖数: 15689
43
{\setlength{\baselineskip}%
{0.5\baselineskip}
\begin{description}
\item[A.] This is A
\item[B.] This is B
\item[C.] This is C
\end{description}
b*****n
发帖数: 71
44
来自主题: TeX版 - 请问如何调整段落格式。
\parindent=0pt
\setlength{\parskip}{4ex} 可根据需要调整
以上命令放在导言区
S**I
发帖数: 15689
45
一个比较麻烦的方法:bibtex生成bbl文件后,打开这个文件,在\begin{
thebibliography}后加上\setlength{\itemsep}{-1mm}。
T*******n
发帖数: 493
46
Try changing the spacing via
\setlength{\textfloatsep}{...}
This will affect spacing between text and both figures
and tables.
g*********r
发帖数: 124
47
用 \setlength 命令增加 \textfloatsep 和 \intextsep 的值
g*********r
发帖数: 124
48
把下面的代码加入导言区
\makeatletter
\renewcommand\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
\makeatother
I***i
发帖数: 14557
49
If you don't want any indent for ALL the paragraphs, then add the following
in the preamble
\setlength{\parindent}{0pt}
S**I
发帖数: 15689
50
bibtex生成bbl文件后,打开这个文件,在\begin{thebibliography}后加上\setlength
{\itemsep}{2\baselineskip}
1 (共1页)