3

i would like to know if it is possible, using boxedminipage, to align what is in a box ? Here follow my code; i would like the mu to be on the same line as the sentence.

\documentclass[a4paper,12pt]{article}
\addtolength{\oddsidemargin}{-1.cm}
\addtolength{\textwidth}{2cm}
\addtolength{\topmargin}{-2cm}
\addtolength{\textheight}{3.5cm}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\usepackage{array} % for "\extrarowheight" macro
\setlength\extrarowheight{2pt} % provide a more open "look"
\usepackage[output-decimal-marker={,}]{siunitx}
\usepackage{etoolbox}
\usepackage{lscape} 
\usepackage[pdftex]{graphicx}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage {boxedminipage}
\usepackage{dsfont}
\usepackage{commath}
\usepackage{float}
\usepackage{hyperref}
\theoremstyle{plain}
\newtheorem{remark}{Remark}

\begin{document}


Therefore, we have \begin{boxedminipage}[poslb]{6,5cm}$\hat{\mu}=2ln(\sum\limits_{i=1}^{n}X_i)-${\large $\frac{3ln(n)}{2}-\frac{ln(\sum\limits_{i=1}^{n}X_i^2)}{2}$}\end{boxedminipage}\\ \\


\end{document} 

enter image description here

2

Just use an \fbox AND a minipage (with t option), instead of a boxedminipage. I also used the \ln operator, instead of ln.

\documentclass[a4paper,12pt]{article}
\addtolength{\oddsidemargin}{-1.cm}
\addtolength{\textwidth}{2cm}
\addtolength{\topmargin}{-2cm}
\addtolength{\textheight}{3.5cm}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\usepackage{array} % for "\extrarowheight" macro
\setlength\extrarowheight{2pt} % provide a more open "look"
\usepackage[output-decimal-marker={,}]{siunitx}
\usepackage{etoolbox}
\usepackage{lscape} 
\usepackage[pdftex]{graphicx}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{commath}
\usepackage{float}
\usepackage{hyperref}
\theoremstyle{plain}
\newtheorem{remark}{Remark}

\begin{document}
Therefore, we have \fbox{\begin{minipage}[t]{6.5cm}$\hat{\mu}=2\ln(
\sum\limits_{i=1}^{n}X_i)-${\large $\frac{3\ln(n)}{2}-\frac{\ln(
\sum\limits_{i=1}^{n}X_i^2)}{2}$}\end{minipage}}\\ \\
\end{document} 

enter image description here

1
  • @ABazigal The boxedminipage package seems very old (1992) and thus, perhaps, unsupported. May 24 '18 at 13:44
2

Use \boxed, instead.

\documentclass[a4paper,12pt]{article}

\usepackage{amsmath}

\begin{document}


Therefore, we have
$
\boxed{
  \hat{\mu}=
  2\ln\Bigl(\,\sum_{i=1}^{n}X_i\Bigr)-
  \frac{3\ln(n)}{2}-
  \frac{\ln\Bigl(\,\sum\limits_{i=1}^{n}X_i^2\Bigr)}{2}} 
$

\end{document}

whatever

Possibly better

\documentclass[a4paper,12pt]{article}

\usepackage{amsmath}

\begin{document}

Therefore, we have
$
\boxed{
  \hat{\mu}=
  2\ln\Bigl(\,\sum_{i=1}^{n}X_i\Bigr)-
  \frac{3\ln(n)}{2}-
  \frac{1}{2}\ln\Bigl(\,\sum\limits_{i=1}^{n}X_i^2\Bigr) 
}
$

\end{document}

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.