Repository for Ideas & Research
Open Source GIS, Hydrologic Modeling, Optimization


1   TikZ to SVG

2   Math-mode fonts

What are all the font styles I can use in math mode?

3   Font for number domains

Use \mathds from the dsfont package.


4   tikzscale doesn’t work when tikz figures are externalized by name

tikzscale not working with externalize using named only

tikzscale and \tikzsetnextfilename do not work together

Scale tikz figure to a percentage of \textwidth

Use \begin{tikzpicture}[scale=0.5\textwidth/240cm] or \begin{tikzpicture}\begin{axis}[width=0.5\textwidth] instead of \includegraphics[width=0.5\textwidth].

5   \cite and \citep don’t work inside changes commands when used with ulem

Change tracking while using bilatex-apa results in an error

ulem commands don’t work with \cite and \citep. A workaround is to redefine \cite and \citep as follows:


Redefine these commands only for marked manuscripts because I don’t want excessively long text boxes in the final version. For example,



However, I still have an issue with the above approach because, even in a marked version, the new \cite and \citep should be used only inside changes commands and the original version of these commands should be used elsewhere. An ugly hack is provided below:



Use \redefineforchanges before using \cite and \citep inside changes commands and restore the original version of these commands later:

\redefineforchanges\added{\cite{Cho.2016} proposed a new approach...}\redefineforothers

An alternative approach is to define separate cite commands for changes commands:



Use them like this:

\added{\changescite{Cho.2016} proposed a new approach...}

6   Redefining an existing command using the same command inside

Using \expandafter for macro redefinitions

A Tutorial on \expandafter

7   The TikZ trapezium node has a sizing bug

Why trapez shape width changes with text?

8   TikZ externalization conflicts with the endfloat package

pdflatex -shell-escape main would not run successfully if main.tex includes \usepackage{endfloat}.

9   lineno numbering issue

Why doesn’t lineno number a paragraph when it is followed by an “align” equation environment without a space?

  \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}}% 

10   elsarticle corresponding author issue

Elsarticle frontmatter corresponding author

    \global\let\@corref\@empty  %% Added

11   Tikz externalize not working when jobname is specified for main document

Tikz externalize not working when jobname is specified for main document