I have two problems.

  1. I have an mechanism. It gives me correct number of lines, which I should make narrow (I have it in \setcounter{ct}{...}). And I want to teach \addpicture that skill and use it as default for the first optional argument. How can I do it?

In nutshell I want default value of optional argument of \addpicture to be calculated every time running this macro based on mandatory arguments of function \addpicture.

But I see that I will not success in this case because the third agrument of \addpicture is not a number of narrow lines. So,

  1. The third argument of \InsertBoxL is number of additional lines which should be narrower too. In documentation it is said correction. But in my function it spoils due to some mystical things. So, what it is now, and what shall I do to correct it?

    enter image description here

    \forloop{ct}{1}{\value{ct} < 30}{\arabic{ct}\newline }

solution to the second question.

The first argument is the number of untouched lines, the second argument is the object to be inserted and the optional argument is a corrective term: the number of supplementary lines which should be narrower (w.r.t. the number of lines calculated by TeX) – just as in the wrapfigure environment.

I propose this simple code, which works fine for one-lined captions. For longer captions, you'll have to make a correction, in terms of the number of supplementary lines, with the command: \myInsertBoxL[no of supplementary lines]{width}{graphic file}{caption text}.


[\numexpr#1 + 3\relax]}




{A useful caption. A useful caption. A useful caption.}%


enter image description here

  • @Bernand Hm. In my MWE I have zero in optional argument. Take a look at screenshot. 7 lines are narrower... not zero...btw, it is your construction of adding pictures (heh). – user98432 Mar 14 '16 at 19:11
  • @Bernand I understood the meaning of parametres. But, why does this construction spoil it?! – user98432 Mar 14 '16 at 19:28
  • and in wrapfigure it is number of ALL narrow lines. but there it is just correction - the number that will add to the number of lines calculated by TeX. Isn't it?! – user98432 Mar 14 '16 at 19:38
  • 1
    Yes. In my opinion, it is simpler than wrapfigure. – Bernard Mar 14 '16 at 20:28
  • @Bernand but you can see that with threeparttable spoils it. I need to add this correction not only for adding place for caption (for example), but in order to make normal wrapping... It is wrong. – user98432 Mar 14 '16 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy