3

Consider the following MWE:

\documentclass{article}
\usepackage{tasks}

\begin{document}
\begin{tasks}[label-format=\itshape](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}
\end{document}

With italics

I would like to not italicize the parentheses:

Without italics

Is it possible to achieve it in an easy way?

Thanks!

manooooh
  • 3,203
  • 2
  • 21
  • 46

2 Answers2

4

One should use \textup{)}, so the italic correction would be automatically added; unfortunately, this crashes because of the nature of \textup that doesn't really like to be used in that place. However, there's an easy fix.

Note that \upshape doesn't take an argument.

\documentclass{article}
\usepackage{tasks}
\usepackage{etoolbox}
\robustify{\textup}

\begin{document}

\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\upshape{)}](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}

\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\/\upshape)](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}

\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\textup{)}](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}

\end{document}

You can see that the second and third examples print the same. In the second example, the italic correction \/ is explicitly added.

enter image description here

egreg
  • 1,121,712
3

Thanks to @AlanMunn for the hint.

I added the \upshape command only for the parentheses and used tsk[a] for a, b, c, ... style numbers, all inside counter-format command.

\documentclass{article}
\usepackage{tasks}

\begin{document}
\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\upshape{)}](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}
\end{document}

Right parentheses

manooooh
  • 3,203
  • 2
  • 21
  • 46
  • 1
    You should italicize both the counter a,b,.. and the ), look at the d), either you italicize both or add a small space between the counter and the paren. In your case, it's the latter choice as done in the image with red arrows. – AboAmmar Aug 26 '18 at 00:24
  • @AboAmmar I would like to keep the actual style. I use \upshape{ )} but the space is too large, and then \upshape{$\,$)} but is the same space. Also tried with \upshape{~)}. What do you recommend? – manooooh Aug 26 '18 at 00:42
  • 1
    A \, might be nice, in case you need to try many variants, see this great answer about horizontal spaces in LaTeX. – AboAmmar Aug 26 '18 at 00:48
  • @AboAmmar woo excellent! Anyway \, isn't the same space of, for example, \begin{enumerate} with a), b), etc. – manooooh Aug 26 '18 at 00:51
  • 1
    You can try with math mode: $\mkern1.5mu)$ (\, is 3mu). – Bernard Aug 26 '18 at 09:48