Sunday, June 10, 2012

Subscript, underscore in Latex

In the equation model, either will work fine. But for inline mathematics you notice a difference. Probalby the operator name isn't needed here, if \max is already defined.
$\max_i$
vs.
$\underset{i}{\operatorname{max}}$

Wednesday, May 23, 2012

Comment Command for Joint Editing

Idea is when we collaborate on a paper it is nice to have a method of leaving comments.

I. Solution write your own commands for each author to make a comment function: author1comment, author2comment.

preamble (need color, anything else?)
\usepackage{color}

commands:
%-----------------------

\def\boxit#1{\vbox{\hrule\hbox{\vrule\kern6pt \vbox{\kern6pt#1\kern6pt}\kern6pt\vrule}\hrule}}
\def\bfred#1{{\color{red}\bf#1}}
\def\bfblue#1{{\color{blue}\bf#1}}
\def\hlred#1{{\color{red}#1}}
\def\hlblue#1{{\color{blue}#1}}


\newcommand{\BHcomment}[1]{\vskip 2mm\boxit{\vskip 2mm{\color{red}\bf#1} {\color{black}\bf -- BH\vskip 2mm}}\vskip 2mm}
\newcommand{\DCcomment}[1]{\vskip 2mm\boxit{\vskip 2mm{\color{blue}\bf#1} {\color{black}\bf -- DC\vskip 2mm}}\vskip 2mm}
\newcommand{\RScomment}[1]{\vskip 2mm\boxit{\vskip 2mm{\color{green}\bf#1} {\color{black}\bf -- RS\vskip 2mm}}\vskip 2mm}


%-----------------------




usage in the body
\BHcomment{Bret writes his comment here. He emphasizes his point with a double exclamation point}

II. There are other solutions:
1. I think there is a track changes package in latex...but I also think I hate this package
2. Good old fashion, Jim gets green, Bob gets red, and Nancy gets blue
pre-amble \usepackage{color}
in text
\textcolor{red}{Here is a comment from Bob, He is *not* happy with this sentence}