更改乳胶中的字体
Changing the font in latex
我正在使用乳胶写报告。但是,当我想往里面添加一个甘特图的时候,发现这个甘特图之后的所有内容的字体都变了。那么谁能告诉我如何找回它呢?谢谢!
这是本章的代码,包括甘特图
\section{Risk Analysis}
\section{Project Plan}
\definecolor{barblue}{RGB}{153,204,254}
\definecolor{groupblue}{RGB}{51,102,254}
\definecolor{linkred}{RGB}{165,0,33}
\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
\sffamily
\begin{ganttchart}[
canvas/.append style={fill=none, draw=black!5, line width=.75pt},
hgrid style/.style={draw=black!5, line width=.75pt},
vgrid={*1{draw=black!5, line width=.75pt}},
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=2cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
group incomplete/.append style={fill=groupblue},
group left shift=0,
group right shift=0,
group height=.5,
group peaks tip position=0,
group label node/.append style={left=.6cm},
group progress label font=\bfseries\small,
link/.style={-latex, line width=1.5pt, linkred},
link label font=\scriptsize\bfseries,
link label node/.append style={below left=-2pt and 0pt}
]{1}{14}
\gantttitle[
title label node/.append style={below left=7pt and -3pt}
]{WEEKS:\quad1}{1}
\gantttitlelist{2,...,14}{1} \
\ganttgroup[progress=0]{WBS 1 More Research}{1}{1}\
\ganttgroup[progress=0]{WBS 2 Speaker Verification}{2}{3} \
\ganttgroup[progress=0]{WBS 3 StarGAN-VC}{4}{5} \
\ganttgroup[progress=0]{WBS 4 SV-StarGAN-VC}{6}{11} \
\ganttgroup[progress=0]{WBS 5 Document}{12}{14} \
\end{ganttchart}
\section{Another Section if You Need It}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
这是 main.tex 的代码:
\documentclass[11pt,oneside]{book}
\usepackage[margin=1.2in]{geometry}
\usepackage{setspace}
\usepackage[toc,page]{appendix}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{pgfgantt}
\usepackage{float}
\usepackage[none]{hyphenat} % turn hyphenation off by default
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{hypertex=true,
colorlinks=true,
linkcolor=blue,
anchorcolor=blue,
citecolor=blue}
\begin{document}
\frontmatter
\begin{titlepage}
\end{titlepage}
% -------------------------------------------------------------------
% Abstract
% -------------------------------------------------------------------
\input{chapters/abstract.tex}
% -------------------------------------------------------------------
% TOC etc
% -------------------------------------------------------------------
\tableofcontents
\listoffigures
\listoftables
\setstretch{1.1}
\mainmatter
\input{chapters/Introduction.tex}
\input{chapters/Literature.tex}
\input{chapters/Analysis.tex}
\input{chapters/Planning.tex}
\input{chapters/Conclusions.tex}
\bibliographystyle{acm}
\bibliography{mybibliography}
\begin{appendices}
\input{chapters/appendixA.tex}
\input{chapters/appendixB.tex}
\end{appendices}
\end{document}
我知道是因为我在写甘特图的时候换了字体。但我只想知道如何获取甘特图后内容的字体?
您明确告诉 latex 使用 \sffamily
更改剩余文档的字体。如果您希望它只影响图表,请在组内使用它或之后切换回 \rmfamily
。
\documentclass[11pt,oneside]{book}
\usepackage[margin=1.2in]{geometry}
\usepackage{setspace}
\usepackage[toc,page]{appendix}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{pgfgantt}
\usepackage{float}
\usepackage[none]{hyphenat} % turn hyphenation off by default
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{
%hypertex=true,
colorlinks=true,
linkcolor=blue,
anchorcolor=blue,
citecolor=blue}
\begin{document}
\section{Risk Analysis}
\section{Project Plan}
\definecolor{barblue}{RGB}{153,204,254}
\definecolor{groupblue}{RGB}{51,102,254}
\definecolor{linkred}{RGB}{165,0,33}
\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
{
\sffamily
\begin{ganttchart}[
canvas/.append style={fill=none, draw=black!5, line width=.75pt},
hgrid style/.style={draw=black!5, line width=.75pt},
vgrid={*1{draw=black!5, line width=.75pt}},
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=2cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
group incomplete/.append style={fill=groupblue},
group left shift=0,
group right shift=0,
group height=.5,
group peaks tip position=0,
group label node/.append style={left=.6cm},
group progress label font=\bfseries\small,
link/.style={-latex, line width=1.5pt, linkred},
link label font=\scriptsize\bfseries,
link label node/.append style={below left=-2pt and 0pt}
]{1}{14}
\gantttitle[
title label node/.append style={below left=7pt and -3pt}
]{WEEKS:\quad1}{1}
\gantttitlelist{2,...,14}{1} \
\ganttgroup[progress=0]{WBS 1 More Research}{1}{1}\
\ganttgroup[progress=0]{WBS 2 Speaker Verification}{2}{3} \
\ganttgroup[progress=0]{WBS 3 StarGAN-VC}{4}{5} \
\ganttgroup[progress=0]{WBS 4 SV-StarGAN-VC}{6}{11} \
\ganttgroup[progress=0]{WBS 5 Document}{12}{14} \
\end{ganttchart}
}
\section{Another Section if You Need It}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
\end{document}
我正在使用乳胶写报告。但是,当我想往里面添加一个甘特图的时候,发现这个甘特图之后的所有内容的字体都变了。那么谁能告诉我如何找回它呢?谢谢! 这是本章的代码,包括甘特图
\section{Risk Analysis}
\section{Project Plan}
\definecolor{barblue}{RGB}{153,204,254}
\definecolor{groupblue}{RGB}{51,102,254}
\definecolor{linkred}{RGB}{165,0,33}
\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
\sffamily
\begin{ganttchart}[
canvas/.append style={fill=none, draw=black!5, line width=.75pt},
hgrid style/.style={draw=black!5, line width=.75pt},
vgrid={*1{draw=black!5, line width=.75pt}},
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=2cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
group incomplete/.append style={fill=groupblue},
group left shift=0,
group right shift=0,
group height=.5,
group peaks tip position=0,
group label node/.append style={left=.6cm},
group progress label font=\bfseries\small,
link/.style={-latex, line width=1.5pt, linkred},
link label font=\scriptsize\bfseries,
link label node/.append style={below left=-2pt and 0pt}
]{1}{14}
\gantttitle[
title label node/.append style={below left=7pt and -3pt}
]{WEEKS:\quad1}{1}
\gantttitlelist{2,...,14}{1} \
\ganttgroup[progress=0]{WBS 1 More Research}{1}{1}\
\ganttgroup[progress=0]{WBS 2 Speaker Verification}{2}{3} \
\ganttgroup[progress=0]{WBS 3 StarGAN-VC}{4}{5} \
\ganttgroup[progress=0]{WBS 4 SV-StarGAN-VC}{6}{11} \
\ganttgroup[progress=0]{WBS 5 Document}{12}{14} \
\end{ganttchart}
\section{Another Section if You Need It}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
这是 main.tex 的代码:
\documentclass[11pt,oneside]{book}
\usepackage[margin=1.2in]{geometry}
\usepackage{setspace}
\usepackage[toc,page]{appendix}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{pgfgantt}
\usepackage{float}
\usepackage[none]{hyphenat} % turn hyphenation off by default
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{hypertex=true,
colorlinks=true,
linkcolor=blue,
anchorcolor=blue,
citecolor=blue}
\begin{document}
\frontmatter
\begin{titlepage}
\end{titlepage}
% -------------------------------------------------------------------
% Abstract
% -------------------------------------------------------------------
\input{chapters/abstract.tex}
% -------------------------------------------------------------------
% TOC etc
% -------------------------------------------------------------------
\tableofcontents
\listoffigures
\listoftables
\setstretch{1.1}
\mainmatter
\input{chapters/Introduction.tex}
\input{chapters/Literature.tex}
\input{chapters/Analysis.tex}
\input{chapters/Planning.tex}
\input{chapters/Conclusions.tex}
\bibliographystyle{acm}
\bibliography{mybibliography}
\begin{appendices}
\input{chapters/appendixA.tex}
\input{chapters/appendixB.tex}
\end{appendices}
\end{document}
我知道是因为我在写甘特图的时候换了字体。但我只想知道如何获取甘特图后内容的字体?
您明确告诉 latex 使用 \sffamily
更改剩余文档的字体。如果您希望它只影响图表,请在组内使用它或之后切换回 \rmfamily
。
\documentclass[11pt,oneside]{book}
\usepackage[margin=1.2in]{geometry}
\usepackage{setspace}
\usepackage[toc,page]{appendix}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{pgfgantt}
\usepackage{float}
\usepackage[none]{hyphenat} % turn hyphenation off by default
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{
%hypertex=true,
colorlinks=true,
linkcolor=blue,
anchorcolor=blue,
citecolor=blue}
\begin{document}
\section{Risk Analysis}
\section{Project Plan}
\definecolor{barblue}{RGB}{153,204,254}
\definecolor{groupblue}{RGB}{51,102,254}
\definecolor{linkred}{RGB}{165,0,33}
\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}
\setganttlinklabel{s-s}{START-TO-START}
\setganttlinklabel{f-s}{FINISH-TO-START}
\setganttlinklabel{f-f}{FINISH-TO-FINISH}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
{
\sffamily
\begin{ganttchart}[
canvas/.append style={fill=none, draw=black!5, line width=.75pt},
hgrid style/.style={draw=black!5, line width=.75pt},
vgrid={*1{draw=black!5, line width=.75pt}},
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=2cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
group incomplete/.append style={fill=groupblue},
group left shift=0,
group right shift=0,
group height=.5,
group peaks tip position=0,
group label node/.append style={left=.6cm},
group progress label font=\bfseries\small,
link/.style={-latex, line width=1.5pt, linkred},
link label font=\scriptsize\bfseries,
link label node/.append style={below left=-2pt and 0pt}
]{1}{14}
\gantttitle[
title label node/.append style={below left=7pt and -3pt}
]{WEEKS:\quad1}{1}
\gantttitlelist{2,...,14}{1} \
\ganttgroup[progress=0]{WBS 1 More Research}{1}{1}\
\ganttgroup[progress=0]{WBS 2 Speaker Verification}{2}{3} \
\ganttgroup[progress=0]{WBS 3 StarGAN-VC}{4}{5} \
\ganttgroup[progress=0]{WBS 4 SV-StarGAN-VC}{6}{11} \
\ganttgroup[progress=0]{WBS 5 Document}{12}{14} \
\end{ganttchart}
}
\section{Another Section if You Need It}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
\end{document}