문장 중간에 수직 공간을 만드는 것이 가능한가요?

문장 중간에 수직 공간을 만드는 것이 가능한가요?

제목 중앙에 링크를 배치하고 싶습니다(Pomodoro, Duelr). 이 문제를 해결하는 가장 좋은 방법은 무엇입니까? 내 코드는 다음과 같습니다

\begin{tabularx}{\linewidth}{X r}
    \rule{0pt}{17pt}
    \hspace{-0.2em}\large\textbf{\textsc{Pomodoro} \vspace{0.5em} \href{https://www.GitHub.com/AllanMukundi/Pomodoro}{\fontsize{7}{8.4}\selectfont - https://www.GitHub.com/AllanMukundi/Pomodoro}} & \textit{May 2017}
\end{tabularx}
\vspace{-1.60em}
\begin{itemize}[noitemsep]
    \item A productivity-oriented web application which incentivizes the Pomodoro Technique via a reward system
    \item Features a dynamic leaderboard, responsive design, and user authentication with support for social accounts
    \item Deployed onto Heroku and built using Django/Python, HTML5, CSS, Bootstrap, JavaScript, jQuery, and AJAX
\end{itemize}
\begin{tabularx}{\linewidth}{X r}
    \rule{0pt}{17pt}
    \hspace{-0.2em}\large\textbf{\textsc{Duelr} \href{https://www.GitHub.com/AllanMukundi/Duelr}{\fontsize{7}{8.4}\selectfont - https://www.GitHub.com/AllanMukundi/Duelr}} & \textit{Jun. 2017}
\end{tabularx}
\vspace{-1.60em}
\begin{itemize}[noitemsep]
    \item Duelr is an online multiplayer 1v1 fighting game which uses web sockets to deliver real-time interactions
    \item Features fluid character animations, intuitive controls, and fully functional collision mechanisms
    \item Hosted on Microsoft Azure and built with JavaScript, Node.js, Express.js, Socket.io, HTML5, CSS, and Phaser
\end{itemize}

견본

답변1

내가 올바르게 이해했다면 아래와 같이 URL을 올리기를 원할 것입니다.

여기에 이미지 설명을 입력하세요

\documentclass{article}

\usepackage{tabularx,enumitem}
\usepackage[colorlinks]{hyperref}

\newcommand\midl[1]{\raisebox{1pt}{#1}}
\begin{document}

\sffamily

\begin{tabularx}{\linewidth}{X r}
    \rule{0pt}{17pt}
    \hspace{-0.2em}\large\textbf{%
\textsc{Pomodoro}
\midl{\href{https://www.GitHub.com/AllanMukundi/Pomodoro}{\fontsize{7}{8.4}\selectfont - https://www.GitHub.com/AllanMukundi/Pomodoro}}} & \textit{May 2017}
\end{tabularx}
\vspace{-1.60em}
\begin{itemize}[noitemsep]
    \item A productivity-oriented web application which incentivizes the Pomodoro Technique via a reward system
    \item Features a dynamic leaderboard, responsive design, and user authentication with support for social accounts
    \item Deployed onto Heroku and built using Django/Python, HTML5, CSS, Bootstrap, JavaScript, jQuery, and AJAX
\end{itemize}
\begin{tabularx}{\linewidth}{X r}
    \rule{0pt}{17pt}
    \hspace{-0.2em}\large\textbf{%
\textsc{Duelr}
\midl{\href{https://www.GitHub.com/AllanMukundi/Duelr}{\fontsize{7}{8.4}\selectfont - https://www.GitHub.com/AllanMukundi/Duelr}}} & \textit{Jun. 2017}
\end{tabularx}
\vspace{-1.60em}
\begin{itemize}[noitemsep]
    \item Duelr is an online multiplayer 1v1 fighting game which uses web sockets to deliver real-time interactions
    \item Features fluid character animations, intuitive controls, and fully functional collision mechanisms
    \item Hosted on Microsoft Azure and built with JavaScript, Node.js, Express.js, Socket.io, HTML5, CSS, and Phaser
\end{itemize}

\end{document}

답변2

\raisebox올려야 할 높이를 사용하고 계산할 수 있습니다 .

\documentclass[]{article}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{enumitem}

\newdimen\mytitlehtONE
\newdimen\mytitlehtTWO

\newcommand{\mytitle}[2]{%
    \setbox0\hbox{\large\textbf{\textsc{#1}}}%
    \mytitlehtONE=\ht0%
    \setbox0\hbox{\textbf{\href{#2}{\fontsize{7}{8.4}\selectfont - #2}}}%
    \mytitlehtTWO=\ht0%
    \advance\mytitlehtONE by -\mytitlehtTWO\relax%
    \hspace{-0.2em}\fbox{\large\textbf{\textsc{#1}}}
    \raisebox{0.5\mytitlehtTWO}{\unhbox0}}

\begin{document}
\begin{tabularx}{\linewidth}{X r}
    \rule{0pt}{17pt}
    \mytitle{Pomodoro}{https://www.GitHub.com/AllanMukundi/Pomodoro} & \textit{May 2017}
\end{tabularx}
\end{document}

결과는 다음과 같습니다. 여기에 이미지 설명을 입력하세요

그것은 \fbox단지 그것이 실제로 선의 중간임을 보여주는 것입니다. 그것이 없으면 명령은 다음과 같습니다.

\newcommand{\mytitle}[2]{%
    \setbox0\hbox{\large\textbf{\textsc{#1}}}%
    \mytitlehtONE=\ht0%
    \setbox0\hbox{\textbf{\href{#2}{\fontsize{7}{8.4}\selectfont - #2}}}%
    \mytitlehtTWO=\ht0%
    \advance\mytitlehtONE by -\mytitlehtTWO\relax%
    \hspace{-0.2em}\large\textbf{\textsc{#1}}
    \raisebox{0.5\mytitlehtTWO}{\unhbox0}}

답변3

또 다른 가능성은 수학 축을 따라 중심을 맞추는 것입니다. 이는 임시 상자를 측정할 필요 없이 자동으로 다양한 크기로 확장된다는 장점이 있습니다. 약간의 낮은 수준의 TeX 코딩이 필요하다는 단점이 있습니다.

다음 코드의 출력

소스 코드는 다음과 같습니다. 여러 지점에서도 정리했습니다.

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{enumitem}
\usepackage[colorlinks]{hyperref}

\makeatletter

\newenvironment*{myList}[3]{%
    {\noindent \parfillskip\z@skip
        \rule{0pt}{17pt}% <-- !!! (But why this rule?)
        % \hspace{-0.2em} % no longer necessary, I guess! ;-)
        {\large
            {%
                \bfseries
                % \scshape % not supported
                #1\/%
            }%
            ~$\m@th \vcenter{\hbox{\scriptsize - \url{#2}}}$%
        }%
        \nobreak\hfill \textit{#3}\@@par
    }%
    % \vspace{-1.60em} % specify "nosep" instead of "noitemsep"
    \begin{itemize}[nosep]%
}{%
    \end{itemize}%
}

\makeatother



\begin{document}

\sffamily

\begin{myList}
        {Pomodoro}
        {https://www.GitHub.com/AllanMukundi/Pomodoro}
        {May 2017}

    \item
        A productivity-oriented web application which incentivizes the Pomodoro
        Technique via a reward system.

    \item
        Features a dynamic leaderboard, responsive design, and user
        authentication with support for social accounts.

    \item
        Deployed onto Heroku and built using Django/Python, HTML5, CSS\@,
        Bootstrap, JavaScript, jQuery, and AJAX\@. %"\@" for precaution
\end{myList}

\begin{myList}
        {Duelr}
        {https://www.GitHub.com/AllanMukundi/Duelr}
        {Jun. 2017}

    \item
        Duelr is an online multiplayer 1v1 fighting game which uses web sockets
        to deliver real-time interactions.

    \item
        Features fluid character animations, intuitive controls, and fully
        functional collision mechanisms.

    \item
        Hosted on Microsoft Azure and built with JavaScript, Node.js,
        Express.js, Socket.io, HTML5, CSS\@, and Phaser.
\end{myList}

\end{document}

관련 정보