对齐文本和 tikzpicture 问题(Minipage)

对齐文本和 tikzpicture 问题(Minipage)

我不知道为什么我不知道如何对齐东西。我试图将我的测试提升到左侧,这样问题的开头和第 1 部分之间就不会有这样的空白。我试过调整框、对齐,但都无济于事。任何帮助都将不胜感激。

\documentclass[11pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
     % remove 'demo' option in real document
\usepackage[utf8]{inputenc}
\usepackage{parskip,adjustbox,setspace}
%\usepackage{fullpage}
\usepackage[top=2cm,bottom=4.5cm,hmargin=2.5cm]{geometry}
\usepackage{amsmath,amsthm,amssymb,amscd}
\usepackage{multicol,enumerate,fancyhdr}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{fillbetween}
    
%% new:
\usepackage{tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight}X}

%TIKZLIBRARY PACKAGES
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{plotmarks}
\usetikzlibrary{shapes.misc, positioning}
\usetikzlibrary{arrows,shapes,positioning,snakes}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta,bending}
\tikzset{font=\footnotesize} 

%PGF GLOBAL COMMANDS
\pgfplotsset{every x tick label/.append style= {font=\small, yshift=0.5ex}}
\pgfplotsset{every y tick label/.append style= {font=\small, xshift=0.5ex}}
\pgfplotsset{every major tick/.append style=  {thick,major tick length=10pt, black}}
\pgfplotsset{grid style={line width=.75pt, draw=gray!50}}
\newcommand*{\dprime}{''\mkern-1.2mu}
\newcommand*{\trprime}{'''\mkern-1.2mu}

% HEADER AND FOOTER
\newcommand\course{AP Calculus AB}
\pagestyle{fancy}
\headheight 35pt
\lhead{}
\chead{\boldmath\textbf{Topic 8.9. Volume with disc method\\revolving around the \(x\)- or \(y\)-axis}}
\rhead{\course \\ \today}
\lfoot{Mr.\ Bennett}
\cfoot{Flint Hill Upper School}
\rfoot{\small\thepage}
\headsep 1.5em


\begin{document}

    \begin{minipage}[t]{.7\textwidth}
        \begin{enumerate}
            \item Find the coordinates of the point at which the two graphs intersect each other.  Then, find the area \(R\). 
        \end{enumerate}
    \end{minipage} 
    \begin{minipage}[c]{.2\textwidth}
        \begin{tikzpicture}[scale=.6]
             \begin{axis}[thick, no markers,
                           scale only axis,
                           axis lines=middle,
                           inner axis line style={-Triangle},
                           ymin=-5,
                           ymax=5,
                           xmin=-1,
                               xmax=5,
                    ]
                    \addplot[name path=f,thick,red,samples=1000,domain=-.25:4]{x-2};
                    \addplot[name path=g,thick,blue,samples=1000,domain=.05:4]{ln(x)};
                    \addplot[blue!25,opacity=0.4] fill between[of=f and g, soft clip={domain=.1585:3.14619}];
                \end{axis}
    \end{tikzpicture}
    \end{minipage} 
\end{document}

在此处输入图片描述

答案1

您可以将baseline的设置为。tikzpicture(current bounding box.north)

在此处输入图片描述

\begin{document}

    \begin{minipage}[t]{.7\textwidth}
        \begin{enumerate}
            \item Find the coordinates of the point at which the two graphs intersect each other.  Then, find the area \(R\). 
        \end{enumerate}
    \end{minipage} 
    \begin{minipage}[t]{.2\textwidth}
        \begin{tikzpicture}[scale=.6, baseline=(current bounding box.north)]
             \begin{axis}[thick, no markers,
                           scale only axis,
                           axis lines=middle,
                           inner axis line style={-Triangle},
                           ymin=-5,
                           ymax=5,
                           xmin=-1,
                           xmax=5,
                    ]
                    \addplot[name path=f,thick,red,samples=1000,domain=-.25:4]{x-2};
                    \addplot[name path=g,thick,blue,samples=1000,domain=.05:4]{ln(x)};
                    \addplot[blue!25,opacity=0.4] fill between[of=f and g, soft clip={domain=.1585:3.14619}];
                \end{axis}
    \end{tikzpicture}
    \end{minipage} 
\end{document}

相关内容