Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

  • 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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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