질문 옆에 줄거리 넣기

질문 옆에 줄거리 넣기

이 그래프를 객관식 질문 옆에 놓는 데 도움이 되었으면 좋겠습니다.

\tasks질문과 그래프가 서로 옆에 있도록 명령을 사용하고 있지만 이제는 위의 나머지 항목과 일치하지 않습니다.

여기에 이미지 설명을 입력하세요

내가 한 일은 다음과 같습니다.

\question Find the equation of the following graph 

\begin{tasks}(2)


\task[]

\begin{oneparchoices}
    \choice $y = (x-1)(x-5)$ \\
    \choice $y = \frac{4(x-1)(x-5)}{5}$ \\
    \choice $y = x^2 -6x -5$\\
    \choice $\frac{4(x-6)}{5}$
\end{oneparchoices}

\task[] 

\pgfplotsset{
    standard/.style={
    axis line style = thick,
    trig format=rad,
    enlargelimits,
    axis x line=middle,
    axis y line=middle,
    enlarge x limits=0.15,
    enlarge y limits=0.15,
    every axis x label/.style={at={(current axis.right of origin)},anchor=north west},
    every axis y label/.style={at={(current axis.above origin)},anchor=south east}
    }
}

\begin{tikzpicture}
\begin{axis}[standard,
            xtick={1, 5},
            ytick={4},
            samples=1000,
            xlabel={$x$},
            ylabel={$y$},
            xmin=-1,xmax=7,
            ymin=-3,ymax=6]

\node[anchor=center,label=south west:$O$] at (axis cs:0,0){};

\addplot[name path=F,domain={-1:7}]{((4/5)*(x-1)*(x-5)};

\end{axis}
\end{tikzpicture}
\end{tasks}

답변1

내 생각에는 (하지만 제공한 코드가 매우 단편적이므로 확실하지 않습니다) 목표로 하는 것은 다음과 같을 수 있습니다.

\documentclass{exam}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18} 

\pgfplotsset{
    standard/.style={
        axis line style=thick,
        trig format=rad,
        enlargelimits,
        axis x line=middle,
        axis y line=middle,
        enlarge x limits=0.15,
        enlarge y limits=0.15,
        every axis x label/.style={
            at={(current axis.right of origin)},
            anchor=north west
        },
        every axis y label/.style={
            at={(current axis.above origin)},
            anchor=south east
        }
    }
}
 
\begin{document}
\begin{questions}

\question Find the equation of the following graph 

\begin{oneparchoices}
    \choice $y = (x-1)(x-5)$ \\
    \choice $y = \frac{4(x-1)(x-5)}{5}$ \\
    \choice $y = x^2 -6x -5$ \\
    \choice $\frac{4(x-6)}{5}$
\end{oneparchoices}

\question Find the equation of the following graph 
\hfill\makebox(0.5\linewidth,0pt)[rt]{%
    \begin{tikzpicture}
    \begin{axis}[
        standard,
        xtick={1, 5},
        ytick={4},
        samples=1000,
        xlabel={$x$},
        ylabel={$y$},
        xmin=-1, xmax=7,
        ymin=-3, ymax=6
    ]
    
    \node[anchor=center, label=south west:$O$] at (axis cs:0,0) {};
    
    \addplot[domain={-1:7}]{((4/5)*(x-1)*(x-5)};
    \end{axis}
    \end{tikzpicture}%
}

\begin{oneparchoices}
    \choice $y = (x-1)(x-5)$ \\
    \choice $y = \frac{4(x-1)(x-5)}{5}$ \\
    \choice $y = x^2 -6x -5$ \\
    \choice $\frac{4(x-6)}{5}$
\end{oneparchoices}

\end{questions}
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보