1

I see ways to make a standalone equation, like here, but I want to have a little bit more than that. I want to make something like

\begin{document}
    Blah blah blah.
    \begin{equation*}
    F(V, T) = E(V) + D(T)
    \end{equation*}
    Blah blah blah.
\end{document}

It seems like all the templates I have to work with default to having the size of a full sheet of paper, but I just want a little rectangle with that content inside.

The bot asked me to clarify but I'm not sure what wasn't understood. I just want to write a document that's about a paragraph in size, maybe with a few equations interlaced with text, maybe an align environment. The purpose is for something to copy-paste into a powerpoint. The standalone document class is often recommended but it doesn't allow for multiple lines, or changing environment types in it.

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 08 '21 at 16:16

1 Answers1

2

Here is your solution. You can change the color of the rectangle as your wish in draw=black or draw=red.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{varwidth}
% \pagecolor{black}
% \color{white}
\begin{document}
\begin{varwidth}{250pt}
  \begin{tikzpicture}
    \path node[draw=black,line width=1pt,inner sep=0.1cm,outer sep=0]
 {\begin{varwidth}{100pt}
    Blah blah blah.
    \begin{equation*}
    F(V, T) = E(V) + D(T)
    \end{equation*}
    Blah blah blah.
    \end{varwidth}};
  \end{tikzpicture}
\end{varwidth}
\end{document}

Update

If you want to deal with the border only. Use this:

\documentclass[
  border={20pt 20pt 20pt 20pt}, % left bottom right top
preview]{standalone} 
\usepackage{amsmath}
\begin{document}
    Blah blah blah.
    \begin{equation*}
    F(V, T) = E(V) + D(T)
    \end{equation*}
    Blah blah blah.
\end{document}
mmr
  • 2,249
  • 5
  • 22
  • 1
    That works! By rectangle I just meant the size of the document, but I got exactly what I wanted by using your snippet and removing draw=black. Thanks! – Frank Harris Dec 08 '21 at 16:31
  • @FrankHarris Then you can do it more efficiently. I have added that in the answer. – mmr Dec 08 '21 at 16:37