如何将文本在中心环境中左对齐?

如何将文本在中心环境中左对齐?

在此处输入图片描述

我想将包含线条的 Font-awesome 图标左对齐,并保持它们位于中心。

\documentclass{article}
\usepackage{fontawesome}
\usepackage[left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm]{geometry}
\begin{document}
\pagenumbering{gobble}
\vspace*{\fill}
\begin{center}
 \LARGE{\textbf{To Learn \LaTeX{}}}
\\
\vspace{2cm}
 \faPhone{} 01515-611989\\
  \faEnvelope{} [email protected]\\
  \faEnvelope{} [email protected]\\
  \faHome{} Room - 1406, Extension-1, SH Hall
\\
\vspace{2cm}
Do you know what is \LaTeX{}?\\
  \LaTeX{} is a highly qualified and powerfull document preparation system \& software.
\end{center}
\vspace*{\fill}
 \end{document}

答案1

您可以使用tabular。它会因为center环境而居中,但其内容将左对齐:

在此处输入图片描述

\documentclass{article}
\usepackage{fontawesome}
\usepackage[left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm]{geometry}
\begin{document}
\pagenumbering{gobble}
\vspace*{\fill}
\begin{center}
{\LARGE\textbf{To Learn \LaTeX{}}}

\vspace{2cm}
\begin{tabular}{l}
  \faPhone{} 01515-611989\\
  \faEnvelope{} [email protected]\\
  \faEnvelope{} [email protected]\\
  \faHome{} Room - 1406, Extension-1, SH Hall
\end{tabular}

\vspace{2cm}
Do you know what is \LaTeX{}?

\LaTeX{} is a highly qualified and powerfull document preparation system \& software.
\end{center}
\vspace*{\fill}
\end{document}

答案2

使用tabular。注意这\LARGE不是带有参数的命令,而是声明。

\documentclass{article}
\usepackage{fontawesome}
\usepackage[left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm]{geometry}
\begin{document}
\pagestyle{empty}

\vspace*{\fill}

\begin{center}
 {\LARGE\textbf{To Learn \LaTeX{}}}
\\[2cm]
\begin{tabular}{@{}cc@{}}
\faPhone    & 01515-611989\\
\faEnvelope & [email protected]\\
\faEnvelope & [email protected]\\
\faHome     & Room - 1406, Extension-1, SH Hall
\end{tabular}
\\[2cm]
Do you know what is \LaTeX{}?

\LaTeX{} is a highly qualified and powerful document 
preparation system \& software.
\end{center}

\vspace*{\fill}

\end{document}

在此处输入图片描述

答案3

根据所需的外观,

堆叠它!...

\documentclass{article}
\usepackage{fontawesome}
\usepackage[left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm]{geometry}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\pagenumbering{gobble}
\vspace*{\fill}
\begin{center}
 \LARGE{\textbf{To Learn \LaTeX{}}}
\\
\vspace{2cm}
\Longstack[l]{
 \faPhone{} 01515-611989\\
  \faEnvelope{} [email protected]\\
  \faEnvelope{} [email protected]\\
  \faHome{} Room - 1406, Extension-1, SH Hall
  }
\\
\vspace{2cm}
Do you know what is \LaTeX{}?\\
  \LaTeX{} is a highly qualified and powerfull document preparation system \& software.
\end{center}
\vspace*{\fill}
 \end{document}

在此处输入图片描述

或者 TABStack 它!

\documentclass{article}
\usepackage{fontawesome}
\usepackage[left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm]{geometry}
\usepackage{tabstackengine}
\setstacktabbedgap{1ex}
\begin{document}
\pagenumbering{gobble}
\vspace*{\fill}
\begin{center}
 \LARGE{\textbf{To Learn \LaTeX{}}}
\\
\vspace{2cm}
\tabbedLongstack{
 \faPhone{}& 01515-611989\\
  \faEnvelope{}&[email protected]\\
  \faEnvelope{}&[email protected]\\
  \faHome{}&Room - 1406, Extension-1, SH Hall
  }
\\
\vspace{2cm}
Do you know what is \LaTeX{}?\\
  \LaTeX{} is a highly qualified and powerfull document preparation system \& software.
\end{center}
\vspace*{\fill}
 \end{document}

在此处输入图片描述

相关内容