When I use \color in the beginning of a cell in tabu, the contents of the cell are shifted downwards:    The issue does not occur when there is any character in front of the \color, but a \null does not help (in fact, it increases the shift).  Here is the code for the example above:  \documentclass{article}  \usepackage{xcolor} \usepackage{tabu}  \begin{document}  \begin{tabu} to 4cm {XX}     Lorem &amp; Ipsum \\     Dolor &amp; {\color{red}Sit} Amet \end{tabu}  \end{document}   Why is the text shifted down, and what is the correct way to color the first word of a cell?
122891
The following latex code prints rows one at a time. However all the cells of the rows don't come out aligned. How can I fix it.   \documentclass{beamer}     \usepackage{tabularx}    \begin{document}  \begin{frame}{}  \begin{tabularx}{3.50in}{lXX}           \hline           &amp; Observation &amp; Conclusion \\           \hline             \uncover&lt;2-&gt;{1.} &amp; \uncover&lt;2-&gt;{Observation 1 } &amp; \uncover&lt;2-&gt;{Conclusion 1} \\   \uncover&lt;3-&gt;{2.} &amp; \uncover&lt;3-&gt;{Observation 2} &amp; \uncover&lt;3-&gt;{Conclusion 2} \\           \end{tabularx}      \end{frame}   \end{document}   The output looks as follows :    As we can see cells in first column do not align with the rest of the rows. Will appreciate any input as to how to fix this.
110972
On  it says:  [[:blank:]]     space and tab characters [[:space:]]     whitespace characters   What's the difference between space and tab characters and whitespace characters? To me, they almost seem the same.
102068
Most examples I've seen are like this:  \begin{tabular}{@{}l r r@{}}   that is, with one @{} to the left of first column specifier and another @{} to the right of the last column specifier.  Yet the "Not So Short Guide to LaTex" says this construct suppresses the leading space.   I'm a bit confused. Which of the following interpretations are correct?   @{} suppresses the space on the side of the column specifier where it is placed (i.e. placed to the left of the specifier it suppresses the leading space and, conversely, placed to the right it suppresses the trailing space) only @{} should be placed to the left of the first column and/or to the right of the last column, but not in between. neither of the above.   Unfortunately I'm not at a computer with LaTeX at this very moment so I cannot try it instead of asking.  Thanks a lot.
27229
I've created a table where the rows alternate in colour however /hline is acting unusually.  The first and second /hline work normally however after this alternating /hlines only show as a small dash next to the vertical column line  \usepackage[table]{xcolor}  \begin{table}[ht]    \rowcolors{2}{gray!25}{white}   \begin{tabular}{l | l|}     \hline     \rowcolor{gray!25}     text part 1 &amp; test part 2  \\                    Priority &amp; High \\ \hline     text part 1 &amp; test part 2  \\                    Priority &amp; High \\ \hline %this hline doesnt show     text part 1 &amp; test part 2  \\                    Priority &amp; High \\ \hline     text part 1 &amp; test part 2  \\                    Priority &amp; High \\ \hline %this hline doesnt show     text part 1 &amp; test part 2  \\                    Priority &amp; High \\ \hline     text part 1 &amp; test part 2  \\                    Priority &amp; High \\ \hline   \end{tabular}   \end{table}   Does anybody know what I'm doing wrong? Thanks.
119973
\begin{center}     \section*{\textcolor{blue}{Ukaaranta }}     \end{center}     \subsection*{Shabhu Harivat}     \addcontentsline{toc}{subsection}{shambhu harivat}  \begin{center}     \section*{\textcolor{blue}{Krostru Shabda}} \end{center}   I have a need to create something like this, however when I run this program, it gives error at the second \end{center}.  Funny but the same command works above. I did not do anything different, just copy pasted and changed the text. Similar commands elsewhere in the document work just fine. I have no clue why it's behaving like this.   Hit ? and R - enter and it gives the desired output but it's a pain to do that every time.
53265
Possible Duplicate:          I am trying to create a table after some text:  Some text. foobar foobar \\  \begin{table}[t] \centering \begin{tabular}{|c|c|c|c|c|c|} \hline  &amp; a &amp; c &amp; &amp; &amp;  \\ \hline $\{X, X', Y\}$ &amp; &amp; b &amp;  &amp; &amp;  \\ \hline \hline \end{tabular} \end{table}   However, the table is appearing before the text even though I type if after I type the text. Why?
103030
My code follows:  \documentclass{book} \usepackage{color,colortbl} \begin{document}  \begin{tabular}{ll&gt;{\color{red}}p{20pc}} a &amp;1 &amp;Test \end{tabular}  \end{document}   The output was:    Some unnecessary vertical space came before the last column. If I remove the tag \color{red} then everything works fine, how can I fix this?  Above said issue was fixed based on the suggestion given by David Carlisle and CarLaTeX, but the same problem was there if I use the supertabular environment, I used supertabular package for auto breaking table and the code follows:  \documentclass{book} \usepackage{color,colortbl,supertabular} \begin{document}  \begin{supertabular}{ll&gt;{\leavevmode\color{red}}p{4pc}&gt;{\leavevmode\color{black}}l&gt;{\leavevmode\color{black}}l&gt;{\leavevmode\color{red}}p{4pc}} a &amp;1 &amp;Test &amp;a &amp;1 &amp;Test\\ a &amp;1 &amp;Test &amp;a &amp;1 &amp;Test\\ \end{supertabular}  \end{document}
100885
\begin{table}[ht] \centering \begin{tabular}{c|ccccccc} \hline &amp; col1 &amp; col2 &amp; col3 &amp; col4 &amp; col5 &amp; col6 &amp; col7 \\ \hline \rowcolor{red} row1&amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra \\ row2&amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra \\ \rowcolor{red} row3&amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra \\ row4&amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra \\ \rowcolor{red} row5&amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra \\ row6&amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra &amp; \ra \\ \hline \end{tabular} \end{table}   I have a simple table with color coded rows (red or black), and I would like to append a simple color coded legend that tells the reader Red = Male, Black = Female. Perhaps something that looks like this?
5017
How do I use xcolor to color a specific cell from a table in pgfplots? Is xcolor the best tool to use here? I'm trying to loop over a list of colors and color the cells in the column individually.  \documentclass{article} \usepackage{pgfplotstable,filecontents} \RequirePackage{listofitems} \usepackage{}  \begin{filecontents*}{test.csv}     ColA, ColB, ColC     0.17, 0.91, 0.67     0.15, 0.17, 0.92     0.48, 0.1, 0.28 \end{filecontents*}     \begin{document}     \pgfplotstabletypeset[col sep=comma,     ]{test.csv}     \def\mylistOne{green, blue, orange}     \readlist*\mylistTwo{\mylistOne}     \newcounter{myCounter}     \setcounter{myCounter}{-1}     \foreachitem\x\in\mylistTwo[]{         \stepcounter{myCounter}         \pgfplotstableset{             every row \themyCounter column 1/.style={                 \cellcolor{\x}         }     } } \end{document}
14384
still working on that table. Here's my new question reguarding the table borders:  It appears, that i do something wrong setting boarders. Here is my code, and a screenshot:  \documentclass{article} \usepackage{multirow} % Used for the vertical cells \usepackage{rotating} % Used for the vertical cells  \usepackage{xcolor} % Used for cell-colors \usepackage{colortbl} % Used for cell-colors  \usepackage[a4paper]{geometry}% Used to set the pdf margins manually \newgeometry{left=2cm,bottom=0.1cm}  \definecolor{grey}{HTML}{F2F2F2} % Define grey for the cells \definecolor{red}{HTML}{FF0000} % Define red for testing  \begin{document} \scriptsize % Use a small font size  \begin{tabular}{|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0.6cm}|p{0,6cm}|}  \cline{10-17}  \multicolumn{9}{|c|}{} &amp; \multicolumn{2}{p{\dimexpr (0.6cm)*2+2\arrayrulewidth+2\tabcolsep\relax}|}{\cellcolor{grey}Work to retired ratio} &amp; \multicolumn{4}{p{\dimexpr (0.6cm)*4+1\arrayrulewidth+2\tabcolsep\relax}|}{Health care sizing (per thousand)} &amp; \multicolumn{2}{p{\dimexpr (0.6cm)*2+1\arrayrulewidth+2\tabcolsep\relax}|}{\cellcolor{grey}Inverse dependency ratio}\\\cline{3-9}  \multicolumn{2}{|c|}{} &amp; \multicolumn{4}{c|}{\cellcolor{grey}Population (mio.)} &amp; \multicolumn{3}{c}{Workforce (1000)}  &amp; \multicolumn{2}{|c|}{\cellcolor{grey}} &amp; \multicolumn{2}{l|}{Physicians by} &amp; \multicolumn{2}{l}{Nurses by} &amp; \multicolumn{2}{|l|}{\cellcolor{grey}Old agers by}\\\hline  \multicolumn{2}{|c|}{} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Overall}\end{sideways} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Young age}\end{sideways} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Working age}\end{sideways} &amp; \begin{sideways}\cellcolor{grey}\parbox{4cm}{Old age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Overall}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Physicians (Proj: 2025)}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Nurses (Proj: 2030)}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}Working age by Old age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}Work force by Old age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Workforce}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Working age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Workforce}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{Working age}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}1 physicians}\end{sideways} &amp; \begin{sideways}\parbox{4cm}{\cellcolor{grey}1 nurse}\end{sideways}\\\hline  \multicolumn{2}{|l}{USA} &amp; \multicolumn{4}{l}{\cellcolor{grey}} &amp; \multicolumn{3}{l}{} &amp; \multicolumn{2}{l}{\cellcolor{grey}} &amp; \multicolumn{4}{l}{} &amp; \multicolumn{2}{l|}{\cellcolor{grey}}\\\hline  1990/1 &amp; &amp; 248,6 &amp; 71,3 &amp; 146,1 &amp; 31,2 &amp; 127.500 &amp; 615,4 &amp; 1491,6 &amp; 4,68 &amp; 4,09 &amp; 4,83 &amp; 4,21 &amp; 11,70 &amp; 10,21 &amp; 50,7 &amp; 20,9\\\hline  1 &amp; 2 &amp; 3 \\\hline  \end{tabular}  \end{document}     On 1 the Top border of Population is not visible although i did used \\\cline{3-9}\cline{12-17} on that line.  In 2 both borders are pushed a bit to the right for no reason i can see.  And in 3 again the top borders are not visible despite using \cline{10-17} on that line. What did i do wrong?  Thanks!
38062
Possible Duplicate:          I have a spreadsheet where I have cell within a row that will contain specific text via data validation. So for instance a cell could contain the text "Due in 7 Days", "Past Due", or "Closed".  I want the row color to change depending on the text that appears in the cell. So if the text "Past Due" appears in the cell I want that entire row to turn red, if "Due In 7 Days" appears the row should turn yellow, and if "Closed" the row would turn gray.  How can I do that?
48092
I want to typeset a tabular with alterning row colors, containing matrices. Somehow, when adding \rowcolors{1}{}{black!5} the left bracket of some matrices is just omited. What am I doing wrong and how can I avoid this?   \documentclass[ border=2pt]{standalone}  \usepackage{amsmath} \usepackage[natural,table]{xcolor}  \begin{document}     \rowcolors{1}{}{black!5}     \begin{tabular}[t]{ll}         \rowcolor{gray!50}{\bfseries SKP} &amp; \\ \hline         $A$ &amp; $\begin{bmatrix}-0.25 &amp; 1 \\ 0 &amp; 0.5  \end{bmatrix}$\\         $b=g$ &amp; $\begin{bmatrix}0 \\ 1\end{bmatrix}$         \end{tabular} \end{document}
110253
I change color globally in math mode, but if I try to change the color locally only to one symbol or letter, it does'n have effect. \documentclass[11pt]{article} \usepackage{xcolor} \usepackage{amssymb,verbatim,amsthm,amsmath,color} \usepackage[T1]{fontenc}  \definecolor{navy}{rgb}{0.0, 0.0,0.5} \usepackage{fontspec} \usepackage{unicode-math} \setmathfont[slash-delimiter=frac,Color=navy]{Cambria Math}  \begin{document} $$x^2-y^2=1$$ $$x^2-(\textcolor{red}{1})^2=1$$ \end{document}
61348
When I add a # in insert mode on an empty line in Vim while editing python files, vim moves the # to the beginning of the line, but I would like the # to be inserted at the tab level where I entered it.  For example, when writing this in vim  for i in range(10):     #   the # does not stay there where I entered it.  It is moved like so, by vim.  for i in range(10): #   Does anyone know of a configuration item in vim that would change this?  If it helps, I am using Ubuntu 8.10.
33955
I use ubuntu 11.04.  Is there a way to set coloring for output after tab completion listing of a cd, ls, or etc. ?  i.e.   myshell@root$ cd ~/user/files/ I hit tab...  myfile myfoo  mybar &lt;--  this output is colored?  I hope you enjoyed my diagram.
52490
The following code shows that a \color{red} command increases the height of a tabular cell. I want to use a switch, not a command as \textcolor{red}{text}.  \documentclass{article}  \usepackage{xcolor} \usepackage{float}  \begin{document}  \begin{table}[H] \begin{tabular}{*{2}{p{0.45\textwidth}}} \hline \color{red} header &amp; header \tabularnewline \hline  %  content  &amp; content \tabularnewline  content  &amp; content \tabularnewline  content  &amp; content \tabularnewline \hline \end{tabular} \end{table}  \end{document}     How can I work around this problem?
63031
In my answer to question    I suggest to (between others) to use makecell package to define head of table and later I sow that the firs row is not colored as expected. It doesn't cover all row. Than I try to correct this with use of cellcolor construct as should be correctly done, when you use multicolumn (simplified MWE from mentioned question):  \documentclass[12pt]{article}     \usepackage[utf8]{inputenc}      \usepackage[table]{xcolor}     \usepackage{longtable}     \usepackage{makecell} \renewcommand\theadfont{\bfseries}  \usepackage[active,tightpage]{preview} \PreviewEnvironment{longtable}%     \setlength\PreviewBorder{1em}      \begin{document} \begin{longtable}{|*{9}{b{\dimexpr 0.11\linewidth-2\tabcolsep}|}}     \hline     \multicolumn{8}{|c|}{\cellcolor{gray!30}{\thead{head\\ 1}}}     &amp; \cellcolor{gray!30}{\thead{head\\ 2}}   \\    \hline 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 \\     \hline\hline \endfirsthead     \hline 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 \\     \hline\hline \endhead A &amp; B &amp; C &amp; D &amp; E &amp; F &amp; G &amp; H &amp; I  \\ J &amp; K &amp; L &amp; M &amp; N &amp; O &amp; P &amp; Q &amp; R  \\ S &amp; T &amp; U &amp; V &amp; W &amp; X &amp; Y &amp; Z &amp;    \\     \hline\hline \end{longtable}     \end{document}   and discover that that head inmulticolumn doesn't has width of it and consequently head background color doesn't fill complete cell.     I Check makecell documentation, but doesn't find valuable information how to stretch actual head to cover entire cell. How to achieve that entire multicolum cell background will be colored?  addendum: for this particular case the stretch \thead over whole \multicolumn can be done on the following way: instead of  \multicolumn{8}{|c|}{\thead{\hfill head\hfill\\ 1}}   the multi column cell should be defined as  \multicolumn{8}{|p{\dimexpr 0.88\linewidth-\tabcolsep}|}{\thead{\hfill head\hfill\\ 1}}   where \dimexpr 0.88\linewidth-\tabcolsep is the width of multi col cell. then the result is:    however, general solutions are given in answers below.