Featured Book

LaTeX Beginners Guide

Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 6 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Vertical Space using Overset on a Subscript

Add tags Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)

Vertical Space using Overset on a Subscript

Postby clarinetist on Sun Nov 18th, 2012

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:
Code: Select all  •  Open in writeLaTeX
\documentclass {article}
\usepackage{amsmath, MnSymbol, wasysym, amsthm, colonequals, mathtools, tensor, fixltx2e}
\usepackage{dsfont}
\usepackage[margin=2 cm]{geometry}
\textwidth 16.59cm
\textheight 21.94 cm
\begin{document}
\\ $Z_{x:\overset{1}{\overline{n}|}}$
\end{document
}


Here's what it produces:
Capture.PNG
Capture.PNG (1.66 KiB) Viewed 690 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!
clarinetist
 
Posts: 11
Joined: Sun Nov 18th, 2012

Re: Vertical Space using Overset on a Subscript

Postby cgnieder on Sun Nov 18th, 2012

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:
Code: Select all  •  Open in writeLaTeX
\documentclass{article}
\usepackage{amsmath}
\begin{document}
 $Z_{x:\overset{1}{\overline{n}|}}$
\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
System: TeXlive 2013, OpenSUSE 12.3
User avatar
cgnieder
Site Moderator
 
Posts: 1696
Joined: Sat Apr 16th, 2011
Location: Germany

Re: Vertical Space using Overset on a Subscript

Postby clarinetist on Mon Nov 19th, 2012

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 667 times
clarinetist
 
Posts: 11
Joined: Sun Nov 18th, 2012

Re: Vertical Space using Overset on a Subscript

Postby cgnieder on Thu Nov 22nd, 2012

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:

Code: Select all  •  Open in writeLaTeX
\documentclass{article}
\usepackage{tikz
}

\makeatletter
\newcommand*\findabettername@aux[2]{%
  \begin{tikzpicture}[remember picture,inner sep=0pt,baseline=(x.base)]
   \node (x) {\(#1#2\)} ;
   \node[overlay,above,yshift=2pt] at (x) {\(#11\)} ;
   \draw[semithick] (x.north west) -- (x.north east) -- (x.south east) ;
  \end{tikzpicture}
}
\newcommand\findabettername{\mathpalette\findabettername@aux}
\makeatother

\begin{document}

\[ Z_{x:\findabettername{n}} \]

\end{document
}


Regards
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen
System: TeXlive 2013, OpenSUSE 12.3
User avatar
cgnieder
Site Moderator
 
Posts: 1696
Joined: Sat Apr 16th, 2011
Location: Germany


Return to Text Formatting

Who is online

Users browsing this forum: No registered users and 6 guests