0
\documentclass{beamer}
\usetheme{CambridgeUS}
\useoutertheme{infolines}
\usepackage{tikz}
\usepackage{tabularx}
\usepackage{ragged2e}  

\begin{document}
\begin{frame}
\frametitle{Introduction}
 \begin{itemize}
        \item Text:
        \break
        \begin{itemize}
           \item \justify \textbf{What is lorem ipsum}: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. \break
            \item \justify \textbf{why do you use it}:It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

        \end{itemize}
        \break
        \end{itemize} 

\end{frame}
\end{document}

I use the package ragged2e to align text. However when I use \justify every item in the list lose the bullet in front of it

Stiar
  • 75

2 Answers2

2

Since you probably don't want a page break in the middle of a slide, one can use \parbox to create a block of justified text. Note that LaTeX uses \fussy and \sloppy to turn justification on, although that is the default for a \parbox.

\documentclass{beamer}
\usetheme{CambridgeUS}
\useoutertheme{infolines}
\usepackage{tikz}
\usepackage{tabularx}
%\usepackage{ragged2e}  
\begin{document}
\begin{frame}
\frametitle{Introduction}
 \begin{itemize}
        \item Text:
        \break
        \begin{itemize}
           \item \parbox[t]{\linewidth}{\textbf{What is lorem ipsum}: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.} \break
            \item \parbox[t]{\linewidth}{\textbf{why do you use it}:It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).}

        \end{itemize}
        \break
        \end{itemize} 

\end{frame}
\end{document}

demo

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
1

Edit: Apparently I did not do my homework to first search within this site. This question has been asked before and there is already an answer by @GonzaloMedina. I can only assume the downvote to my answer is due to the duplicate, since my code fixing is identical to that of @GonzaloMedina, except the order of %\raggedright and \justifying.

I wanted to clarify that I did not plagiarize from @GonzaloMedina. My answer starts by telling the OP to use \justifying and not \justify, which is not even mentioned in @GonzaloMedina’s answer. I would appreciate anyone suspicious of plagiarism at least writes me a comment pointing to the answer of @GonzaloMedina, so I can edit my post accordingly.


Original answer

First thing first: It is \justifying, not \justify.

There is a reason for this: You should never include long paragraphs in your presentation!!! What would you expect the audience to do? Should they read what’s on the screen? Or should they listen to you read the paragraphs while staring them?

To get the unpleasant result, let’s change the definition of \itemize found in beamerbaselocalstructure.sty:

\documentclass{beamer}
\usepackage{blindtext}
\usepackage{ragged2e}
\makeatletter
\renewcommand{\itemize}[1][]{%
  \ifblank{#1}{}{\def\beamer@defaultospec{#1}}%
  \ifnum \@itemdepth >2\relax\@toodeep\else
    \advance\@itemdepth\@ne
    \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
    \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
    \list
      {\usebeamertemplate{itemize \beameritemnestingprefix item}}
      {\def\makelabel##1{%
          {%
            \hss\llap{{%
                \usebeamerfont*{itemize \beameritemnestingprefix item}%
                \usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
          }%
        }%
      }
  \fi%
  \beamer@cramped%
%  \raggedright% <- commented out
  \justifying% <- changed here
  \beamer@firstlineitemizeunskip%
}
\makeatother

\begin{document}

\begin{frame} \begin{itemize} \item \blindtext \item \blindtext \end{itemize} \end{frame}

\end{document}

itemize justified

Ruixi Zhang
  • 9,553
  • Thank you for your time to post an answer. Please check that text is a dummy lorem ipsum text which is used only as a test text. So please be kind as you don't know the person who posts and how s/he handles the presentation process and writing style – Stiar Aug 25 '18 at 18:38
  • @Stiar I’m fully aware of your use of the blind text ;-) My comment on “not including long paragraph” is recommended by many: If you read the last few lines of Gonzalo’s answer, then you’d find out him and I share the same idea. Also, I would highly encourage you to check this excellent TED talk. In particular, starting from 7:16, the speaker explains why keeping your slide short and simple is a good practice. – Ruixi Zhang Aug 25 '18 at 19:14
  • @Stiar The main take-away is: Your items in a bullet list should be short and concise. And if you follow this advice, then no \justifying will be needed anymore. When I’m presenting a long theorem, I’d actually make my effort to rephrase long sentences in my paper so it comes out clean and simple on my slides. – Ruixi Zhang Aug 25 '18 at 19:35
  • And how can you change the background color of Chambridge template to black as the presentation mentioned? – Stiar Aug 25 '18 at 19:53