Too much white space between caption and figure produced by tikzDevice and ggplot2 in LaTeX
It's been so long since I asked this question, but I wanted to answer what was the problem in the end.
As you can see in this question on the differences between \input{} and \include{}, the problem has to do with the fact that \include{}
does a \clearpage
before and after \include{}
, that generates the white space I was talking about.
On the other hand, using \input{}
is the equivalent to copy and pasting the code into the LaTeX document, that will prevent the white spaces.
Too much space between the paragraph and an image
The space between the text and an object with the [h]
floating specifier is defined by \intextsep
. Its default value is 12.0pt plus 2.0pt minus 2.0pt
, but in can be modified like this:
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularx}
\setlength{\intextsep}{5.0pt plus 2.0pt minus 2.0pt}
\begin{document}
bla bla bla bla
\begin{figure}[h]
%\setlength\tabcolsep{2pt}%
\begin{tabularx}{\textwidth}{@{}*{3}{c}@{}}%
\includegraphics[ width=0.3\linewidth, height=0.3\linewidth, keepaspectratio,page=1]{example-image-duck} &
\includegraphics[ width=0.3\linewidth, height=0.29\linewidth, keepaspectratio,page=2]{example-image-duck} &
\includegraphics[ width=0.3\linewidth, height=0.41\linewidth, keepaspectratio,page=3]{example-image-duck}\\
(a) & (b) & (c)\\
\includegraphics[ width=0.3\linewidth, height=0.3\linewidth, keepaspectratio,page=4]{example-image-duck} &
\includegraphics[ width=0.3\linewidth, height=0.3\linewidth, keepaspectratio,page=5]{example-image-duck} &
\includegraphics[ width=0.3\linewidth, height=0.3\linewidth, keepaspectratio,page=6]{example-image-duck}\\
(d) & (e) & (f)\\
\end{tabularx}%
\caption{Spatial distribution of customers - centered depot. (a) 30C, (b) 22C, (c) 15C, (d) 20C, (e) 15C.1}% \label{fig:spatial-distribution}%
\end{figure}
\end{document}
Getting rid of the Figure 1 : bit
Using the caption
package:
\usepackage[labelformat=empty]{caption}
Will remove the "Figure n:" from your captions.
LaTeX puts too much space next to integrals
Something like this will do the trick.
\usepackage{amsmath}
\def\mathclap#1{\text{\hbox to 0pt{\hss$\mathsurround=0pt#1$\hss}}}
\begin{document}
\[
\int\limits_{\mathclap{-\infty < x < c}} (c - x) \ dP(x)
\]
\end{document}
More about such tricks is given in this article.
Related Topics
Remove Specific Characters from Column Names in R
Remove Ids With Fewer Than 9 Unique Observations
Using Ifelse Statement on the Whole Dataset Instead of a Single Column
How to Declare a Vector of Zeros in R
Select the Row With the Maximum Value in Each Group
Apply Several Summary Functions on Several Variables by Group in One Call
How to Use R'S Ellipsis Feature When Writing Your Own Function
Emulate Ggplot2 Default Color Palette
Force the Origin to Start At 0
Selecting Multiple Odd or Even Columns/Rows for Dataframe
R: Error in Usemethod("Tbl_Vars")
Combing a Categorical Variable to Create a New Categorical Variable in R
Counting Unique Values Across Variables (Columns) in R
Converting Year and Month ("Yyyy-Mm" Format) to a Date
Pass a Data.Frame Column Name to a Function
Show Percent % Instead of Counts in Charts of Categorical Variables