某些列中出现奇怪的字符

某些列中出现奇怪的字符

我在 win 7 中使用 miktex

我的 MWE 是

\documentclass[12pt,a4paper,fleqn]{book}
%
\usepackage{subfiles}
\usepackage{thesis_style}

\title{hfvj}
\author{fgikf}
\date{}

\begin{document}

\begin{landscape}
\begin{table}[htbp]
\scriptsize\addtolength{\tabcolsep}{-2pt}
\centering
\begin{tabular}{lrrrrrrrrrrrrrrrrrrrrrr}
Longitude & \multicolumn{2}{|c|}{114.25} & \multicolumn{2}{|c|}{-155.79} & \multicolumn{2}{|c|}{-96.58} & \multicolumn{2}{|c|}{-8.02} & \multicolumn{2}{|c|}{101.27} & \multicolumn{2}{|c|}{37.00} & \multicolumn{2}{|c|}{-79.82} & \multicolumn{2}{|c|}{-100.37} & \multicolumn{2}{|c|}{-117.85} & \multicolumn{2}{|c|}{102.98} & \multicolumn{2}{|c}{-110.33}  \\
Latitude & \multicolumn{2}{|c|}{37.87} & \multicolumn{2}{|c|}{20.13} & \multicolumn{2}{|c|}{39.08} & \multicolumn{2}{|c|}{38.53} & \multicolumn{2}{|c|}{21.93} & \multicolumn{2}{|c|}{-4.00} & \multicolumn{2}{|c|}{39.08} & \multicolumn{2}{|c|}{41.86} &         \multicolumn{2}{|c|}{33.66} & \multicolumn{2}{|c|}{38.57} & \multicolumn{2}{|c}{31.48}  \\
\hline
Depth (cm) & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min   & Max   & Min \\
\hline
5     &       &       & 9.07  & -9.46 &       &       & 3.80  & 0.50  &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
10    &  –5.4   &  –10.6   & 9.72  & -11.33 & -1.80 & -1.90 &       &       & -3.00 & -5.00 &       &       &       &       &       &       &       &       &       &       & -2.00 & -5.00 \\
15    &       &       & 11.03 & -11.22 &       &       & 3.50  & 2.20  &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
20    &  –3.6   &  –10.3   & 7.52  & -11.35 & -3.00 & -3.80 &       &       & -5.50 & -6.40 &       &       &       &       &       &       &       &       & 7.00  & 2.00  & -8.50 & -9.00 \\
25    &       &       &       &       &       &       & -0.50 & -2.00 &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
30    &  –7.3   &  –10.6   & 7.79  & -10.38 & -2.60 & -3.90 &       &       &       &       &       &       & -5.80 & -10.90 &       &       &       &       & 7.00  & 3.00  &       &  \\
35    &       &       &       &       &       &       & -1.00 & -2.50 &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
40    &       &       & 6.69  & -8.37 & -2.40 & -5.80 &       &       &       &       & -3.50 & -4.50 &       &       &       &       &       &       &       &       &       &  \\
45    &       &       &       &       &       &       & -2.50 & -5.80 & -5.00 & -5.80 &       &       &       &       &       &       &       &       &       &       &       &  \\
50    &  –7.1   &  –10.4   & 3.98  & -5.95 & -6.50 & -6.90 &       &       &       &       &       &       &       &       & -11.00 & -12.00 &       &       & 4.00  & 1.00  &       &  \\
55    &       &       &       &       &       &       & -3.50 & -5.80 &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
60    &       &       &       &       &       &       &       &       & -6.00 & -7.00 &       &       &       &       &       &       &       &       &       &       & -9.00 & -15.00 \\
65    &       &       &       &       &       &       & -3.80 & -5.80 &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
70    &  –7.4   &  –9.8   & 3.15  & -4.93 & -6.80 &       &       &       &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
75    &       &       &       &       &       &       & -5.80 & -6.10 &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
80    &       &       &       &       &       &       &       &       & -6.80 & -7.80 &       &       &       &       &       &       &       &       &       &       &       &  \\
85    &       &       &       &       &       &       & -5.80 & -5.90 &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
90    &  –6.4   &  –7.7   & 2.63  & -6.57 & -6.00 & -6.50 &       &       &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
95    &       &       &       &       &       &       & -4.50 & -4.50 &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
100   &       &       &       &       & -6.40 & -6.60 &       &       & -7.00 & -7.50 &       &       &       &       & -10.50 & -12.50 & -0.50 & -3.00 & 1.00  & -5.00 & -13.00 & -13.50 \\
110   &  –6.9   &  –8.2   &       &       & -5.80 & -8.20 &       &       &       &       &       &       &       &       &       &       &       &       &       &       &       &  \\
120   &       &       &       &       &       &       &       &       & -6.20 & -7.50 &       &       &       &       &       &       &       &       &       &       &       &  \\
150   &       &       &       &       &       &       &       &       & -7.00 & -7.80 &       &       &       &       & -10.00 & -11.50 &       &       &       &       & -13.00 & -13.00 \\
200   &       &       &       &       &       &       &       &       &       &       &       &       &       &       & -10.50 & -12.50 &       &       &       &       &       &  \\
300   &       &       &       &       &       &       &       &       &       &       &       &       &       &       & -14.00 & -11.00 &       &       &       &       &       &  \\
\hline
\end{tabular}%
\caption{reghg}\label{ewt}
\end{table} 

\end{landscape}

\end{document}

.sty 文件是

\ProvidesPackage{thesis_style}
%
%%% PAGE DIMENSIONS AND SETTINGS
\usepackage{geometry} % to change the page dimensions
\geometry{a4paper} % or letterpaper (US) or a5paper or....
%\geometry{margin=1in} % for example, change the margins to 2 inches all round
\geometry{top=1.0in, bottom=1.0in, left=1in, right=1in}
% \geometry{landscape} % set up the page for landscape
%%spacing between lines
\usepackage{setspace}
\doublespacing
% Activate to begin paragraphs with an empty line rather than an     indent
%\usepackage[parfill]{parskip} 
%
%%%%
%%%%GRAPHICS, FLOATS, SYMBOLS AND MATHS
% support the \includegraphics command and options
\usepackage{graphicx} 
\usepackage{booktabs} % for much better looking tables
\usepackage{floatrow}%for side captions
% for rotating floats
\usepackage{lscape}
%for subfigures and tables
\usepackage[font=small,labelfont=bf]{caption}
\usepackage[font=footnotesize]{subfig}
%for long tables
\usepackage{longtable}
\usepackage{amsmath,amssymb}
%\usepackage[osf,sc]{mathpazo} %for upright math
\usepackage{eulervm}
\usepackage{gensymb}
\usepackage{wasysym} %for per mil sign
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
\usepackage[version=3]{mhchem} % for upright CO2 etc
\usepackage{wrapfig}%text wrapped figures
%%%%%
%%%%%FONT SETTINGS
%changing the default font
\renewcommand*{\familydefault}{\rmdefault}
\renewcommand*\rmdefault{ppl}
%%%to modify chapter heading look and size
\usepackage{calligra}%For cursive font
\usepackage[T1]{fontenc}
\usepackage{titlesec, blindtext, color}
\definecolor{brown}{rgb}{0.5, 0.2, 0.0}
\definecolor{cornellred}{rgb}{0.7, 0.11, 0.11}
\definecolor{brown_w}{rgb}{0.65, 0.16, 0.16}
%\titleformat{\chapter}[hang]{\Large\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Large\bfseries}
\titleformat{\chapter}[hang]{\normalfont\Large\bfseries}{\chaptertitlename\         \thechapter:}{1em}{} 
\titlespacing*{\chapter}{0pt}{0pt}{5pt}
\titlespacing*{\section}{0pt}{0pt}{5pt}
\usepackage{atbegshi,etoolbox}
%
%% Get underlining for headings right
\usepackage[normalem]{ulem}
%%% HEADERS & FOOTERS
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\setlength{\headheight}{50pt} 
\pagestyle{fancy} % options: empty , plain , fancy
\fancyhead{}
\renewcommand{\headrulewidth}{1pt} % customise the layout...
\renewcommand{\footrulewidth}{1pt}
\lhead{\slshape\nouppercase{\leftmark}}\chead{}\rhead{}
\lfoot{}\cfoot{}\rfoot{\thepage}
%
\def\bibfont{\footnotesize} %to decrease font size of the bibliography
%%%
%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
%%%%
\setcounter{tocdepth}{1}
\renewcommand{\bibname}{References}
\usepackage[colon,authoryear]{natbib}
%
%mytilde
\newcommand{\mytilde}{\raise.17ex\hbox{$\scriptstyle\mathtt{\sim}$}} %around tilde

抱歉文件这么长,但这是一个具有单一风格的多文件项目。

问题

正如你所看到的,我得到的红色方框列很奇怪,但其他的看起来很好......

答案1

看起来您的某些输入未使用(“纯”)ASCII 编码。如果您添加指令

\usepackage[utf8]{inputenc}

到文件thesis_style.sty,事情似乎进展顺利 - 至少就表格中某些列中的“奇怪的字符”而言。

顺便说一句,本例中的“怪异字符”是 Unicode(非 ASCII)字符 的十四个 [14!] 个实例utf8启用输入编码后,这些字符会产生印刷正确的“减号”,而不仅仅是简单的(短)破折号。您可以使用编辑器将 Unicode 减号 的十四个 [14!] 个实例替换-(简单破折号)。或者将表格数字部分中的所有简单破折号字符替换为(Unicode 减号)……如果“怪异字符”问题仍然存在,您可能应该花一些时间找出导致输入部分以意外方式编码的原因。您是否可能从其他来源复制并粘贴了部分(但不是全部)表格材料?

如果我单独发表评论:该文件thesis_style.sty当前有说明

\renewcommand*\rmdefault{ppl}

虽然该指令用于设置主要文本字体Palatino,它不会影响数学模式下的任何材料排版。你真的应该用

\usepackage{mathpazo}

或者——假设你有一个相当最新的 TeX 发行版——

\usepackage{newpxtext,newpxmath}

相关内容