TeXstudio の画像に関する指示

TeXstudio の画像に関する指示

最近、TeXstudio で次のようなディレクティブを発見しました%!TEX root = ../main.tex。このコンセプトは素晴らしいです。

写真をアップロードするフォルダーを指定するディレクティブを見つけようとしました。つまり、次のようなディレクティブがあるのでしょうか%!TEX picture folder = ../../picture?

答え1

パッケージgraphicx(いずれにせよロードする必要があります) に\graphicspathは、 のようなフォルダーのリストを指定できるコマンドが用意されています\graphicspath{{../../picture}{folder2}}。LaTeX はこれらのフォルダー内の画像を検索します。

\documentclass{article}
\usepackage{graphicx}

\graphicspath{{./img/}{./pictures/}}

\begin{document}
    \includegraphics{one}   %picture named one in directory img
    \includegraphics{two}   %picture named two in directory img
    \includegraphics{three} %picture named three in directory pictures
\end{document}

このコマンドの利点は、どのエディタでも(Texstudioだけでなく)機能することです。cfrのおかげです。続きは(コマンドプロンプトから)graphicspathで読むことができます。grfguidetextdoc grfguide

したがって、texstudio のようなコマンドの必要性は%!TEX picture folder=...生じず、私の知る限りではそのようなコマンドは存在しません。

関連情報