Why, in some instances, is the text Here is some text presented before the picture.jpg in the final document, please?  \begin{figure}[h] \centering \includegraphics[width=...]{picture.jpg} \caption{The best caption in the world.} \end{figure}  Here is some text.   I have had similar problems when doing \protect\footnotemark inside the \caption{...}, when the \footnotetext{...} which is supposed to come afterwards, is presented before the image.
How to influence the position of float environments like figure and table in LaTeX?   This is a general question and should collect useful answers for all users. I hope we can use this as a reference
I had a bunch of errors in the output of sudo apt-get update:  duplicate entries and 404 not found errors.  Figured those out, I hope: I removed PPAs that didn't have any packages associated with them, then I removed out a duplicate entry in /etc/apt/sources.list.  It seems I have royally buggered it up.  Now most of the lines say Ign when I do sudo apt-get update.  How do I go about straightening out what I have screwed up?  I need to get rid of these Igns that are all over the place.  There are about 50% (eyeball guess) Igns! Proving that the difference of the terms of a sequence, multiplied by $n$ converge Erasing elements from a vector I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this:  void erase(std::vector&lt;int&gt;&amp; myNumbers_in, int number_in) {     std::vector&lt;int&gt;::iterator iter = myNumbers_in.begin();     std::vector&lt;int&gt;::iterator endIter = myNumbers_in.end();     for(; iter != endIter; ++iter)     {         if(*iter == number_in)         {             myNumbers_in.erase(iter);         }     } }  int main(int argc, char* argv[]) {     std::vector&lt;int&gt; myNmbers;     for(int i = 0; i &lt; 2; ++i)     {         myNmbers.push_back(i);         myNmbers.push_back(i);     }      erase(myNmbers, 1);      return 0; }   This code obviously crashes because I am changing the end of the vector while iterating through it. What is the best way to achieve this? I.e. is there any way to do this without iterating through the vector multiple times or creating one more copy of the vector? $\mathbb{Q}(\sqrt{p},\sqrt[3]{q})= \mathbb{Q}(\sqrt{p}\cdot \sqrt[3]{q})$ ?? If $f(x)=x+\int_{0}^{1}[xy^2+x^2y]f(y)dy$ where $x$ and$y$ are independent variable.Find $f(x).$ How do I shrink the partition of an img file made from dd? Cancelling upvote on comment? As mentioned on :     For something that can be done so   easily by accident, there should be   the ability to undo mistakes.   I know that I have clicked several times on a comment up-vote without actually wanting to.  I would suggest being able to cancel the up-vote (maybe only for a couple of minutes or even less than a minute, no problem, as long as I can undo a miss-click). I know that Wubi is slower in disk IO, but I can't find anything about it online other than vague statements such as "slightly slower disk seeks".  Has anyone done any benchmarks to quantify the speed difference? The question is as follows.  Imagine we have two closed geodesics on a surface, where these two geodesics bound a cylinder together and the geodesics are diffeomorphic to circles.  Can the cylinder have $K&gt;0$ everywhere or $K&lt;0$ everywhere?  Here $K$ is Gaussian Curvature.   What's confusing me about this question is that a cylinder has Gaussian Curvature of $K=0$ everywhere, so wouldn't the answer to both questions be no?  But then I don't get the point of the question with the geodesics.  Thank you in advance How to convert strings into integers in Python? Adding shapefile or feature class as layer in ArcMap using ArcPy Resetting Ubuntu to factory settings Determine whether the series $\sum_{n=1}^{\infty}(\frac{n}{n+1})^{n^2}$ is convergent or divergent.  I've tried applying all the basic tests to no avail. I need to find out what the "trick" for this particular series is. How do I pre-install Ubuntu for someone (OEM install)? I would like to pre-install Ubuntu on a computer for someone. I may want to customize it for them, but in the end they need to be able to choose a username, password, etc. when they first boot it up. (Also called an OEM install).  How do I do this? I've just upgraded from Ubuntu 18.04 to its newest LTS version - 20.04. While it comes with some interesting changes, the Desktop icon system was messed up in my opinion. When you hover the mouse cursor over the icons, you see a huge space marked around them that cannot be violated (as you can see in the image below) so that they need to be placed very far apart from each other.  18.04 allowed you to place icons much closer to each other and didn't have that marked space around them. This new way leaves much less space on the Desktop to organize large amounts of icons - including folders, files and shortcuts. Is there a way I can significantly reduce the size of icons and their "spaces" or go back to the old system of organizing files? On "Settings", there is a tool to change the size of Dock icons, but not of Desktop icons.  Also, every time I move or delete something, the Desktop "flashes" and the icons seem to rearrange themselves automatically, nothing of which happened in 18.04. I also can't move anything directly to the Desktop; I need to move to the Desktop folder on Nautilus. This makes me start to think about downgrading Ubuntu back to 18.04. Zero probability and impossibility I read a comment under :     There are plenty of events that can occur that have zero probability.   This reminds me that I have seen similar saying before elsewhere, and have never been able to make sense out of it. So I was wondering    if zero probability and impossibility mean the same? if an event with zero probability doesn't mean that the event is impossible to occur, how probability theory represents/describes impossibility?   Thanks and regards! Provide two arguments to one option using getopts In below code when I give option r then getopts requires one arguments:  while getopts ":hr::l:" opt; do     case $opt in         r ) echo "Run Numbers - argument = $OPTARG " ;;         l ) echo "Latency range - argument = $OPTARG" ;;         h ) helptext             graceful_exit ;;         * ) usage             clean_up             exit 1     esac done   But I need to pass two arguments after -r option, instead of one. Is there an easy way to do this? What is the proper way of creating installation media from Ubuntu iso? This is the third time I've tried to install Ubuntu Server 14.04.03 64-bit on the same laptop, and each time it caused different problems.  Each time I wrote the same iso image to a USB flash drive by using a different application and OS.   Universal USB Installer (pendrivelinux.com) from Windows WinImage writer from Windows built-in image writer from Linux Mint 17.2    The iso image is the same in all three cases, the USB flash drive is the same, and the laptop is the same. However each time the installation of Ubuntu gave me different installation options. For example, the last time I installed Ubuntu, it didn't show all the packages to choose while installing (Basic Ubuntu server, etc.). I always use lm() in R to perform linear regression of $y$ on $x$. That function returns a coefficient $\beta$ such that $$y = \beta x.$$  Today I learned about total least squares and that princomp() function (principal component analysis, PCA) can be used to perform it. It should be good for me (more accurate). I have done some tests using princomp(), like:  r &lt;- princomp( ~ x + y)   My problem is: how to interpret its results? How can I get the regression coefficient? By "coefficient" I mean the number $\beta$ that I have to use to multiply the $x$ value to give a number close to $y$. How to define a bijection between $(0,1)$ and $(0,1]$?