Wednesday, June 9, 2010

Structure and Command Set Of LaTeX


After the Installation and overview i am going to discuss some of the basic commands that are used to desing your document using latex
Given below is small structure code is
%%Remember every command should start with a backslash
%%this doc is produced from latex %%comment section
\documentclass{type}[optional] %%type tells what type of doc. whether article,journal etc. and optional part tells about various options like article size etc.
\usepackage{package_name} %% to include some of the packages needed for additional functions to be performed.....
\begin{section} %%this section begins your major piece of document
\begin{subsection1}
\begin{subsection2} %%subsection starts here
\end{subsection2} %%corresponding subsection starts here
\end{subsection1}
\end{section} %%main section ends here
Above discussed is just a simple basic structure of your Latex Program and produce .dvi file when is compiled. I am writing here a simple code in .tex format
which you can copy and can compile to Let know about basic idea behind LaTeX use.
%%Program to write code for printing String Helloin C++ using LaTeX
\documentclass{article}[a4paper]
\begin{Program}
\textbf{Program 1:- to write code for printing String Hello in C++ using LaTeX}
\begin{itemize}
\item \#include\textless iostream.h\textgreater
\item \#include\textless conio.h \textgreater
\item void main()
\item \{
\item cout\textless\textless ``Helloo... Word";
\item getch();
\item \}
\end{itemize}
\end{Program}
After that copy it save it using gedit in test.tex format and then using command

latex test.tex

then .dvi file is made and after that made pdf from that. (I have discussed earlier)

No comments:

Post a Comment