because LaTeX matters

figure

In the standard document classes report and book, figure and table counters are reset after every chapter. On the other hand, article does not reset these counters when a new section is started. The chngcntr package provides the \counterwithin and \counterwithout commands to redefine a counter, by adding or removing a dependency. Through these commands, the behavior of the figure and table counters can be changed.

Continuous figure and table numbering in report/book

The \counterwithout command removes a dependency from a counter and redefines \the’counter’ such that it is printed without the dependency.

Through \counterwithout, the figure and table counters can be changed to continuously number these figures and tables throughout a report or book. The command also redefines the way the counter is printed, such that the chapter number is not shown (e.g. ‘Figure 3′ instead of ‘Figure 1.3′). Redefining \the’counter’ can be omitted through the starred version \counterwithout*.

Similarly, a reset-dependency can be added to any counter through \counterwithin. The command also redefines \the’counter’ (e.g. ‘Figure 1.3′ instead of ‘Figure 1′). Again, the package provides a starred version \conterwithin* that does not redefine \the’counter’.

As an example, the \counterwithin command can be used to automatically reset the figure and table counters whenever a new section is started in an article. Also, the command redefines \thefigure to \thesection.\arabic{figure}. Therefore, figure 3 in section 1 will be printed as ‘Figure 1.3′. The same applies to \thetable.

I was looking for a simple schematic representation of DNA – protein interaction and didn’t find anything of the sort on the web. Below is what I came up with. I hope that some of you might find it useful.

DNA

The two strands of DNA are represented by two wavy lines, using the decoration coil. I slightly shifted one line to the right.

Often, figures have a white background which makes the figure border invisible on white paper. If a figure has several disconnected elements, it looks better to delimit them with a frame around figure. The adjustbox package scales, resizes, trims, rotates, and also frames LaTeX content. Conveniently, these functions can be exported to the \includegraphics command, which is what I will show below.

Load the adjustbox package with the export option to make functions available to the \includegraphics command (graphicx package).

The subcaption package handles positioning differently from subfigure and subfig. It defines the subfigure environment which is simply a minipage. Figures are then placed within the environment along with the caption and label. The caption can therefore be move on top of the figure simply by rearranging the commands.

The rotating package provides easy-to-use functionality to rotate content. The float environments sidewaystable and sidewaysfigure introduce landscape tables and figures, respectively. The package automatically takes care of the rotation direction for twoside documents. Besides 90 degrees rotation, the package also provides a command and environment to rotate content at an arbitrary angle.

Sidewaysfigure example

The easiest way to take full advantage of the page and position a figure (or table) in landscape-form is through the rotating package.

\documentclass[11pt]{article}
\usepackage{rotating, graphicx}
\begin{document}
\begin{sidewaysfigure}
\includegraphics[width=\textwidth]{capsules}
\caption{Result of a long day at work.}
\end{sidewaysfigure}
\end{document}

I manually rotated the page to better fit here. Sidewaysfigure will place the figure on a separate page, as will sidewaystable.

Arbitrary angle text example

The command turn allows rotation at an arbitrary angle in degrees. Here is a rather useless example, but you get the idea: