7

I am a new user of LaTeX. I want to underline the answers to mathematics problems using a \rightharpoondown symbol. If possible, I would like a \rightharpoondown of variable size, as in the image below. How can I achieve this?

enter image description here

  • 3
    Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. – Xavier Jul 7 '13 at 15:54
  • I don't understand your question. You mention \rightharpoondown but the link to your example doesn't use it; it circles the answer. Is a circled answer what you are looking for? – Frédéric Jul 7 '13 at 16:20
  • Sorry the insufficient my question. I mentioned it follow the two examples. $\overset{5 Volts}{\rightharpoondown}$ $\underset{\rightharpoondown}{4 Volts}$ But \rightharpoondown will be variable. – Özgür Jul 7 '13 at 16:34
  • Now that I know you are talking about \rightharpoondown, please explain what is your problem with it, what you actually want to attain. – Frédéric Jul 7 '13 at 16:46
12

Here is are three macros that (1) underline with a hook, (2) circle an answer (with an ellipse) and (3) that place two diagonal lines in the lower right corner. Note that I used the siunitx package to write the answer; this package is made to correctly write the units of a value.

\documentclass[border=5pt]{standalone}

\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.geometric}

\newcommand{\answer}[1]{
\tikz[baseline=(answer.base)]{
\node[inner sep=3pt] (answer) {#1};
\draw[line cap=round] (answer.south west) -- (answer.south east)  -- ++(-0.1,-0.1); 
}} 

\newcommand{\answercircled}[1]{
\tikz[baseline=(answer.base)]{
\node[ellipse,draw,inner sep=3pt] (answer) {#1};
}} 

    \newcommand{\answerside}[1]{
\tikz[baseline=(answer.base)]{
\node[inner sep=3pt] (answer) {#1};
\draw[double, double distance=2pt] ($(answer.south east) + (45:0.2)$) -- ($(answer.south east) - (45:0.2)$);
}} 

\begin{document}
$x = \answer{\SI{5}{Volts}} = \answercircled{\SI{5}{Volts}}= \answerside{\SI{5}{Volts}}$

\end{document}

The result is

enter image description here

2

After that teaching my example, again thank you Frédéric.

 \documentclass[border=5pt]{standalone}

 \usepackage{amsmath}
 \usepackage{siunitx}
 \usepackage{tikz}
 \usepackage{color}

 \usetikzlibrary{calc}
 \usetikzlibrary{shapes.geometric}

 \newcommand{\answer}[1]{
 \tikz[baseline=(answer.base)]{
 \node[inner sep=3pt] (answer) {#1};
 \color{red}
 \draw[line width=1pt,color=red][line cap=round] {[rounded corners](answer.south west) -- (answer.south east) } -- ++(-0.5,-0.5);
 }} 

 \begin{document}

 $x = \answer{\SI{5.977}{Volts}}$

 \end{document}

The result is

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.