![如何将地址放在同一层级?](https://linux22.com/image/411704/%E5%A6%82%E4%BD%95%E5%B0%86%E5%9C%B0%E5%9D%80%E6%94%BE%E5%9C%A8%E5%90%8C%E4%B8%80%E5%B1%82%E7%BA%A7%EF%BC%9F.png)
\documentclass[a4paper,12pt]{article}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{ragged2e}
\begin{document}
\begin{flushleft}
\textbf{Riyam Sen} \\
Department of Mathematical Sciences, Aligarh University \\
Napaam, Sonitpur, Delhi-110025, India. \\
e-mail: [email protected]
\end{flushleft}
\begin{flushright}
\textbf{Pronoy Pratim Dutta} \\
Statistics and Mathematics Unit, Indian Statistical Institute,\\
Bangalore, R. V. College Post, Bangalore 560059,
India. \\
e-mail: [email protected]
\end{flushright}
\end{document}
在这段代码中,我试图将名称和地址放在同一级别,但一个稍微向上,一个稍微向下。
我们怎样才能把它们放在同一水平?
答案1
如果您想要一个用户友好的“编程”界面,我建议您使用该tcolorbox
包执行此类任务。
下面的示例是一个很好的起点。
(也许我有太多幻想,但我想你正在寻找这样的东西)
\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\setlength\parindent{0pt}
\newtcolorbox{heading}{%
blankest,
sidebyside,
enlarge left by = -1cm,
enlarge right by = 2cm,
width = \linewidth+2cm,
halign lower = flush right,
after = \bigskip\bigskip,
top = 4mm,
bottom = 4mm,
sidebyside align = top seam,
borderline north = {1.8pt}{0pt}{black},
borderline south = {1.0pt}{0pt}{black}
}
\begin{document}
\begin{heading}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\textbf{Riyam Sen} \\
Department of Mathematical Sciences, Aligarh University \\
Napaam, Sonitpur, Delhi-110025, India. \\
e-mail: [email protected]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tcblower
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\textbf{Pronoy Pratim Dutta} \\
Statistics and Mathematics Unit\\
Indian Statistical Institute\\
Bangalore, R. V. College Post\\
Bangalore 560059 India \\
e-mail: [email protected]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{heading}
\lipsum
\end{document}