将框中的某些内容与句子对齐?

将框中的某些内容与句子对齐?

我想知道是否可以使用 来boxedminipage对齐框中的内容?下面是我的代码;我希望 mu 与句子在同一行。

\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} 

在此处输入图片描述

答案1

只需使用\fboxAND a minipage(带t选项),而不是boxedminipage。我还使用了\ln运算符,而不是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} 

在此处输入图片描述

答案2

改用\boxed, 。

\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}

任何

可能更好

\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}

在此处输入图片描述

相关内容