
텍스트에 동그라미 숫자를 넣고 Ti를 사용하고 싶습니다.케이Z 솔루션 게시됨여기. 그러나 원과 텍스트를 조금 더 작게 만들고 싶어서 다음과 같이 시도했습니다.
\documentclass{article}
\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
Numbers aligned with the text: \scriptsize{\circled{1}} end.
\end{document}
불행하게도 \scriptsize
이 명령 뒤의 모든 텍스트가 작기 때문에 (텍스트에서 "끝"도 스크립트 크기에 있음) 곱슬 괄호가 올바르게 닫혀 있기 때문에 "누출"되는 것 같습니다.
"leak" 명령 없이 어떻게 이 작업을 수행할 수 있나요 \scriptsize
?
답변1
해결책은 글꼴 크기를 올바르게 변경하는 것입니다. \scriptsize
인수를 사용하지 않고 나중에 모든 텍스트의 글꼴 크기를 변경합니다. 중괄호로 묶인 경우(예: 인수 내부 \circled{·}
) 글꼴 크기 변경은 로컬에만 적용됩니다.
변경된 코드:
\documentclass{article}
\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
Numbers aligned with the text: \circled{\scriptsize1} \circled{1} end.
\end{document}
출력은 다음과 같습니다.
원 크기를 변경하려면 inner sep
AndréC의 설명에 언급된 옵션 값을 변경하면 됩니다.
답변2
node
다양한 옵션을 사용하여 TikZ 내부에 LaTeX의 많은 항목(텍스트, 수식, 표, 이미지 등)을 삽입할 수 있습니다 . 가장 좋은 옵션 중 하나는 scale
LaTeX 옵션보다 훨씬 유연하다는 것입니다: , \tiny
, \scriptsize
, \footnotesize
, \small
, \normalsize
, \large
, \Large
, \LARGE
( 아마도 Stefan Kottwitz가\huge
\Huge
그의 대답).
요약하자면, 이 상황을 scale
가정 해 보겠습니다.node
\documentclass{article}
\usepackage{tikz}
\newcommand*\circled[2]{\tikz[baseline=(char.base)]{
\node[circle,draw,scale=#2,inner sep=2pt] (char) {#1};}}
\begin{document}
Numbers aligned with the text: \circled{1}{1} \circled{\color{blue} 1}{1.5} end.
\end{document}