2

I have difficulty in the use of tikz package. I want to be like the output below. Please heip me! Thank you very much!

enter image description here

cfr
  • 198,882
  • It seems to be much more than minipage. Maybe you should look around for a calss. – Enlico Oct 27 '16 at 14:39
  • 1
    Please do NOT edit your question to include an answer - especially not an answer you've just copied from one of the answers to your original question. Doing so makes the existing answers make no sense and doing so without even bothering to attribute the code to its author is extremely rude when people have spent a good deal of time to help you despite your apparently making no effort to help yourself before or after asking your question. – cfr Nov 01 '16 at 03:11
  • Take a look at: http://tex.stackexchange.com/a/324218/1952 – Ignasi Nov 02 '16 at 16:50

2 Answers2

7

First of all, read tutorial 1 in pgfmanual. After that you will understand how to draw this simple graphic.

Second, take a look at tcolorbox documentation and you'll see how to format this kind of boxes.

After that, try to understand following code and you'll be able to adapt it to your needs:

\documentclass[twocolumn]{article}
\usepackage[most]{tcolorbox}
\usetikzlibrary{arrows.meta}
\usepackage{lipsum}

\newtcolorbox{boxone}{%
    enhanced,
    colback=brown!10,
    boxrule=0pt,
    sharp corners,
    frame hidden,
    fontupper=\bfseries,
    notitle,
    overlay={%
        \draw[Circle-Circle, brown!70!black, line width=2pt](frame.north west)--(frame.south west); 
        \draw[Circle-Circle, brown!70!black, line width=2pt](frame.north east)--(frame.south east);}
    }

\newtcolorbox{boxtwo}{%
    enhanced,
    %frame style={draw=none},
    colback=orange!20,
    boxrule=0pt,
    sharp corners,
    frame hidden,
    notitle,
    overlay={%
        \draw[{Triangle[right]}-{Triangle[left]}, , line width=2pt](frame.north west)--(frame.north east); 
        \draw[{Triangle[left]}-{Triangle[right]}, , line width=2pt](frame.south west)--(frame.south east);}
    }

\newtcolorbox{boxthree}[2][]{%
    enhanced,
    %frame style={draw=none},
    colback=orange!10,
    colbacktitle=orange!10,
    boxrule=0pt,
    fonttitle=\Large\bfseries,
    coltitle=brown!30!black,
    sharp corners,
    frame hidden,
    title=#2,
    overlay={%
        \draw[thick, brown!70!black, double=orange, double distance=2pt] (frame.north west)--(frame.north east); 
        \draw[thick, brown!70!black, double=orange, double distance=2pt] (frame.south west)--(frame.south east);
        \fill[red!50!brown] ([shift={(3mm,.5mm)}]title.south west)--([shift={(-3mm,0mm)}]title.south east)--([shift={(3mm,-.5mm)}]title.south west)--cycle;}
    }

\begin{document}
\begin{boxone}
\lipsum[1]
\end{boxone}

\begin{boxtwo}
\lipsum[3]
\end{boxtwo}

\begin{boxthree}{Nice maths}
\[\sin^2 x + \cos^2 = 1\]
\end{boxthree}

{\par\centering
\begin{tikzpicture}
\draw[help lines, dotted] (0,0) grid (7,4);
\draw[cyan] (1,1) node[below left, black] {$B$}--node[above left]{$c$} (2,3) node[above, black]{$A$}--node[above right]{$b$} (6,1) node[below right, black]{$C$}--node[below]{$c'$}(2,1) node[below,black]{$H$}--node[below]{$b'$}(1,1)--cycle;
\draw[violet] (2,1)--node[right]{$h$}(2,3);
\draw[violet] (2,1.2)-|(2.2,1);
\draw[thin] (1,.9)--++(-90:.8) (6,.9)--++(-90:.8);
\draw[LaTeX-LaTeX] (1,.3)-- node[fill=white]{$a$}(6,.3);
\end{tikzpicture}
\par}

\end{document}

enter image description here

Ignasi
  • 136,588
3

You do not show what have tried. But have a look at the following code. It will give you a possible starting point.

\documentclass[a4paper,12pt,twocolumn]{article}
\usepackage{amsmath,tcolorbox,tikz}
\begin{document}
\foreach \y in {1,...,34} {
\begin{tcolorbox}
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}
This is another \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[title= My nice title]
\foreach \z in {1,...,10} {This is a long \textbf{tcolorbox}.}
\end{tcolorbox}
}
\end{document} 

enter image description here

Denis
  • 5,267