Style files


Commath.sty contains a variety of useful environments/commands, including \eval (“evaluate at”), \dfrac (\displaystyle\frac), \od (ordinary differential equations), etc. I do not personally use \dfrac or \od though: these commands display the fraction very small; I would renewcommand \dfrac as:


\dod is “displaystyle-\od”. \dpd is “dislaystyle-\pd”.

Line numbers disappear when using lineno.sty and align env.

lineno.sty provides line numbers on PDF. However, on paragraphs with equation(s), line numbers may disappear. To prevent this, issue:

\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}}%

according to

It might be more useful to create your own .sty file to automatically solve this problem.

How to track changes

One possible difficulty in writing a co-authored paper is how to highlight changes. There are basically three ways:

  1. Use texdiff (perl-based?)
  2. Use changes.sty (included in TeXLive)
  3. Use trackchanges.sty (

I mainly use trackchanges.sty (by locating its symbolic link in TeXLive). I found some pros and cons for each; texdiff is the easiest but readability is low, I thought (no waving underline needed to me!!). Changes.sty was not comfortable to me (I forgot the reason but I tried at one point). TrackChanges.sty was useful, with a potential incompatibility with \cite command or {equation} environment. It does not go without adding\protect command before \cite (or any other commands of .bib citation) and \begin{equation}.

Goodbye, wrapfig!

I quite often used to use wrapfig.sty, which I think is one of the major packages for wrapping texts above and/or beneath figures; however, the behavior of wrapfig is quite random, stochastic, and unpredictable. Therefore I switched to use picins.sty and minipage.sty. I found the behavior of the combination of minipage and picins is much simpler, highly flexible, and use-friendly.

picins.sty was not available in my system, so I get it from CTAN and placed in my local texlive system.

% or load ’graphicx’ and ’blindtext’ manually


%%%%%%vertically aligned figure starts

\pichskip{8pt}% Horizontal gap between picture and text


スクリーンショット 2017-10-11 17.01.03