\documentclass[12pt]{article}
\usepackage[
top=0.75in, bottom=0.75in, left=0.75in, right=0.75in,
textheight=8.75in
]{geometry}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\pagestyle{empty}
\begin{document}
\begin{minipage}{0.4\linewidth}
{\LARGE\textsc{My Name}}
\end{minipage}
\begin{minipage}[b]{0.4\linewidth}
\begin{flushright}
\footnotesize\texttt{[email protected]}
\end{flushright}
\end{minipage}
\smallskip
\hrule
\bigskip
{\textsc{ABC University}}
\end{document}
我的代码如上所示...如果我删除,\hrule
电子邮件会正确对齐到右侧;但是一旦我添加它,它就会搞砸。有什么建议可以解决这个问题吗?
答案1
实际上你不需要minipage
这里。
\documentclass[12pt]{article}
\usepackage[
top=0.75in, bottom=0.75in, left=0.75in, right=0.75in,
textheight=8.75in
]{geometry}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\pagestyle{empty}
\begin{document}
{\LARGE\textsc{My Name}}
\hfill
\footnotesize\texttt{[email protected]}
\smallskip
\hrule
\bigskip
{\textsc{ABC University}}
\end{document}
如果你想保留你的s ,你应该把它们的宽度设置为as 的minipage
大约一半。textwidth
\begin{minipage}[b]{0.495\linewidth}
\documentclass[12pt]{article}
\usepackage[
top=0.75in, bottom=0.75in, left=0.75in, right=0.75in,
textheight=8.75in
]{geometry}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\pagestyle{empty}
\begin{document}
\begin{minipage}{0.495\linewidth}
{\LARGE\textsc{My Name}}
\end{minipage}
\begin{minipage}[b]{0.495\linewidth}
\begin{flushright}
\footnotesize\texttt{[email protected]}
\end{flushright}
\end{minipage}%
\smallskip
\hrule
\bigskip
{\textsc{ABC University}}
\end{document}
\hfill
或者你可以在小页面之间发出类似
\begin{minipage}{0.4\linewidth}
{\LARGE\textsc{My Name}}
\end{minipage}\hfill % ,----here
\begin{minipage}[b]{0.4\linewidth}
\begin{flushright}
\footnotesize\texttt{[email protected]}
\end{flushright}
\end{minipage}%
\smallskip
\hrule
\bigskip
{\textsc{ABC University}}
以获得与@egreg 的评论中提到的相同的效果。