1

Please how to set two rows in a framebox?

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[czech,english]{babel} 

\begin{document}
\framebox[\textwidth]{\centering \textbf{Instruction:}\\ Find the ground state energy of a helium atom in first-order perturbation theory.} \par
\end{document}

Is the instruction grammatically correct?

1

\framebox creates a single line box. Click here for more info.

Since you have many lines in your box, you could use framed environment, from the package of the same name.

Off-topic: don't use \\ for going to a new line, just leave an empty line.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[czech,english]{babel} 
\usepackage{framed}

\begin{document}
\begin{framed}\centering\textbf{Instruction:}

Find the ground state energy of a helium atom in first-order perturbation theory.
\end{framed}
\end{document} 

enter image description here

  • Thank you and how to set bold border please? I editted the code in question. – Elisabeth Nov 4 '18 at 8:03
  • @Johannes_B Elisabeth asked a new question: tex.stackexchange.com/questions/458298/mdframed-bold-frame. I deleted the edit to her question. – CarLaTeX Nov 4 '18 at 8:19
  • 2
    For a bold border, you have \setlength{\FrameRule}{some length}. – Bernard Nov 4 '18 at 11:55
  • 1
    @Elisabeth you can have bold border also with framed: see Bernard's comment. – CarLaTeX Nov 4 '18 at 13:17

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.