PDA

View Full Version : Latex Help


msoni
Jul24-04, 08:16 PM
Hello People!!

Im new to this forums and didnt really found a specific thread on Latex help.
Im trying to convert word documents into Latex format.

Im a novice in this topic.. was wondering if anyone can help me out.

I have a problem in changing the default value of Section in Latex.
By default it assigns 1 to the first section defined in Latex. How do I change the default value, say from 1 to 1.3.

I would appreciate any help in this regard.

Thanks Much,
Soni.

faust9
Jul24-04, 08:38 PM
\setcounter{subsection}{2}

the 1 comes from the section tag

the .3 comes from the subsection tag

if you set the subsection couter to 2 then then next time you use the subsection tag it will display as three. I'm sure there's another way to do it, but I've always used the above.

Good luck.

faust9
Jul24-04, 08:42 PM
Here:
http://www.stdout.org/~winston/latex/latexsheet.pdf
http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/ltxprimer-1.0.pdf

enjoy

msoni
Jul24-04, 10:25 PM
Hey Thanks..
Those links really help...
Still not able to fix that problem Im trying :confused:

faust9
Jul24-04, 10:51 PM
If I'm reading your question correctly then this should have worked:


\begin{document}

\section{Some Section}
\setcounter{subsection}{2}
\subsection{Some subsection starting at 1.3}

\end{document}


Are you using subsections?

msoni
Jul25-04, 01:00 AM
No no...
Im not using any subsections...
Its the section no. which I want to name it is 1.3

say..

\begin{document}
.........
\section{some section title which is 1.3}

after it compile it should print as

" 1.3 Multi dimensional arays"

there are no subsections involved.

Actually this is kinda heading...


I could have just coded as bold font and using :
\textbf{1.3\qquad Multiplication of Vectors by Numbers}

But I dont wanna do it that way. If I come across many such headings numbered in similar way in one page... say 1.3, 1.4, 1.5... How do I chage the default section number from 1 to 1.3 and for subsequent sections it can increment as 1.4... 1.5
Those are not subsections!!!! Im using them as sections!!


Thanks

faust9
Jul25-04, 01:36 AM
You can't. You can surpress sections and use subsections to number 1.3, 1.4, ... 1.n like this:

\begin{document}
\setcounter{section}{1}
\section*{}
\setcounter{subsection}{2}
\subsection{Label this}
\end{document}

You need to use subsections to append the numbering after the initial chapter section.

Here, this is a section from my dynamics notes:


%Chapter 13
\setcounter{section}{12}
\newpage
\section{Kinetics of a Particle: Force and acceleration}
\subsection{Newton's Law of Motion}
\begin{itemize}
\item
\end{itemize}
\subsection{The Equation of Motion}
\begin{itemize}
\item
\end{itemize}
\subsection{Equation of Motion for a System of Particles}
\begin{itemize}
\item
\end{itemize}
\subsection{Equation of Motion: Rectangular Coordinates}
\begin{itemize}
\item
\end{itemize}
\subsection{Equation of Motion: Normal-Tangential Coordinates}
\begin{itemize}
\item
\end{itemize}
\subsection{Equation of Motion: Cylindrical Coordinates}
\begin{itemize}
\item
\end{itemize}
\subsection{Central-Force Motion and Space Mechanics}
\begin{itemize}
\item
\end{itemize}


If you compile the above you will see the output is:

13 Kinetics of a Particle: Force and acceleration
13.1 Newton's Law of Motion
13.2 The Equation of Motion

etc.

Trust me, use the subsections because the compiler knows how to handle them already and it will format everything for you. Compile my dynamics notes (minuse the notes that is) and see what I mean. If you want to surpress the "13 Kinetics of a Particle: Force and acceleration" then use this:

\section*{}

msoni
Jul25-04, 03:03 AM
Awesome!! Got it now!! Looks like you have worked a lot in Latex...

More Im into it.. the more intresting it becomes.

Next Im having some issues labelling equations ..
I have used \begin{eqnarray}
But the compiler is giving some wiered errors..
will try for some more time.. elz you will
have to come for rescue again!! :wink:

Anyways thanks a lot..
going to bed now...its 3:00am now.. Im in Tampa FL
how abt you??

msoni
Jul26-04, 09:47 PM
Im trying to label these equations as 1.1 and 1.2 When I compile the code I get this error mssg:

! Extra Alignment tab has been changed to\cr
<template> \egroup\endtemplate


what does this mean and how do i fix it??



(s + t)A = sA + tA
s(A + B) = sA + sB

faust9
Jul27-04, 12:18 AM
Ohhh, linear algebra notes huh?

Add this line somewhere before your \begin{document}: \newtheorem{eqn}{Equation}[section] You probably have a two or three line block below the page layout section and prior to the title section if you're using a latex template (that's where I've seen it with most LaTeX templates).

You can actually place it immediately before the first call of it but try not to do that because you'll be forced to scan the entire doc if you decide to change it.

To get rid of the word "Equation" simply use this:
\newtheorem{eqn}{}[section]

Ok, to actually use the above do this:

\begin{eqn}
$(s + t)A = sA + tA$
\end{eqn}
\begin{eqn}
$s(A + B) = sA + sB$
\end{eqn}

Viola numbered equations.

Good luck.

faust9
Jul27-04, 12:35 AM
Awesome!! Got it now!! Looks like you have worked a lot in Latex...

More Im into it.. the more intresting it becomes.

Next Im having some issues labelling equations ..
I have used \begin{eqnarray}
But the compiler is giving some wiered errors..
will try for some more time.. elz you will
have to come for rescue again!! :wink:

Anyways thanks a lot..
going to bed now...its 3:00am now.. Im in Tampa FL
how abt you??

I've used LaTeX a bit more than the average person I'd say. I'm not a professional typesetter by any means but I can put some good looking stuff together with the help of LaTeX. If you can type fast the LaTeX is definetly the fastest way to put together a good report. Typing {\bf yadda yadda yadda} is much faster than than using the mouse to select bold font but not quite as fast as ctrl-B. LaTeX typesetting shows its worth when presenting a document with a lot of equations and graphs. Yyping an equation into LaTeX is about 40x faster than using equation editor. Add GNUPlot and use EMACS as your environment then you'll be cruising along. I prepared a physics experiment report for my physics class a few semesters back in the time it took the other students and mine was more than twice as long. LaTeX does most the work for ya so you save time instead of fighting with word trying to get data into a table in the correct location. Oh, and if you really want to impress your professor, just drop

\maketitle
\begin{abstract}The following document was typeset using the \LaTeX\ typesetting evironment.\end{abstract}
\newpage
\tableofcontents
\newpage

below the \begin{document} tag.

Detroit BTW.

Well, good luck. Keep practicing the latex.

msoni
Aug10-04, 11:36 PM
Im trying to enumerate starting from say.. 9 till 15, instead starting from 1 which is default.
I used \usepackage{enumerate} in the declerations and
while enumerating..
\begin{enumerate}[9.]
\item...........
\item.......
........
.......
\end{enumerate}

Insteading of numbering 9 10 11 it either numbers all the points as 9 or at times increments 10 in no. as.. 9 19 29..


where am I going wrong??? :confused:

faust9
Aug11-04, 11:47 AM
\begin{enumerate}
\item[9.]some stuff here
\item[10.]some more stuff here
\end{enumerate}