如何使页眉中的垂直条倾斜?

如何使页眉中的垂直条倾斜?

我知道有解决方案,但我不想更改文件的编码,即从 utf8 更改为 T1。我想获取以下标题,但它不起作用。 在此处输入图片描述

在此处输入图片描述

一位朋友建议我将以下 renewcommand 与 结合使用\slshape,但我不太确定如何将其合并到我的fancyhdr编码中。

\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter\ \textbar\ #1}{}}

我该如何修复我的问题以获得上述标题样式。我当前的编码如下:

\documentclass[envcountchap,sectrefs,12pt]{svmono} 
\usepackage[utf8]{inputenc}
\usepackage[paperwidth=8.5in,paperheight=11in,includeall,
                  twoside,inner=1in,outer=0.5in,top=1cm,bottom=0.7cm,
                  marginparwidth=1.75in,headsep=0.25in,heightrounded]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
%\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter\ \textbar\ #1}{}}
\fancyhead[RE]{\ifnum\value{chapter}=0 \runheadsize\runheadstyle\slshape\leftmark \fi
            %The chapter number only if = 0
            \ifnum\value{chapter}>0 \slshape Experiment\ \thechapter\ |\ \leftmark \fi %This LINE 
            %The chapter number only if it's greater than 0
            }
\fancyhead[LO]{\runheadsize\runheadstyle\itshape\rightmark}
\fancyhead[LE,RO]{\ifnum\value{chapter}=0 \runheadsize\runheadstyle\itshape\thepage \fi%
                \ifnum\value{chapter}>0 \runheadsize\runheadstyle\thepage \fi}
\fancypagestyle{plain}{%
  \renewcommand{\headrulewidth}{0pt}%
  \fancyhf{}%
  \fancyfoot[RE,LO]{\runheadsize\runheadstyle\thepage}%
}
\begin{document}

\mainmatter
\chapter{Introduction to General Chemistry Laboratory} \label{chapter:1.ICL}
\markboth{Introduction to Chemistry Laboratory}{}

This lab is designed to introduce you to the general chemistry lab: the physical facilities, the equipment we will be using, and basic skills in data collection and analysis that we will expect you to know.

\section{Background: Equipment and Glassware} \label{section:1.Background}

Throughout the semester, we will be using different pieces of equipment and glassware; it is important that you know the name of what you will be using, as well as when it is appropriate to use it. A discussion of some of the most common types of glassware and equipment is included here. Pictures of these, and other pieces of equipment, are available on p. \tit{\pageref{section:Glass}} of this lab manual. Other glassware and equipment will be presented to you during the course of the semester as needed.

\subsection{Lab Glassware} \label{subsection:LG}

Lab glassware is typically made of \tit{borosilicate} glass (name brands you may be familiar with include Pyrex and Kimax). This special kind of glass is more resistant to chemicals and heat than regular glass, which means we can use it without worrying too much about it being etched with chemicals, or shattering when the temperature changes suddenly, like regular glass might.
\end{document}

答案1

你写,

我不想更改我的文件的编码,即将 utf8 更改为 T1。

事实上,并不冲突:utf8指定一个输入编码时T1指定输出,或者更准确地说,字体编码。

文档类的默认字体编码svmono似乎是OT1。正如您(重新)发现的那样,|在文本模式下无法按预期“工作”。(顺便说一下,>和符号也是如此!)此外,会产生垂直而不是倾斜的“|”符号。<\textbar

但是,如果你添加指令

\usepackage[T1]{fontenc}

序言部分,|正如预期的那样。当然,你可以自由地用|:\textbar替换T1字体编码生效的情况下,其输出将是倾斜的酒吧也是如此。

答案2

你好像想要\textup{/}

\RequirePackage{fix-cm}
\documentclass[envcountchap,sectrefs,12pt]{svmono} 
\usepackage[utf8]{inputenc}

\usepackage{lipsum}

\usepackage[
  paperwidth=8.5in,
  paperheight=11in,includeall,
  twoside,
  inner=1in,
  outer=0.5in,
  top=1cm,
  bottom=0.7cm,
  marginparwidth=1.75in,
  headsep=0.25in,
  heightrounded
]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{%
  \runheadsize\runheadstyle\slshape
  %The chapter number only if > 0
  \ifnum\value{chapter}>0
    Experiment \thechapter\ \textup{/}\ 
  \fi
  \leftmark
}
\fancyhead[LO]{\runheadsize\runheadstyle\slshape\rightmark}
\fancyhead[LE,RO]{%
  \runheadsize\runheadstyle
  \ifnum\value{chapter}=0 \itshape\fi
  \thepage
}
\fancypagestyle{plain}{%
  \renewcommand{\headrulewidth}{0pt}%
  \fancyhf{}%
  \fancyfoot[RE,LO]{\runheadsize\runheadstyle\thepage}%
}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}

\newcommand{\tit}{\textit}

\begin{document}

\mainmatter
\chapter{Introduction to General Chemistry Laboratory} \label{chapter:1.ICL}
%\markboth{Introduction to Chemistry Laboratory}{}

This lab is designed to introduce you to the general chemistry lab: the physical 
facilities, the equipment we will be using, and basic skills in data collection 
and analysis that we will expect you to know.

\section{Background: Equipment and Glassware} \label{section:1.Background}

Throughout the semester, we will be using different pieces of equipment and glassware; 
it is important that you know the name of what you will be using, as well as when it 
is appropriate to use it. A discussion of some of the most common types of glassware 
and equipment is included here. Pictures of these, and other pieces of equipment, are 
available on p. \tit{\pageref{section:Glass}} of this lab manual. Other glassware and 
equipment will be presented to you during the course of the semester as needed.

\subsection{Lab Glassware} \label{subsection:LG}

Lab glassware is typically made of \tit{borosilicate} glass (name brands you may be 
familiar with include Pyrex and Kimax). This special kind of glass is more resistant 
to chemicals and heat than regular glass, which means we can use it without worrying 
too much about it being etched with chemicals, or shattering when the temperature 
changes suddenly, like regular glass might.

\lipsum[1-20]

\end{document}

我做了一些修改来优化代码。我还更改了\itshape标题中的部分,以匹配\slshape章节。

在此处输入图片描述

相关内容