0

Can anyone help with the drawing of this pic in latex?

I have included what I have done:

enter image description here

\documentclass[12pt]{article}
\setlength{\topmargin}{-1cm}
\setlength{\oddsidemargin}{0in} 
\setlength{\textheight}{9in}
\setlength{\textwidth}{6.51in}

%\pagestyle{empty}
\usepackage{tikz}
\usepackage{amsthm}
\usepackage{mathtools}
\usetikzlibrary{arrows,positioning}
\usepackage{amssymb,amsfonts}
\usepackage{fullpage}

\usepackage[ruled,vlined,linesnumbered]{algorithm2e}


 %\linespread{1.5}
\newcommand\answerbox{%%
    \fbox{\rule{1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
\pagestyle{plain}

\begin{document}


\begin{center}

\pagestyle{empty}
    %
 \tikzstyle{int}=[draw, fill=white!20, minimum size=4em]

  \tikzstyle{init} = [pin edge={to-,thin,black}]

  \begin{tikzpicture}[node distance=2.5cm,auto,>=latex']

    \node [int,align=center] (a) {$ f \in \mathbb{Z}_p[x_1,x_2, \cdots,x_n]$\\Black Box $ \mathbf{B}$}; 
   
    \draw[<-] ([yshift=5pt]a.west)  -- node[above]{$\alpha$} ++(-4em,0em);  ++(4em,0em);   
    \draw[->] ([yshift=5pt]a.east) -- node[above]{$f(\alpha)\mod p$} ++(8em,0em); 
    \end{tikzpicture} 
 
\end{document}
1
  • Welcome to TeX.SX! Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site, which is why you received a downvote. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – Teepeemm May 24 at 0:33
1

Your code is totally unclean! This is for you reference.

enter image description here

\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{amsthm,amssymb,mathtools}
\begin{document}
\begin{center}
\begin{tikzpicture}
\node[draw,inner xsep=5mm,inner ysep=20mm] (a) {$f(x_1,x_2, \cdots,x_n) \in \mathbb{Z}_p[x_1,x_2, \cdots,x_n]$}; 
\draw[->] (a.east)--+(3,0)  node[midway,above]{$f(\alpha)\mod p$}; 
\draw[<-] (a.north)--+(0,2) node[midway,right]{$p$}; 
\def\d{.75}
\draw[<-] (a.west)++(0,2*\d)--+(-2,0) node[midway,above]{$\alpha_1$};   
\draw[<-] (a.west)++(0,\d)--+(-2,0) node[midway,above]{$\alpha_2$};   
\draw[<-] (a.west)--+(-2,0) node[midway,above]{$\alpha_3$};   
\draw (a.west)+(-1,-\d+.2) node{$\vdots$};   
\draw[<-] (a.west)++(0,-2*\d)--+(-2,0) node[midway,above]{$\alpha_n$};   
\end{tikzpicture} 
\end{center}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.