When I'm typing my own documents, it's often the case that an awkwardly placed theorem environment near the end of the page will jump to the next because it's too large to fit in one page. When this happens, a large blank space is created at the end of the first; of course, this looks remarkably ugly.  In particular, consider the following image:    As a stylistic choice, I don't want to allow the theorem boxes to split across pages, which causes the following problem.   On the other hand, I noticed that no author has this problem in their books; they somehow always manage to fit their environments and text in such a way that every page is filled to the brim (so to speak) and no theorem environment is broken across a page. My question is: how do these authors do this? Is there a way to remedy the situation above automatically, or do I have to manually fill in the gap with extra content?   Thanks.  Edit: An example as suggested in the comments:  \documentclass{article} \usepackage{lipsum} \usepackage{amsmath} \usepackage{amssymb} \usepackage[margin=4cm,includefoot]{geometry}  \usepackage{newpxtext} \usepackage{newpxmath}  % theorem styles \usepackage{mdframed} \usepackage{xcolor}  \mdfsetup{skipabove=5pt,skipbelow=5pt,nobreak}  \definecolor{pale}{HTML}{FFB5CE} \definecolor{redbrown}{HTML}{A52A2A}  \mdfdefinestyle{paleStyle}{%     linecolor=pale,     backgroundcolor=pale,     innertopmargin=0pt,     innerbottommargin=10pt,     innerrightmargin=10pt,     innerleftmargin=10pt,     frametitleaboveskip=5pt,     font=\itshape }  \mdtheorem[style=paleStyle, frametitleaboveskip = 10pt, frametitlebelowskip = 10pt, frametitlefont = \normalfont\large\fontfamily{pag}\selectfont, theoremseparator = {\quad}]{MDtheorem}{Theorem}   \newenvironment{theorem}[1][]{     \ifstrempty{#1}{\begin{MDtheorem}}{\begin{MDtheorem}[#1]} }{%     \end{MDtheorem}% }% \newenvironment{theorem*}[1][]{     \ifstrempty{#1}{\begin{MDtheorem*}}{\begin{MDtheorem*}[\normalfont#1]}% }{%     \end{MDtheorem*}% }%   \begin{document}  \lipsum[1-4]  Another strip of text another strip of text Another strip of text another strip of text Another strip of text another strip of text another strip of text another strip of text another strip of text another strip of text   \begin{theorem}[Riemann Hypothesis] \lipsum[2] \end{theorem}  \end{document}   In this case, I have the "nobreak" setting on, so the theorem environment is forced to the next page, leaving a large white space below the text.
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
How do I make a bootable USB OS X installer on a Mac? Does anyone have a Terminal command-line recipe for making a new bootable USB flash drive for one of the new MacBook Air's?  Is there a way to dd copy the USB boot device that comes in the box and make the new copy bootable?  I'd like to make a new backup copy of the USB rescue device for my MBA, preferably on a much larger flash drive with room for a backup of some of my working directories.  Added:  And is it possible to make, not just a rescue drive, but a bootable USB drive that will boot a fully updated version of the OS (say 10.6.8 or later)?  If so how on a MacBook Air 11, and how big a USB stick will this require? I am familiar with what partitions are, but I saw , and realised I didn't know what "aligned partitions" are.  So what does it mean to "align" partitions? What are the benefits, and the downsides? I didn't grow out of it.   or      I haven't grown out of it.    Which sentence is grammatically more correct? I'd rather say the second, but  I saw in the text the first one. How can I get query string values in JavaScript? How do you make samba follow symlink outside the shared path This is Ubuntu server 10.04 64 and samba 3.4.7.  I have a shared directory /home/mit/share and another one /home/temp that I link into the shared one:  ln -s /home/temp /home/mit/share/temp   But on windows, after using internet, I cannot open S:/temp, but on Linux it is possible to access /home/mit/share/temp like expected.   This works if I link directories inside /home/mit/share/temp, so I guess samba is restricting to jump with a link outside/above the shared directory.   EDIT:  See also this question titled .  It seems best to put unix extensions = no into the global section and follow symlinks = yes and wide links = yes only into the shares section, where you really need it.  The unix extension flag has to live in the global section and not in the individual shares sections. But for security reasons it is better to use the other options only where you need it, and not globally. I have a shapefile with a "id" field in which some non-unique ID numbers exist (don't ask).  When I try to import this to a PostGIS database using QGIS' DB Manager, it tries to re-use those IDs are unique primary key and fails.  The "Primary key" option is not ticked. "id" is shown in grey next to it.   How can I make DB Manager ignore an existing "id" column and just create a new SERIAL field or something like that?  QGIS 2.18. The table cards were A,K,K,8,3. All four suits were on the board. Player one had A,8. Player two had A,3.   Is this a split pot? Example where Hamiltonian $H \neq T+V=E$, but $E=T+V$ is conserved I'm looking for an example of a Hamiltonian $H$, where $H\neq T+V$, but the total energy in the system, $E=T+V$, is still conserved.   While I'm at it, I might as well add that I'd be most interested in an example from a classical field theory. Furthermore, I am looking for a nontrivial example, e.g. where $H$ doesn't just differ from $E$ by some gradient function that integrates to 0 in the action.   In particular, I am trying to get a better understanding of the physical implications of $H$ being conserved when nontrivial variables are used, i.e. physically, what does $H$ this correspond to. Conversely, can one have a system where $E = H$ in one frame, and is conserved, while in another frame $E'\neq H'$, and $H'$ is conserved while $E'$ is not? primes whose difference is a multiple of $n$ Hello everyone this is my first question here so if there are any suggested edits  feel free to participate! Is it true that for every $n$ there two prime numbers $p$ and $q$ with $n\mid p-q$? I have verified this empirically but  am not sure if there is a proof for this The close dialog says there are two off-topic votes, but none of the off-topic reasons have votes next to them I've found strange behavior when closing this  - I definitely see that there are 3 closing votes and 2 of them are at "Off-topic" section:   -but there are no explanations on section itself:   -while, normally, it's expected that it will appear. In custom comments section there are also no closing-votes displayed.   Perhaps it's just my browser (which is FF 26 x64 under Win) - so marking this as a "possible bug". Thank you for your attention. Evaluation of $\lim_{n\rightarrow \infty}\frac{1}{2n}\cdot \ln \binom{2n}{n}$ Prove there are no other solutions of functional equation $f(x+y) = \frac{f(x)+f(y)}{1-f(x)f(y)}$ Dear all I think I have a problem with the collation of makeidx.  following some suggestions found here I have got in the text something like this  \index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00855 @855A|qt}  \index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00868 @868f-869b|nn{\thefootnote}}   the first is an \index entry in the text, the second in a footnote. My problem is that even if I put the sort also on the second level of indexing it keeps keeping them separated.  I use this package information  \usepackage[splitindex]{imakeidx} \makeindex[name=n, title=Nomi di persone e luoghi]  \makeindex[name=p, title=Passi citati nel testo] \makeindex[name=t, title=Altri testi citati] \makeindex[name=pap, title=Papiri e manoscritti citati nel testo]  \newcommand{\nn}[2]{#2 \textit{n}#1} \newcommand{\qt}[1]{\textbf{#1}}   in the .idx file I get this  \indexentry{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00855 @855A|hyperindexformat{\qt}}{8}  \indexentry{Plutarco!demalignitate@\textit  {De Malignitate Herodoti}!00868 @868 b-c|hyperindexformat{\nn{33}}}{10}   can somebody advise me on what I am doing wrong here, please? I have tried to use \string after the first sort with no effect.    sure, sorry: this is the file I'm using  \documentclass[12pt,a4paper]{book} \usepackage[utf8x]{inputenx}  \usepackage{palatino}        \usepackage[LGR,T1]{fontenc} \usepackage[english,german,polutonikogreek,italian]{babel}  \usepackage[splitindex]{imakeidx} \makeindex[name=p, title=Passi citati nel testo,columns=1] \newcommand{\nn}[2]{#2 \textit{n}#1} \newcommand{\qt}[1]{\textbf{#1}} \usepackage[hidelinks]{hyperref} \begin{document}  (855A\index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00855 @855A|qt})% \footnote{DHM 868 B-C\index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00868 @868 b-c|nn{\thefootnote}}} \printindex[p] \end{document} Is there a way to solve this integral?  $$\int \frac{dx}{\sqrt{-ax^2 + bx +c}}, \;\;\;\;\; \forall\; a,b,c \in (0,+\infty) \;in\;R$$  I have tried it by changing of variable and by parts, but no result. I don't know what else to do.  Thanks in advance. Minecraft pocket edition restoring skin problem I updated Minecraft PE so I can have custom skins. I clicked on 'restore skins' without selecting any particular skin, It is now stuck with a  message saying 'we're restoring your skins!' but it has been like that for 20 minutes. Is there a reason why it is like this? How can I manage the "Open with Explorer" button based on user permissions? Reducing size of KML file (after converting from Shapefile) Allow horizontal scrolling of long math expressions Stack Exchange formats math, but often the formatted math is wider than the screen. It would be nice if formatted math were scrollable the same way that formatted code wider than the screen is scrollable. How to extrude and scale with an even offset? If you provide 0 as the dayValue in Date.setFullYear you get the last day of the previous month:  d = new Date(); d.setFullYear(2008, 11, 0); //  Sun Nov 30 2008   There is reference to this behaviour at . Is this a reliable cross-browser feature or should I look at alternative methods?