
図の上に描画しているのですが、次の図が視覚的に中央に配置されていないことに驚いています。
\documentclass{article}
\usepackage{mwe}
\usepackage{tikz}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}
\draw (0, 0)
node (image) { \includegraphics[width=1cm]{example-image} };
\draw[red, x={(image.south east)}, y={(image.north west)}] (0.5, 0.5)
node (text) { \SI{100}{\micro\meter} };
\end{tikzpicture}
\end{document}
赤いテキストが画像の右端まで伸びているのに、左端には伸びていないことに注目してください。
\SI{100}{\micro\meter}
を置き換えると---------
、TikZ コードが正しいことが示されているようです。
私はあまりにうるさく言い過ぎでしょうか、それとも内容との整合性が取れていないのでしょうかsiunitx
?
答え1
これは、 と 10 ポイントのフォント サイズの間の視覚的な効果のようです1
。 100 を 500 に置き換えると、すべてが正常に見えます (目には)。 フォントのサイズを拡大または縮小しても同じです。 がsiunitx
数字と単位の間のスペースを変更しているかどうかはわかりません。 タイプセット\SI{500}{}
または\SI{500}{}
中央が完全に中央揃えで表示されます。を使用0
せずに省略した場合の結果も比較してください。SI
{100 \textmu m}
\documentclass{article}
\usepackage{mwe}
\usepackage{tikz}
\usepackage{siunitx}
\begin{document}
default size font
\begin{tikzpicture}
\draw (0, 0)
node (image) { \includegraphics[width=1cm]{example-image} };
\draw[red, x={(image.south east)}, y={(image.north west)}] (0.5, 0.5)
node (text) {\SI{100}{\micro\meter}};
\end{tikzpicture}
\begin{tikzpicture}
\draw (0, 0)
node (image) { \includegraphics[width=1cm]{example-image} };
\draw[red, x={(image.south east)}, y={(image.north west)}] (0.5, 0.5)
node (text) {\SI{500}{\micro\meter}};
\end{tikzpicture}
without SI
\begin{tikzpicture}
\draw (0, 0)
node (image) { \includegraphics[width=1cm]{example-image} };
\draw[red, x={(image.south east)}, y={(image.north west)}] (0.5, 0.5)
node (text) {100 \textmu m };
\end{tikzpicture}
\begin{tikzpicture}
\draw (0, 0)
node (image) { \includegraphics[width=1cm]{example-image} };
\draw[red, x={(image.south east)}, y={(image.north west)}] (0.5, 0.5)
node (text) {500 \textmu m};
\end{tikzpicture}
{\large%
larger font
\begin{tikzpicture}
\draw (0, 0)
node (image) { \includegraphics[width=1cm]{example-image} };
\draw[red, x={(image.south east)}, y={(image.north west)}] (0.5, 0.5)
node (text) { \SI{100}{\micro\meter} };
\end{tikzpicture}
}
{\small%
smaller font
\begin{tikzpicture}
\draw (0, 0)
node (image) { \includegraphics[width=1cm]{example-image} };
\draw[red, x={(image.south east)}, y={(image.north west)}] (0.5, 0.5)
node (text) { \SI{100}{\micro\meter} };
\end{tikzpicture}
}
\end{document}
アップデート
実際、サイドベアリングの点では、この数字は1
他の数字(および文字 )とは大きく異なります。これは、Philipp Gesang が提供したプログラムを使用した出力です。l
数字の境界ボックスは互いに類似しています。これは、Yiannis Lazaridesの回答の出力です。
つまり、数字は1
実際には画像の左側まで伸びているのです。10pt で画像の左端がインクのすぐ上にあるのは単なる偶然です。