Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have an operation that I call \conv, that I defined as follows:

\newcommand\conv{{}^{\scriptstyle\smile}}

Sometimes I use it in this situation:

$a\conv$

and sometimes I use it in this situation:

$$\big(\prod a\big)\conv$$

In both cases, the superscript \conv is at the same level. However, in the second case, the \sum is so big, that the \conv seems to hit it at mid-level. I want it to somehow adjust to the larger size of the \sum so that it is up at the top of the \big), not so far down.

Please let me know how I can clarify my question.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

There may a be a beeter way to do this. Using

\newcommand\conv{^{\scriptstyle\smile}}

Should do the job. The empty {} is responsible for the constant height of smile.

\documentclass{article}
\newcommand\conv{^{\scriptstyle\smile}}
\begin{document}
\[\left(\prod a\right)\conv\]
\[a\conv\]
\end{document}

I suggest using \[ \] instead of $$ $$ and \( \) for $ $. Also instead of using static \big( and \big), it is better to use dynamic \left( and \right)

enter image description here

EDIT Different version:

\documentclass{article}
\newcommand{\conv}[1]{{#1}^{\scriptstyle\smile}}
% \newcommand\conv{^{\scriptstyle\smile}}
\begin{document}
\[\conv{\left(\prod a\right)}\]
\[\conv{a}\]
\(\conv{}\conv{}\)
\end{document}
share|improve this answer
    
But then it doesn't let me put $\conv\conv$.! Here is the error message that I get: Double superscript. \conv ->^ {\scriptstyle \smile } l.58 \item $a\conv\conv =a$ for all $a\in A$. ? –  MathMastersStudent Apr 14 '12 at 0:17
    
use \(\conv{}\conv\) –  Harish Kumar Apr 14 '12 at 0:23
    
OK, now I'm getting a different error:<inserted text> } l.52 ...ary operations on $A$, $\comp$ and $\conv$ are unary operations on $... ? And here is what I put in the preamble:\newcommand{\conv}[1]{{#1}^{\scriptstyle\smile}} –  MathMastersStudent Apr 14 '12 at 4:25
    
@MathMastersStudent: While code snippets are useful, your complete problem will be better understood and reproduced by us only if you provide a complete MWE and we will be able to answer better. I think you can start a new question with your current problem (pl. add a complete MWE). –  Harish Kumar Apr 14 '12 at 6:00
    
Of course your suggestion of using \conv{}\conv doesn't work when the first \conv follows a large delimiter. –  egreg Apr 14 '12 at 9:19
show 3 more comments

A method for being able to use \conv\conv is the following

\makeatletter
\newcommand\conv{^\bgroup\scriptscriptstyle\@conv\conv}
\def\@conv#1{\smile\@ifnextchar\conv\@conv\egroup}
\makeatother

I've used \scriptscriptstyle, as \scriptstyle is redundant.

Here's an example:

\documentclass{article}
\makeatletter
\newcommand\conv{^\bgroup\scriptscriptstyle\@conv\conv}
\def\@conv#1{\smile\@ifnextchar\conv\@conv\egroup}
\makeatother

\begin{document}
$a\conv$

$a\conv\conv$

$\Bigl[a\Bigr]\conv$
\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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