# Latex: Strikethrough text

with the ulem package this becomes:

\usepackage[normalem]{ulem}
\sout{Hello World}

With the soul package this is:

\usepackage{soul}
\st{Hellow world}

https://tex.stackexchange.com/a/23712

# How to remove space after image caption

A quick way would be to use \vspace{} with negative length as input. However, this is not the right approach and is not recommended for use.

Without using vspace the output would look like:

Here is a MWE with vspace and negative length as input followed by the output.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{xcolor}

\begin{document}

\begin{figure}[!ht]
\centering
\includegraphics[width=0.5\textwidth]{image}
\vspace{-1em}
\caption{\textcolor{gray}{\footnotesize \textit{ImageCaption}}}
\vspace{-1.5em}
\end{figure}
This is first text after caption.

\end{document}

Note how the use of vspace after the figure and after the caption shrinks the space.

https://tex.stackexchange.com/a/100131

# highlight several successive paragraphs, including tables

\documentclass{report}
\usepackage[table]{xcolor}

\begin{document}
Some black text

{\color{red}\makeatletter\let\default@color\current@color\makeatother

Some red text

\begin{table}[h]
Text that ought\\
to be red\\
\end{table}
More red text
}

More black text
\end{document}

https://tex.stackexchange.com/a/296847

# Placing a figure inside a multirow table cell

or those wondering how to put images in tables in general, the salient point is the bracketed fixup after the {*} in \multirow:

\multirow{2}{*}[fixup]{\includegraphics[width=2in]{...}}

For example:

\multirow{2}{*}[0.5in]{\includegraphics[width=2in]{...}}

By adjusting the fixup you can avoid Latex’s default behavior of putting the image way too low in the table.

https://tex.stackexchange.com/a/182609

# foreign command atop frack or genfrac should be used instead(amsmath)

Using \atop is abusing its functionality; if you want to turn a screw, sometimes a knife can help, but a screwdriver is surely better.

In other words, use \substack that has been specifically defined for this task and can accommodate any number of lines. It’s also easier to use even for two lines.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$\sum_{1\le i\le n\atop i\ne j}\quad \sum_{\scriptstyle 1\le i\le n\atop\scriptstyle i\ne j}\quad \sum_{\substack{1\le i\le n\\ i\ne j}}$
\end{document}

The first is wrong; the second is complicated to write. With \substack you also avoid the warning

Package amsmath Warning: Foreign command \atop;
(amsmath)                \frac or \genfrac should be used instead
(amsmath)                 on input line 6.

https://tex.stackexchange.com/questions/153490/atop-vs-substack-for-multiple-lines-under-a-sum/153502

# get IEEEtran to work with the subcaption package

The problem is that there does not seem to be a way to prevent subcaption from taking control of the main caption formatting away from IEEEtran like the caption=false option does under subfig.sty. IEEEtran has to format captions differently depending on its mode. An admittedly crude hack that might work is simply to restore IEEEtran’s definition of \@makecaption:

\makeatletter
\let\MYcaption\@makecaption
\makeatother

\usepackage[font=footnotesize]{subcaption}

\makeatletter
\let\@makecaption\MYcaption
\makeatother

And then code figures like:

\begin{figure*}[!p]
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=2.5in]{box}%
\subcaption{Case I}\label{fig_first_case}%
\end{minipage}%
\hfil
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=2.5in]{box}%
\subcaption{Case II}\label{fig_second_case}%
\end{minipage}%
\caption{Simulation results for the network.}
\label{fig_sim}
\end{figure*}

This did seem to work for me in one simple test, but more extensive testing is required.

http://www.michaelshell.org/tex/ieeetran/

# Show \textwidth and \linewidth values in latex

Here’s a snippet you can paste into your latex document to reveal the values of \textwidth and \linewidth printed into your document. First include this in your header:


\usepackage{layouts}


linewidth: \printinunitsof{in}\prntlen{\linewidth}