我需要在我的方程式中清楚地识别两个对象,波浪号和横杠作为变量运算符。然而,它们几乎无法辨认,而且实际上不可微分,特别是当它们出现在分数的分母中时。
我想继续在我的文本中引用变量\tilde
,\bar
而不是引入新命令。如果这意味着分数外面的横线和波浪号有“太多”空间,我很乐意承担这个代价。
我可以在序言中做些什么来使它们更清晰易读吗?
% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = pdflatexmk
\documentclass[11pt]{article}
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
\usepackage{dcolumn}
\usepackage{booktabs}
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\newcommand{\mbeq}{\overset{!}{=}}
\usepackage{epstopdf}
\usepackage[utf8]{inputenc}
\usepackage{marginnote}
\renewcommand*{\marginfont}{\color{red}\sffamily}
\usepackage[backgroundcolor=green, linecolor=green]{todonotes}
\usepackage{placeins}
\usepackage{filecontents}
\usepackage{amsthm}
\usepackage[round]{natbib}
\usepackage[notref]{showkeys}
\bibliographystyle{chicago}
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
\renewcommand{\topfraction}{0.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.85}
\renewcommand\thesubsection{\thesection.\alph{subsection}}
\usepackage[
colorlinks=true, %no frame around URL
urlcolor=black, %no colors
menucolor=black, %no colors
linkcolor=black, %no colors
citecolor=black,
bookmarks=true, %tree-like TOC
bookmarksopen=true, %expanded when starting
hyperfootnotes=false, %no referencing of footnotes, does not compile
pdfpagemode=UseOutlines %show the bookmarks when starting the pdf viewer
]{hyperref}
\urlstyle{same}
\date{}
\begin{document}
\begin{align*}
\bar p_x &=\begin{cases} a^\frac{1}{\bar\theta} & i < \gamma \\
a^\frac{1}{\tilde\theta} & i \geq \gamma \\
\end{cases}
\end{align*}
\end{document}
答案1
我认为分母上的横线\theta
是问题所在。以下是一些变化:
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\bar p_x & =
\begin{cases}
a^\frac{1}{\bar\theta} & i < \gamma \\
a^\frac{1}{\tilde\theta} & i \geq \gamma \\
\end{cases}\\
\bar p_x & =
\begin{cases}
a^{1/\bar\theta} & i < \gamma \\
a^{1/\tilde\theta} & i \geq \gamma \\
\end{cases}\\
\bar p_x & =
\begin{cases}
a^{\bar\theta^{-1}} & i < \gamma \\
a^{\tilde\theta^{-1}} & i \geq \gamma \\
\end{cases}\\
\bar p_x & =
\begin{cases}
a^\frac{1}{
\vbox{\kern.2ex\hbox{$\scriptscriptstyle\bar\theta$}}
} & i < \gamma \\
a^\frac{1}{\tilde\theta} & i \geq \gamma \\
\end{cases}
\end{align*}
\end{document}
后一种宏形式的变化。\barfix
在强制参数中的数学符号周围添加一个空格。前面的可选参数允许微调。
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\makeatletter
\newcommand*{\barfix}[2][.175ex]{%
\mathpalette{\@barfix{#1}}{#2}%
}
\newcommand*{\@barfix}[3]{%
% #1: space
% #2: math style
% #3: symbol
\vbox{%
\kern#1\relax
\hbox{$#2#3\m@th$}%
}%
}
\makeatother
\begin{document}
\begin{align*}
\bar p_x & =
\begin{cases}
a^\frac{1}{\barfix{\bar\theta}} & i < \gamma \\
a^\frac{1}{\barfix[.1ex]{\tilde\theta}} & i \geq \gamma \\
\end{cases}
\end{align*}
\end{document}
可以在其之上定义其他宏\barfix
,例如:
\newcommand*{\barF}[1]{\barfix{\bar#1}}
\newcommand*{\tildeF}[1]{\barfix[.15ex]{\tilde#1}}
...
$\barF\theta, \tildeF\theta$