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

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

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

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

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

سلام دوستان

میخواستم از این محیط که دارم بتوانم با استفاده از \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,627 امتیاز)
ویرایش شده خرداد 21, 1397 توسط شاپور مددپور
...