bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vertical shifting of inline images


From: Werner LEMBERG
Subject: Re: vertical shifting of inline images
Date: Fri, 23 Apr 2021 04:33:18 +0000 (UTC)

> If you could explain what the use case was for an image inserted
> inside text, I might try to see if it could be achieved in TeX using
> a @macro.

Our main LilyPond use case currently is images in tables; see the
attached screenshots (before – after).  Additionally, inserting such
small Gregorian neumes as inline images into normal paragraphs both
saves a lot of vertical space and increases readability.

However, I believe that having support for inline images is a good
feature for other use cases, too.

> @iftex
> @macro Image{args}
> @lower 23pt @hbox{@image{\args\}}
> @end macro
> @end iftex
>
> @ifnottex
> @alias Image=image
> @end ifnottex

Right now, I'm successfully using the following code.

```
@tex
\gdef\raisebox#1#2{%
  \setbox0 = \hbox{#2}%
  \def\width{\wd0 }%
  \def\height{\ht0 }%
  \dimen0 = #1\relax
  \raise\dimen0 \box0 }

% Factor -0.4 is heuristic.
\global\let\imageold = \image
\gdef\image#1{%
  \ifhmode
    \raisebox{-.4\height}{\imageold{#1}}%
  \else
    \imageold{#1}%
  \fi}
@end tex
```


    Werner

PNG image

PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]