[OS X TeX] fboxes

Murray Eisenberg murrayeisenberg at gmail.com
Thu Jul 16 17:15:36 EDT 2020


It’s unclear whether you want to size all the parboxes to the same width. If so, the following will do it.
(If you want each parbox’s width sized separately, the solution is even simpler.) I’m including some blind text so you can actually see the columns!

\documentclass[11pt,twocolumn]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{enumerate}
\usepackage[margin=0.5in, landscape, paperwidth=4.5in, paperheight=8in]{geometry}

\setlength{\columnsep}{3em}

\newcommand{\mathbox}[1]{\fbox{\ensuremath{#1}}}

\usepackage{calc}

\usepackage[math]{blindtext}

\begin{document}

\Blindtext[1]

\newcommand{\firsthyp}{Theorem: If $x_{k}\to x$ and $y_{k}\to y$,}
\newcommand{\firstconcl}{then $z_{k}=(x_{k}+y_{k})\to z=(x+y)$}
\newcommand{\secondhyp}{Theorem: If $x_{k}\to x$ and $y_{k}\to y$,}
\newcommand{\secondconcl}{then $z_{k}=(x_{k}+y_{k})\to z=(x+y)$}
\newcommand{\thmonewidth}{\maxof{\widthof{\firsthyp}}{\widthof{\firstconcl}}}
\newcommand{\thmtwowidth}{\maxof{\widthof{\secondhyp}}{\widthof{\secondconcl}}}
\newcommand{\thmswidth}{\maxof{\thmonewidth}{\thmtwowidth}}

\begin{flushleft}
\fbox{\parbox{\thmswidth}{\firsthyp\\
	\firstconcl}}
\fbox{\parbox{\thmswidth}{\secondhyp\\
	\secondconcl}}
\end{flushleft}

\Blindtext[2]

\end{document}


> On 16 Jul2020, at 4:29 PM, Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu> wrote:
> 
> I am generating a two-column document, and want to box in the statement of a theorem.
> If in one line, it runs across the two columns.  So I put it in a \parbox, and broke it into two lines.  
> 
> My question is this:
> (see attached example) if I set the width as either \linewidth or \columnwidth, the box 
> (and hence the frame) runs to the end of the column line.  This makes sense, but it leaves
> a lot of space to the right of the text in the box. 
> Is there a way to make the box fit the width of the text, rather than the predefined line or column width?
> I don’t want to use rigid lengths (eg 4in) because the pdf that I generate will go through an ExplainEverything
> recording, and I am not sure what the final dimensions of anything will be—I prefer to have that controlled
> internally.
> 
> 
> Zbigniew Nitecki
> Department of Mathematics
> Tufts University
> Medford, MA 02155
> 
> telephones:
> Office    (617)627-3843
> Dept.    (617)627-3234
> Dept. fax    (617)627-3966
> http://www.tufts.edu/~znitecki/ <http://www.tufts.edu/~znitecki/>
> 
> 
> 
> <EGtest.tex><EGtest.pdf>----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
> List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
>                https://email.esm.psu.edu/pipermail/macosx-tex/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

---
Murray Eisenberg			murrayeisenberg at gmail.com
503 King Farm Blvd #101	Home (240)-246-7240
Rockville, MD 20850-6667	Mobile (413)-427-5334


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200716/6aa252bf/attachment.htm>


More information about the MacOSX-TeX mailing list