LaTeX forum ⇒ Text FormattingVertical Space using Overset on a Subscript

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
clarinetist
Posts: 11
Joined: Sun Nov 18, 2012 8:20 pm

Vertical Space using Overset on a Subscript

Postby clarinetist » Sun Nov 18, 2012 8:32 pm

Hi,

This is my first post (plus I'm kinda new to LaTeX) - hope that I've posted this in the right place. Here's the code I've used:
  1. \documentclass {article}
  2. \usepackage{amsmath, MnSymbol, wasysym, amsthm, colonequals, mathtools, tensor, fixltx2e}
  3. \usepackage{dsfont}
  4. \usepackage[margin=2 cm]{geometry}
  5. \textwidth 16.59cm
  6. \textheight 21.94 cm
  7. \begin{document}
  8. \\ $Z_{x:\overset{1}{\overline{n}|}}$
  9. \end{document}


Here's what it produces:
Capture.PNG
Capture.PNG (1.66 KiB) Viewed 1173 times


I want the part that starts with the x to be treated as a regular subscript, i.e. the problem is that there's too much vertical space. I've done a lot of searching and haven't found a solution to this problem.

Thanks for any help!

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Sun Nov 18, 2012 9:55 pm

Hi clarinetist,

Welcome to the LaTeX community!

How should it look like? It seems as if you're faking a fraction, but that's probably not it?

BTW: your MWE can still be shortened:
  1. \documentclass{article}
  2. \usepackage{amsmath}
  3. \begin{document}
  4. $Z_{x:\overset{1}{\overline{n}|}}$
  5. \end{document}


I take it the \\ in the MWE is a leftover? Anyway, I suspect you're using it wrongly. It should rarely be necessary to use \\ anywhere else than in tables and arrays...

Regards
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode:
HTML:
Hide post links
Show post links

clarinetist
Posts: 11
Joined: Sun Nov 18, 2012 8:20 pm

Postby clarinetist » Mon Nov 19, 2012 12:55 am

Hi cgnieder,

Thanks for the blurb about the \\. This is what I want (minus the bar on top of the Z:
Capture.PNG
Capture.PNG (737 Bytes) Viewed 1150 times

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Thu Nov 22, 2012 2:34 pm

clarinetist wrote:Hi cgnieder,

Thanks for the blurb about the \\.

You wouldn't believe how many people use it the wrong way...

There should be better ways of doing this and it still needs tweaking but it might be a start:

  1. \documentclass{article}
  2. \usepackage{tikz}
  3.  
  4. \makeatletter
  5. \newcommand*\findabettername@aux[2]{%
  6. \begin{tikzpicture}[remember picture,inner sep=0pt,baseline=(x.base)]
  7. \node (x) {\(#1#2\)} ;
  8. \node[overlay,above,yshift=2pt] at (x) {\(#11\)} ;
  9. \draw[semithick] (x.north west) -- (x.north east) -- (x.south east) ;
  10. \end{tikzpicture}
  11. }
  12. \newcommand\findabettername{\mathpalette\findabettername@aux}
  13. \makeatother
  14.  
  15. \begin{document}
  16.  
  17. \[ Z_{x:\findabettername{n}} \]
  18.  
  19. \end{document}


Regards
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Text Formatting”

Who is online

Users browsing this forum: Google [Bot] and 3 guests