如何调整文本各种颜色的深度

如何调整文本各种颜色的深度

问题:1

如何调整文档中不同颜色的深度?

问题2

我想添加指定宽度和长度的页眉和页脚,甚至想在左、中、右页眉处写一些文本,在页脚处也写一些文本。如果我在定义geometry文档(边距)时犯了错误,请指导我。

梅威瑟:

\documentclass[12pt, a4paper]{article}
\usepackage[top=0.6 in,bottom=0.6 in,left=0.6 in,right=0.6 in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[shortlabels]{enumitem}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\usepackage{parskip}
%line spacing
\renewcommand{\baselinestretch}{0.95} 
%reduce top margin
\addtolength{\headsep}{-0.45cm}
\begin{document}
    \large
\begin{center}
    \textcolor{Magenta}{\textbf{Exercises}} 
\end{center} 
\textcolor{Magenta}{\textbf{Example}}

\textcolor{Blue}{\textbf{Body of question Body of question Body of question Body of question}}

\textcolor{Magenta}{\textbf{Solution}}

\textcolor{Green}{\textbf{Body of solution Body of solution Body of solution Body of solution}}
\end{document} 










                                       

答案1

xcolor(的文档这里) 和fancyhdr这里)将帮助您进一步定制内容,但这将帮助您入门。

\documentclass{article}
\usepackage{xcolor}
\usepackage{fancyhdr}
\lhead{LeftHeader}
\chead{CentreHeader}
\rhead{RightHeader}
\lfoot{LeftFooter}
\cfoot{CentreFooter}
\rfoot{RightFooter}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\pagestyle{fancy}
\begin{document}
\section*{Question 1}

\subsection*{Shades}

\textcolor{magenta}{magenta} \\
\textcolor{magenta!90!black}{magenta!90!black} \\
\textcolor{magenta!80!black}{magenta!80!black} \\
\textcolor{magenta!70!black}{magenta!70!black} \\
\textcolor{magenta!60!black}{magenta!60!black} \\
\textcolor{magenta!50!black}{magenta!50!black} \\
\textcolor{magenta!40!black}{magenta!40!black} \\
\textcolor{magenta!30!black}{magenta!30!black} \\
\textcolor{magenta!20!black}{magenta!20!black} \\
\textcolor{magenta!10!black}{magenta!10!black} \\
\textcolor{black}{black}

\subsection*{Tints}

\textcolor{magenta}{magenta} \\
\textcolor{magenta!90!white}{magenta!90!white} \\
\textcolor{magenta!80!white}{magenta!80!white} \\
\textcolor{magenta!70!white}{magenta!70!white} \\
\textcolor{magenta!60!white}{magenta!60!white} \\
\textcolor{magenta!50!white}{magenta!50!white} \\
\textcolor{magenta!40!white}{magenta!40!white} \\
\textcolor{magenta!30!white}{magenta!30!white} \\
\textcolor{magenta!20!white}{magenta!20!white} \\
\textcolor{magenta!10!white}{magenta!10!white} \\
\textcolor{white}{white}

\section*{Question 2}

Add this to your preamble:

\begin{verbatim}
\usepackage{fancyhdr}
\lhead{LeftHeader}
\chead{CentreHeader}
\rhead{RightHeader}
\lfoot{LeftFooter}
\cfoot{CentreFooter}
\rfoot{RightFooter}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\pagestyle{fancy}
\end{verbatim}

\end{document} 

输出

相关内容