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

Bulleted list spacing tweaks? #29

Closed
bgat opened this issue Feb 17, 2015 · 13 comments
Closed

Bulleted list spacing tweaks? #29

bgat opened this issue Feb 17, 2015 · 13 comments

Comments

@bgat
Copy link
Contributor

bgat commented Feb 17, 2015

Mtheme is an absolutely BEAUTIFUL, intelligent, well-designed theme. Thank. You!!

My slides often have two sections of itemized (bulleted) lists, i.e.:

Lorem

  • a
  • b

Ipsum

  • c
  • d

I'd like to automatically add some additional vspace between "* b" and "Ipsum", but my attempts so far have also pushed Lorem downwards. Can you offer a suggestion that won't break the overall template?

Thanks!

@matze
Copy link
Owner

matze commented Feb 17, 2015

You are touching an issue that is nagging on me for quite some time now. In regular LaTeX one could use the enumitem package to customize enumeration environments. Unfortunately, Beamer overrides the enumeration environments itself thus making any space customization very hard (without replicating everything in the theme again).

Your case is simpler however and you may define a new environment to add that spacing, i.e. something like this

\newenvironment{Itemize}{\vspace{1em}\begin{itemize}}{\end{itemize}}

@matze matze modified the milestone: Version 1.0 Jun 17, 2015
@rchurchley
Copy link
Contributor

@bgat After looking into beamer's source code, I discovered that its redefined itemize/enumerate enviroments helpfully provide hooks for customization, so you don't have to create any custom environments after all.

\setbeamertemplate{itemize/enumerate body end}{\vspace{1em}}

will automatically add some extra space after the end of each itemize and enumerate environment without breaking anything else. (Note: itemize/enumerate is the actual key name; itemize or enumerate separately won't work.)

Hope this helps!

@benjamin-weiss
Copy link
Contributor

Another related problem which is bugging me, is the \leftmargini of the itemize and enumerate environment. Our current setting looks fine for itemize, but bad for enumerate.

screenshot_lists

But simply increasing the \leftmargini values doesn't help either. Because then it is the other way around. And afaik there is now easy way to change the two independently.

Any thoughts on this one?

@bgat
Copy link
Contributor Author

bgat commented Jun 19, 2015

Is the problem actually due to the bullet's sidebearing? Is it actually
character width that makes it look wrong?

On Fri, Jun 19, 2015, 1:50 AM Benjamin Weiss notifications@github.com
wrote:

Another related problem which is bugging me, is the \leftmargini of the
itemize and enumerate environment. Our current setting looks fine for
itemize, but bad for enumerate.

[image: screenshot_lists]
https://cloud.githubusercontent.com/assets/9158719/8244718/92ab634c-1624-11e5-81ac-eaed07d6db35.png

But simply increasing the \leftmargini values doesn't help either.
Because then it is the other way around. And afaik there is now easy
way to change the two independently.

Any thoughts on this one?

Reply to this email directly or view it on GitHub
#29 (comment).

Bill Gatliff
bgat@billgatliff.com

@benjamin-weiss
Copy link
Contributor

Is it actually character width that makes it look wrong?

Yes. Because the length \leftmargini sets the distance between the left frame margin and the start of each item. I hope you understand how I mean that. If not, just set it to zero to test it. Then it should be clear what happens.

\setlength{\leftmargini}{0pt}

So if the label of each item is wider than the bullet it doesn't fit. And it gets even worse if you have 2 digit numbers.

@rchurchley
Copy link
Contributor

Untested but worth trying: let \leftmargini take its default value and instead use the itemize item Beamer template to

  • \flushleft the bullet,
  • \flushleft the bullet after putting it in a box of width \leftmargini, or
  • add space after the bullet to push it to the left,

whichever of these actually works.

@rchurchley
Copy link
Contributor

As @bgat says, this ultimately comes down to the size of the bullet: since it is considerably narrower than a numeral, it is not possible to get all the alignments perfect.

The current behaviour aligns itemize bullets perfectly with the periods after each enumerate numeral, creating consistent spacing between each bullet and the corresponding list item.
current

@benjamin-weiss's proposed behaviour would align both itemize bullets and enumerate numerals on the left with the surrounding text. This is possible with

\setbeamertemplate{itemize item}{\makebox[\labelwidth][l]{\textbullet}}
\setbeamertemplate{enumerate item}{\makebox[\labelwidth][l]{\insertenumlabel.}}

but necessarily comes at the cost of misaligned periods and bullets on the right-hand side.
alternate

I generally prefer the first behaviour, so I'll vote to close this issue, but I'm open to other suggestions if you have them.

@benjamin-weiss
Copy link
Contributor

Looking at your screenshots I actually also prefer the first one. It is the way itemize and enumerate are indented in LaTeX and this seems to give the best results. But if we decide to use the first one we should increase the leftmargini value or just remove the following adjustments in the inner theme completely.

\setlength{\leftmargini}{1em}
\setlength{\leftmarginii}{1em}
\setlength{\leftmarginiii}{1em}

@rchurchley
Copy link
Contributor

I'd be fine with removing the adjustments.

@benjamin-weiss
Copy link
Contributor

I also tested it with the default settings and I agree. Removing the adjustments is imho the best solution.

@matze
Copy link
Owner

matze commented Jul 10, 2015

Does that mean both enumerate and itemize would be flush to the left? I don't have a good source to cite, but whenever I encountered these types (regardless of TeX or not) they are always indented (or IMHO worse "hanging").

rchurchley added a commit to rchurchley/mtheme that referenced this issue Jul 10, 2015
Also consolidates `itemize item` templates
@rchurchley
Copy link
Contributor

We originally investigated the possibility of having enumerate and itemize flush to the left, but we have since decided that that would cause more problems than it solves. The current proposal is to remove the code

\setlength{\leftmargini}{1em}
\setlength{\leftmarginii}{1em}
\setlength{\leftmarginiii}{1em}

to return the item left margin to its default value. This fixes the issue that @benjamin-weiss raised about enumerate labels extending too far to the left relative to the surrounding text.

@matze
Copy link
Owner

matze commented Jul 10, 2015

Ah alright, then I misunderstood your intentions. With that I am fine.

@matze matze removed this from the Version 1.0 milestone Jul 10, 2015
@matze matze closed this as completed in 4d71e7b Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants