4

MWE:

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[margin=3cm]{geometry}
\begin{document}
\paragraph*{Problem 1}
This problem can be modelled as a clamped-free cantilever with a point load at the end. Thus, the following boundary conditions can be assigned:
\begin{alignat}{2}
\underline{\emph{Clamped end:}}& &\underline{\emph{Free end:}}&\nonumber \\
w(0) &= 0\quad\textnormal{(no deflection)}\quad\quad\quad & w''(L) &= 0\quad\textnormal{(no moment)}\nonumber \\
w'(0) &= 0\quad\textnormal{(no slope)}\quad\quad\quad & w'''(L) &= 0\quad\textnormal{(no shear force)}\nonumber
\end{alignat}
The boundary condition concerning the shear force at $ x=L $ is a matter of taste, since there is a discontinuity in the shear force in this point.
\end{document}

Producing this: I want a box surrounding the boundary conditions

I would like a box similar to the one produced by \boxed{} around all the boundary conditions stated (including the underlined text). I've looked around on similar questions but it always seems like a special solution for that particular problem - what's the easiest way to do this?

  • Thanks. I know the general rule says "avoid mixing underlining, bold, and italics", but I think it looks nice in this case. How would you present these BC's to make it look nice? One can also argue about the alignment of the text to the equations below... – Carsten Gade Nov 1 '14 at 18:59
  • No, it looks awful, if I can speak frankly. – egreg Nov 1 '14 at 19:01
  • Really? Can you somehow share how you would present it nicely? Maybe add another answer or edit the one you made. – Carsten Gade Nov 1 '14 at 19:05
  • Actually I don't think I will include the box anyway, but it's nice to know. – Carsten Gade Nov 1 '14 at 19:06
7

It's a simple application of empheq

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,empheq}
\usepackage[margin=3cm]{geometry}
\begin{document}
\paragraph*{Problem 1}
This problem can be modelled as a clamped-free cantilever with a point load at the end. Thus, the following boundary conditions can be assigned:
\begin{empheq}[box=\fbox]{alignat=2}
\underline{\emph{Clamped end:}}& &\underline{\emph{Free end:}}&\nonumber \\
w(0) &= 0\quad\textnormal{(no deflection)}\quad\quad\quad & w''(L) &= 0\quad\textnormal{(no moment)}\nonumber \\
w'(0) &= 0\quad\textnormal{(no slope)}\quad\quad\quad & w'''(L) &= 0\quad\textnormal{(no shear force)}\nonumber
\end{empheq}
The boundary condition concerning the shear force at $ x=L $ is a matter of taste, since there is a discontinuity in the shear force in this point.
\end{document}

enter image description here

  • I was going to answer this using a minipage. I wasn't even aware of this package. So nice and clean. – A.Ellett Nov 1 '14 at 18:03
  • @egreg: Defining a \widebox as, say, \fbox{\quad#1\quad} would look better, I think. Also, needless to load amsmath: empheq does it. – Bernard Nov 1 '14 at 19:23
3

A possible option with hf-tikz:

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[margin=3cm]{geometry}
\usepackage[norndcorners,customcolors]{hf-tikz}
\tikzset{set border color=black,set fill color=white}
\begin{document}
\paragraph*{Problem 1}
This problem can be modelled as a clamped-free cantilever with a point load at the end. Thus, the following boundary conditions can be assigned:
\begin{alignat}{2}\tikzmarkin{a}
\underline{\emph{Clamped end:}}& &\underline{\emph{Free end:}}&\nonumber \\
w(0) &= 0\quad\textnormal{(no deflection)}\quad\quad\quad & w''(L) &= 0\quad\textnormal{(no moment)}\nonumber \\
w'(0) &= 0\quad\textnormal{(no slope)}\quad\quad\quad & w'''(L) &= 0\quad\textnormal{(no shear force)}\nonumber\tikzmarkend{a}
\end{alignat}
The boundary condition concerning the shear force at $ x=L $ is a matter of taste, since there is a discontinuity in the shear force in this point.
\end{document}

The result:

enter image description here

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.