cases
sets \arraystretch
to 1.2. You can decrease this value:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\def\env@cases{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{1}%
\array{@{}l@{\quad}l@{}}}
\makeatother
\begin{document}
\begin{equation}
f(x) = \begin{cases}
g_1(x), & \text{if condition 1}; \\
g_2(x), & \text{if condition 2}; \\
g_3(x), & \text{if condition 3}; \\
g_4(x), & \text{if condition 4}; \\
g_5(x), & \text{if condition 5}; \\
g_6(x), & \text{if condition 6}; \\
g_7(x), & \text{if condition 7}. \\
\end{cases}
\end{equation}
\end{document}
Packages in LaTeX (or other format flavors in fact) are essentially of three different types:
- Packages that extend the functionality of LaTeX (e.g.,
multicol
provides additional commands and environments to balance columns)
- Packages that modify the behavior and layout without providing any additional functionality
- Hybrid packages that do both of the above.
Most packages are of type 1) and 3), that is packages that are mostly only changing layout, still usually offer some additional functionality to parameterize, e.g., geometry
's main purpose is to set page layout dimension, but in order to do so it offers additional commands to customize it (this is of type 3) not 2)). But bottom line all 3 types exist.
Packages of type 1
If you don't use the additional functionality then loading or not loading it should make no difference whatsoever. So if you only have such packages then the test would be: "comment the loading out and if the document compiles you don't need the package".
Packages of type 2
Here the situation is different: if you don't load them the document would still compile, but the output would be different. So in this case the test should be on any change to the output produced.
A simple test approach would be to add \showoutput
in the preamble. That would generate for each output page a precise symbolic content structrue in the .log
file which could be compared.
The logs would need a bit of cleanup first so that other things are not compared as well, but essentially that would tell you: has the file change when I didn't load the package.
Now, if a package is of this type why doesn't it always changes the behavior of all documents? Simply because it may only change some aspects and those specific ones do not appear in the current document.
Packages of type 3
Being a hybrid, you will need to test for both, if you do not use the extended features (which would break your document when missing) you might still have a layout difference.
Conclusion
As there is no proper classification available into which bucket a package falls, one has to assume that they are all of type 3 and accordingly watch out for layout differences when compiling without the package. Missing functionality will be tested for free (as they will result in an error).
Full automation of such a test might be a bit difficult to program but not that hard.
Best Answer
I modified Antal S-Z's answer to this question to allow text to be completely blinded - i.e. the text to hide will be removed entirely from the document such as to prevent it from showing when marking it with the mouse cursor or using some other tool to analyse the document. However, the layout and appearance of the surrounding text will remain intact (although some slight differences may appear due to changes in hyphenation).
Here is the entire code:
And here is an example showing a text with and without anonymization. The setting can be controlled by simple commenting and uncommenting two lines of code.
With anonymity:
Without anonymity: