Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide options that let the user set independently the spaces between upper and lower text, respectively, to the separation line #163

Open
dbitouze opened this issue Jan 2, 2022 · 4 comments

Comments

@dbitouze
Copy link
Contributor

dbitouze commented Jan 2, 2022

Currently, middle sets the same space between upper and lower text to the separation line. It would be useful to provide options such as:

  • upper middle,
  • lower middle,

that let the user set independently the spaces between upper and lower text, respectively, to the separation line.

@T-F-S
Copy link
Owner

T-F-S commented Jan 7, 2022

I will put this on my ToDo list, but I cannot promise to implement it (soon), because I think it provokes changes at possibly many places (with possible new side effects).

@dbitouze
Copy link
Contributor Author

dbitouze commented Jan 7, 2022

I will put this on my ToDo list,

Thanks!

but I cannot promise to implement it (soon), because I think it provokes changes at possibly many places (with possible new side effects).

I don't understand why: if upper middle and lower middle are by default both equal to middle, no change should be provoked, isn't it?

BTW, let me provide a use case. In the following MCE, if the options top and middle are not set (equal to the minimum height of the nodes), the content of the upper and lower part of the tcblisting is likely to overlap these nodes. But the vertical space at the bottom of the upper part would be better not so big.

\documentclass{article}
\usepackage{tcolorbox}

\tcbuselibrary{listings,skins}

\begin{document}
\begin{tcblisting}{%
    sharp corners,
    skin=bicolor,
    top=0.5cm,
    middle=0.5cm,
    overlay={
      \node[minimum width=1cm,minimum height=0.5cm,outer sep=auto,
      anchor=north east,fill=white] at (interior.north east)
      {\itshape\small code};
      \node[minimum width=1cm,minimum height=0.5cm,outer sep=auto,
      anchor=north east,fill=white] at ([yshift=.1mm]segmentation.east)
      {\itshape\small result};
    }
  }
Foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foooo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foooo
\end{tcblisting}
\end{document}

image

(BTW, the [yshift=.1mm] is the above code (thanks @muzimuzhi!), is discussed in this question.)

@muzimuzhi
Copy link
Contributor

(BTW, the [yshift=.1mm] is the above code (thanks @muzimuzhi!), is discussed in this question.)

Finally a new issue is opened, see #166. Sorry I was a bit lazy for the past 1-2 weeks.

@dbitouze
Copy link
Contributor Author

dbitouze commented Jan 8, 2022

Finally a new issue is opened, see #166. Sorry I was a bit lazy for the past 1-2 weeks.

You're very welcome 😄 I hesitated to open an issue myself, not being sure of the status of this phenomenon (and that's why I first asked on TeX.SE).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants