4

I have to make a white box, blank of text, that is 1 by 1 inch and then position it exactly on the right side of the text. Also, I need to make the borders a bit thick.coding result How do I do this?

My coding is:

\section {Space Filling}
One inch away is a box which measures exactly 1" by 1":
\framebox
{ \begin{minipage}{1in} 
\hfill\vspace{1in}
\end{minipage} }

It should look like the image shown attached.

  • When you post a question and then get an answer, deleting that question is kind of insulting the person who tried to answer your question. – akrun Sep 24 '17 at 15:51
4
  • The box can be moved by \nobreak\hfill or \hspace*{\fill} to the right side of the text area.
  • \raisebox{\depth}{...} moves the box to the base line.
  • The line width of \fbox can be controlled by \fboxrule.
  • \fboxsep is used to create a white box with dimensions 2\fboxsep × 2\fboxsep (1in × 1in).
\documentclass{article}
\begin{document}
\section {Space Filling}
One inch away is a box which measures 1" by 1":
\hspace*{\fill}
\raisebox{\depth}{%
  \setlength{\fboxrule}{2pt}%
  \setlength{\fboxsep}{.5in}%
  \fbox{}%
}
\end{document}

Result

If the border should be included in the dimensions of 1in × 1in, then the border width needs to be subtracted:

\documentclass{article}
\begin{document}
\section {Space Filling}
One inch away is a box which measures 1" by 1":
\hspace*{\fill}
\raisebox{\depth}{%
  \setlength{\fboxrule}{2pt}%
  \setlength{\fboxsep}{\dimexpr.5in-\fboxrule\relax}%
  \fbox{}%
}
\end{document}

Result

  • Thanks a lot. Just one more question: how do you position the box left or right horizontally on that same line? – Math Expert Jul 17 '14 at 5:44
  • @user59223: \hfill or \hspace*{\fill} adds stretchable space to move the box to the right. – Heiko Oberdiek Jul 17 '14 at 5:46
  • Got it. I used "\hspace*{0.15\textwidth}" to get what I want. I appreciate the help! – Math Expert Jul 17 '14 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.