如何为整个文档正确选择具有压缩宽度的 Helvetica?
方法 1
为此,我使用了helvet
包并设置:
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\seriesdefault}{c}
以下 MWE 在不同系统上给出不同的结果。
\documentclass{scrartcl}
%\documentclass{article}
\usepackage{helvet}
\usepackage{lipsum}
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\seriesdefault}{c}
%\renewcommand{\bfdefault}{bc}
\author{Author}
\title{Title}
\begin{document}
\maketitle
\section{Section}
\lipsum
\end{document}
在我的本地机器(TL2019)上,输出正如我预期的那样,在 Overleaf(TL2019)上,文本和标题字体仍然具有标准宽度。
背面日志:
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex 2019.12.13) 13 MAY 2020 12:59
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**Stadtgeographie.tex
(/compile/Stadtgeographie.tex
LaTeX2e <2019-10-01> patch level 3
(/usr/local/texlive/2019/texmf-dist/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2019/12/23 v3.28 KOMA-Script document class (article)
(/usr/local/texlive/2019/texmf-dist/tex/latex/koma-script/scrkbase.sty
Package: scrkbase 2019/12/23 v3.28 KOMA-Script package (KOMA-Script-dependent b
asics and keyval usage)
(/usr/local/texlive/2019/texmf-dist/tex/latex/koma-script/scrbase.sty
Package: scrbase 2019/12/23 v3.28 KOMA-Script package (KOMA-Script-independent
basics and keyval usage)
(/usr/local/texlive/2019/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
) (/usr/local/texlive/2019/texmf-dist/tex/latex/koma-script/scrlfile.sty
Package: scrlfile 2019/12/23 v3.28 KOMA-Script package (loading files)
))) (/usr/local/texlive/2019/texmf-dist/tex/latex/koma-script/tocbasic.sty
Package: tocbasic 2019/12/23 v3.28 KOMA-Script package (handling toc-files)
\scr@dte@tocline@numberwidth=\skip41
\scr@dte@tocline@numbox=\box27
)
Package tocbasic Info: omitting babel extension for `toc'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `toc' on input line 137.
Class scrartcl Info: File `scrsize11pt.clo' used instead of
(scrartcl) file `scrsize11.clo' to setup font sizes on input line 221
1.
(/usr/local/texlive/2019/texmf-dist/tex/latex/koma-script/scrsize11pt.clo
File: scrsize11pt.clo 2019/12/23 v3.28 KOMA-Script font size class option (11pt
)
) (/usr/local/texlive/2019/texmf-dist/tex/latex/koma-script/typearea.sty
Package: typearea 2019/12/23 v3.28 KOMA-Script package (type area)
\ta@bcor=\skip42
\ta@div=\count80
\ta@hblk=\skip43
\ta@vblk=\skip44
\ta@temp=\skip45
\footheight=\skip46
Package typearea Info: These are the values describing the layout:
(typearea) DIV = 10
(typearea) BCOR = 0.0pt
(typearea) \paperwidth = 597.50793pt
(typearea) \textwidth = 418.25555pt
(typearea) DIV departure = -6%
(typearea) \evensidemargin = 17.3562pt
(typearea) \oddsidemargin = 17.3562pt
(typearea) \paperheight = 845.04694pt
(typearea) \textheight = 595.80026pt
(typearea) \topmargin = -25.16531pt
(typearea) \headheight = 17.0pt
(typearea) \headsep = 20.40001pt
(typearea) \topskip = 11.0pt
(typearea) \footskip = 47.6pt
(typearea) \baselineskip = 13.6pt
(typearea) on input line 1718.
)
\c@part=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\scr@dte@section@maxnumwidth=\skip47
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl) for `\section on input line 4722.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl) for `\section on input line 4722.
\scr@dte@part@maxnumwidth=\skip48
Class scrartcl Info: using compatibility default `afterindent=false'
(scrartcl) for `\part on input line 4730.
\scr@dte@subsection@maxnumwidth=\skip49
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl) for `\subsection on input line 4740.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl) for `\subsection on input line 4740.
\scr@dte@subsubsection@maxnumwidth=\skip50
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl) for `\subsubsection on input line 4750.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl) for `\subsubsection on input line 4750.
\scr@dte@paragraph@maxnumwidth=\skip51
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl) for `\paragraph on input line 4760.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl) for `\paragraph on input line 4760.
\scr@dte@subparagraph@maxnumwidth=\skip52
Class scrartcl Info: using compatibility default `runin=bysign'
(scrartcl) for `\subparagraph on input line 4770.
Class scrartcl Info: using compatibility default `afterindent=bysign'
(scrartcl) for `\subparagraph on input line 4770.
\abovecaptionskip=\skip53
\belowcaptionskip=\skip54
\c@pti@nb@sid@b@x=\box28
Package tocbasic Info: omitting babel extension for `lof'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `lof' on input line 6001.
\scr@dte@figure@maxnumwidth=\skip55
\c@figure=\count87
Package tocbasic Info: omitting babel extension for `lot'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `lot' on input line 6013.
\scr@dte@table@maxnumwidth=\skip56
\c@table=\count88
Class scrartcl Info: Redefining `\numberline' on input line 6177.
\bibindent=\dimen102
) (/usr/local/texlive/2019/texmf-dist/tex/latex/psnfss/helvet.sty
Package: helvet 2005/04/12 PSNFSS-v9.2a (WaS)
) (/usr/local/texlive/2019/texmf-dist/tex/latex/lipsum/lipsum.sty (/usr/local/t
exlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2019-11-07 L3 programming layer (loader)
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex
Package: expl3 2019-11-07 L3 programming layer (code)
\c_max_int=\count89
\l_tmpa_int=\count90
\l_tmpb_int=\count91
\g_tmpa_int=\count92
\g_tmpb_int=\count93
\l__seq_internal_a_int=\count94
\l__seq_internal_b_int=\count95
\g__kernel_prg_map_int=\count96
\c__ior_term_noprompt_ior=\count97
\c_log_iow=\count98
\l_iow_line_count_int=\count99
\l__iow_line_target_int=\count100
\l__iow_one_indent_int=\count101
\l__iow_indent_int=\count102
\c_zero_dim=\dimen103
\c_max_dim=\dimen104
\l_tmpa_dim=\dimen105
\l_tmpb_dim=\dimen106
\g_tmpa_dim=\dimen107
\g_tmpb_dim=\dimen108
\c_zero_skip=\skip57
\c_max_skip=\skip58
\l_tmpa_skip=\skip59
\l_tmpb_skip=\skip60
\g_tmpa_skip=\skip61
\g_tmpb_skip=\skip62
\c_zero_muskip=\muskip10
\c_max_muskip=\muskip11
\l_tmpa_muskip=\muskip12
\l_tmpb_muskip=\muskip13
\g_tmpa_muskip=\muskip14
\g_tmpb_muskip=\muskip15
\l_keys_choice_int=\count103
\l__intarray_loop_int=\count104
\c__intarray_sp_dim=\dimen109
\g__intarray_font_int=\count105
\c__fp_leading_shift_int=\count106
\c__fp_middle_shift_int=\count107
\c__fp_trailing_shift_int=\count108
\c__fp_big_leading_shift_int=\count109
\c__fp_big_middle_shift_int=\count110
\c__fp_big_trailing_shift_int=\count111
\c__fp_Bigg_leading_shift_int=\count112
\c__fp_Bigg_middle_shift_int=\count113
\c__fp_Bigg_trailing_shift_int=\count114
\c__kernel_randint_max_int=\count115
\g__fp_array_int=\count116
\l__fp_array_loop_int=\count117
\l__sort_length_int=\count118
\l__sort_min_int=\count119
\l__sort_top_int=\count120
\l__sort_max_int=\count121
\l__sort_true_max_int=\count122
\l__sort_block_int=\count123
\l__sort_begin_int=\count124
\l__sort_end_int=\count125
\l__sort_A_int=\count126
\l__sort_B_int=\count127
\l__sort_C_int=\count128
\l__str_internal_int=\count129
\c__str_replacement_char_int=\count130
\l__tl_analysis_normal_int=\count131
\l__tl_analysis_index_int=\count132
\l__tl_analysis_nesting_int=\count133
\l__tl_analysis_type_int=\count134
\l__regex_internal_a_int=\count135
\l__regex_internal_b_int=\count136
\l__regex_internal_c_int=\count137
\l__regex_balance_int=\count138
\l__regex_group_level_int=\count139
\l__regex_mode_int=\count140
\c__regex_cs_in_class_mode_int=\count141
\c__regex_cs_mode_int=\count142
\l__regex_catcodes_int=\count143
\l__regex_default_catcodes_int=\count144
\c__regex_catcode_D_int=\count145
\c__regex_catcode_S_int=\count146
\c__regex_catcode_L_int=\count147
\c__regex_catcode_O_int=\count148
\c__regex_catcode_A_int=\count149
\c__regex_all_catcodes_int=\count150
\l__regex_show_lines_int=\count151
\l__regex_min_state_int=\count152
\l__regex_max_state_int=\count153
\l__regex_left_state_int=\count154
\l__regex_right_state_int=\count155
\l__regex_capturing_group_int=\count156
\l__regex_min_pos_int=\count157
\l__regex_max_pos_int=\count158
\l__regex_curr_pos_int=\count159
\l__regex_start_pos_int=\count160
\l__regex_success_pos_int=\count161
\l__regex_curr_char_int=\count162
\l__regex_curr_catcode_int=\count163
\l__regex_last_char_int=\count164
\l__regex_case_changed_char_int=\count165
\l__regex_curr_state_int=\count166
\l__regex_step_int=\count167
\l__regex_min_active_int=\count168
\l__regex_max_active_int=\count169
\l__regex_replacement_csnames_int=\count170
\l__regex_match_count_int=\count171
\l__regex_min_submatch_int=\count172
\l__regex_submatch_int=\count173
\l__regex_zeroth_submatch_int=\count174
\g__regex_trace_regex_int=\count175
\c_empty_box=\box29
\l_tmpa_box=\box30
\l_tmpb_box=\box31
\g_tmpa_box=\box32
\g_tmpb_box=\box33
\l__box_top_dim=\dimen110
\l__box_bottom_dim=\dimen111
\l__box_left_dim=\dimen112
\l__box_right_dim=\dimen113
\l__box_top_new_dim=\dimen114
\l__box_bottom_new_dim=\dimen115
\l__box_left_new_dim=\dimen116
\l__box_right_new_dim=\dimen117
\l__box_internal_box=\box34
\l__coffin_internal_box=\box35
\l__coffin_internal_dim=\dimen118
\l__coffin_offset_x_dim=\dimen119
\l__coffin_offset_y_dim=\dimen120
\l__coffin_x_dim=\dimen121
\l__coffin_y_dim=\dimen122
\l__coffin_x_prime_dim=\dimen123
\l__coffin_y_prime_dim=\dimen124
\c_empty_coffin=\box36
\l__coffin_aligned_coffin=\box37
\l__coffin_aligned_internal_coffin=\box38
\l_tmpa_coffin=\box39
\l_tmpb_coffin=\box40
\g_tmpa_coffin=\box41
\g_tmpb_coffin=\box42
\l__coffin_bounding_shift_dim=\dimen125
\l__coffin_left_corner_dim=\dimen126
\l__coffin_right_corner_dim=\dimen127
\l__coffin_bottom_corner_dim=\dimen128
\l__coffin_top_corner_dim=\dimen129
\l__coffin_scaled_total_height_dim=\dimen130
\l__coffin_scaled_width_dim=\dimen131
\c__coffin_empty_coffin=\box43
\l__coffin_display_coffin=\box44
\l__coffin_display_coord_coffin=\box45
\l__coffin_display_pole_coffin=\box46
\l__coffin_display_offset_dim=\dimen132
\l__coffin_display_x_dim=\dimen133
\l__coffin_display_y_dim=\dimen134
\g__char_data_ior=\read1
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/l3deprecation.def
File: l3deprecation.def 2019-04-06 v L3 Deprecated functions
)) (/usr/local/texlive/2019/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.de
f
File: l3backend-pdfmode.def 2019-04-06 L3 backend support: PDF mode
\l__kernel_color_stack_int=\count176
\l__pdf_internal_box=\box47
)) (/usr/local/texlive/2019/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
Package: xparse 2019-10-11 L3 Experimental document command parser
\l__xparse_current_arg_int=\count177
\g__xparse_grabber_int=\count178
\l__xparse_m_args_int=\count179
\l__xparse_v_nesting_int=\count180
)
Package: lipsum 2019/01/02 v2.2 150 paragraphs of Lorem Ipsum dummy text
(/usr/local/texlive/2019/texmf-dist/tex/latex/lipsum/lipsum.ltd.tex
File: lipsum.ltd.tex 2019/01/02 v2.2 The Lorem ipsum dummy text
)) (/compile/output.aux)
\openout1 = `output.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Trying to load font information for OT1+phv on input line 1
4.
(/usr/local/texlive/2019/texmf-dist/tex/latex/psnfss/ot1phv.fd
File: ot1phv.fd 2001/06/04 scalable font definitions for OT1/phv.
)
LaTeX Font Warning: Font shape `OT1/phv/c/n' undefined
(Font) using `OT1/phv/m/n' instead on input line 14.
Package scrbase Info: activating english \contentsname on input line 14.
Package scrbase Info: activating english \listfigurename on input line 14.
Package scrbase Info: activating english \listtablename on input line 14.
LaTeX Font Info: Font shape `OT1/phv/bx/n' in size <10.95> not available
(Font) Font shape `OT1/phv/b/n' tried instead on input line 16.
LaTeX Font Info: Font shape `OT1/phv/bx/n' in size <20.74> not available
(Font) Font shape `OT1/phv/b/n' tried instead on input line 16.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <14.4> on input line 16.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 16.
LaTeX Font Info: Font shape `OT1/phv/bx/n' in size <14.4> not available
(Font) Font shape `OT1/phv/b/n' tried instead on input line 17.
[1
{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] [2] (/c
ompile/output.aux)
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
)
Here is how much of TeX's memory you used:
13078 strings out of 492164
266380 string characters out of 6125314
666680 words of memory out of 5000000
17463 multiletter control sequences out of 15000+600000
540873 words of font info for 37 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
46i,6n,78p,10110b,317s stack positions out of 5000i,500n,10000p,200000b,80000s
{/usr/local/texlive/2019/texmf-dist/fonts/enc/dvips/base/8r.enc}</usr/local/t
exlive/2019/texmf-dist/fonts/type1/urw/helvetic/uhvb8a.pfb></usr/local/texlive/
2019/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb>
Output written on /compile/output.pdf (2 pages, 18065 bytes).
PDF statistics:
20 PDF objects out of 1000 (max. 8388607)
13 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
方法 2
在 Overleaf 设置上
\renewcommand{\seriesdefault}{mc}
\renewcommand{\bfdefault}{bc}
有效。但这会为我本地机器上的章节标题提供错误的字体宽度。日志列出了有关系列选择的警告mc
:
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 14.
LaTeX Font Info: ... okay on input line 14.
LaTeX Font Info: Trying to load font information for OT1+phv on input line 1
4.
(/usr/local/texlive/2019/texmf-dist/tex/latex/psnfss/ot1phv.fd
File: ot1phv.fd 2001/06/04 scalable font definitions for OT1/phv.
LaTeX Warning: Font shape declaration has incorrect series value `mc'.
It should not contain an `m'! Please correct it.
Found on input line 21.
LaTeX Warning: Font shape declaration has incorrect series value `mc'.
It should not contain an `m'! Please correct it.
Found on input line 24.
LaTeX Warning: Font shape declaration has incorrect series value `mc'.
It should not contain an `m'! Please correct it.
Found on input line 27.
LaTeX Warning: Font shape declaration has incorrect series value `mc'.
It should not contain an `m'! Please correct it.
Found on input line 47.
我article
也尝试了这门课程,但遇到了类似的问题。
答案1
您是否愿意使用 XeLaTeX 或 LuaLaTeX 代替 pdfLaTeX?如果是这样,以下使用该fontspec
包及其\setmainfont
宏的解决方案可能会让您感兴趣。(测试程序使用 Arial 和 Arial Narrow 主要是因为我的电脑上没有 Helvetica Condensed。)
\documentclass{article}
\usepackage{fontspec}
\newcommand\qbf{The quick brown fox jumps over the lazy dog.}
\newcommand\test{\qbf\par\textbf{\qbf}\par\textit{\qbf}\par\textit{\textbf{\qbf}}}
\begin{document}
\setmainfont{Arial}
\test
\medskip
\setmainfont{Arial Narrow}
\test
\end{document}