Text FormattingvSpace in tablecell comes after following text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
redted
Posts: 5
Joined: Sat Jul 17, 2010 8:32 pm

vSpace in tablecell comes after following text

Post by redted »

Hi,

I try in to do something like this within a p-type table cell

Code: Select all

{\vspace{3pt}}\begin{small}\emph{\glsentryuseri{##1}}\end{small}
(I use the glossaries package, thats where \glsentryuseri comes from). However the Space created by vspace ends up after the first line of the text from inside the small-block. I would like to create the space before the paragraph. The "{}" arround vspace was an attempt to force the space before the text. The problem might be related to the fact that i try to insert hte vspace within a glossary styledefinition and that i have no idea of expansion order/control.

Greetings and thanks in advance Ted


Minimal example (not wuite minimal but pretty close):

Code: Select all

\documentclass{scrreprt}
\usepackage[latin1]{inputenc}
\usepackage[toc,nomain]{glossaries}

\usepackage{ifmtarg}

\makeatletter
\newcommand*{\ifuseriempty}[3]{%
  \protected@edef\tmp{\glsentryuseri{#1}}%
  \expandafter\@ifmtarg\expandafter{\tmp}{#2}{#3}%
}
\makeatother

\newglossarystyle{acronymAndExplanation}{%
\glossarystyle{long}
% put the glossary in a longtable environment:
\renewenvironment{theglossary}{\begin{longtable}{lp{\glsdescwidth}}}{\end{longtable}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{\bfseries{\glstarget{##1}{##2}} & ##3 \\
\ifuseriempty{##1}%
  {}%
  { &{\vspace{3pt}}
  \begin{small}\emph{\glsentryuseri{##1}}\end{small}\\}%
}
% Nothing between groups:
%\renewcommand*{\glsgroupskip}{& \\}%
}
\newglossary[abkuerzungen]{abk}{abkin}{abkout}{Abkürzungsverzeichnis}
\makeglossaries

\newacronym[type=abk]{abc}{abc}{Alphabet}
\newacronym[type=abk,user1={my longer description, which needs multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam fermentum porttitor turpis, viverra gravida est dignissim ut. Nulla vitae nisi eu nisi scelerisque congue eu vel lacus. Etiam consectetur nunc ac turpis fermentum pulvinar. Curabitur bibendum sodales leo et fringilla.}]{abba}{abba}{Band}

\glsaddall

\begin{document}

\printglossary[type=abk,nonumberlist,style=acronymAndExplanation]

\end{document}
Edit: Added PDF showing the problem (generated by minimal example code above)

If my question is unclear or I violated a forum rule please ask or tell me. I tried searching but i might have used the wrong search terms
Attachments
minimalExample.pdf
Shows the misplaced spacing. I would like the gap between "band" and "my long..." instead of between "my long..." and "ipsum dolor sit ..." where it is at the moment
(46.19 KiB) Downloaded 201 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply