Code Monkey home page Code Monkey logo

Comments (13)

matze avatar matze commented on June 2, 2024

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}}

from mtheme.

rchurchley avatar rchurchley commented on June 2, 2024

@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!

from mtheme.

benjamin-weiss avatar benjamin-weiss commented on June 2, 2024

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?

from mtheme.

bgat avatar bgat commented on June 2, 2024

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 [email protected]
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
[email protected]

from mtheme.

benjamin-weiss avatar benjamin-weiss commented on June 2, 2024

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.

from mtheme.

rchurchley avatar rchurchley commented on June 2, 2024

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.

from mtheme.

rchurchley avatar rchurchley commented on June 2, 2024

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.

from mtheme.

benjamin-weiss avatar benjamin-weiss commented on June 2, 2024

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}

from mtheme.

rchurchley avatar rchurchley commented on June 2, 2024

I'd be fine with removing the adjustments.

from mtheme.

benjamin-weiss avatar benjamin-weiss commented on June 2, 2024

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

from mtheme.

matze avatar matze commented on June 2, 2024

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").

from mtheme.

rchurchley avatar rchurchley commented on June 2, 2024

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.

from mtheme.

matze avatar matze commented on June 2, 2024

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

from mtheme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.