%EA%B0%80%20%EC%A4%84%EA%B3%BC%20%EA%B2%B9%EC%B9%98%EB%8F%84%EB%A1%9D%20%EC%84%9C%EC%8B%9D%EC%9D%B4%20%EC%A7%80%EC%A0%95%EB%90%9C%20%ED%85%8D%EC%8A%A4%ED%8A%B8%EC%97%90%20%EA%B3%A0%EB%A5%B4%EA%B2%8C%20%EB%B0%91%EC%A4%84%EC%9D%84%20%EA%B8%8B%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
서식이 지정된 텍스트에 밑줄을 긋으려고 합니다.
내가하려는 일은 다음과 같습니다.
\usepackage{xcolor}
\usepackage{tikz}
\newcommand{\udensdot}[1]{%
\tikz[baseline=(todotted.base)]{
\node[inner sep=1pt,outer sep=0pt] (todotted) {#1};
\draw[densely dotted] (todotted.south west) -- (todotted.south east);
}%
}%
\newcommand{\ans}[1]{\udensdot{
\textcolor{blue}{\fontfamily{pzc}\selectfont{~#1~}}
}
}
\begin{document}
I go to \ans{the} cinema in \ans{the} evening \ans{eventually}.
\end{document}
마지막 줄이 다른 줄 아래에 있는 다음과 같은 결과를 얻습니다.
모든 줄을 같은 수준에 두고 디센더(예: 여기서 "y")가 밑줄과 겹치도록 하고 싶지만 이를 달성하는 방법을 알 수 없습니다.
어떤 제안이 있으십니까?
답변1
이 그림과 같이 텍스트 문구의 파란색을 검은색 점으로 덮고 싶으십니까?:
그렇지 않은 경우 텍스트 줄의 기준선에 점이 있고 텍스트 구문의 파란색이 점의 검은색을 덮도록 하려면 로 노드를 만들고 \phantom
선을 그린 다음 노드를 만들 수 있습니다. : 대신 텍스트 사용 \phantom
:
\documentclass[border=6pt]{standalone}
\usepackage{xcolor}
\usepackage{tikz}
\newcommand{\udensdot}[1]{%
\tikz[baseline=(todotted.base)]{
\node[inner sep=1pt,outer sep=0pt] (todotted) {\phantom{\mbox{#1}}};
\draw[densely dotted] (todotted.base west) -- (todotted.base east);
\node at (todotted) [inner sep=1pt,outer sep=0pt] {\mbox{#1}};
}%
}
\newcommand{\ans}[1]{\udensdot{%
\textcolor{blue}{\fontfamily{pzc}\selectfont{~#1~}}%
}%
}
\begin{document}
I go to \ans{the} cinema in \ans{the} evening \ans{eventually}.
\end{document}
답변2
TikZ에서 자신만의 밑줄을 만드는 대신 다음과 같은 패키지를 사용할 수 있습니다 lua-ul
.
% !TeX TS-program = lualatex
\documentclass{article}
\usepackage{lua-ul}
\usepackage{xcolor}
\usepackage{fontspec}
\newfontfamily{\zapf}{Zapf Chancery}
\makeatletter
\newunderlinetype\beginUnderDot{\cleaders\hb@xt@ .44em{\hss\raisebox{-0.5ex}{.}\hss}}
\makeatother
\NewDocumentCommand\underDot{+m}{{\beginUnderDot#1}}
\newcommand{\ans}[1]{%
{\zapf\underDot{~\textcolor{blue}{#1}~}}%
}
\begin{document}
I go to \ans{the} cinema in \ans{the} evening \ans{eventually}.
\end{document}
또는 ulem
:
\documentclass{article}
\usepackage[normalem]{ulem}
\usepackage{xcolor}
\newcommand{\ans}[1]{%
{\fontfamily{pzc}\selectfont\dotuline{~\textcolor{blue}{#1}~}}%
}
\begin{document}
I go to \ans{the} cinema in \ans{the} evening \ans{eventually}.
\end{document}
답변3
해결책은 명령에서 base west
및 를 사용하는 것입니다 .base east
\udensdot
\documentclass[border=6pt]{standalone}
\usepackage{xcolor}
\usepackage{tikz}
\newcommand{\udensdot}[1]{%
\tikz[baseline=(todotted.base)]{
\node[inner sep=1pt,outer sep=0pt] (todotted) {#1};
\draw[densely dotted] (todotted.base west) -- (todotted.base east);
}%
}
\newcommand{\ans}[1]{\udensdot{%
\textcolor{blue}{\fontfamily{pzc}\selectfont{~#1~}}%
}%
}
\begin{document}
I go to \ans{the} cinema in \ans{the} evening \ans{eventually}.
\end{document}