
自分の名前とプログラムを連絡先の横に配置する方法がわかりません。自分の名前とプログラムは別の行にあります。連絡先はテーブル内に配置されます (1 列、3 行、テキストは左揃え)。
私のコードは次のようになります:
\documentclass[a4paper,12pt]{article}
%======PREAMBLE======================
% Document font - https://ctan.org/tex-archive/fonts/gillius?lang=en
\usepackage{gillius}
% Add clickable links
\usepackage{hyperref}
% Set spacing
\usepackage{setspace}
% Use Font Awesome icons
\usepackage{fontspec}
\usepackage{fontawesome5}
\usepackage{xparse}
%====================================
\onehalfspacing
\begin{document}
% HEADER
% Name & Program
\begin{flushleft}
Anthony Johnson \\*
Electrical Engineering Student at MIT
\end{flushleft}
% Contacts Section
\begin{flushright}
\begin{tabular}{ l }
\href{https://github.com/AnthonyJohnson}{\faGithub \hspace{0.25 em} AnthonyJohnson} \\
\href{mailto:[email protected]}{\faEnvelope \hspace{0.25 em} [email protected]} \\
\faPhone \hspace{0.25 em} (123) - 456 - 7890 \\
\end{tabular}
\end{flushright}
\end{document}
\end{onehalfspacing}
これを実現する方法を教えてください。ありがとうございます :)
答え1
このように2つのミニページを使うことができます
\documentclass[a4paper,12pt]{article}
%======PREAMBLE======================
% Document font - https://ctan.org/tex-archive/fonts/gillius?lang=en
\usepackage{gillius}
% Set spacing
\usepackage{setspace}
% Use Font Awesome icons
\usepackage{fontspec}
\usepackage{fontawesome5}
\usepackage{xparse}
% Add clickable links
\usepackage{hyperref}
\onehalfspacing
\begin{document}
% HEADER
% Name & Program
\noindent % <===========================================================
\begin{minipage}[c]{0.6\textwidth} % <==================================
\begin{flushleft}
Anthony Johnson \\*
Electrical Engineering Student at MIT
\end{flushleft}
\end{minipage} % <======================================================
\hfill
\begin{minipage}[c]{0.35\textwidth}% <==================================
% Contacts Section
\begin{flushright}
\begin{tabular}{ l }
\href{https://github.com/AnthonyJohnson}{\faGithub \hspace{0.25 em} AnthonyJohnson} \\
\href{mailto:[email protected]}{\faEnvelope \hspace{0.25 em} [email protected]} \\
\faPhone \hspace{0.25 em} (123) - 456 - 7890 \\
\end{tabular}
\end{flushright}
\end{minipage}% <=======================================================
\end{document}
望ましい結果を得るには: