\emailfrom 안에 두 줄의 텍스트를 정렬합니다.

\emailfrom 안에 두 줄의 텍스트를 정렬합니다.

저는 TeX을 처음 접했고 LaTeX를 사용하여 간단한 소개서를 작성하려고 합니다. 자기 소개서용 템플릿을 다운로드했는데 여기에는 이름이 붙은 구성 요소(이것을 어떻게 부르는지 모르겠습니다)가 있습니다 \emailfrom. 내 코드는 다음과 같습니다

\emailfrom{ % Email address
[email protected] \\
[email protected] \\
[email protected]
}

현재 제가 얻고 있는 내용은 다음과 같습니다.

정렬 문제

지금까지 나의 유일한 우아하지 않은 해결책은 다음과 같습니다.

\emailfrom{ % Email address
[email protected] \\
[email protected] \\
[email protected]
}

두 번째와 세 번째 이메일을 첫 번째 이메일에 정렬하고 싶습니다. 어떻게 이를 달성할 수 있나요?

모호해서 미안하지만 TeX에 대해서는 전혀 모릅니다.

답변1

MWE가 없을 경우 테스트되지 않았습니다. 다음과 같이 시도해 보십시오.

\emailfrom{% Email address
\begin{tabular}[t]{l}
[email protected] \\
[email protected] \\
[email protected]
\end{tabular}
}

mailto: put서문에서 하이퍼링크와 \usepackage{hyperref}`를 얻고 다음을 사용합니다.

\href{mailto:your name}{first.email}

답변2

불행하게도 TeX 기본 요소(여기에 사용됨)가 LaTeX 가이드에 설명되어 있지 않기 때문에 받아들일 수 없는 또 다른 "재미있는" 답변이 있습니다.

% in preamble:
\def\emails#1{\vtop\bgroup\emailsA #1,,}
\def\emailsA#1,{\ifx,#1,\egroup\else\hbox{\ignorespaces#1}\expandafter\emailsA\fi}

% in document:
Emails: \emails{[email protected], [email protected], [email protected]}

답변3

어쩌면 다음과 같은 것일 수도 있습니다.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{etoolbox,hyperref}

\newcounter{email}
\newcommand{\emailfrom}[1]{%
  \begingroup
  \parindent 0pt%
  \parbox{2cm}{Email:}%
  \setcounter{email}{0}%
  \renewcommand*{\do}[1]{%
    \stepcounter{email}%
    \ifnum\value{email}<2\relax%
    \emailformat{##1}\par
    \else
    \hspace{2cm}\emailformat{##1}\par
  \fi}%
  \docsvlist{#1}
  \endgroup}
\newcommand{\emailformat}[1]{\href{mailto:#1}{#1}}

\begin{document}

\emailfrom{% Email address
[email protected], [email protected], [email protected]}

\end{document}

목록의 첫 번째 항목이 다음 항목과 다르게 작동하도록 할 수 있도록 '이메일'이라는 카운터를 설정합니다. 이 명령은 \emailformat이메일 주소의 스타일을 보다 쉽게 ​​지정할 수 있도록 사용됩니다. \parindent및 에 대한 매개변수를 \parindent취향에 맞게 변경해야 합니다. (원하는 경우 \emailfrom명령을 실행할 때 변경할 수 있도록 정의에 통합할 수 있습니다 .)

관련 정보