What latex package has the Sbox env?
What latex package has the Sbox env?
The `Sbox` environment (with a capital 'S') is provided by the **`sbox`** package. This package defines the `Sbox` environment as an alternative to the standard LaTeX `lrbox` environment. Both are used to save material into a LaTeX box register without typesetting it immediately. Here's a basic example of how to use it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | \documentclass{article} \usepackage{sbox} % Load the package \newsavebox{\mybox} % Declare a box register \begin{document} First, we save some content into the box: \begin{Sbox}{\mybox} % Start the Sbox environment, saving to \mybox This is some text that will be saved in the box. It can contain multiple lines and formatting like \textbf{bold text}. \end{Sbox} % End the Sbox environment The content is now saved but not yet printed. Now, we can use the saved content: Here it is: \usebox{\mybox} And we can use it again: \usebox{\mybox} \end{document} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | \documentclass{article} % No extra package needed for lrbox \newsavebox{\myotherbox} % Declare a box register \begin{document} Using lrbox: \begin{lrbox}{\myotherbox} % Start the lrbox environment Content saved using lrbox. \end{lrbox} % End the lrbox environment Now print it: \usebox{\myotherbox} \end{document} |
Testing if the previous output contains the string fancybox
: False