Tikz 사진 인라인

Tikz 사진 인라인

tikzpicture 코드를 인라인으로 배치할 수 있는 방법이 있나요? 내가 실제로 달성하고 싶은 것은 다음과 같습니다.

볼록 함수는 "볼록성을 위한 tikz 코드"

누군가 나에게 이것이 가능하다고 말했습니다. 또한 tikz-pgf 튜토리얼에서 나는 많은 tikz 코드를 인라인으로 보았습니다. 예를 들어 크기 조정 섹션에서 작성자는 회전하는 타원을 인라인(텍스트 옆)에 배치합니다.

이것이 어떻게 달성될 수 있습니까?

답변1

tikzpicture환경이나 인라인 매크로로 사용하세요 \tikz.

그러나 라인 스트레칭의 문제는 매우 명백합니다!

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadings}

\begin{document}
A stupid text followed by \begin{tikzpicture}\draw[fill=red,line width=1pt]  circle(1ex);\end{tikzpicture}

A stupid text followed by \tikz{\draw[fill=red,line width=1pt]  circle(1ex);}

A stupid text followed by another stupid text followed

A stupid text followed by some dots \tikz{%
    \foreach \x /\cola in {1/blue,2/yellow,3/red,4/green,5/orange}  {%
      \shade[ball color=\cola] (\x,0)  circle(0.5ex*\x);
    }%
}
\end{document}

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

답변2

제가 가지고 있는 실제 문서의 또 다른 예는 다음과 같습니다.

\documentclass{article}

\usepackage{tikz}

\newcommand{\ground}{%
    \begin{tikzpicture}[scale=0.5, baseline=-3mm, thick]
    \draw (0,0) -- +(0mm,-4.0mm) {
        [yshift=-4mm]
        +(-2mm,0mm) -- +(2mm,0mm)
                +(-1mm,-1mm) -- +(1mm,-1mm)
                +(-0.3mm,-2mm) -- +(0.3mm,-2mm)
        };
    \end{tikzpicture}%
}

\begin{document}

We have a text here, and then I refer to the ground (\ground) connection point in the instrument. Clearly, the \ground{} symbol will change the spacing... 
you can play with the \texttt{scale} and \texttt{baseline=-3mm} parameters in the definition\dots 
\end{document}

위 스니펫의 출력

답변3

다음은 인라인을 배치하고 tikz 코드가 텍스트에서 충분히 높지 않은 방법에 대한 제안입니다.

\raisebox{-2pt}{\tikz{\draw[line width=1pt, >->] (0, 0) arc (-180:0:8pt);}}

나에게 주어진 결과는 다음과 같았습니다. 꽤 좋은 것 같습니다.

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

관련 정보