I'd like to create a newenvironment that could contain two lists, each with an arbitrary number of items.
Some fixed text
\begin{itemize}
\item item 1
\item item 2
\item item 3
\item item 4
% Maybe more items
\end{itemize}
Some more fixed text
\begin{itemize}
\item item 5
\item item 6
% Could have more items here
\end{itemize}
Some text at the end
I am creating a presentation using Beamer, and I have a recurring slide structure on several slides (but not all). One that has two lists, and an image on the right. I would like to separate the content (the items and picture path) from the display. Let's say I wanted to have the picture on the right instead of left. I would like to be able to change the environment definition, and apply changes to all relevant slides.
Thank you
I'm not sure if I understand what you require. I guess a \newcommand might be all you need:
\newcommand{\myenvironment}[6]{%
Some fixed text
\begin{itemize}
\item #1
\item #2
\item #3
\item #4
\end{itemize}
Some more fixed text
\begin{itemize}
\item #5
\item #6
\end{itemize}
Some text at the end
}
If you put the above into the preamble of the document, you yould use
\myenvironment{item 1}{item 2}{item 3}{item 4}{item 5}{item 6}
within the text.
Please add some detail to what you require, if it is different. ;-)
Related
I'm working on a beamer template and I'm struggling to customize my itemize environment. More precisely, I've troubles with the itemsep in my itemize environment. In general, I'm changing the font size for deeper levels (-> the font size becomes smaller) and that's where the problems begin.
In the appendix you can see a picture with three itemize levels (itemsep_not_constant). If you look closely, then you can see that the vertical spacing between the penultimate and the last items of the same level becomes smaller. This applies for the first level and for the second level.
I've noticed that this problem only occurs, if I add a another (deeper) itemize level with a different font size. Therefore, you can see that the vertical spacing between the items in the third level remains constant.
To get rid of this problem I've tried different approaches, e.g. defining a \newlist. After some research in the internet I've found out that it is recommended to use the \setbeamertemplate for customizations and to avoid using the itemize package (\usepackage{itemize}) in beamer.
Here's my MWE:
\documentclass[aspectratio=169,xcolor=table,12pt]{beamer}
% compile in pdfLaTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[type=none]{fgruler} % ruler
\usepackage{xcolor}
\renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}
\definecolor{footerGrey}{RGB}{135,135,135}
\setbeamercolor*{normal text}{fg=footerGrey}
\setbeamertemplate{itemize/enumerate body begin}{\normalsize}
\setbeamertemplate{itemize/enumerate subbody begin}{\footnotesize}
\setbeamertemplate{itemize/enumerate subsubbody begin}{\scriptsize}
\setbeamertemplate{itemize item}{\color{footerGrey}\rule[0.9mm]{0.6ex}{0.6ex}}
\setbeamertemplate{itemize subitem}{\color{footerGrey}\rule[0.8mm]{0.6ex}{0.6ex}}
\setbeamertemplate{itemize subsubitem}{\color{footerGrey}\rule[0.5mm]{0.6ex}{0.6ex}}
\begin{document}
\begin{frame}
\fgruler{upperleft}{0cm}{0cm}%
\begin{itemize}
\item Item 1
\item Item 2
\item Item 3
\begin{itemize}
\item Item 4
\item Item 5
\item Item 6
\begin{itemize}
\item Item 7
\item Item 8
\item Item 9
\item Item 10
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
I'm running out of ideas and I'd really appreciate any help! Thank you and
DIFFERENT APPROACHES THAT HAVE BEEN TRIED:
define \setbeamertemplate (see case description);
another approach:
create a newlist and change the settings for each level
\setlist[unthaItemize,1]{font=\sffamily\bfseries\Huge,
label=\color{footerGrey}\rule[0.9mm]{0.6ex}{0.6ex},
align = left,
leftmargin = 0.025\paperwidth,
labelsep = 0pt,
labelwidth = 8pt,
itemindent= -0.5pt,
topsep = 2.5pt,
itemsep = 2.5pt,
}
\setlist[unthaItemize,2]{label=\color{footerGrey}\rule[0.8mm]{0.6ex}{0.6ex},
align = left,
leftmargin = 0.025\paperwidth,
labelsep = 0pt,
labelwidth = 8pt,
itemindent= -0.5pt,
topsep = 2.5pt,
itemsep = 2.5pt,
%before* = \fontsize{10pt}{10pt}\selectfont
}
etc.
You have to finish the paragraph (e.g. by inserting an empty line) before you switch to a different font size (see also https://github.com/josephwright/beamer/issues/530):
\documentclass[aspectratio=169,xcolor=table,12pt]{beamer}
% compile in pdfLaTeX
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage[type=none]{fgruler} % ruler
%\usepackage{xcolor}
\renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}
\definecolor{footerGrey}{RGB}{135,135,135}
\setbeamercolor*{normal text}{fg=footerGrey}
\setbeamertemplate{itemize/enumerate body begin}{\normalsize}
\setbeamertemplate{itemize/enumerate subbody begin}{\footnotesize}
\setbeamertemplate{itemize/enumerate subsubbody begin}{\scriptsize}
\setbeamertemplate{itemize item}{\color{footerGrey}\rule[0.9mm]{0.6ex}{0.6ex}}
\setbeamertemplate{itemize subitem}{\color{footerGrey}\rule[0.8mm]{0.6ex}{0.6ex}}
\setbeamertemplate{itemize subsubitem}{\color{footerGrey}\rule[0.5mm]{0.6ex}{0.6ex}}
\begin{document}
\begin{frame}
\fgruler{upperleft}{0cm}{0cm}%
\begin{itemize}
\item Item 1
\item Item 2
\item Item 3
\begin{itemize}
\item Item 4
\item Item 5
\item Item 6
\begin{itemize}
\item Item 7
\item Item 8
\item Item 9
\item Item 10
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
I want to change the bullet point symbol of certain items in my list after a certain slide.
A solution to a similar problem, but without nestled \itemize environments, was posted here: https://tex.stackexchange.com/questions/424011/change-beamer-itemize-symbol-and-overlay
The list looks like this:
\documentclass[9pt,aspectratio=169]{beamer}
\newenvironment{redenv}{\only{\setbeamercolor{local structure}{fg=red}}}{}
\begin{itemize}
\item<1-|red#3-> Item 1
\item Item 2
\begin{itemize}
\item<2-|red#3-> Item 3
\end{itemize}
\item Item 4
\end{itemize}
\end{document}
I want to change the symbol for Item 1 and Item 3 after a certain pause. This solution works only for Item 1, but not Item 3.
Edit:
Turns out I copied the example wrongly here, but not in my actual document. Instead I found the real culprit: My document uses a beamercolor.sty sheet that defines the color of the bullet points:
\setbeamercolor{item}{parent=local structure}
\setbeamercolor{subitem}{parent=item, fg=gray}
\setbeamercolor{subsubitem}{parent=subitem}
So, when I delete the fg=gray, it works as indended. But I want the gray color as default and only change the color in places I choose. How can reconcile both coloring methods?
You are missing the fg= in your colour definition:
\documentclass[9pt,aspectratio=169]{beamer}
\newenvironment{redenv}{\only{\setbeamercolor{local structure}{fg=red}}}{}
\begin{document}
\begin{frame}
\begin{itemize}
\item<1-|red#3-> Item 1
\item Item 2
\begin{itemize}
\item<2-|red#3-> Item 3
\end{itemize}
\item Item 4
\end{itemize}
\end{frame}
\end{document}
Or if you don't mind that the text also changes colour, you could use alert:
\documentclass[9pt,aspectratio=169]{beamer}
\begin{document}
\begin{frame}
\begin{itemize}
\item<1-|alert#3-> Item 1
\item Item 2
\begin{itemize}
\item<2-|alert#3-> Item 3
\end{itemize}
\item Item 4
\end{itemize}
\end{frame}
\end{document}
I was wondering, if there is any way to have an enumeration using LaTeX to have something like:
1. (a) Some text, some text
(b) Some more text
2. (a) Yet some more text
(b) Something more ...
Please note that I can very well have
1. Somethig here ...
(a) Some text
(b) Some more text
2. Another text
(a) Something here ...
(b) Etc. etc.
What you show is simply the default behaviour of enumerate:
\documentclass{article}
\begin{document}
\begin{enumerate}
\item
\begin{enumerate}
\item test
\item test
\end{enumerate}
\item
\begin{enumerate}
\item test
\item test
\end{enumerate}
\end{enumerate}
\end{document}
What is the best way to format a list as to remove the spaces between list items.
It's easier with the enumitem package:
\documentclass{article}
\usepackage{enumitem}
\begin{document}
Less space:
\begin{itemize}[noitemsep]
\item foo
\item bar
\item baz
\end{itemize}
Even more compact:
\begin{itemize}[noitemsep,nolistsep]
\item foo
\item bar
\item baz
\end{itemize}
\end{document}
The enumitem package provides a lot of features to customize bullets, numbering and lengths.
The paralist package provides very compact lists: compactitem, compactenum and even lists within paragraphs like inparaenum and inparaitem.
You could do something like this:
\documentclass{article}
\begin{document}
Normal:
\begin{itemize}
\item foo
\item bar
\item baz
\end{itemize}
Less space:
\begin{itemize}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\item foo
\item bar
\item baz
\end{itemize}
\end{document}
This question was already asked on https://tex.stackexchange.com/questions/10684/vertical-space-in-lists. The highest voted answer also mentioned the enumitem package (here answered by Stefan), but I also like this one, which involves creating your own itemizing environment instead of loading a new package:
\newenvironment{myitemize}
{ \begin{itemize}
\setlength{\itemsep}{0pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt} }
{ \end{itemize} }
Which should be used like this:
\begin{myitemize}
\item one
\item two
\item three
\end{myitemize}
Source: https://tex.stackexchange.com/a/136050/12065
compactitem does the job.
\usepackage{paralist}
...
\begin{compactitem}[$\bullet$]
\item Element 1
\item Element 2
\end{compactitem}
\vspace{\baselineskip} % new line after list
In beamer frames I want the contents to be spread out evenly across the frame.
Using option \documentclass[slidestop]{beamer} I can easily specify the contents to be top/center aligned but when I have only few bullets on a slide they get clustered together at the top, I want beamer to decide the spacing between them automatically to spread them evenly.
Is this possible without putting vspace by trial and error?
I think using \vfill would reduce the trial and error part. One \vfill between each bullet should guarantee even spacing. Try \vfill before and/or after bullets to get separation from preceding text or from bottom of page. I don't use or know Beamer, but I suspect there's a way to put the \vfill commands into the Beamer template.
\documentclass{article}
\begin{document}
\begin{itemize}
\vfill\item This is text of first item
\vfill\item This is text of second item
\vfill\item This is text of third item
\end{itemize}
\end{document}
Per your comment, here's one way you could define vfill to be automatically used in main list items but have no vfill in subitems. THis way lets you use same \item command regardless of whether you're in main list or in nested list, but requires you to define or redefine environments, and to be aware of when you're adding a main (i.e, vfilled) list and when you're adding a non-vfilled (i.e, nested) list:
\documentclass{article}
\newenvironment{novfillenum}{\begin{enumerate}\let\item\olditem}%
{\end{enumerate}}
\newenvironment{vfilleditems}{\begin{itemize} \let\olditem\item \renewcommand\item{\vfill\olditem}}%
{\end{itemize}}
\begin{document}
\begin{vfilleditems}
\item Item One
\begin{novfillenum}
\item subitem1
\item s2
\item s3
\end{novfillenum}
\item Item Two
\begin{novfillenum}
\item subitem1
\item s2
\item s3
\end{novfillenum}
\item item three
\begin{novfillenum}
\item subitem1
\item s2
\item s3
\end{novfillenum}
\end{vfilleditems}
\end{document}
Adding another sample here because first answer getting too crowded. Tested altering the label commands and, what do you know, it seems to work, sort of. It gives errors, though, which I'm sure are related to having the \vfill as part of the label construct. I'm surprised it does seem to create the desired output, but the method would need some tweaking to get it to work without errors:
\begin{document}
\let\oldlabelitemi\labelitemi
\renewcommand{\labelitemi}{\vfill\oldlabelitemi{\hspace{1ex}}}
\begin{itemize}
\item Item One
\begin{itemize}
\item subone
\item subtwo
\item subthree
\end{itemize}
\item Item Two
\begin{itemize}
\item subitem1
\item s2
\item s3
\end{itemize}
\item item three
\begin{itemize}
\item subitem1
\item s2
\item s3
\end{itemize}
\end{itemize}
\end{document}