Search This Blog

Thursday, December 30, 2010

rsync excluding .svn dir

rsync -av --exclude=".svn" -e ssh  A  B





Thursday, December 23, 2010

to increase section number by 2

\addtocounter{section}{2}

pdfpages to include pdf files into LaTex

\usepackage{pdfpages}
\usepackage{fancyhdr}


\includepdf[pages=-, pagecommand={\thispagestyle{fancy}}]{PeerEvalScanned.pdf}

\includepdf[pages=-, fitpaper=true, pagecommand={\thispagestyle{fancy}},addtolist={1,figure,{some interesting}, TEformNumeric}]{TE/TEformNumeric.pdf}

Wednesday, December 22, 2010

Natbib reference sheet

Natbib reference sheet

\citet{jon90} --> Jones et al. (1990)
\citet[chap. 2]{jon90} --> Jones et al. (1990, chap. 2)
\citep{jon90} --> (Jones et al., 1990)
\citep[chap. 2]{jon90} --> (Jones et al., 1990, chap. 2)
\citep[see][]{jon90} --> (see Jones et al., 1990)
\citep[see][chap. 2]{jon90} --> (see Jones et al., 1990, chap. 2)
\citet*{jon90} --> Jones, Baker, and Williams (1990)
\citep*{jon90} --> (Jones, Baker, and Williams, 1990)
























Tuesday, December 21, 2010

How to use nomenclature

  • Put \usepackage[〈options〉]{nomencl} in the preamble of your document.
  • Put \makenomenclature in the preamble of your document.
  • Issue the \nomenclature command (see Section 2.2) for each symbol you want to have included in the nomenclature list. The best place for this command is immediately after you introduce the symbol for the first time.
  • Put \printnomenclature at the place you want to have your nomenclature list.





\documentclass[12pt]{article}
\usepackage{nomencl}  
\makenomenclature

\begin{document}
\maketitle
\tableofcontents
\printnomenclature

\nomenclature{$N$}{The number of particles}

\end{document}

To compile do followings in Unix prompt:
makeindex 〈filename〉.nlo   -s   nomencl.ist   -o   〈filename〉.nls


Friday, December 17, 2010

TAR a large disk image

http://bit.ly/11m9K6

Particle variables

for i = 1, np

Particle radius
  • AP(i) 

Translational Coordinates and Uelocities, Acceleration
  • CX(i), UX(i), AX(i)
  • CY(i), UY(i), AY(i) 
  • CX(i), UZ(i), AZ(i) 

Rotational Euler-coordinates and Welocities (omega), Bacceleration (Boosting rotation)
  • EX(i), WX(i), BX(i)
  • EY(i), WY(i), BY(i) 
  • EX(i), WZ(i), BZ(i)  

Saturday, December 4, 2010

KCB's LaTeX files

KCB's LaTeX files: "\timestamp"

LaTeX Tools and Templates

LaTeX Tools and Templates

periodic boundary conditions

1, 2, 3, ..., L-1, L


i + 1 => mode ( i , L) + 1
i + 2 => mode ( i+1, L) + 1


i - 1 => mode ( i - 2 + L , L ) + 1
i - 2 => mode ( i - 3 + L , L ) + 1

Friday, December 3, 2010

Octave/MATLAB basics

Octave/MATLAB basics

Getting to Grips with Latex - Tables - Latex Tutorials by Andrew Roberts @ School of Computing, University of Leeds

Getting to Grips with Latex - Tables - Latex Tutorials by Andrew Roberts @ School of Computing, University of Leeds: "\begin{center}
\begin{tabular}{ l | c || r | }
\hline
1 & 2 & 3 \\ \hline
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\
\hline
\end{tabular}
\end{center}"

LaTeX:Commands - AoPSWiki

LaTeX:Commands - AoPSWiki

LaTex \newcommand

\newcommand{\dd}{\mathrm{d}}
\newcommand{\dt}{\mathrm{d}t}
\newcommand{\tr}{\mathrm{tr}}
\newcommand{\bmcal}[1]{\bm{\mathcal{#1}}}


\newcommand{\mycolor}{white}%purple, white
\newcommand{\mypause}{\pause}%
\newcommand{\justmoment}{\mypause}
%
\newcommand{\tcol}[1]{\textsf{\textcolor{\mycolor}{#1}}}
\newcommand{\tcolred}[1]{\textsf{\textcolor{red}{#1}}}
\newcommand{\tcolpurple}[1]{\textbf{\textcolor{purple}{#1}}}
\newcommand{\tcolul}[1]{\underline{\textbf{\textcolor{\mycolor}{#1}}}}
\newcommand{\tcolep}[1]{\emph{\textbf{\textcolor{\mycolor}{#1}}}}
\newcommand{\tcolmath}[1]{{\textcolor{\mycolor}{#1}}}
\newcommand{\tcolmathblue}[1]{{\textcolor{blue}{#1}}}
\newcommand{\tcolmathbf}[1]{\mathbf{\textcolor{\mycolor}{#1}}}
\newcommand{\tcolmathrm}[1]{\mathrm{\textcolor{\mycolor}{#1}}}
\newcommand{\textrtblue}[1]{\textrt{\textcolor{blue}{#1}}}
%\newcommand{\tcol}[1]{\textbf{\textcolor{white}{#1}}}
%\newcommand{\tcolmath}[1]{\mathbf{\textcolor{white}{#1}}}
%
\newcommand{\dbar}{d\mkern-6mu\mathchar'26}
\newcommand{\degree}{\textdegree}
\newcommand{\FigurePath}{/Users/albertsk/svn2009/Library/Figures}
\newcommand{\xunit}{\mathbf{i}}
\newcommand{\yunit}{\mathbf{j}}
\newcommand{\zunit}{\mathbf{k}}
\newcommand{\ii}{\mathbf{i}}
\newcommand{\jj}{\mathbf{j}}
\newcommand{\kk}{\mathbf{k}}
\newcommand{\textrt}[1]{\textit{\textrm{#1}}}
\newcommand{\paren}[1]{\left[{#1}\right]}
\newcommand{\prn}[1]{\left({#1}\right)}
\newcommand{\jmitem}{\justmoment \item}
\newcommand{\pitem}{\justmoment \item}
\newcommand{\lb}{\ \mathrm{lb}}
\newcommand{\ft}{\ \mathrm{ft}}
\newcommand{\inch}{\ \mathrm{in}}
\newcommand{\lbft}{\ \mathrm{lb}\cdot\mathrm{ft}}
\newcommand{\N}{\ \mathrm{N}}
\newcommand{\kN}{\ \mathrm{kN}}
\newcommand{\kip}{\ \mathrm{kip}}
\newcommand{\mm}{\ \mathrm{mm}}
\newcommand{\m}{\ \mathrm{m}}
\newcommand{\Nm}{\ \mathrm{N}\cdot\mathrm{m}}
\newcommand{\comment}[1]{}
\newcommand{\skipframe}[1]{}
\newcommand{\myvspace}{3cm}
\newcommand{\commentvspace}[1]{\vspace{\myvspace}}
\newcommand{\myfirstsection}{1}
\newcommand{\D}{\mathrm{d}}
\newcommand{\second}{\,\mathrm{sec}}
\newcommand{\minute}{\,\mathrm{min}}
\newcommand{\minutes}{\,\mathrm{mins}}
\newcommand{\hour}{\,\mathrm{hr}}
\newcommand{\hours}{\,\mathrm{hrs}}
\newcommand{\Pe}{\mathrm{Pe}}
\newcommand{\Plus}{^{+}}
\newcommand{\PlusPlus}{^{2+}}
\newcommand{\Minus}{^{-}}
\newcommand{\MinusMinus}{^{2-}}
\newcommand{\subs}[1]{$_{#1}$}
\newcommand{\supers}[1]{$^{#1}$}
\newcommand{\mailto}[1]{\href{mailto:#1}{#1}}


Friday, November 19, 2010

bug in "find" command in Linux

One should put single quotations for the wild card option.

 > find  $HOME  -name  '*.tcl'


This command is to find any file whose extension is tcl under the home directory including all the sub-directories.

Wednesday, November 17, 2010

shell script

This script read a directory, zip the directory, and create directory.zip file.
And it send the zip file to specific location in my Mac computer using scp.

==========

#!/bin/sh
echo $1
zip -r $1 $1
scp $1.zip albertsk@stokes.eng.hawaii.edu:/Users/albertsk/Desktop/On-going/Presentations/APS-DFD/simulations/

Monday, November 15, 2010

Latex: how to change footnote symbols

Arabic numerals, e.g., 1, 2, 3...
\renewcommand{\thefootnote}{\arabic{footnote}}


Roman numerals (lowercase), e.g., i, ii, iii...\renewcommand{\thefootnote}{\roman{footnote}}



Roman numerals (uppercase), e.g., I, II, III...
\renewcommand{\thefootnote}{\Roman{footnote}}

Alphabetic (lowercase), e.g., a, b, c...

\renewcommand{\thefootnote}{\alph{footnote}}

Alphabetic (uppercase), e.g., A, B, C...

\renewcommand{\thefootnote}{\Alph{footnote}}

A sequence of nine symbols (try it and see!)

\renewcommand{\thefootnote}{\fnsymbol{footnote}}

LaTex: Long arrow



If 


\longrightarrow

is not sufficiently long, try


\[ \xrightarrow{\hspace*{3cm}} \]

Saturday, November 13, 2010

PDF to Keynote (pdftokeynote)

For people who enjoys LaTex presentation, beamer, this free software "pdftokeynote"provides an excellent link between pdf and keynote.  A pdf presentation is prepared using beamer with full functionality of math typesetting. Once the final pdf file is made, then pdftokeynote can convert the pdf file with a number of slides to a Keynote file. Each Keynote page includes a pdf image of the presentation.  Only slide transition is possible in Keynote.

http://www.cs.hmc.edu/~oneill/freesoftware/pdftokeynote.html

Thursday, June 10, 2010

Eigenvalues of an Inverse Matrix

If lambda is an eigen value of a matrix A, then
1/lambda is an eigen value of the inverse matrix of A.


http://en.wikipedia.org/wiki/Inverse_eigenvalues_theorem

Monday, May 3, 2010

AMBER on Macintosh: Installing g95 or gfortran with MacPorts

Here is how to install gfortran on Mac using macport.

sudo port install g95


if not working

sudo port install gcc45 +gfortran



AMBER on Macintosh: Installing g95 or gfortran with MacPorts

Sunday, May 2, 2010

Migration – MacPorts

After I installed Snow Leopard, macport was not working well, especially when I tried to install texmacs and octave. Below is the site that showed me the entire step to fresh MacPort by reinstalling everything again.


Migration – MacPorts: "sudo ./restore_ports.tcl myports.txt"

Wednesday, April 28, 2010

LaTeX/Packages/Listings - Wikibooks, collection of open-content textbooks

A way to easily convert FORTRAN code to LaTex

LaTeX/Packages/Listings - Wikibooks, collection of open-content textbooks


\documentclass[11pt]{article}
%\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
%\geometry{letterpaper}                   % ... or a4paper or a5paper or ...
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
%\usepackage{graphicx}
%\usepackage{amssymb}
%\usepackage{epstopdf}
\usepackage{listings}
\lstset{ %
language= Fortran,                % choose the language of the code
basicstyle=\footnotesize,       % the size of the fonts that are used for the code
basicstyle=\scriptsize,
numbers=left,                   % where to put the line-numbers
numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers
numberstyle=\scriptsize,      % the size of the fonts that are used for the line-numbers
stepnumber=2,                   % the step between two line-numbers. If it's 1 each line will be numbered
numbersep=5pt,                  % how far the line-numbers are from the code
%backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}
%showspaces=false,               % show spaces adding particular underscores
%showstringspaces=false,         % underline spaces within strings
%showtabs=false,                 % show tabs within strings adding particular underscores
frame=single,                % adds a frame around the code
tabsize=2,                % sets default tabsize to 2 spaces
captionpos=b,                   % sets the caption-position to bottom
breaklines=true,                % sets automatic line breaking
breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
title=\lstname,                 % show the filename of files included with \lstinputlisting; also try caption instead of title
escapeinside={\%*}{*)}          % if you want to add a comment within your code
%morekeywords={*,...}            % if you want to add more keywords to the set
}
%\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\title{Brief Article}
\author{The Author}
%\date{}                                           % Activate to display a given date or no date

\begin{document}
\maketitle
%\section{}
%\subsection{}

\lstinputlisting[language=Fortran]{pGrand_hsnj.f}
\lstinputlisting[language=Fortran]{pHydroTort_FT_F.f90}

\end{document}

Thursday, March 11, 2010

How to add a new rpm using repoman

I needed to install pdftk rpm in my RHEL 5 host using repoman. Here is one that I figured out.

1. Download a necessary rpm from any source.

2. Copy the rpm file to a sub-directory under /deport/. In my case, it is
/depot/contrib/rhel/5/x86_64/

3. Type and enter:

ngedit

and follow instruction.

To manually update repository, type/enter:

repoman -r "Repo for rhel-5-x86_64" -u

Of course, contents in " " is specified for a given repository name. Option "-u" indicates update.

4. Select "next" in most sequential cases in repoman. Click the name of rpm that you want to install. And, finally enjoy using it.

Saturday, February 6, 2010

Restarting LSF deamon after electric outage

When I got a notice of a total electric outage of my building, yesterday I shutdown all the nodes of my cluster, being managed by LSF. Those nodes include 18 worker and 1 master nodes.

By advises from Platform Inc., I did the followings:

1. Login as a root:
  sudo bash

2. Login as a lsfadmin:
  su - lsfadmin

3. type and enter the following:
  lmgrd -c /opt/lsf/conf/license.dat

4. Log out lsfadmin to be root again, and start lsf deamon:
  /etc/init.d/lsf_daemons start

(to stop, one can use the following command. But, I did not.)
  /etc/init.d/lsf_daemons stop

Friday, January 8, 2010

Locations of MacTex files and how to texhash

Class files: /usr/local/texlive/2009/texmf-dist/tex/latex/
BST files: /usr/local/texlive/2009/texmf-dist/bibtex/bst/
STY files: /usr/local/texlive/2009/texmf-dist/tex/latex/

To update ls-R database, type and enter in Mac Terminal

>>sudo /usr/texbin/texhash

Labels

Blog Archive