0

I know, it sounds strange, but I need to have a fraction in italics. I have plenty of tables in my document where in one column everything is always in italics. And there I have one specific table with some simple fractions. I don't need and don't want them in math-mode. I tried following to have it look as text-mode:

\begin{longtable}[r]{p{0.46\linewidth}p{0.46\linewidth}}

$\frac{\text{1}}{\text{2}}$ & một \textbf{phần} hai \\ 
\\
$\frac{\text{3}}{\text{4}}$ & ba \textbf{phần} tư \\
\\
$\frac{\text{6}}{\text{8}}$ & sáu \textbf{phần} tám \\

\end{longtable}

But when it finally looks as all other text, I can't make it italic. I tried this:

\begin{longtable}[r]{p{0.46\linewidth}p{0.46\linewidth}}

$\frac{\text{\textit{1}}}{\text{\textit{2}}}$ & một \textbf{phần} hai \\ 
\\
$\frac{\text{\textit{3}}}{\text{\textit{4}}}$ & ba \textbf{phần} tư \\
\\
$\frac{\text{\textit{6}}}{\text{\textit{8}}}$ & sáu \textbf{phần} tám \\

\end{longtable}

but it doesn't look good... I mean: It is not the whole fraction that is in italics - it's only the numbers that went into italics.

italic numbers in fractions

Does anyone have an idea if there's a better way to have it done?

8
  • 1
    "Looking good" is subjective and depends also on the font (in your picture it's a sans-serif one). But instead of your \text{\textit{1}} construction you could use simply \mathit. Or even define \newcommand*{\itfrac}[2]{\frac{\mathit{#1}}{\mathit{#2}}}.
    – campa
    Commented Aug 26, 2015 at 14:14
  • Sorry, I overlooked the title "No math-mode preferred".
    – campa
    Commented Aug 26, 2015 at 14:18
  • You could try something like $\frac{\it 1}{\it 2}$ or even ${\it \frac{1}{2}}$. It's definitely shorter.
    – RHertel
    Commented Aug 26, 2015 at 14:19
  • What I mean saying "not looking good" is: It is not the whole fraction that is in italics - it's only the numbers that went into italics.
    – Dominik
    Commented Aug 26, 2015 at 14:25
  • @RHertel But \it shouldn't really be used: Does it matter if I use \textit or \it, \bfseries or \bf, etc Commented Aug 26, 2015 at 14:28

1 Answer 1

6

Simple text fraction

A simple way for simple fractions is the text form a/b:

\documentclass{article}
\usepackage[utf8]{vietnam}

\usepackage{array}
\usepackage{longtable}

\begin{document}
\begin{longtable}[r]{>{\itshape}p{0.46\linewidth}p{0.46\linewidth}}
  1/2 & một \textbf{phần} hai \\
  3/4 & ba \textbf{phần} tư \\
  6/8 & sáu \textbf{phần} tám \\
\end{longtable}
\end{document}

Result

Package nicefrac

\documentclass{article}
\usepackage[utf8]{vietnam}

\usepackage{array}
\usepackage{longtable}

\usepackage{nicefrac}

\begin{document}
\begin{longtable}[r]{>{\itshape}p{0.46\linewidth}p{0.46\linewidth}}
  \nicefrac{1}{2} & một \textbf{phần} hai \\
  \nicefrac{3}{4} & ba \textbf{phần} tư \\
  \nicefrac{6}{8} & sáu \textbf{phần} tám \\
\end{longtable}
\end{document}

Result nicefrac

Package xfrac

\documentclass{article}
\usepackage[utf8]{vietnam}

\usepackage{array}
\usepackage{longtable}

\usepackage{xfrac}

\begin{document}
\begin{longtable}[r]{>{\itshape}p{0.46\linewidth}p{0.46\linewidth}}
  \sfrac{1}{2} & một \textbf{phần} hai \\
  \sfrac{3}{4} & ba \textbf{phần} tư \\
  \sfrac{6}{8} & sáu \textbf{phần} tám \\
\end{longtable}
\end{document}

Result

Horizontal fraction line with shifted numerator

\documentclass{article}
\usepackage[utf8]{vietnam}

\usepackage{array}
\usepackage{longtable}

\usepackage{amstext}
\newcommand*{\itfrac}[2]{%
  \ensuremath{%
    \frac{\,\text{\itshape #1}}{\mkern-\thinmuskip\text{\itshape #2}}%
  }%
}

\begin{document}
\begin{longtable}[r]{>{\itshape}p{0.46\linewidth}p{0.46\linewidth}}
  \itfrac{1}{2} & một \textbf{phần} hai \\
  \itfrac{3}{4} & ba \textbf{phần} tư \\
  \itfrac{6}{8} & sáu \textbf{phần} tám \\
\end{longtable}
\end{document}

Result with horizontal fraction line and shifted numerator

If math fonts should be used, then \text{\itshape ...} can be replaced by \mathit.

2
  • OK, that's true. But it avoids the typical writing of one digit above the other...
    – Dominik
    Commented Aug 26, 2015 at 14:57
  • @Dominik The slash is also a typical form for a fraction especially for text. I have now added a variant with horizontal line, but shifted numerator. The variants with nicefrac and xfrac act as "nice" compromise between the two extremes. Commented Aug 26, 2015 at 15:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .