下面的代码
\begin{tabular}{|m{1cm}| |m{10cm}|}
\hline
\rowcolor[gray]{0.9} \centering Grupo & \centering Descrição \tabularnewline
\hline
\hline
2B & instalações que utilizam fontes seladas em equipamentos para fins de radiografia industrial \tabularnewline
\hline
7B & instalações radiativas que utilizam equipamentos geradores de radiação ionizante que produzem feixe com energia maior que 0,10 MeV e menor ou igual a 0,60 Mev \tabularnewline
\hline
\end{tabular}
在我的项目中,生成下表:
正如您所见,\rowcolor
它并没有按照我想要的方式运行。
但是,当我将代码粘贴到新文档中时,它\rowcolor
运行正常。
发生了什么?
更新
这看起来像是字体系列问题。我使用的是:
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
然后我取消注释该helvet
包
%\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
并且桌子是固定的。
但现在我的文档太丑了。我真的很想念helvet
这个包。我该怎么办?
更新:
现在发布整个代码,这样你也可以看到问题(简化版本,只是为了重现问题)
\documentclass[a4paper,11pt,oneside]{book}
\usepackage{graphicx}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{epsfig}
\usepackage{float}
\usepackage{multicol}
\usepackage{array}
\usepackage[table]{xcolor}
\usepackage{multirow}
\usepackage{lastpage}
\usepackage{amsmath}
\usepackage{caption}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{tabularx}
\usepackage{colortbl,xcolor}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usetikzlibrary{matrix,arrows,shapes.geometric,positioning}
\begin{document}
\begin{center}
\centering
\begin{tabular}{|m{1cm}| |m{10cm}|}
\hline
\rowcolor[gray]{0.9} \centering Grupo & \centering Descrição \tabularnewline
\hline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
\end{tabular}
\end{center}
\end{document}
我正在使用 ubuntu、texstudio 和 pdflatex 来编译代码。
我发现问题出在“Descrição”这个词上——当我将它改为任何不带拉丁字母的单词时,比如只是“Descr”,rowcolor 甚至可以与 helvet 包一起使用。
更新时间:2013-10-31-03:57 PM
超级简化的示例,根据要求重现了行颜色问题:
\documentclass[a4paper,11pt,oneside]{book}
\usepackage{float}
\usepackage{multicol}
\usepackage{array}
\usepackage[table]{xcolor}
\usepackage{multirow}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\begin{center}
\centering
\begin{tabular}{|m{1cm}| |m{10cm}|}
\hline
\rowcolor[gray]{0.9} \centering Grupo & \centering Descrição \tabularnewline
\hline
\hline
A & B \tabularnewline
\hline
C & D \tabularnewline
\hline
\end{tabular}
\end{center}
\end{document}
现在,日志文件:
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2013.4.1) 31 OCT 2013 15:56
entering extended mode
%&-line parsing enabled.
**root.tex
(./root.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(/usr/share/texmf-texlive/tex/latex/base/book.cls
Document Class: book 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/bk11.clo
File: bk11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/home/erickfis/texmf/tex/latex/float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count88
\float@exts=\toks14
\float@box=\box26
\@float@everytoks=\toks15
\@floatcapt=\box27
)
(/usr/share/texmf-texlive/tex/latex/tools/multicol.sty
Package: multicol 2008/12/05 v1.6h multicolumn formatting (FMi)
\c@tracingmulticols=\count89
\mult@box=\box28
\multicol@leftmargin=\dimen103
\c@unbalance=\count90
\c@collectmore=\count91
\doublecol@number=\count92
\multicoltolerance=\count93
\multicolpretolerance=\count94
\full@width=\dimen104
\page@free=\dimen105
\premulticols=\dimen106
\postmulticols=\dimen107
\multicolsep=\skip43
\multicolbaselineskip=\skip44
\partial@page=\box29
\last@line=\box30
\mult@rightbox=\box31
\mult@grightbox=\box32
\mult@gfirstbox=\box33
\mult@firstbox=\box34
\@tempa=\box35
\@tempa=\box36
\@tempa=\box37
\@tempa=\box38
\@tempa=\box39
\@tempa=\box40
\@tempa=\box41
\@tempa=\box42
\@tempa=\box43
\@tempa=\box44
\@tempa=\box45
\@tempa=\box46
\@tempa=\box47
\@tempa=\box48
\@tempa=\box49
\@tempa=\box50
\@tempa=\box51
\c@columnbadness=\count95
\c@finalcolumnbadness=\count96
\last@try=\dimen108
\multicolovershoot=\dimen109
\multicolundershoot=\dimen110
\mult@nat@firstbox=\box52
\colbreak@box=\box53
)
(/usr/share/texmf-texlive/tex/latex/tools/array.sty
Package: array 2008/09/09 v2.4c Tabular extension package (FMi)
\col@sep=\dimen111
\extrarowheight=\dimen112
\NC@list=\toks16
\extratabsurround=\skip45
\backup@length=\skip46
)
(/usr/share/texmf/tex/latex/xcolor/xcolor.sty
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)
(/etc/texmf/tex/latex/config/color.cfg
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
(/usr/share/texmf-texlive/tex/latex/pdftex-def/pdftex.def
File: pdftex.def 2010/03/12 v0.04p Graphics/color for pdfTeX
\Gread@gobject=\count97
)
(/usr/share/texmf-texlive/tex/latex/colortbl/colortbl.sty
Package: colortbl 2001/02/13 v0.1j Color table columns (DPC)
\everycr=\toks17
\minrowclearance=\skip47
)
\rownum=\count98
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
(/home/erickfis/texmf/tex/latex/multirow.sty
\bigstrutjot=\dimen113
)
(/usr/share/texmf-texlive/tex/generic/babel/babel.sty
Package: babel 2008/07/06 v3.8l The Babel package
(/usr/share/texmf-texlive/tex/generic/babel/portuges.ldf
Language: portuges 2008/03/18 v1.2q Portuguese support from the babel system
(/usr/share/texmf-texlive/tex/generic/babel/babel.def
File: babel.def 2008/07/06 v3.8l Babel common definitions
\babel@savecnt=\count99
\U@D=\dimen114
)
Package babel Warning: No hyphenation patterns were loaded for
(babel) the language `Portuguese'
(babel) I will use the patterns loaded for \language=0 instead.
\l@portuges = a dialect from \language0
\l@brazilian = a dialect from \language\l@portuges
Package babel Info: Making " an active character on input line 145.
)) (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty
Package: inputenc 2008/03/30 v1.1d Input encoding file
\inpenc@prehook=\toks18
\inpenc@posthook=\toks19
(/usr/share/texmf-texlive/tex/latex/base/utf8.def
File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encoding T1
(/usr/share/texmf-texlive/tex/latex/base/t1enc.dfu
File: t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
defining Unicode char U+00A3 (decimal 163)
defining Unicode char U+00AB (decimal 171)
defining Unicode char U+00BB (decimal 187)
defining Unicode char U+00BF (decimal 191)
defining Unicode char U+00C0 (decimal 192)
defining Unicode char U+00C1 (decimal 193)
defining Unicode char U+00C2 (decimal 194)
defining Unicode char U+00C3 (decimal 195)
defining Unicode char U+00C4 (decimal 196)
defining Unicode char U+00C5 (decimal 197)
defining Unicode char U+00C6 (decimal 198)
defining Unicode char U+00C7 (decimal 199)
defining Unicode char U+00C8 (decimal 200)
defining Unicode char U+00C9 (decimal 201)
defining Unicode char U+00CA (decimal 202)
defining Unicode char U+00CB (decimal 203)
defining Unicode char U+00CC (decimal 204)
defining Unicode char U+00CD (decimal 205)
defining Unicode char U+00CE (decimal 206)
defining Unicode char U+00CF (decimal 207)
defining Unicode char U+00D0 (decimal 208)
defining Unicode char U+00D1 (decimal 209)
defining Unicode char U+00D2 (decimal 210)
defining Unicode char U+00D3 (decimal 211)
defining Unicode char U+00D4 (decimal 212)
defining Unicode char U+00D5 (decimal 213)
defining Unicode char U+00D6 (decimal 214)
defining Unicode char U+00D8 (decimal 216)
defining Unicode char U+00D9 (decimal 217)
defining Unicode char U+00DA (decimal 218)
defining Unicode char U+00DB (decimal 219)
defining Unicode char U+00DC (decimal 220)
defining Unicode char U+00DD (decimal 221)
defining Unicode char U+00DE (decimal 222)
defining Unicode char U+00DF (decimal 223)
defining Unicode char U+00E0 (decimal 224)
defining Unicode char U+00E1 (decimal 225)
defining Unicode char U+00E2 (decimal 226)
defining Unicode char U+00E3 (decimal 227)
defining Unicode char U+00E4 (decimal 228)
defining Unicode char U+00E5 (decimal 229)
defining Unicode char U+00E6 (decimal 230)
defining Unicode char U+00E7 (decimal 231)
defining Unicode char U+00E8 (decimal 232)
defining Unicode char U+00E9 (decimal 233)
defining Unicode char U+00EA (decimal 234)
defining Unicode char U+00EB (decimal 235)
defining Unicode char U+00EC (decimal 236)
defining Unicode char U+00ED (decimal 237)
defining Unicode char U+00EE (decimal 238)
defining Unicode char U+00EF (decimal 239)
defining Unicode char U+00F0 (decimal 240)
defining Unicode char U+00F1 (decimal 241)
defining Unicode char U+00F2 (decimal 242)
defining Unicode char U+00F3 (decimal 243)
defining Unicode char U+00F4 (decimal 244)
defining Unicode char U+00F5 (decimal 245)
defining Unicode char U+00F6 (decimal 246)
defining Unicode char U+00F8 (decimal 248)
defining Unicode char U+00F9 (decimal 249)
defining Unicode char U+00FA (decimal 250)
defining Unicode char U+00FB (decimal 251)
defining Unicode char U+00FC (decimal 252)
defining Unicode char U+00FD (decimal 253)
defining Unicode char U+00FE (decimal 254)
defining Unicode char U+00FF (decimal 255)
defining Unicode char U+0102 (decimal 258)
defining Unicode char U+0103 (decimal 259)
defining Unicode char U+0104 (decimal 260)
defining Unicode char U+0105 (decimal 261)
defining Unicode char U+0106 (decimal 262)
defining Unicode char U+0107 (decimal 263)
defining Unicode char U+010C (decimal 268)
defining Unicode char U+010D (decimal 269)
defining Unicode char U+010E (decimal 270)
defining Unicode char U+010F (decimal 271)
defining Unicode char U+0110 (decimal 272)
defining Unicode char U+0111 (decimal 273)
defining Unicode char U+0118 (decimal 280)
defining Unicode char U+0119 (decimal 281)
defining Unicode char U+011A (decimal 282)
defining Unicode char U+011B (decimal 283)
defining Unicode char U+011E (decimal 286)
defining Unicode char U+011F (decimal 287)
defining Unicode char U+0130 (decimal 304)
defining Unicode char U+0131 (decimal 305)
defining Unicode char U+0132 (decimal 306)
defining Unicode char U+0133 (decimal 307)
defining Unicode char U+0139 (decimal 313)
defining Unicode char U+013A (decimal 314)
defining Unicode char U+013D (decimal 317)
defining Unicode char U+013E (decimal 318)
defining Unicode char U+0141 (decimal 321)
defining Unicode char U+0142 (decimal 322)
defining Unicode char U+0143 (decimal 323)
defining Unicode char U+0144 (decimal 324)
defining Unicode char U+0147 (decimal 327)
defining Unicode char U+0148 (decimal 328)
defining Unicode char U+014A (decimal 330)
defining Unicode char U+014B (decimal 331)
defining Unicode char U+0150 (decimal 336)
defining Unicode char U+0151 (decimal 337)
defining Unicode char U+0152 (decimal 338)
defining Unicode char U+0153 (decimal 339)
defining Unicode char U+0154 (decimal 340)
defining Unicode char U+0155 (decimal 341)
defining Unicode char U+0158 (decimal 344)
defining Unicode char U+0159 (decimal 345)
defining Unicode char U+015A (decimal 346)
defining Unicode char U+015B (decimal 347)
defining Unicode char U+015E (decimal 350)
defining Unicode char U+015F (decimal 351)
defining Unicode char U+0160 (decimal 352)
defining Unicode char U+0161 (decimal 353)
defining Unicode char U+0162 (decimal 354)
defining Unicode char U+0163 (decimal 355)
defining Unicode char U+0164 (decimal 356)
defining Unicode char U+0165 (decimal 357)
defining Unicode char U+016E (decimal 366)
defining Unicode char U+016F (decimal 367)
defining Unicode char U+0170 (decimal 368)
defining Unicode char U+0171 (decimal 369)
defining Unicode char U+0178 (decimal 376)
defining Unicode char U+0179 (decimal 377)
defining Unicode char U+017A (decimal 378)
defining Unicode char U+017B (decimal 379)
defining Unicode char U+017C (decimal 380)
defining Unicode char U+017D (decimal 381)
defining Unicode char U+017E (decimal 382)
defining Unicode char U+200C (decimal 8204)
defining Unicode char U+2013 (decimal 8211)
defining Unicode char U+2014 (decimal 8212)
defining Unicode char U+2018 (decimal 8216)
defining Unicode char U+2019 (decimal 8217)
defining Unicode char U+201A (decimal 8218)
defining Unicode char U+201C (decimal 8220)
defining Unicode char U+201D (decimal 8221)
defining Unicode char U+201E (decimal 8222)
defining Unicode char U+2030 (decimal 8240)
defining Unicode char U+2031 (decimal 8241)
defining Unicode char U+2039 (decimal 8249)
defining Unicode char U+203A (decimal 8250)
defining Unicode char U+2423 (decimal 9251)
)
Now handling font encoding OT1 ...
... processing UTF-8 mapping file for font encoding OT1
(/usr/share/texmf-texlive/tex/latex/base/ot1enc.dfu
File: ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
defining Unicode char U+00A3 (decimal 163)
defining Unicode char U+00B8 (decimal 184)
defining Unicode char U+00BF (decimal 191)
defining Unicode char U+00C5 (decimal 197)
defining Unicode char U+00C6 (decimal 198)
defining Unicode char U+00D8 (decimal 216)
defining Unicode char U+00DF (decimal 223)
defining Unicode char U+00E6 (decimal 230)
defining Unicode char U+00EC (decimal 236)
defining Unicode char U+00ED (decimal 237)
defining Unicode char U+00EE (decimal 238)
defining Unicode char U+00EF (decimal 239)
defining Unicode char U+00F8 (decimal 248)
defining Unicode char U+0131 (decimal 305)
defining Unicode char U+0141 (decimal 321)
defining Unicode char U+0142 (decimal 322)
defining Unicode char U+0152 (decimal 338)
defining Unicode char U+0153 (decimal 339)
defining Unicode char U+2013 (decimal 8211)
defining Unicode char U+2014 (decimal 8212)
defining Unicode char U+2018 (decimal 8216)
defining Unicode char U+2019 (decimal 8217)
defining Unicode char U+201C (decimal 8220)
defining Unicode char U+201D (decimal 8221)
)
Now handling font encoding OMS ...
... processing UTF-8 mapping file for font encoding OMS
(/usr/share/texmf-texlive/tex/latex/base/omsenc.dfu
File: omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A7 (decimal 167)
defining Unicode char U+00B6 (decimal 182)
defining Unicode char U+00B7 (decimal 183)
defining Unicode char U+2020 (decimal 8224)
defining Unicode char U+2021 (decimal 8225)
defining Unicode char U+2022 (decimal 8226)
)
Now handling font encoding OMX ...
... no UTF-8 mapping file for font encoding OMX
Now handling font encoding U ...
... no UTF-8 mapping file for font encoding U
defining Unicode char U+00A9 (decimal 169)
defining Unicode char U+00AA (decimal 170)
defining Unicode char U+00AE (decimal 174)
defining Unicode char U+00BA (decimal 186)
defining Unicode char U+02C6 (decimal 710)
defining Unicode char U+02DC (decimal 732)
defining Unicode char U+200C (decimal 8204)
defining Unicode char U+2026 (decimal 8230)
defining Unicode char U+2122 (decimal 8482)
defining Unicode char U+2423 (decimal 9251)
))
(/usr/share/texmf-texlive/tex/latex/tools/tabularx.sty
Package: tabularx 1999/01/07 v2.07 `tabularx' package (DPC)
\TX@col@width=\dimen115
\TX@old@table=\dimen116
\TX@old@col=\dimen117
\TX@target=\dimen118
\TX@delta=\dimen119
\TX@cols=\count100
\TX@ftn=\toks20
)
(/usr/share/texmf-texlive/tex/latex/psnfss/helvet.sty
Package: helvet 2005/04/12 PSNFSS-v9.2a (WaS)
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks21
)) (./root.aux)
\openout1 = `root.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 18.
LaTeX Font Info: ... okay on input line 18.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 18.
LaTeX Font Info: ... okay on input line 18.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 18.
LaTeX Font Info: ... okay on input line 18.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 18.
LaTeX Font Info: ... okay on input line 18.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 18.
LaTeX Font Info: ... okay on input line 18.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 18.
LaTeX Font Info: ... okay on input line 18.
LaTeX Font Info: Try loading font information for OT1+phv on input line 18.
(/usr/share/texmf-texlive/tex/latex/psnfss/ot1phv.fd
File: ot1phv.fd 2001/06/04 scalable font definitions for OT1/phv.
)
(/usr/share/texmf-texlive/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count101
\scratchdimen=\dimen120
\scratchbox=\box54
\nofMPsegments=\count102
\nofMParguments=\count103
\everyMPshowfont=\toks22
\MPscratchCnt=\count104
\MPscratchDim=\dimen121
\MPnumerator=\count105
\everyMPtoPDFconversion=\toks23
)
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <10.95> on input line 23.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 23.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 23.
Overfull \hbox (2.14104pt too wide) in paragraph at lines 27--27
[]|\OT1/phv/m/n/10.95 Grupo|
[]
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}
] (./root.aux) )
Here is how much of TeX's memory you used:
2123 strings out of 495061
25048 string characters out of 1182622
85158 words of memory out of 3000000
5303 multiletter control sequences out of 15000+50000
8808 words of font info for 26 fonts, out of 3000000 for 9000
28 hyphenation exceptions out of 8191
41i,14n,35p,187b,191s stack positions out of 5000i,500n,10000p,200000b,50000s
{/usr/share/texmf-texlive/fonts/enc/dvips/base/8r.enc}</usr/sha
re/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb>
Output written on root.pdf (1 page, 7827 bytes).
PDF statistics:
11 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
答案1
正如 ulrike-fischer 指出的那样,我的 tex 安装包含非常旧的软件包。我使用的是 ubuntu 12.04 软件包,这些软件包是从 ubuntu 存储库中获取的。
然后我按照以下说明升级我的 tex 安装 如何在 Debian 或 Ubuntu 上安装“原始” TeXLive?
现在 rowcolor 可以与 helvet 包和拉丁字符正常配合使用。
谢谢你 ulrike!