테이블 형식 환경에서 글꼴 크기 사용자 정의가 작동하지 않습니다.

테이블 형식 환경에서 글꼴 크기 사용자 정의가 작동하지 않습니다.

테이블 항목의 글꼴 크기를 늘려야 합니다. 에 대한 이전 질문에 따르면 환경을 TEX.SE시작하기 전에 글꼴 크기 명령(예: \large)을 추가하는 것과 같은 잠재적인 솔루션이 tabular작동해야 합니다. 하지만 내 경우에는 그러한 명령이 아무 것도 바꾸지 않습니다. 어떻게 고쳐야 합니까?

\documentclass[letterpaper, 10pt]{IEEEconf}

\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{booktabs}

\title{My Title*}

\author{Guy$^{1}$
\thanks{*This work was not supported by any organization}% <-this % stops a space
\thanks{$^{1}$Guy is with Hell, {\tt\small [email protected]}}%
}

\begin{document}

\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

ABSTRACT

\end{abstract}

\section{INTRODUCTION}

\begin{table}[h!]
    \centering
    \caption{Caption for the table.}
    \label{tab:table3}
    \resizebox{\columnwidth}{!}{%
    \LARGE  ------> It affects nothing
    \begin{tabular}{ccccccccc}
        \toprule
        $$      & $S^{h}(\theta^{h})$ & $S^{h}(\theta^{h})$ & $S^{h}(\theta^{h})$ & $S^{h}(\theta^{h})$ & $S^{v}(\theta^{v})$ & $^{v}(\theta^{v})$ & $S^{v}(\theta^{v})$ & $S^{v}(\theta^{v})$\\
        \midrule
        $S^{h}(\theta^{h})$ & occupied & & & & & &\\[0.5em]
        $S^{h}(\theta^{h})$ & & & & & & &\\[0.5em]
        $S^{h}(\theta^{h})$ & & & occupied & & & &\\[0.5em]
        $S^{h}(\theta^{h})$ & & & & & & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & occupied & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & & & occupied\\
        \bottomrule
    \end{tabular}
    }
\end{table}

\end{document}

답변1

당신은 원하지 \LARGE않지만 \footnotesize. 네 진짜로 요!

문제는 큰 테이블을 만든 다음 열 너비에 맞게 크기를 조정한다는 것입니다. 그렇게 해도 \HUMONGOUSLYHUGE결과는 정확히 동일합니다.

기억하세요: \resizebox테이블에는 절대 하지 마세요. 필요에 따라 제작하세요.

이 경우 \footnotesize열 사이의 공간을 줄이고 텍스트에서 설명할 수 있는 기호로 큰 "점유"를 변경하는 것이 합리적으로 보입니다.

표를 입력할 때 일부 현지 속기를 사용했습니다. 문서 전체 \STh에서 대신 사용하도록 제안하는 것은 아니지만 이 큰 테이블의 경우 속기는 코드 가독성에 도움이 됩니다.S^{h}(\theta^{h})

의 값은 어떻게 결정했습니까 \addtolength? 나는 그것 없이 표를 조판했고 73.22162pt만큼 과잉을 얻었습니다. 열간 패딩이 16개이므로 그 양을 16으로 나누고 소수 첫째 자리까지 반올림했습니다.

여담이지만, 이 \tt명령은 20년 넘게 더 이상 사용되지 않는 명령이었습니다. \ttfamily또는 "명령 형식"을 사용하십시오 \texttt.

\documentclass[letterpaper, 10pt]{IEEEconf}

\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{booktabs}

\usepackage{lipsum}

\title{My Title*}

\author{Guy$^{1}$
\thanks{*This work was not supported by any organization}% <-this % stops a space
\thanks{$^{1}$Guy is with Hell, {\ttfamily\small [email protected]}}%
}

\begin{document}

\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

ABSTRACT

\end{abstract}

\section{INTRODUCTION}

\lipsum[2]

\begin{table}[htp]
\caption{Caption for the table.}
\label{tab:table3}

%%% Local shorthands
\newcommand{\STh}{$S^{h}(\theta^{h})$}
\newcommand{\STv}{$S^{v}(\theta^{v})$}
%%% The definition of \occ could be in the preamble,
%%% if you use it also in other tables
\newcommand{\occ}{$\times$} % <--- change to your liking

\centering\footnotesize

%%% do the computation only at the very last moment
\addtolength{\tabcolsep}{-4.7pt}

\begin{tabular}{@{}*{9}{c}@{}}
\toprule
  & \STh & \STh & \STh & \STh & \STv & \STv & \STv & \STv\\
\midrule
\STh & \occ & & & & & &\\
\STh & & & & & & &\\
\STh & & & \occ & & & &\\
\STh & & & & & & &\\
\STv & & & & & & &\\
\STv & & & & & \occ & &\\
\STv & & & & & & &\\
\STv & & & & & & & \occ\\
\bottomrule
\end{tabular}

\end{table}

\lipsum

\end{document}

무엇이든

답변2

와 같은 지시문을 사용하여 글꼴 크기를 확대하려고 시도하는 것은 \large지시문이 있기 때문에 설정에서 완전히 실패하는 것입니다 \resizebox.

다른 길로 가야 합니다. 다음 단계를 수행하는 것이 좋습니다.

  • "점유" 대신 "occ."라고 쓰면 셀 내용이 공간을 덜 차지합니다.

  • S^{h}(\theta^{h})글 을 쓰며 S^{v}(\theta^{v})공간을 많이 차지합니다. 아래 코드에서는 이러한 용어를 훨씬 더 간결하게 조판하는 것이 좋습니다.

  • 열 사이의 공백을 줄이세요. 기본 금액(2*6pt)이 꽤 넉넉합니다. \tabcolsep시행착오를 거쳐 매개 변수를 조정하기보다는 0pt바로 설정하고 tabular*환경 대신 환경을 사용하는 것이 좋습니다 tabular. 그런 식으로 LaTeX는 최적의(즉, 사용 가능한 최대) 공백의 양을 알아냅니다.

이러한 조정이 완료되면 표의 글꼴 크기를 \small. 다음 스크린샷은 전후 비교를 제공합니다. 나는 "이후" 테이블이 당신이 달성하기를 바랐던 것과 어느 정도 일치한다고 믿습니다.

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

\documentclass[letterpaper,10pt]{IEEEconf}
\usepackage{booktabs,graphicx}
\usepackage[skip=0.333\baselineskip,font={bf,sf}]{caption}
\newcommand\Sth[1]{S^{#1}\mkern-3mu(\mkern-2.5mu\theta^{\mkern-1mu#1}\mkern-2mu)}
\begin{document}
\section{Introduction}
\hrule % just to illustrate width of textblock

%%%% First the "before" look
\begin{table}[h!]
    \centering
    \caption{Before}
    \label{tab:table3}
    \resizebox{\columnwidth}{!}{%
    \LARGE % ------> It affects nothing
    \begin{tabular}{ccccccccc}
        \toprule
        $$      & $S^{h}(\theta^{h})$ & $S^{h}(\theta^{h})$ & $S^{h}(\theta^{h})$ & $S^{h}(\theta^{h})$ & $S^{v}(\theta^{v})$ & $^{v}(\theta^{v})$ & $S^{v}(\theta^{v})$ & $S^{v}(\theta^{v})$\\
        \midrule
        $S^{h}(\theta^{h})$ & occupied & & & & & &\\[0.5em]
        $S^{h}(\theta^{h})$ & & & & & & &\\[0.5em]
        $S^{h}(\theta^{h})$ & & & occupied & & & &\\[0.5em]
        $S^{h}(\theta^{h})$ & & & & & & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & occupied & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & & &\\[0.5em]
        $S^{v}(\theta^{v})$ & & & & & & & occupied\\
        \bottomrule
    \end{tabular}
    }
\end{table}

%%%% Now the "after" look
\begin{table}[h!]
\captionsetup{font={small,bf,sf}} % optional
\small
\caption{After} \label{tab:table3}
\setlength\tabcolsep{0pt} % make LaTeX calculate intercolumn whitespace
\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}} ccccccccc}
\toprule
& $\Sth{h}$ & $\Sth{h}$ & $\Sth{h}$ & $\Sth{h}$ & $\Sth{\nu}$ & $\Sth{\nu}$ & $\Sth{\nu}$ & $\Sth{\nu}$\\
\midrule
$\Sth{h}$ & occ. & & & & & &\\
$\Sth{h}$ & & & & & & &\\
$\Sth{h}$ & & & occ. & & & &\\
$\Sth{h}$ & & & & & & &\\
$\Sth{\nu}$ & & & & & & &\\
$\Sth{\nu}$ & & & & & occ. & &\\
$\Sth{\nu}$ & & & & & & &\\
$\Sth{\nu}$ & & & & & & & occ.\\
\bottomrule
\end{tabular*}
\end{table}

\end{document}

관련 정보