Σελίδα 1 από 1

Πλαίσια

Δημοσιεύτηκε: Δευ Νοέμ 20, 2017 5:30 pm
από stathis1978
Καλησπέρα.

Πρόσφατα αποφάσισα να γράψω ορισμένες από τις μαθηματικές μου σημειώσεις ηλεκτρονικά (σε latex) και σκέφτηκα ότι θα ήταν ωραίο αν μπορούσα να βάλω τα θεωρήματα μέσα σε διάφορα χρωματιστά πλαίσια. Βρήκα ότι ένας τρόπος είναι με την εντολή \tcolorbox, η οποία όμως δεν με ικανοποίησε ιδιαίτερα. Υπάρχει κάποιος άλλος τρόπος;

Ευχαριστώ,
Στάθης.

Re: Πλαίσια

Δημοσιεύτηκε: Δευ Νοέμ 20, 2017 8:01 pm
από Tolaso
Καλώς ήρθατε στο forum! Το πακέτο tcolorbox είναι ένα αξιοπρεπέστατο πακέτο για να φτιάξει κανείς πλαίσια. Το χρησιμοποιώ κατά κόρον στις σημειώσεις μου. Για παράδειγμα:

Κώδικας: Επιλογή όλων

\begin{tcolorbox}[colback=gray!5!white, colframe=gray!60!black, title=\textbf{Theorem}]

If a function $f:\mathbb{C} \rightarrow \mathbb{C}$ is entire and non-constant, then the set of values 
that $f(z)$ assumes is either the whole complex plane or the plane minus a single point.

\end{tcolorbox}
με το κατάλληλο προοΐμιο . To αποτέλεσμα είναι το παρακάτω:
1f3f540b-094c-45b9-8dbd-16937dc78dbe.png
1f3f540b-094c-45b9-8dbd-16937dc78dbe.png (10.06 KiB) Προβλήθηκε 5781 φορές
Τι ακριβώς δε σας αρέσει ;

Υ.Σ: Το εγχειρίδιό του είναι εδώ.

Re: Πλαίσια

Δημοσιεύτηκε: Κυρ Νοέμ 26, 2017 7:58 pm
από Jmetax
Θεωρώ πως το πακέτο tcolorbox είναι μονόδρομος. Και άλλο ένα παράδειγμα με αυτό το πακέτο: ( το οποίο δεν είναι δικό μου )

Κώδικας: Επιλογή όλων

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}

\newtcbtheorem[number within=section]{mytheo}{My Theorem}%
{colback=green!5,colframe=green!35!black,fonttitle=\bfseries}{th}

\begin{document}
\begin{mytheo}{This is my title}{theoexample}
  This is the text of the theorem. The counter is automatically assigned and,
  in this example, prefixed with the section number. This theorem is numbered with
  \ref{th:theoexample} and is given on page \pageref{th:theoexample}.
\end{mytheo}

\end{document}
δίδει
uf8bQ.png
uf8bQ.png (10.19 KiB) Προβλήθηκε 5749 φορές
Κάποτε πριν βγει αυτό το πακέτο ( αλήθεια πότε βρήκε ; ) χρησιμοποιούσαμε το πακέτο mdframed μαζί με το pstricks αν θέλαμε χρώματα στο πλαίσιο. Ένας κώδικας

Κώδικας: Επιλογή όλων

\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}

\newmdtheoremenv{theorem}{Theorem}

\begin{document}

\begin{theorem}
\lipsum*[1]
\end{theorem}

\end{document}
Ας πούμε με Pstricks είναι το παρακάτω και ο κώδικας που το δίδει
gYRzZ.png
gYRzZ.png (41.99 KiB) Προβλήθηκε 5749 φορές

Κώδικας: Επιλογή όλων

\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-grad}
\usepackage{framed}
\usepackage[framed]{ntheorem} 
\usepackage{lipsum}

% framed theorem, red background
\theoremstyle{plain}
\theoremsymbol{}
\theoremseparator{}
\def\theoremframecommand{%
      \psshadowbox[fillstyle=solid,fillcolor=red,linecolor=black]}
\newshadedtheorem{mytheorem}{Special Theorem}

% framed theorem, gradient shading
\theoremstyle{plain}
\theoremsymbol{}
\theoremseparator{}
\def\theoremframecommand{%
      \psshadowbox[fillstyle=gradient,gradbegin=red,gradend=yellow,linecolor=black]}
\newshadedtheorem{myfancytheorem}{Sunset special theorem}

\begin{document}

\begin{mytheorem}
\lipsum[1] 
\end{mytheorem}

\begin{myfancytheorem}
 \lipsum[1]
\end{myfancytheorem}

\end{document}
( ούτε αυτό το χω φτιάξει εγώ ... το χω πάρει έτοιμο )

Σημείωση: Για να τρέξει το pstricks χρειάζεται να τρέξει κάποιος το έγγραφο με xetex αλλιώς φορτώνει στο προοίμιο το

Κώδικας: Επιλογή όλων

\usepackage[pdf]{pstricks}