2

I use kpfonts, and equations like \left(\frac{1}{2}\right) or\left[\frac{1}{2}\right] produce thick parentheses etc. that look very heavy compared to the rest of the text.

Is it possible to make them to be of the same thickness as the non-adaptive version [ ] ( )?

Example:

\documentclass[]{article}
\usepackage{kpfonts}

\begin{document}

\begin{equation}
[x_j] \left[x_j\right] \left(\frac{1}{y_j}\right) \text{(some text for comparison)}
\end{equation}

\end{document}

enter image description here

  • tex has no control over this at all, the design of the larger parenthesis, just as the design of the smaller ones is in the hands of the font designer. Assuming the extended delimiters are coming from a suitable font. If you had included an example document the font usage could be debugged. – David Carlisle Jun 13 '18 at 11:15
  • I've added a picture to show what I mean. So, the only possibility is to import these delimiters from another font? – homocomputeris Jun 13 '18 at 11:37
  • yes, but also not use left/right so much (I would never use it with x_j for example). – David Carlisle Jun 13 '18 at 11:47
  • @DavidCarlisle Well, they are still too thick for fractions, matrices etc. – homocomputeris Jun 13 '18 at 11:56
  • 1
    That is the design of font designer chose, you are free to choose another font by another designer. – David Carlisle Jun 13 '18 at 12:37

2 Answers2

5

enter image description here

enter image description here

The kpfonts have a lighter weight extension font so you can copy the declarations of omxjkp.fd so they use the font from omxjkpl.fd

\documentclass{article}
\usepackage{kpfonts}
\ProvidesFile{omxjkpl.fd}
    [2006/08/15 v1.0]

\DeclareFontFamily{OMX}{jkp}{}
\DeclareFontShape{OMX}{jkp}{m}{n}{
   <-> jkplex%
}{}
\DeclareFontShape{OMX}{jkp}{bx}{n}{
   <-> jkplbex%
}{}
\DeclareFontShape{OMX}{jkp}{l}{n}{<->ssub * jkpl/m/n}{}
\DeclareFontShape{OMX}{jkp}{b}{n}{<->ssub * jkpl/bx/n}{}



\begin{document}

\[
(A)\left(A_j\right)\left(\frac{B}{C}\right)
  \left(\frac{\frac{D_a^2}{D_b}}{\frac{E_x}{E_y}}\right)
\quad
[A]\left[A_j\right]\left[\frac{B}{C}\right]
  \left[\frac{\frac{D_a^2}{D_b}}{\frac{E_x}{E_y}}\right]
\quad
\sum_0^nx^2
\]
\end{document}
David Carlisle
  • 757,742
  • Great! This works. Could you explain what <-> jkplbex% and <->ssub * jkpl/m/n mean? – homocomputeris Jun 15 '18 at 10:23
  • 1
    @homocomputeris that is standard latex syntax for loading (or for ssub substituting) a font, look in any .fd file or the latex companion. The first says at any size load jkplbex.tfm suitable scaled, and the second says at every size substitute the non-bold font that you would get for a request for jkpl/m/n instead of jkplbx/n – David Carlisle Jun 15 '18 at 10:38
3

I can't really recommend this approach except for small documents, because it is labor intensive. It requires you to

  1. change syntax from \left...\right to \scaleleftright[]{}{}{}

  2. customize the max-width (optional argument) parameter for each particular case

  3. employ the \big...\Bigg approach to get the best appearance

  4. It requires the occasional use of \vphantoms to get vertical symmetry about the math axis.

The method uses the optional argument of \scaleleftright to horizontally compress the glyphs to be no larger than the specified max-width.

The proper solution is to find a font that best suits, or else manually import just a new set of delimiters into the font.

The MWE:

\documentclass{article}
\usepackage{kpfonts,scalerel}
\begin{document}

\[
(A)\left(A_j\right)\left(\frac{B}{C}\right)
  \left(\frac{\frac{D_a^2}{D_b}}{\frac{E_x}{E_y}}\right)
\quad
[A]\left[A_j\right]\left[\frac{B}{C}\right]
  \left[\frac{\frac{D_a^2}{D_b}}{\frac{E_x}{E_y}}\right]
\]
\[
(A)\,\scaleleftright[3.1pt]{\bigl(}{A_j^{\vphantom{f}}}{\bigr)}\,
  \scaleleftright[2.8pt]{\biggl(}{\frac{B}{C}}{\biggr)}\,
  \scaleleftright[3.1pt]{\Biggl(}{\frac{\frac{D_a^2}{D_b}}{\frac{E_x}{E_y}}}{\Biggr)}
  \quad
[A]\,\scaleleftright[2.5pt]{\bigl[}{A_j^{\vphantom{f}}}{\bigr]}\,
  \scaleleftright[2.8pt]{\biggl[}{\frac{B}{C}}{\biggr]}\,
  \scaleleftright[3.1pt]{\Biggl[}{\frac{\frac{D_a^2}{D_b}}{\frac{E_x}{E_y}}}{\biggr]}
\]
\end{document}

enter image description here


Alternate syntax of \xleft[]{}...\xright[]{}

\documentclass{article}
\usepackage{kpfonts,scalerel}
\newcommand\xleft[2][99pt]{\mathopen{\scalerel*[#1]{#2}{#2}}}
\newcommand\xright[2][99pt]{\mathclose{\scalerel*[#1]{#2}{#2}}}
\begin{document}

\[
(A)\left(A_j\right)\left(\frac{B}{C}\right)
\quad
[A]\left[A_j\right]\left[\frac{B}{C}\right]
\]
\[
(A)\,\xleft[3.1pt]{\bigl(}A_j\xright[3.1pt]{\bigr)}\,
  \xleft[2.8pt]{\Bigl(}\frac{B}{C}\xright[2.8pt]{\Bigr)}\,
  \quad
[A]\,\xleft[2.4pt]{\bigl[}A_j\xright[2.4pt]{\bigr]}\,
  \xleft[2.8pt]{\Bigl[}\frac{B}{C}\xright[2.8pt]{\Bigr]}\,
\]
\end{document}

enter image description here

  • This is, obviously, a solution and looks much better. I'm afraid, it is not suitable for a 100-page document. – homocomputeris Jun 13 '18 at 12:11
  • A follow up question: how to find the delimiters definitions to import? This question https://tex.stackexchange.com/questions/14386/importing-a-single-symbol-from-a-different-font/ doesn't clarify much for me. For example, I like palatino/mathpazo/newpx* brackets. – homocomputeris Jun 13 '18 at 12:12
  • @homocomputeris I think David's answer takes this approach. – Steven B. Segletes Jun 13 '18 at 13:22