اولین بار است که به اینجا می‌آیید؟ راهنمای سایت را بخوانید!
Close Sidebar
وب‌سایت پرسش و پاسخ پارسی‌لاتک جایی برای پرسش و پاسخ درباره سیستم حروف‌چینی لاتک و بسته زی‌پرشین است. در اینجا می‌توانید سوال‌های خود را بپرسید و به سوال‌های دیگران پاسخ دهید.

محبوب‌ترین برچسب‌ها

رفع خطا جدول مراجع xepersian ریاضی‌نویسی شکل فونت فهرست مطالب شماره‌گذاری منابع bidi پانویس بیب‌تک tikz تک‌لایو parsilatex بیمر اسلاید زی‌پرشین پاورقی سربرگ bibtex نماد فرمول‌نویسی رسم شکل قالب ارجاع‌دهی biditexmaker هدر ویرایشگر beamer واژه‌نامه اندازه فونت texstudio عنوان فصل ماتریس اعمال نشدن تغییرات در پی‌دی‌اف رسم جدول bidipresentation شماره صفحه حاشیه رنگ عنوان شکل اسلاید فارسی محیط قضیه گراف مکان شکل tikzpicture حروف‌چینی کد شماره فصل enumerate tabriz_thesis نمایه align زیرنویس شکل کادر itemize listings الگوریتم عدم اجرا نیم‌فاصله متن لاتین و فارسی فهرست اشکال بسته فاصله بین خطوط قالب پایان‌نامه فرمول نصب تک‌لایو فارسی‌تک hyperref شماره فرمول glossaries کپشن نمودار حروف‌چینی چندستونی فونت فارسی و انگلیسی ماکرونویسی خروجی biditools شماره پاورقی پیوست‌ فاصله‌گذاری فرمول چندضابطه‌ای لاتک سوال امتحانی subfigure extrafootnotefeatures header texmaker pdf tex biditufte-book تصویر شمارنده texlive2015 longtable زیرنویس خطا رسم نمودار شماره‌گذاری صفحات پایان نامه دیاگرام فهرست جداول میک‌تک texlive2016 تنظیم جدول kashida texworks caption اندیس lollipop iust-thesis multicol فصل‌نویسی شعر سوال چهارگزینه‌ای بولد تورفتگی آکولاد اعداد فارسی فاصله عمودی xindy چپ‌چینی اوبونتو میکروسافت ورد قاب geometry fancyhdr تک لایو 2015 عنوان بخش به‌روزرسانی بسته aimc46 صفر توخالی فرمول طولانی بیرون‌زدگی texlive کاما وسط‌چینی پوستر شماره گذاری فاصله سطرها نوشتافت شکست خط tex-programming فونت اعداد pgfplots قرآن tabriz-thesis ایتالیک winedt جستجوی معکوس xelatex فلش جایابی تصویر tcolorbox قالب کتاب پاراگراف‌بندی بازیابی اطلاعات هایپرلینک فهرست نمادها شمارنده فصل محیط ریاضی رسم کادر جداکننده جدول طولانی فهرست تصاویر شماره‌گذاری فرمول algorithm2e font فونت بولد proof equation bidipoem eps جدول افقی عکس به‌روزرسانی پانویس چندستونی کمک مالی فاصله خطوط حروف‌چینی شعر زیرشکل minipage قلم پانویس پاراگرافی ltrfootnote پیوست computeautoilg متن فارسی و انگلیسی فرمول چندخطی neveshtuft غلط‌گیری املایی تک‌پارسی پیکان لاتکس tabular baselineskip شماره قسمت قسمت عنوان جدول
6 نفر آنلاین
0 عضو و 6 مهمان در سایت حاضرند
بازدید امروز: 9840
بازدید دیروز: 10871
بازدید کل: 20627185

ارجاع دهی به قضیه در فرمولهای ریاضی

0 رای
723 بازدید

سلام
وقتی در فرمول به قضیه (قضیه 1.1) ارجاع میدم عنوان "قضیه 1.1" در فرمول، clickable نمیشه. برای clickable شدن چه راه حلی رو پیشنهاد میکنید.

سپاسگزارم.

سوال شده مرداد 8, 1396 توسط محسن آوجی (18 امتیاز)
این باگ بسته bidi هست. سعی می‌کنم توی این هفته درست کنم و نسخه تازه‌ای به CTAN بدهم. پاسخ من رو بصورت کامل برای همه توضیحات بخونید.
سلام، پاسختون فوق العاده بود، سپاسگزارم.

2 پاسخ

+1 رای

چرا \autoref داخل دستور \text در محیط ریاضی کار نمی‌کند؟

بسته amstext دستور شرطی \iffirstchoice@ را تعریف می‌کند که به صورت پیش‌فرض مقدارش درست است هرچند اگر تعریف دستور \text@ (که در تعریف دستور \textبه کار رفته است) را در این بسته نگاه کنید

\def\text@#1{{\mathchoice
  {\textdef@\displaystyle\f@size{#1}}%
  {\textdef@\textstyle\f@size{\firstchoice@false #1}}%
  {\textdef@\textstyle\sf@size{\firstchoice@false #1}}%
  {\textdef@\textstyle \ssf@size{\firstchoice@false #1}}%
  \check@mathfonts
  }%
}

می‌بینید که در همه حالات غیر از حالت \displaystyle مقدار دستور شرطی نادرست است. از طرفی دیگر همین بسته دستور \addtocounter را تنها زمانی تعریف (بازتعریف) می‌کند که مقدار دستور شرطی درست باشد

\def\addtocounter#1#2{%
  \iffirstchoice@
  \@ifundefined {c@#1}{\@nocounterr {#1}}%
    {\global \advance \csname c@#1\endcsname #2\relax}%
  \fi}

بنابراین در نمونه شما دستور \addtocounter هیچ کاری انجام نمی‌دهد حال آنکه بسته hyperref از این دستور برای ارجاعات استفاده می‌کند.

راه‌حل کوتاه

در این نمونه از دستور \text استفاده شده است.

\documentclass{book}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage[colorlinks=true]{hyperref}
\usepackage{xepersian}
\settextfont[Scale=1]{Yas}
\setlatintextfont[Scale=.95]{Times New Roman}
\setdigitfont[Scale=1]{Yas}
\defpersianfont\chapfont[Scale=3.3]{Yas}
\def\theoremautorefname{قضیۀ}


\newtheoremstyle{Plain}% vahid
{\topsep}% measure of space to leave above the theorem. E.g.: 3pt
{\topsep}% measure of space to leave below the theorem. E.g.: 3pt
{\itshape}% name of font to use in the body of the theorem
{\parindent}% measure of space to indent
{\bf}%name of head font
{.}% punctuation between head and body
{0.5em}% space after theorem head; " " = normal interword space
{}%Manually specify head
\theoremstyle{Plain}
%\theoremstyle{definition}
\newtheorem{definition}{تعریف}[chapter]
\newtheorem{theorem}{قضیه}[chapter]
\newtheorem{Lemma}[theorem]{لم}
\begin{document}
\chapter{فضاهای متریک}
\begin{theorem}\label{theorem}
\end{theorem}

\begin{equation}
A\in G_{n}\stackrel{\text{\SetBoolean{firstchoice@}{true}
\autoref{theorem}}}{\Longleftrightarrow}B\in G_{n}
\end{equation}
\end{document}

راه‌حل بلند

در این نمونه دستوری به نام \mytext تعریف شده که مشابه دستور \text کار می‌کنه اما مشکل اون رو نداره و فقط برای محیط ریاضی طراحی شده.

\documentclass{book}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage[colorlinks=true]{hyperref}
\usepackage{xepersian}
\settextfont[Scale=1]{Yas}
\setlatintextfont[Scale=.95]{Times New Roman}
\setdigitfont[Scale=1]{Yas}
\defpersianfont\chapfont[Scale=3.3]{Yas}
\makeatletter
\def\theoremautorefname{قضیۀ}
\newcommand*{\mytext}[1]{%
{\mathchoice{{\hbox{%
\everymath{\displaystyle}%
\let\f@size\f@size\selectfont%
#1}}}{{\hbox{%
\everymath{\textstyle}%
\let\f@size\f@size\selectfont%
#1}}}{{\hbox{%
\everymath{\textstyle}%
\let\f@size\sf@size\selectfont%
#1}}}{{\hbox{%
\everymath{\textstyle}%
\let\f@size\ssf@size\selectfont%
#1}}}%
 \check@mathfonts
 }%
}
\makeatother

\newtheoremstyle{Plain}% vahid
{\topsep}% measure of space to leave above the theorem. E.g.: 3pt
{\topsep}% measure of space to leave below the theorem. E.g.: 3pt
{\itshape}% name of font to use in the body of the theorem
{\parindent}% measure of space to indent
{\bf}%name of head font
{.}% punctuation between head and body
{0.5em}% space after theorem head; " " = normal interword space
{}%Manually specify head
\theoremstyle{Plain}
%\theoremstyle{definition}
\newtheorem{definition}{تعریف}[chapter]
\newtheorem{theorem}{قضیه}[chapter]
\newtheorem{Lemma}[theorem]{لم}
\begin{document}
\chapter{فضاهای متریک}
\begin{theorem}\label{theorem}
\end{theorem}

\begin{equation}
A\in G_{n}\stackrel{\mytext{\autoref{theorem}}}{\Longleftrightarrow}B\in G_{n}
\end{equation}
\end{document}

ویرایش

در نسخه پیشین بسته hyperref در فایل hxetex.def که تعریفات درایور زی‌تک برای لینک‌هاست دستور \Hy@EndAnnot بصورت

\def\Hy@EndAnnot{%
  \ifnum\value{Hy@AnnotLevel}=\@ne
    \Hy@endcolorlink
    \@pdfm@mark{eann}%
  \fi
  \addtocounter{Hy@AnnotLevel}\m@ne
}

تعریف شده بود در صورتی که در حال حاضر تعریف این دستور به صورت

\def\Hy@EndAnnot{%
  \ifnum\value{Hy@AnnotLevel}=\@ne
    \Hy@endcolorlink
    \@pdfm@mark{eann}%
  \fi
  \global\advance\c@Hy@AnnotLevel\m@ne
}

تغییر کرده. همونوطوری که از مقایسه تعریف دو دستور مشاهده می‌کنید

\global\advance\c@Hy@AnnotLevel\m@ne

جایگزین

\addtocounter{Hy@AnnotLevel}\m@ne

شده. هر دوی اینها معادل هم هستند اما با توجه به توضیحی که در بالا دادم این تغییر در بسته hyperref پیش اومده تا مشکلی که بهش اشاره کردم پیش نیاد. شما وقتی از بسته bidi استفاده می‌کنید تعریف قدیمی وجود داره و به همین خاطر به مشکل برمی‌خورید. بنابراین برای حل مشکل از پایه بهتره تعریف این دستور در بسته bidi بروز بشود.

پاسخ داده شده مرداد 8, 1396 توسط وفا (24,380 امتیاز)
ویرایش شده مرداد 8, 1396 توسط وفا
+1 رای

این مشکل در نسخه 30.9 بسته bidi که بهزودی به CTAN داده خواهد شد، حل شده است. بنابراین با نسخه 30.9 بسته bidi نمونه زیر مشکلی نخواهد داشت.

\documentclass{book}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage[colorlinks=true]{hyperref}
\usepackage{xepersian}
\settextfont[Scale=1]{Yas}
\setlatintextfont[Scale=.95]{Times New Roman}
\setdigitfont[Scale=1]{Yas}
\defpersianfont\chapfont[Scale=3.3]{Yas}
\def\theoremautorefname{قضیۀ}


\newtheoremstyle{Plain}% vahid
{\topsep}% measure of space to leave above the theorem. E.g.: 3pt
{\topsep}% measure of space to leave below the theorem. E.g.: 3pt
{\itshape}% name of font to use in the body of the theorem
{\parindent}% measure of space to indent
{\bf}%name of head font
{.}% punctuation between head and body
{0.5em}% space after theorem head; " " = normal interword space
{}%Manually specify head
\theoremstyle{Plain}
%\theoremstyle{definition}
\newtheorem{definition}{تعریف}[chapter]
\newtheorem{theorem}{قضیه}[chapter]
\newtheorem{Lemma}[theorem]{لم}
\begin{document}
\chapter{فضاهای متریک}
\begin{theorem}\label{theorem}
\end{theorem}

\begin{equation}
A\in G_{n}\stackrel{\text{\autoref{theorem}}}{\Longleftrightarrow}B\in G_{n}
\end{equation}
\end{document}
پاسخ داده شده مرداد 18, 1396 توسط وفا (24,380 امتیاز)
...