수직으로 가운데 맞춤 테이블 셀 텍스트

수직으로 가운데 맞춤 테이블 셀 텍스트

이 셀 알긴의 내용을 어떻게 수직 중앙에 맞추나요? 노트

아래 코드를 기반으로 한 현재 출력은 다음과 같습니다. 감사해요

\documentclass[]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{pgfplots}
\renewcommand{\thesection}{\arabic{section}}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{pgfplots}
\usepackage{amsmath}
\newtheorem{theorem}{THEOREM}
\newtheorem{proof}{PROOF}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes,fit,calc}
\usepackage{amssymb}
\usetikzlibrary{patterns}
\usepackage{fancyhdr}
\usepackage{bigints}
\usepackage{color}
\usepackage{tcolorbox}
\usepackage{color,xcolor }
\usepackage{booktabs,array}
\usepackage{hyperref}
\usepackage{graphicx}
\usetikzlibrary{arrows}
\usepackage{polynom}
\DeclareMathOperator{\rank}{rank}
\makeatletter
\newenvironment{sqcases}{%
    \matrix@check\sqcases\env@sqcases
}{%
\endarray\right.%
}
\def\env@sqcases{%
    \let\@ifnextchar\new@ifnextchar
    \left\lbrack
    \def\arraystretch{1.2}%
    \array{@{}l@{\quad}l@{}}%
}
\begin{document}
The graph of the quadratic function $y=ax^2$
\begin{center}
\setlength\arraycolsep{6pt} % default is "5pt"
$\begin{array}{>{\centering\arraybackslash}m{1in}cc}
\midrule
\text{ } &
a>0 &
a<0\\
\midrule
\text{graph} &
\pgfplotsset{every axis/.append style={
axis x line=middle,    % put the x axis in the middle
axis y line=middle,    % put the y axis in the middle
axis line style={<->}, % arrows on the axis
title={$y$},
xlabel={$x$},          % default put x on x-axis
ylabel={},          % default put y on y-axis
ticks=none
}}
\begin{tikzpicture}
\begin{axis}[
xmin=-1.3,xmax=1.3,ymin=-0.5,ymax=1.5
]
\addplot[thick,samples=20,domain=-1:1] {x^2};
\end{axis}
\end{tikzpicture} &
\pgfplotsset{every axis/.append style={
axis x line=middle,    % put the x axis in the middle
axis y line=middle,    % put the y axis in the middle
axis line style={<->}, % arrows on the axis
title={$y$},
xlabel={$x$},          % default put x on x-axis
ylabel={},          % default put y on y-axis
ticks=none
}}
\begin{tikzpicture}
\begin{axis}[
xmin=-1.3,xmax=1.3,ymin=-1.5,ymax=0.5
]
\addplot[thick,samples=20,domain=-1:1] {-x^2};
\end{axis}
\end{tikzpicture}
\\
\midrule
\text{behaviour} &
\text{increasing for } x>0, \text{decreasing for }x<0 &
\text{decreasing for } x>0, \text{increasing for }x<0
\\\\
\midrule
\text{vertext} &
\multicolumn{2}{c}{(0,0)}\\
\\
\midrule
\text{size} &
\multicolumn{2}{c}{\text{If the value of }|a|\quad
\begin{sqcases}
\text{increases, the wider the shape of the parabola}\\
\text{decreases, the narrower the shape of the parabola}\\
\end{sqcases}}\\
\midrule
\end{array}$
\newline\newline
\end{center}
\end{document}

답변1

완벽하게 중앙에 위치합니다. 당신이 얻는 유일한 이유는 두 개의 빈 행입니다. \\귀하의 코드 관련 부분(82-91행)에서 잘못된 부분을 주석 처리했습니다 .

\midrule
\text{behaviour} &
\text{increasing for } x>0, \text{decreasing for }x<0 &
\text{decreasing for } x>0, \text{increasing for }x<0
\\%\\
\midrule
\text{vertext} &
\multicolumn{2}{c}{(0,0)}%\\
\\
\midrule

또한 환경을 그래프 tikzpicture`(58-64행) tikzpicture 로 래핑합니다.\raisebox-0.5\height{…}, you can centre thetext. Example for the first

\raisebox{-0.5\height}{\begin{tikzpicture}
\begin{axis}[
xmin=-1.3,xmax=1.3,ymin=-0.5,ymax=1.5
]
\addplot[thick,samples=20,domain=-1:1] {x^2};
\end{axis}
\end{tikzpicture}} &

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

관련 정보