Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make first row / column of table all bold #9

Open
1 of 5 tasks
vafakhalighi opened this issue May 14, 2020 · 0 comments
Open
1 of 5 tasks

Make first row / column of table all bold #9

vafakhalighi opened this issue May 14, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vafakhalighi
Copy link
Contributor


Brief outline of the feature request

I have a table with a number of columns and rows in which the title row has both text and math. I'd like to make all of the titles appear in bold shape. Clearly, I can add \textbf or \mathbf, etc. to each of them. However, I'm looking for a nicer way of doing this, particularly for tables with many columns. Tabu package provides \rowfont command which works perfectly with \bfseries and \boldmath as it's font specification. It would be awesome to have a similar command in bidi / xepersian packages to make first row / column of tabular environment.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example

\documentclass{article}
\usepackage{amsmath}
\usepackage{bm,tabu,array}
\usepackage{xepersian}
\settextfont{Yas}

\newcolumntype{+}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
  #1\ignorespaces
}

\begin{document}

\begin{table}[!h]
\centering
\caption{جدول ساخته شده در محیط \lr{tabular}}
\begin{tabular}{|*{11}{c|}}
\hline
\textbf{صفر}
& یک & دو &
$\bm{\Delta\mu\nabla\sigma}$
& سه & \% & 
\textbf{چهار}
& $\boldsymbol{n=10}$ & $\mathbf{n=15}$ & $\boldsymbol{\Delta\mu\nabla\sigma}$ & $\mathbf{\Delta\mu\nabla\sigma}$
\\ \hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline
\end{tabular}
\end{table}

\begin{table}[!h]
\caption{جدول ساخته شده در محیط \lr{tabu}}
\centering
\begin{tabu}{|*{11}{c|}}
\hline
\rowfont{\bfseries\boldmath}
صفر & یک & دو & $\Delta\mu\nabla\sigma$ & سه & \% & چهار
& $n=10$ & $n=15$ & $\Delta\mu\nabla\sigma$ & $\Delta\mu\nabla\sigma$
\\ \hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline
\end{tabu}
\end{table}

\begin{table}[!h]   % https://tex.stackexchange.com/questions/4811
\caption{جدول ساخته شده در محیط \lr{tabular} با دستورات تعریف شده بسته \lr{array}}
\centering
\begin{tabular}{|+c|*{10}{^c|}}
\hline
\rowstyle{\bfseries\boldmath}
صفر & یک & دو & $\Delta\mu\nabla\sigma$ & سه & \% & چهار
& $n=10$ & $n=15$ & $\Delta\mu\nabla\sigma$ & $\Delta\mu\nabla\sigma$
\\ \hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline
\end{tabular}
\end{table}
اعداد در متن 1234 و در فرمول $1234$
\[ 1 2 3 4 \]
\end{document}

Expected behavior

MWE-table-first-row.pdf

@vafakhalighi vafakhalighi added the enhancement New feature or request label May 14, 2020
@vafakhalighi vafakhalighi self-assigned this May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant