由买买提看人间百态

topics

全部话题 - 话题: setcounter
1 (共1页)
p*l
发帖数: 1359
1
我的模版
\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.}~... 阅读全帖
f**********t
发帖数: 1001
2
来自主题: JobHunting版 - Amazon一道synchronization的面试题
刚看了一个例子。大概是说static synchronized method是对class object lock,
synchronized method是对当前object lock。如果都是static synchronized或者都是
synchronized,则可以实现synchronization,因为是对同一个object。
那么在这个例子里面,f1和f2的两个synchronized是对不同的object lock。要让它们
真正synchronized,函数得用static synchronization。
以上是我的观点,不知对不对?
Using synchronized keyword along with method is easy just apply synchronized
keyword in front of method. What we need to take care is that static
synchronized method locked on class object lock and non static synchroniz... 阅读全帖
c*****t
发帖数: 1879
3
来自主题: Java版 - AspectJ question
Basically, I wanted to do the following, right after
out.setActivity (state.getActivity ());
I wanted to add another piece of code
out.setCount (state.getCount ());
How to write the aspect code? I tried the following and didn't work.
Any suggestions?
aspect X
{
after (Out out, State state):
(cflowbelow (call (int State.getActivityType ()) && target (state)))
&&
(call (void Out.setActivityType (int)) && target (out))
{
out.setCount (state.getCount ());
... 阅读全帖
T*******n
发帖数: 493
4
来自主题: TeX版 - 怎样把公式编号重新计数?
What document class? If article, try either
\appendix
\renewcommand{\theequation}{\thesection\arabic{equation}}
\section{...} % Appendix A
\setcounter{equation}{0}
...
\section{...} % Appendix B
\setcounter{equation}{0}
...
or
\usepackage{amsmath}
...
\appendix
\numberwithin{equation}{section}
\section{...} % Appendix A
...
\section{...} % Appendix B
...
The first method gives A1, A2, B1, B2, while the second method
gives A.1, A.2, B.1, B.2, etc.

..
T*******n
发帖数: 493
5
Try adding this before \begin{document} or just before \tableofcontents:
\setcounter{tocdepth}{3} % controls whether \subsubsection
\setcounter{secnumdepth}{3} % controls whether \subsubsections are numbered
Somewhere in the .cls or .sty files that you are using, these two parameters
were probably changed to a value smaller than 3.

thx
T*******n
发帖数: 493
6
In the main LaTeX source file, right before the appendices begin,
try something like \setcounter{tocdepth}{0} or \setcounter{tocdepth}{1}
depending on the class file you are using. This way the appendices
will completely disappear from the TOC. If you want the appendices
listed without page numbers, you will need to change the .cls file or
load a .sty file that overrides the .cls file.
l*b
发帖数: 4369
7
来自主题: TeX版 - 关于REVTeX的问题
【 以下文字转载自 Physics 讨论区 】
发信人: lab (天冰大果), 信区: Physics
标 题: 关于REVTeX的问题
发信站: BBS 未名空间站 (Sun Mar 16 19:17:03 2008), 转信
在REVTeX下面,如何控制\tableofcontents的层数?
那个\setcounter{tocdepth}{1}不管用,总是显示所有的层。如果改回{article}类,
就差得太多了。
不知道谁有妙招没有?我google了半天也没啥收获。基本上查latex的就直接说用
setcounter命令,查revtex好像没有找到关于这个东西。。。
s********r
发帖数: 158
8
我是按照一个 模板 做的, 其中有关 Appendix 是
\newcommand\appendices{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\gdef\@chapapp{\appendixname}%
\gdef\thechapter{\@Alph\c@chapter}%
\@inappendixtrue%
\@gotappendicestrue%
\chapterheader{\appendicesname}%
}
还有一个问题
\appendices
\chapter {Appendix A title}
text
\section {Appendix A.1 title}
text
\section {Appendix A.2 title}
text
\chapter {Appendix B title}
text
\section {Appendix B.1 title}
text
如果在 table of content 中只想显示 Chapter title而忽略 sec... 阅读全帖
i*******r
发帖数: 1064
9
来自主题: TeX版 - 求助 - toc spacing
这是我用的 style file 中的 \listoftables 的定义
%----------
\def\listoftables{%%%
\newpage\pagestyle{plain}\pagenumbering{roman}
\setcounter{page}{\value{@ldpage}}
\doublesp@cing
\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
\vspace*{53pt}\centerline{\Large\bf\listtablename}
\addcontentsline{toc}{chapter}{\listtablename}
\vskip 46pt
\@starttoc{lot}
\if@restonecol\twocolumn\fi
\newpage\setcounter{@ldpage}{\value{page}}
\addtocontents{lof}{\setst... 阅读全帖
l*b
发帖数: 4369
10
来自主题: Physics版 - 关于REVTeX中目录深度的问题
在REVTeX下面,如何控制\tableofcontents的层数?
那个\setcounter{tocdepth}{1}不管用,总是显示所有的层。如果改回{article}类,
就差得太多了。
不知道谁有妙招没有?我google了半天也没啥收获。基本上查latex的就直接说用
setcounter命令,查revtex好像没有找到关于这个东西。。。
b*******t
发帖数: 33714
11
来自主题: PhotoGear版 - 包子题。。。求助
试试看
\pagestyle{headings}
\setcounter{page}{1}
\pagenumbering{roman}
m******o
发帖数: 774
12
来自主题: Java版 - what's wrong with this little jsp?
Guys, I'm playing with Spring 3.0 but this little jsp keeps getting an error
that I could not figure out:
<%@ page import="com.mcnz.spring.*, org.springframework.context.*, org.
springframework.web.context.support.*"
contentType="text/html; %>
<%
ApplicationContext beanFactory = WebApplicationContextUtils.
getRequiredWebApplicationContext(getServletContext());
ClickCounter counter = (ClickCounter)beanFactory.getBean("clickCounter",
ClickCounter.class);
String clickedButton = request.getParameter... 阅读全帖
z****e
发帖数: 54598
13
来自主题: Java版 - 这个Method为什么需要同步?
setCount的那个方法也有synchronized吧
T*******n
发帖数: 493
14
来自主题: TeX版 - Label problem
Your "secnumdepth" counter is probably set at the default
value of 3, so \paragraph does not actually produce the
paragraph number "1.1.1.1", nor does it increment the
reference counter used by \label in the background.
You need to say
\setcounter{secnumdepth}{4} % or larger value
to enable paragraph numbering. Then you will get "1.1.1.1"
in front of the paragraph heading, and the \ref will produce
"1.1.1.1" as you wanted.
m*********i
发帖数: 38
15
来自主题: TeX版 - 章节和公式编号
解决了
用setcounter
m***I
发帖数: 467
16
来自主题: TeX版 - page number的问题
我写毕业论文,希望每章末尾附有该章的参考文献,
但是参考文献的页码总是从1开始,有什么办法可以
调整这个页码呢?我试了\setcounter{page}{number},
对正文起作用,但是对bibliography没用。
T*******n
发帖数: 493
17
Put \setcounter{table}{7} before your \caption{...}.
T*******n
发帖数: 493
18
What document class? Book or report or something similar?
In these classes the heading for "Abstract" is set using
\chapter*{Abstract}, and \chapter* includes a hidden command
\setcounter{topnumber}{0}, which prevents a float from going
to the top of the page (above the heading "Abstract"). If
you have a small figure it might go to the bottom of the
page if you allow it, but if the figure is too large, it
will be moved to the next page.
Since you just want an unnumbered figure, try using
\begi
T*******n
发帖数: 493
19
来自主题: TeX版 - question regarding bookmark
I think it is tied to the tocdepth counter which controls the
section level depth in the table of contents. Try playing around
with \setcounter{tocdepth}{3}, change it to 4, etc., see whether
this does the trick.
T*******n
发帖数: 493
20
来自主题: TeX版 - 如何去掉section前面的数字
\setcounter{secnumdepth}{0}
The section headings will still appear in the TOC, but will not be numbered
anywhere (on the actual page, in the TOC, in the page header).
T*******n
发帖数: 493
21
来自主题: TeX版 - Latex 顺序乱了
Try adding \setcounter{topnumber}{0} between \clearpage
and \section*{}.
p**v
发帖数: 853
22
用latex写东东,想要生成独立的正文和reference,
而且各自用自己的页号。试过\setcounter,可以实现
各自的页码,但是用dvips -P 来各自生成文件后
就又变了。请指点一二,谢谢了。
T*******n
发帖数: 493
23
Not sure what you mean exactly. Can you describe more details,
i.e., how you want the pages to be numbered? What are you
using \setcounter for?
p****o
发帖数: 1340
24
okay, if it does not work, then u can try this: put
\setcounter{enumi}{4}
before the first \item in the second enumerate.
T*******n
发帖数: 493
25
article-based: \section*{Acknowledgements}
thesis-based:
\frontmatter % executes a hidden \setcounter{secnumdepth}{0}
\maketitle
\chapter{Abstract}
. . .
\chapter{Acknowledgements}
. . .
\tableofcontents % can appear anywhere in \frontmatter
\mainmatter
\chapter{Introduction}
s******e
发帖数: 285
26
没有,我想了一个本办法。
把Tabular放在\author{}里面,然后自己给figure编号Fig. 1.
然后在正文里面\setcounter{figure}{1},赫赫
T*******n
发帖数: 493
27
来自主题: TeX版 - 罗马数字 I 怎么表示?
Not sure what you want:
\newcounter{mycounter}
\setcounter{mycounter}{1234}
\Roman{mycounter}
\MakeUppercase{\romannumeral1234} % for a constant, no {} around constant
J*******r
发帖数: 379
28
if you really want it automatically, try this:
\[
\textbf{\newcounter{test}\setcounter{test}{2}\Roman{test}}
\]
T*******n
发帖数: 493
29
Try \setcounter{tocdepth}{3} (or maybe 4, I don't remember)
and run LaTeX at least twice to update the TOC.

o
c*******t
发帖数: 13
30
\setcounter{framenumber}{-1}
\begin{frame}[plain]
\titlepage
\end{frame}

words
S**I
发帖数: 15689
31
来自主题: TeX版 - section编号问题
\renewcommand\thesection{Appendix \arabic{section}}
\renewcommand\thesubsection{A\arabic{section}.\arabic{subsection}}
\setcounter{section}{0}
c********r
发帖数: 154
32
我用的是report类型
\begin{document}
\pagenumbering{roman}
\include{titlepage}
\setcounter{page}{2}
\include{cv}
\include{acknowledgements}
\include{abstract}
\tableofcontents
\listoftables
\listoffigures
\cleardoublepage
\pagenumbering{arabic}
\include{foreword}
\chapter{Introduction}
\input{chapter1/introduction}
在contents里面,学校要求要列出Foreword,但是那就一页,并不是一章,请问如何把
它加到contents里面,而且不算第一章。我知道在toc文件里面手动加上
\contentsline {chapter}{\numberline {}Foreword}{1}可以达到这个效果,不知道在
tex里面加什么命令可以自动这样,谢谢指教!
S**I
发帖数: 15689
33
在\subsection{Appendix1}之前加上 \setcounter{subsection}{0}
c*******h
发帖数: 1096
34
the following is the quick solution:
\numberwithin{equation}{section}
if you really want to use the letter 'S' instead of the section number
appended by a dot, you can do the following instead:
\renewcommand{\theequation}{S\arabic{equation}}
btw, you may also want to reset the equation counter in your supporting
material:
\setcounter{equation}{0}
m****d
发帖数: 9307
35
来自主题: TeX版 - 编section号的一个问题
我设置是\setcounter{secnumdepth}{1}
为啥出来的是0.1,0.2呢,我希望是1,2,3.。。。
T*******n
发帖数: 493
36
来自主题: TeX版 - 编section号的一个问题
\setcounter{secnumdepth}{2}
should turn on numbering for subsection.
m****d
发帖数: 9307
37
我编的命令是
\setcounter{secnumdepth}{2.2.1}
\subsubsection{XXX}
但是结果出来排版有问题,但是用同样命令写subsection就没有问题,section也没有问
题。。。。
b***k
发帖数: 2673
38
来自主题: TeX版 - LaTeX中参数改变的命令
为什么有的变量用setlength,有的必须要用renewcommand,
而计数器都是用setcounter,
这个东西有规律可循吗?否则记起来有点麻烦。
比如\parindent, \pariskip,\floatsep用\setlength
而\baselinestretch, \floatpagefraction, \topfraction必须用\renewcommand
b***k
发帖数: 2673
39
have a try...
\renewcommand{\thesection}{\arabic{section}.}
\setcounter{section}{0}
b*******t
发帖数: 33714
40
试试看\setcounter{secnumdepth}{4}
Y*Y
发帖数: 694
41
You might want to set tocdepth higher, such as
\setcounter{tocdepth}{2} % or 3, 4, ...
I have to say that I have only used the basic command \tableofcontents
So I don't know whether it work the same way in your case.
b*******t
发帖数: 33714
42
来自主题: TeX版 - 目录中的页码和实际不符
试试\setcounter{page}{1}
l****u
发帖数: 4
43
多谢版主提示!
我把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 ... 阅读全帖
m*********g
发帖数: 11102
44
【 以下文字转载自 TeX 讨论区 】
发信人: cockroach (冬冬), 信区: TeX
标 题: Re: 公式编号前面怎么加入一个字母?
发信站: BBS 未名空间站 (Wed Aug 12 10:35:00 2009, 美东)
the following is the quick solution:
\numberwithin{equation}{section}
if you really want to use the letter 'S' instead of the section number
appended by a dot, you can do the following instead:
\renewcommand{\theequation}{S\arabic{equation}}
btw, you may also want to reset the equation counter in your supporting
material:
\setcounter{equation}{0}
1 (共1页)