اولین بار است که به اینجا می‌آیید؟ راهنمای سایت را بخوانید!
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 texlive fancyhdr تک لایو 2015 عنوان بخش به‌روزرسانی بسته aimc46 صفر توخالی فرمول طولانی بیرون‌زدگی کاما وسط‌چینی tcolorbox پوستر شماره گذاری فاصله سطرها نوشتافت شکست خط tex-programming فونت اعداد pgfplots قرآن tabriz-thesis ایتالیک winedt جستجوی معکوس xelatex فلش جایابی تصویر قالب کتاب پاراگراف‌بندی بازیابی اطلاعات هایپرلینک فهرست نمادها شمارنده فصل font محیط ریاضی رسم کادر جداکننده جدول طولانی فهرست تصاویر شماره‌گذاری فرمول algorithm2e فونت بولد proof equation bidipoem eps جدول افقی عکس به‌روزرسانی پانویس چندستونی کمک مالی فاصله خطوط حروف‌چینی شعر زیرشکل minipage قلم پانویس پاراگرافی ltrfootnote پیوست computeautoilg متن فارسی و انگلیسی فرمول چندخطی neveshtuft غلط‌گیری املایی تک‌پارسی پیکان لاتکس tabular baselineskip شماره قسمت قسمت عنوان جدول
10 نفر آنلاین
0 عضو و 10 مهمان در سایت حاضرند
بازدید امروز: 9911
بازدید دیروز: 44967
بازدید کل: 21058298

تعریف محیط با استفاده از \begin{محیط} و \end{محیط} با انتخاب رنگ و عنوان

+1 رای
711 بازدید

سلام دوستان

میخواستم از این محیط که دارم بتوانم با استفاده از \begin{محیط} و \end{محیط} بکارش ببرم که انتخاب رنگ و عنوانش را هم تغییر دهم

 \documentclass[12pt,fleqn,explicit]{book}


\usepackage[left=1cm,right=1cm,bottom=2cm]{geometry}


\usepackage[x11names,usenames,dvipsnames,svgnames,table]{xcolor}

\usepackage{titlesec,titletoc}
\usepackage{xcolor}
\definecolor{mybluei}{RGB}{0,173,239}
\definecolor{myblueii}{RGB}{63,200,244}
\definecolor{myblueiii}{RGB}{199,234,253}

\usepackage{tikz}

\usetikzlibrary{calc}
\usetikzlibrary{shapes,snakes}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
%----------
\definecolor{azzul}{RGB}{6,96,167}

%----------
\newcounter{counter}

\newcommand{\syBrisse}[6][\textwidth-\pgfkeysvalueof{/pgf/inner xsep}-4mm]{%
\begin{center}
\par\bigskip%
\begin{tikzpicture}
\node[rounded corners, text width=#1, align=justify, inner sep=8pt, outer sep=0] (one)
{\medskip\parbox[t]{\textwidth}{\vspace*{22pt}\par#6}};
\node[text=black,anchor=north east,align=center, minimum height=20pt, inner xsep=5pt] (two) at (one.north east) {#5 \hspace*{.5mm}};
\path[fill=#2,draw=#2]
    ($(one.north west)+(0ex,-4.5pt)$) [rounded corners=3pt] --
    ($(two.north west)+(-22pt,-4.5pt)$) --
    ($(two.south west)+(-4pt,0pt)$) [sharp corners] --
    (two.south east) [rounded corners] --
    (one.north east) --
    (one.north west) [sharp corners] -- cycle;
\node[text=black,anchor=north west,align=center, minimum height=20pt, text height=2ex,inner sep=8pt, inner ysep=3pt] (three) at ($(one.north west)+(0,-3pt)$) {#4};
\node[text=white,anchor=north east,align=center, minimum height=20pt, inner sep=8pt,inner ysep=6.5pt] (for) at ($(one.north east)+(0,1.5pt)$) {\stepcounter{counter}\thecounter.\thechapter#5\hspace*{0.8mm}};
\path[draw=#2,line width=0.8pt]
    (one.south west) [rounded corners] --
    (one.south east) [rounded corners] --
    (one.north east) --
    (one.north west) [rounded corners] -- cycle;
\foreach \x in {10,20,...,100}
\path[opacity=\x*0.01]
    ($(one.north west)+(0.4pt,-6.5pt+\x/100)$) [rounded corners=3pt,draw=gray!\x] --
    ($(two.north west)+(-23.3pt+\x/100,-6.5pt+\x/100)$) [rounded corners=3.5pt,draw=gray!\x] --
    ($(two.south west)+(-5.3pt+\x/100,-1.9pt+\x/100)$) --
    ($(two.south east)+(-0.4pt,-1.9pt+\x/100)$);
\path[draw=white,line width=1.1pt]
    ($(one.north west)+(0.4pt,-5.2pt)$) [rounded corners=3pt] --
    ($(two.north west)+(-22.3pt,-5.2pt)$) [rounded corners=3.5pt] --
    ($(two.south west)+(-4.3pt,-0.6pt)$) --
    ($(two.south east)+(-0.4pt,-0.6pt)$);
\begin{pgfonlayer}{background}
\path[fill=#3!5]
    (one.south west) [rounded corners] --
    (one.south east) [rounded corners] --
    (one.north east) --
    (one.north west) [rounded corners] -- cycle;
\path[opacity=0.5, top color=#3!5,bottom color=#3,middle color=#3!30]
    (one.south west) [rounded corners] --
    (one.south east) [sharp corners] --
    ($(one.south east)+(0ex,0.8cm)$) --
    ($(one.south west)+(0ex,0.8cm)$) [rounded corners] -- cycle;
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
}

\usepackage{xepersian}
\settextfont{Yas}


\begin{document}
\syBrisse[12cm]{CornflowerBlue}{CornflowerBlue}{ }{\textbf{ تعریف‌‌:}}{
    \begin{RTL}
اینجا هم متن ریاضی یا هر چیز دیگه‌ هم باشد
\end{RTL}}


\end{document}

که به صورت

\begin{محیط}{رنگ}{عنوان}
متن اینجا
\end{محیط}

بتوانم ازش استفاده‌ بكنم

ممنون میشم راهنمایی کنید

سوال شده خرداد 12, 1397 توسط مجید حسینی (19 امتیاز)
برچسب گذاری دوباره خرداد 23, 1397 توسط وحید دامن‌افشان

1 پاسخ

+4 رای
 
بهترین پاسخ

سلام
خواسته‌ی شما با محیط mybox با تعریف زیر برآورده می‌شود:

\newenvironment{mybox}[3]{\syBrisse[12cm]{#2}{#2}{}{\textbf{#1:}}{\persian#3}}

پس دستورات شما به صورت زیر است:

\documentclass[12pt,fleqn,explicit]{book}
\usepackage[left=1cm,right=1cm,bottom=2cm]{geometry}
\usepackage[x11names,usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{titlesec,titletoc}
\usepackage{xcolor}
\definecolor{mybluei}{RGB}{0,173,239}
\definecolor{myblueii}{RGB}{63,200,244}
\definecolor{myblueiii}{RGB}{199,234,253}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{shapes,snakes}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
%----------
\definecolor{azzul}{RGB}{6,96,167}

%----------
\newcounter{counter}
\newcommand{\syBrisse}[6][\textwidth-\pgfkeysvalueof{/pgf/inner xsep}-4mm]{%
\begin{center}
\par\bigskip%
\begin{tikzpicture}
\node[rounded corners, text width=#1, align=justify, inner sep=8pt, outer sep=0] (one)
{\medskip\parbox[t]{\textwidth}{\vspace*{22pt}\par#6}};
\node[text=black,anchor=north east,align=center, minimum height=20pt, inner xsep=5pt] (two) at (one.north east) {#5 \hspace*{.5mm}};
\path[fill=#2,draw=#2]
    ($(one.north west)+(0ex,-4.5pt)$) [rounded corners=3pt] --
    ($(two.north west)+(-22pt,-4.5pt)$) --
    ($(two.south west)+(-4pt,0pt)$) [sharp corners] --
    (two.south east) [rounded corners] --
    (one.north east) --
    (one.north west) [sharp corners] -- cycle;
\node[text=black,anchor=north west,align=center, minimum height=20pt, text height=2ex,inner sep=8pt, inner ysep=3pt] (three) at ($(one.north west)+(0,-3pt)$) {#4};
\node[text=white,anchor=north east,align=center, minimum height=20pt, inner sep=8pt,inner ysep=6.5pt] (for) at ($(one.north east)+(0,1.5pt)$) {\stepcounter{counter}\thecounter.\thechapter#5\hspace*{0.8mm}};
\path[draw=#2,line width=0.8pt]
    (one.south west) [rounded corners] --
    (one.south east) [rounded corners] --
    (one.north east) --
    (one.north west) [rounded corners] -- cycle;
\foreach \x in {10,20,...,100}
\path[opacity=\x*0.01]
    ($(one.north west)+(0.4pt,-6.5pt+\x/100)$) [rounded corners=3pt,draw=gray!\x] --
    ($(two.north west)+(-23.3pt+\x/100,-6.5pt+\x/100)$) [rounded corners=3.5pt,draw=gray!\x] --
    ($(two.south west)+(-5.3pt+\x/100,-1.9pt+\x/100)$) --
    ($(two.south east)+(-0.4pt,-1.9pt+\x/100)$);
\path[draw=white,line width=1.1pt]
    ($(one.north west)+(0.4pt,-5.2pt)$) [rounded corners=3pt] --
    ($(two.north west)+(-22.3pt,-5.2pt)$) [rounded corners=3.5pt] --
    ($(two.south west)+(-4.3pt,-0.6pt)$) --
    ($(two.south east)+(-0.4pt,-0.6pt)$);
\begin{pgfonlayer}{background}
\path[fill=#3!5]
    (one.south west) [rounded corners] --
    (one.south east) [rounded corners] --
    (one.north east) --
    (one.north west) [rounded corners] -- cycle;
\path[opacity=0.5, top color=#3!5,bottom color=#3,middle color=#3!30]
    (one.south west) [rounded corners] --
    (one.south east) [sharp corners] --
    ($(one.south east)+(0ex,0.8cm)$) --
    ($(one.south west)+(0ex,0.8cm)$) [rounded corners] -- cycle;
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
}

\usepackage[logo=on,
inlinemathdigits=persian,%
displaymathdigits=persian%
]{xepersian}
\settextfont[Scale=1.2]{Yas}
\settextdigitfont[Scale=.9]{Yas}
\setmathdigitfont[Scale=.9]{PGaramond}

\newenvironment{mybox}[3]{\syBrisse[12cm]{#2}{#2}{}{\textbf{#1:}}{\persian#3}}

\begin{document}
\null\vfill
\syBrisse[12cm]{CornflowerBlue}{CornflowerBlue}{ }{\textbf{تعریف‌‌:}}{
\begin{RTL}
اینجا هم متن ریاضی یا هر چیز دیگه‌ هم باشد
\end{RTL}}

\begin{mybox}{تعریف}{red}{
\begin{RTL}
اینجا هم متن ریاضی یا هر چیز دیگه‌ هم باشد
\end{RTL}   
}
\end{mybox}
\begin{mybox}{لم}{cyan}{
\[a^5=b^5+c^5\] 
}
\end{mybox}

\begin{mybox}{قضیه}{magenta}{
\begin{equation}
a^6=b^6+c^6
\end{equation}
}
\end{mybox}
\end{document}

و خروجی شما با نسخه‌های اولیه‌ی تک‌لایو 2018 به صورت زیر است:


enter image description here


موفق باشید.

پاسخ داده شده خرداد 13, 1397 توسط شاپور مددپور (8,647 امتیاز)
ویرایش شده خرداد 21, 1397 توسط شاپور مددپور
...