Facebook Connect Login Box

Connect with facebook

Hi , login or create a new account below

Login

If you already have an account with this website login with your existing user name and password to enable Facebook Connect

Forgot your password? Forgot you username?
Register

Alternativley to create a new account using details from your Facebook profile enter your desired user name and password below

Powered by myApi

Registration and login on this web site has been made faster and easier by myApi, the Facebook Connect Joomla bridge

There is no need to worry, this website will never be able gain access to your account, or personal data you do not explicitly give it permission to use

Creative Commons License
Unless specified otherwise
 

Linux

My Personal LaTeX Template

Last Updated on Saturday, 17 July 2010 14:56 Written by Mehmet Ali ANIL Monday, 17 May 2010 12:34

Since I use LaTeX in order to prepare my documants for a while, I want to share those who are newcomers into the field, the cluster of code that grew sporadically for couple of years, because of my bad copy - paste habit while working with documents. I will at some time create my own functions, but I don't think that would be anytime soon, since I have other works to do. 

Before I begin bombarding you with codes, I use Kile in order to write and compile my code. It is sufficent enough and very user-friendly with its shortcuts and symbol lists.  This is only application I could't part within the whole KDE application list. I use Zotero and Mendeley in order to manage my souorces, and I extract BibTex citations from there. 

First of all, I have a bunch of packages I load everytime I start a document, regardless of the fact that If I use it or not. This is indeed bad habnit, since, packages tend to create conflicts, but to be frankly, who's going to memorize which package is used for what reason? So this is my header:

 
 \documentclass[a4paper,10pt]{article}            % Let's use International standards.
\usepackage{amsmath}            %For math typesetting
\usepackage{amssymb}            %For all those symbols that are generally used in math mode, like logic notation.
\usepackage[utf8]{inputenc}            %In order to map turkish characters written in the code to the turkish characters
\usepackage[turkish]{babel}            %In order to print turkish caharcters, hyphenation, and key words like "Bibliography"
\usepackage{mathrsfs}            %Handwritten fancy character in order to use for e.g. H of Hamiltonian operator.
\usepackage{graphicx}            %Used In order to add figures
\usepackage{lscape}            %Landscape mode
\usepackage{xkeyval}            %In order to create macros
\usepackage{lmodern}            %I use it for its oldstyle numbers
\usepackage[T1]{fontenc}            %For lmodern
\usepackage{subfigure}            %Enables subfigures
\usepackage{gensymb}            %Symbols like Celcius , perthousand etc.
\usepackage{bbm}            %For Complex and Real Set symbols
\usepackage{float}            %In order to bypass figure positioning latex uses, I use [H] for all times
\usepackage{bpchem}            %Chemical Symbols
\usepackage{natbib}            %Bibliography Manager
\usepackage{rotating}            %In order to rotate figures
 

 Those are pretty self explanatory. I know some may clash, or the ordering might be wrong, but It works anyway. 

Then I define two functions:

 
\let\oldhat\hat
\renewcommand{\vec}[1]{\mathbf{#1}}
\renewcommand{\hat}[1]{\oldhat{\mathbf{#1}}}
\newcommand{\citemali}[2]{\footnote{\citeauthor*{#1}, \citeyear{#1}, #2}} 
 

The first 2 lines is there in order to change the definition that  is set for \vec which in reality produces: 

 \vec{\nabla} \cdot \vec{E} = \frac{\rho}{\epsilon_0} 

in such a way that when \vec is used, it emboldens the symbol used. This bold vector notation can be seen in many books, it is preferred by many modern textbooks.

 \mathbf{\nabla} \cdot \mathbf{E} = \frac{\rho}{\epsilon_0}  

 The other definition, \citemali is a citation style I saw in Reed College's latex standards page, It creates a superscript number, and adds a footnote to the page, printing a non parenthetical citation.

Until the bug is resolved, the ones that load Turkish Babel must add \shorthandoff{=} after \begin{document} since there is a conflict between graphicx, and babel, I suppose.

 For formulae, I use align, which gives me more freedom in order to present mathematical relations. The & symbol lets you how these formulas are to be aligned. Latex compiler will try to align all those invisible & characters in a line. 

 
\begin{align*}
C\dot V =& I - g_{K}n^4(V-E_k)- g_{Na}m^3(V-E_{Na})- g_{L}(V-E_L)\\
\dot n =& \alpha_n(V)(1-n)-\beta_n(V)n\\
\dot m =& \alpha_m(V)(1-m)-\beta_m(V)m\\
\dot h =& \alpha_h(V)(1-h)-\beta_h(V)h\\
&\alpha_n(V)=0.01\frac{10-V}{exp(\frac{10-V}{10})-1}\\
&\alpha_m(V)=0.1\frac{25-V}{exp(\frac{25-V}{10})-1}\\
&\alpha_h(V)=0.07exp(\frac{-V}{20})
\end{align*} 

 In order to present a figure, I use this codelet, that generates the figure scaled, rotated if necessary, captiones, centered, and positioned rigth in the place it is in the code. 

 
\begin{figure} [H]
\centering
\includegraphics[height=0.9\linewidth,angle=-90]{nullclines.ps}
\caption{Hodgkin Huxley sisteminin I=-10,-30,-60 ve -100 $\mu A/cm^2$ değerleri için çözümler ve her çözüme ait sıfır eğrileri}
\end{figure} 
  

In order to generate a bibliography, I use these commands:

 
\bibliographystyle{plainnat}
\bibliography{main}
 

 In order to generate a table, I use this code:

 
 \begin{tabular}{c c c c c c }
$I_{dc}$ &$P_{dc}$ & $V_{out}$ & $P_{y}$ &$\eta$ & Distorsiyon\\
\hline\\
74.48&1147mW&4.86V&590mW& 52 & \%48
\end{tabular}
 
 

Though it is not that latex-worthy in looks, but I have still not found a better one.

 And also, I use the savetrees package if I am sure that there will be no constructive criticism, which shrinks the margins.  In other words, I also add \usepackage{savetrees} to the header.

The last, and probably the least in importance, for reports, I use this scaled titlepage rather than the minimal titlepage latex generates:

 
 \begin{center}
  \vspace{10cm}
  \textsc{\huge Name of the University \\ \bigskip \huge Name of the Faculty}
  \vfill 
  \Huge The name of the course\\ \smallskip
  \Large The topic of the report
  \vfill
  \Large Name, Surname \\ \oldstylenums{Number} \\ \smallskip
  Deney Tarihi : \oldstylenums{The date the lab was attended}\\ Teslim Tarihi : \oldstylenums{\today}
  \vfill
  \Large Grup:\oldstylenums{C09} \\ The research assistant that was in charge: The name of the Research Assistant \smallskip 
\end{center}
\newpage
  
 

  In my opinion, it is worthy to learn about latex, at least try it. Though you lose time at first, you get to find it handy ans much more beautiful, after getting hang of it. It is a better choice for large documents, like theses, since it gives you much freedom about your style and it does not mess up if a correction is made to the document in the middle afterwards.  

  Good luck to those who get started with LaTeX, and don't hesitate to comment if you would like to reply to this text.