1

I searched but not found "water cup" symbol in LaTeX. How can I draw this symbol like attached image? Thanks

enter image description here

\documentclass[a4paper,11pt]{article}
\usepackage[a4paper,left=2cm,right=2cm,top=1cm,bottom=1cm]{geometry}
\usepackage{amsmath,amssymb,scalerel}
\usepackage{lmodern}
\usepackage[most]{tcolorbox}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[utf8]{vietnam}
%\usepackage[utf8]{english}
\usepackage[english]{babel}
\usepackage{MnSymbol,wasysym}
\usepackage{tikzsymbols} 
\usepackage[format=plain,
            labelfont={bf,it},
            textfont=it]{caption} 
%\usepackage{adjustbox}
\usepackage{bbding}
\usepackage{pifont}
\input{insbox}
\usepackage{enumitem}
\makeatletter
\tcbset{
        myvbox/.style 2 args={%
        enhanced, 
        colback=white,
        colframe=blue!30!black,
        left=8mm,
        overlay={
            \node[rotate=90, anchor=north west, inner sep=2mm, text=white] (title@aux) at (frame.south west) {#2};
            \path[fill=tcbcol@frame] ([email protected] west)--([email protected] east) 
                to[out=90, in=270] ([yshift=5mm][email protected])--
                ([email protected]|-frame.north)
                [rounded corners=\kvtcb@arc] -| 
                (frame.west) |- ([email protected])[sharp corners] -- cycle;   
            \node[rotate=90, inner sep=2mm, text=white] at (title@aux) {#2};
        },
        #1
    },  
      }


\makeatother



\newtcolorbox{myvbox}[2][]{%
    myvbox={#1}{#2}
}


\begin{document}



\begin{tcbposter}[
  poster = {columns=1, rows=1, width=0.5\textwidth, height=0.5\textheight,spacing=0.1mm}]


\posterbox[height=3cm,width =10cm, myvbox={colframe=blue!80!black}{Water cup}]{column=1, row=1,  xshift=0cm, yshift=1cm}{
 \vspace*{0.5cm} 
 \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm}  $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm}  $\bigcup$ \hspace*{0.2cm}
 \\
 \hspace*{0.2cm} 
 $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm}  $\bigcup$ \hspace*{0.2cm}  $\bigcup$ \hspace*{0.2cm}  $\bigcup$ \hspace*{0.2cm}
 }

\end{tcbposter}
\end{document}
4
  • Sorry, but your code does not compile: Command \Square already defined. \newcommand{\Square}{\@chooseSymbol{'146}} Commented Sep 21, 2018 at 14:11
  • i use www.overleaf.com and this code can compile
    – latexforti
    Commented Sep 21, 2018 at 14:16
  • No it does not compile, overleafe is just good at hiding error messages. If you'll have a look at the log files, you'll see this: i.sstatic.net/IarM0.png Commented Sep 21, 2018 at 14:22
  • Thank so much @Samcarter. you are right and it work well
    – latexforti
    Commented Sep 21, 2018 at 14:35

1 Answer 1

8

You could use tikz to draw the symbol yourself.

To give you something to start with:

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw (0,1.2) -- (0.2,0) -- (0.6,0) -- (0.8,1.2);

\draw[blue] (0.05,1) -- (0.1,1.1) -- (0.2,1) -- (0.3,1.1) -- (0.4,1)-- (0.5,1.1) -- (0.6,1) -- (0.7,1.1) -- (0.75,1);

\end{tikzpicture}

\end{document}

enter image description here

Or a more creative approach could be to use the ducksay package:

\documentclass{article}

\usepackage{ducksay}

\AddAnimal{cup}
{



\            /
 \~~~~~~~~~~/      
  \        /
   \      /
    \____/
}

\begin{document}


\ducksay[animal=cup]{}


\end{document}

enter image description here

If the water glass can have a different shape:

\documentclass{standalone}

\usepackage{tikzducks}

\begin{document}

\begin{tikzpicture}
\duck[invisible,wine=blue]
\end{tikzpicture}

\end{document}

enter image description here


You can define a new command with any of the images above for easy repetitive use:

\documentclass{article}

\usepackage[most]{tcolorbox}

\makeatletter
\tcbset{
        myvbox/.style 2 args={%
        enhanced, 
        colback=white,
        colframe=blue!30!black,
        left=8mm,
        overlay={
            \node[rotate=90, anchor=north west, inner sep=2mm, text=white] (title@aux) at (frame.south west) {#2};
            \path[fill=tcbcol@frame] ([email protected] west)--([email protected] east) 
                to[out=90, in=270] ([yshift=5mm][email protected])--
                ([email protected]|-frame.north)
                [rounded corners=\kvtcb@arc] -| 
                (frame.west) |- ([email protected])[sharp corners] -- cycle;   
            \node[rotate=90, inner sep=2mm, text=white] at (title@aux) {#2};
        },
        #1
    },  
}
\makeatother

\newcommand{\mycup}{%
    \begin{tikzpicture}
        \draw (0,1.2) -- (0.2,0) -- (0.6,0) -- (0.8,1.2);
        \draw[blue] (0.05,1) -- (0.1,1.1) -- (0.2,1) -- (0.3,1.1) -- (0.4,1)-- (0.5,1.1) -- (0.6,1) -- (0.7,1.1) -- (0.75,1);
    \end{tikzpicture}%
    \hspace{1em}%
}

\begin{document}

\begin{tcbposter}[poster = {columns=1, rows=1, width=0.5\textwidth, height=0.5\textheight,spacing=0.1mm}]
    \posterbox[height=3cm,width =10cm, myvbox={colframe=blue!80!black}{Water cup}]{column=1, row=1,  xshift=0cm, yshift=1cm}{%
        \mycup\mycup\mycup\mycup\mycup\\
        \mycup\mycup\mycup\mycup\mycup
    }
\end{tcbposter}

\end{document}

enter image description here

6
  • thank for your answer. "\begin{tikzpicture} \draw (0,1.2) -- (0.2,0) -- (0.6,0) -- (0.8,1.2); \draw[blue] (0.05,1) -- (0.1,1.1) -- (0.2,1) -- (0.3,1.1) -- (0.4,1)-- (0.5,1.1) -- (0.6,1) -- (0.7,1.1) -- (0.75,1); \end{tikzpicture}" How can i use this code for repeat symbol. Example: 8 water cup symbol in 2 rows. Thanks
    – latexforti
    Commented Sep 21, 2018 at 11:18
  • and i can call this symbol where i need. Thanks
    – latexforti
    Commented Sep 21, 2018 at 11:25
  • 1
    @BVOT Sure you can repeat the symbol and use it at the place you want to. But as you are not showing any attempt or context in your question I cannot show you an example. Commented Sep 21, 2018 at 11:30
  • @Scamcarter: sorry. my old cup display in posterbox: \posterbox[height=3cm,width =4.8cm, myvbox={colframe=blue!80!black}{Drink up}]{column=1, row=3, xshift=12.2cm, yshift=-3.8cm}{ \vspace*{0.5cm} \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} \\ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} $\bigcup$ \hspace*{0.2cm} } thanks
    – latexforti
    Commented Sep 21, 2018 at 11:34
  • 1
    @BVOT As you can see comments are not a good place to share code as they will destroy all formatting. Also I don't want to guess which packages might be necessary to compile your code. Please make a minimal working example (MWE) and include it in your question Commented Sep 21, 2018 at 13:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .