
xepersian 환경에서 "\subfigimg" 매크로를 사용하면 각 이미지에 대한 레이블이 누락됩니다.
\documentclass[preview]{standalone}
\usepackage{mwe}
\usepackage[table]{xcolor}
\usepackage{xepersian}
\settextfont{XB Zar}
\newcommand{\subfigimg}[3][,]{%
\setbox1=\hbox{\includegraphics[#1]{#3}}% Store image in box
\leavevmode\rlap{\usebox1}% Print image
\rlap{\raisebox{\dimexpr\ht1-1\baselineskip}{\textbf{\color{red}#2}}}% Print label
\phantom{\usebox1}% Insert appropriate spcing
}
\begin{document}
\begin{figure}[htp]
\centering
\begin{tabular}{@{}p{0.33\linewidth}@{\hspace{1mm}}p{0.33\linewidth}@{\hspace{1mm}}p{0.33\linewidth}@{}}
\subfigimg[width=\linewidth]{الف}{example-image-a} &
\subfigimg[width=\linewidth]{ب}{example-image-b} &
\subfigimg[width=\linewidth]{پ}{example-image-c} \\
\end{tabular}
\end{figure}
\end{document}
답변1
그들은 아래에 있습니다.
대칭으로 인해 오른쪽 및 왼쪽 겹침, 이미지 및 텍스트의 원하는 결과를 이끌어내는 6개의 조합(올바른 순서로 수행됨)이 있어야 합니다.
이 버전은 레이블을 먼저 배치한 다음 양쪽에 동일한 여백을 두고 레이블을 이미지에 겹치고 레이블은 이미지의 왼쪽에 있습니다.
MWE
\documentclass{article}%[preview]{standalone}
\usepackage{mwe}
\usepackage[table]{xcolor}
\usepackage{xepersian}
\settextfont{XB Niloofar}%Zar}
\newcommand{\subfigimg}[3][,]{%
\setbox1=\hbox{\includegraphics[#1]{#3}}% Store image in box
\leavevmode%{\usebox1}% Print image
{\phantom{\usebox1}}% Insert appropriate spcing
\llap{\raisebox{\dimexpr\ht1-1\baselineskip}{\textbf{\color{red}#2}}}% Print label
\llap{\usebox1}
% \phantom{\usebox1}% Insert appropriate spcing
}
\begin{document}
\large
\begin{figure}[htp]
\centering
\begin{tabular}{@{}p{0.33\linewidth}@{\hspace{1mm}}p{0.33\linewidth}@{\hspace{1mm}}p{0.33\linewidth}@{}}
\subfigimg[width=\linewidth]{الف}{example-image-a} &
\subfigimg[width=\linewidth]{ب}{example-image-b} &
\subfigimg[width=\linewidth]{پ}{example-image-c} \\
\end{tabular}
\end{figure}
\end{document}
추가하도록 수정했습니다
핵심은 와 함께 가 의 xepersian
위에 놓이는 것을 {A}\llap{B}
의미합니다 . 일반적인 텍스트 흐름 방향을 수행합니다.A
B
\rlap
문을 사용하여 이미지의 왼쪽 위(TL), 오른쪽 위(TR), 왼쪽 아래(BL) 또는 오른쪽 아래(BR) 모서리에 텍스트 옵션이 있는 비슷한 것이 필요합니다 if
. 또한, 이미지에 텍스트를 추가하여 bidicontour
텍스트를 더 쉽게 읽을 수 있도록 했습니다.
오른쪽 상단 위치는 다음과 같습니다.
확대:
MWE
\documentclass{article}
\usepackage{graphicx}
\usepackage[outline]{bidicontour}%before xepersian
\usepackage[table]{xcolor}
\usepackage{xepersian}
\settextfont{XB Niloofar}
\newcommand\imagea{}
\newcommand\texta{}
\newif\ifcaptionBR
\newif\ifcaptionTR
\newif\ifcaptionBL
\newif\ifcaptionTL
\newcommand\capinit{%
\captionBRfalse
\captionTRfalse
\captionBLfalse
\captionTLfalse
}
\newcommand\capimage[2]{%1=image,2=text,(3=location: global)
\ifcaptionBR%
{#2}\kern-\wd2{#1}
\fi%
\ifcaptionTR%
{\raisebox{\dimexpr\ht1-\baselineskip}{#2}}\kern-\wd2{#1}
\fi%
\ifcaptionBL%
{\phantom{#1}}\llap{#2}\llap{#1}
\fi%
\ifcaptionTL%
{\phantom{#1}}\llap{\raisebox{\dimexpr\ht1-\baselineskip}{#2}}\llap{#1}
\fi%
}
\newcommand\subimg[4]{% 1=width,2=image,3=text, 4=text location command
\renewcommand\imagea{\includegraphics[width=#1]{#2}}
\renewcommand\texta{{\textcolor{red}{\textbf{\bidicontour{yellow}{#3}}}}}
\setbox1=\hbox{\imagea}
\setbox2=\hbox{\texta}
\capinit
#4
\capimage{\imagea}{\texta}
}
\bidicontourlength{0.8pt}
\begin{document}
%
%\subimg{0.30\linewidth}{example-image-a}{الف}{\captionTLtrue}
%
%
%\subimg{0.30\linewidth}{example-image-a}{الف}{\captionBLtrue}
%
%
%\subimg{0.30\linewidth}{example-image-a}{الف}{\captionTRtrue}
%
%
%
%
%\subimg{0.30\linewidth}{example-image-a}{الف}{\captionBRtrue}
\begin{figure}[htp]
\centering
\begin{tabular}{@{}p{0.33\linewidth}@{\hspace{1mm}}p{0.33\linewidth}@{\hspace{1mm}}p{0.33\linewidth}@{}}
\subimg{0.98\linewidth}{example-image-a}{الف}{\captionTRtrue} &
\subimg{0.98\linewidth}{example-image-b}{ب}{\captionTRtrue} &
\subimg{0.98\linewidth}{example-image-c}{پ}{\captionTRtrue} \\
\end{tabular}
\end{figure}
\end{document}
이는 대칭 그룹과 (2축) 반사의 '손잡이'에 대한 연습입니다. 매우 흥미로운.