
나는 TikZ의 아주 기본적인 것만 알고 있으며, 내 문서 중 하나에 대한 예쁜 흐름도를 생성하는 데만 TikZ를 사용했습니다. 최근에 Inkscape를 사용하여 TikZ로 내보낼 수 있다는 것을 알게 되었습니다.
Inkscape->TikZ 작업 흐름의 제한 사항은 무엇입니까? 단순히 Inkscape에서 TikZ로 내보내는 것보다 TikZ(학습 곡선이 상당히 가파르다고 들었습니다)를 배우는 데 시간을 투자해야 하는 설득력 있는 이유가 있습니까?
답변1
편집하다:@XiaodongQi가 그 아래 댓글을 달았습니다.
최신 버전의 Inkscape에서는 동일한 옵션을 더 이상 사용할 수 없습니다. 그러나 PDF를 저장할 때도 비슷한 옵션이 있습니다.
잉크스케이프 그림을 PDF로 저장하고 \includegraphics
. 그림에 텍스트가 있는 경우 inkscape pdf로 저장 메뉴에서 PDF+LaTeX 옵션을 선택할 수 있습니다. 대신 pdf_tex 파일이 생성됩니다. 그 \input
파일과 TeX이 조판을 합니다.
잉크스케이프에서:
PDF로 저장을 선택한 후 잉크스케이프에서 저장합니다. Inkscape는 파일을 씁니다 topview.pdf_tex
.
문서에서:
\begin{figure}[h]
\centering{
\resizebox{75mm}{!}{\input{images/topview.pdf_tex}}
\caption{Top view.}
\label{fig:topView}
}
\end{figure}
산출:
이것은 분명히 tikz로 그릴 수 있는 그림이지만 @HarishKumar에 대한 응답에서 귀하가 명시한 이유 때문에 그렇게 하지 않기로 결정했습니다. tikz 학습 곡선이 더 길고 가끔씩 사용하기 위한 wysiwyg에 대한 선호입니다. 정확한 배치(실제로 모서리에서 만나는 선)가 필요한 경우 Inkscape의 스냅 기능을 사용하여 그렇게 할 수 있습니다. 나는 아직 그것을 시도하지 않았습니다.
답변2
내보낸 후(Ethan Bolker 설명) 다음 코드 조각을 사용하여 Inscape에서 생성된 이미지를 삽입합니다.
\begin{figure}
\def\svgwidth{\linewidth}
\input{img/filename.pdf_tex}
\caption{}
\end{figure}
의지 \def\svgwidth{desired width}
대신 사용\resizebox
글꼴 크기 유지. 이는 생성된 파일의 헤드에 설명된 권장 방법입니다.
%% Creator: Inkscape 0.91_64bit, www.inkscape.org
%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
%% Accompanies image file '_masks.pdf' (pdf, eps, ps)
%%
%% To include the image in your LaTeX document, write
%% \input{<filename>.pdf_tex}
%% instead of
%% \includegraphics{<filename>.pdf}
%% To scale the image, write
%% \def\svgwidth{<desired width>}
%% \input{<filename>.pdf_tex}
%% instead of
%% \includegraphics[width=<desired width>]{<filename>.pdf}
%%
%% Images with a different path to the parent latex file can
%% be accessed with the `import' package (which may need to be
%% installed) using
%% \usepackage{import}
%% in the preamble, and then including the image with
%% \import{<path to file>}{<filename>.pdf_tex}
%% Alternatively, one can specify
%% \graphicspath{{<path to file>/}}
%%
%% For more information, please see info/svg-inkscape on CTAN:
%% http://tug.ctan.org/tex-archive/info/svg-inkscape
%%
답변3
또 다른 대안으로 도구가 있습니다.SVG2TikZ(이전에는 Inkscape2TikZ였음), TikZ 코드를 생성하는 데 사용할 수 있습니다.
GitHub 저장소에서 Python 패키지를 설치하는 경우 다음과 같이 TikZ를 사용하여 SVG(Inkscape에서 내보낼 수 있음)를 TeX 소스 코드로 변환할 수 있습니다.
svg2tikz a.svg > a.tex
Inkscape 확장으로 설치할 수도 있습니다.