TransWikia.com

Unable to change font in table to qcr using `renewcommand{ttdefault}{qcr}`

TeX - LaTeX Asked on May 11, 2021

1

Suppose I load the following packages:

documentclass{article}
usepackage{calc}
setlengthtextwidth{6.5in}
setlengthtextheight{10in}setlengthoddsidemargin{(paperwidth-textwidth)/2 - 1in}
setlengthtopmargin{(paperheight-textheight-headheight-headsep-footskip)/2 - 1in}
usepackage{amsmath, amssymb, array}
usepackage{tabu, colortbl}
usepackage[table]{xcolor}
usepackage[cache=false]{minted}
usepackage{xpatch}
xpatchcmd{minted}{VerbatimEnvironment}{VerbatimEnvironmentletitshaperelax}{}{}
usemintedstyle{bw}

2

Now I create some random table:

begin{table}[ht]
centering
footnotesize
renewcommand{ttdefault}{qcr}
begin{tabular}{rrlllrlllrllllrlrllrrrrrrrlrllllrrrrlr}
% border
 & STATE__ & BGN_DATE & BGN_TIME & TIME_ZONE & COUNTY & COUNTYNAME & STATE & EVTYPE & BGN_RANGE & BGN_AZI & BGN_LOCATI & END_DATE & END_TIME & COUNTY_END & COUNTYENDN & END_RANGE & END_AZI & END_LOCATI & LENGTH & WIDTH & F & MAG & FATALITIES & INJURIES & PROPDMG & PROPDMGEXP & CROPDMG & CROPDMGEXP & WFO & STATEOFFIC & ZONENAMES & LATITUDE & LONGITUDE & LATITUDE_E & LONGITUDE_ & REMARKS & REFNUM  
  hline
  1 & 1.00 & 4/18/1950 0:00:00 & 0130 & CST & 97.00 & MOBILE & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 14.00 & 100.00 & 3.00 & 0.00 & 0.00 & 15.00 & 25.00 & K & 0.00 &  &  &  &  & 3040.00 & 8812.00 & 3051.00 & 8806.00 &  & 1.00  
  2 & 1.00 & 4/18/1950 0:00:00 & 0145 & CST & 3.00 & BALDWIN & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 2.00 & 150.00 & 2.00 & 0.00 & 0.00 & 0.00 & 2.50 & K & 0.00 &  &  &  &  & 3042.00 & 8755.00 & 0.00 & 0.00 &  & 2.00  
  3 & 1.00 & 2/20/1951 0:00:00 & 1600 & CST & 57.00 & FAYETTE & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 0.10 & 123.00 & 2.00 & 0.00 & 0.00 & 2.00 & 25.00 & K & 0.00 &  &  &  &  & 3340.00 & 8742.00 & 0.00 & 0.00 &  & 3.00  
  4 & 1.00 & 6/8/1951 0:00:00 & 0900 & CST & 89.00 & MADISON & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 0.00 & 100.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 &  &  &  &  & 3458.00 & 8626.00 & 0.00 & 0.00 &  & 4.00  
  5 & 1.00 & 11/15/1951 0:00:00 & 1500 & CST & 43.00 & CULLMAN & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 0.00 & 150.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 &  &  &  &  & 3412.00 & 8642.00 & 0.00 & 0.00 &  & 5.00  
  6 & 1.00 & 11/15/1951 0:00:00 & 2000 & CST & 77.00 & LAUDERDALE & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 1.50 & 177.00 & 2.00 & 0.00 & 0.00 & 6.00 & 2.50 & K & 0.00 &  &  &  &  & 3450.00 & 8748.00 & 0.00 & 0.00 &  & 6.00  
% border
end{tabular}
end{table}

However, notice that footnotesize is applied to all elements in the table, but qcr front is not. What did I do wrong?

One Answer

Thank you @Ulrike Fischer for your help. I figured out a way fix my issue.

The key is to call ttfamily underneath renewcommand{ttdefault}{qcr}:

begin{table}[ht]
centering
footnotesize
renewcommand{ttdefault}{qcr}
ttfamily
begin{tabular}{rrlllrlllrllllrlrllrrrrrrrlrllllrrrrlr}
% border
 & STATE__ & BGN_DATE & BGN_TIME & TIME_ZONE & COUNTY & COUNTYNAME & STATE & EVTYPE & BGN_RANGE & BGN_AZI & BGN_LOCATI & END_DATE & END_TIME & COUNTY_END & COUNTYENDN & END_RANGE & END_AZI & END_LOCATI & LENGTH & WIDTH & F & MAG & FATALITIES & INJURIES & PROPDMG & PROPDMGEXP & CROPDMG & CROPDMGEXP & WFO & STATEOFFIC & ZONENAMES & LATITUDE & LONGITUDE & LATITUDE_E & LONGITUDE_ & REMARKS & REFNUM  
  hline
  1 & 1.00 & 4/18/1950 0:00:00 & 0130 & CST & 97.00 & MOBILE & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 14.00 & 100.00 & 3.00 & 0.00 & 0.00 & 15.00 & 25.00 & K & 0.00 &  &  &  &  & 3040.00 & 8812.00 & 3051.00 & 8806.00 &  & 1.00  
  2 & 1.00 & 4/18/1950 0:00:00 & 0145 & CST & 3.00 & BALDWIN & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 2.00 & 150.00 & 2.00 & 0.00 & 0.00 & 0.00 & 2.50 & K & 0.00 &  &  &  &  & 3042.00 & 8755.00 & 0.00 & 0.00 &  & 2.00  
  3 & 1.00 & 2/20/1951 0:00:00 & 1600 & CST & 57.00 & FAYETTE & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 0.10 & 123.00 & 2.00 & 0.00 & 0.00 & 2.00 & 25.00 & K & 0.00 &  &  &  &  & 3340.00 & 8742.00 & 0.00 & 0.00 &  & 3.00  
  4 & 1.00 & 6/8/1951 0:00:00 & 0900 & CST & 89.00 & MADISON & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 0.00 & 100.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 &  &  &  &  & 3458.00 & 8626.00 & 0.00 & 0.00 &  & 4.00  
  5 & 1.00 & 11/15/1951 0:00:00 & 1500 & CST & 43.00 & CULLMAN & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 0.00 & 150.00 & 2.00 & 0.00 & 0.00 & 2.00 & 2.50 & K & 0.00 &  &  &  &  & 3412.00 & 8642.00 & 0.00 & 0.00 &  & 5.00  
  6 & 1.00 & 11/15/1951 0:00:00 & 2000 & CST & 77.00 & LAUDERDALE & AL & TORNADO & 0.00 &  &  &  &  & 0.00 &  & 0.00 &  &  & 1.50 & 177.00 & 2.00 & 0.00 & 0.00 & 6.00 & 2.50 & K & 0.00 &  &  &  &  & 3450.00 & 8748.00 & 0.00 & 0.00 &  & 6.00  
% border
end{tabular}
end{table}

Answered by Michael Šòdéké on May 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP