0
\documentclass{beamer}
\begin{document}
\newcommand{\origintext}[??]{?????}         %<-------------How ?
\section{aaa}

\subsection{bbb}


%%%%%%%%%%%%%%%%%%%  frame 1


\frame{test frame 1}


%%%%%%%%%%%%%%%%%%%%%%% frame 2

\origintext{

\section*{sec title}

\subsection*{subsec title}

sadsadf
asfsaf


asfasf

}

%%%%%%%%%%%%%%%%%%%%%%%%  frame

\frame{test frame 3}

\end{document}

thanks a lot! @cfr @barbara beeton @Christian Hupfer. Yes, I want show sth. from another .tex file use \documentclass{article}, hope looks like the result pdf file. the \section*{} generate bold large font ... Barbara Beeton gives a way, but I want generate it directively

\documentclass{article}
\begin{document}
\section*{sec title}

\subsection*{subsec title}

sadsadf
asfsaf


asfasf
\end{document}
Zeno Shuai
  • 395
  • 1
  • 7
  • Welcome to TeX.SX! What do you mean by \origintext? LaTeX code displayed as LaTeX code? –  Sep 06 '15 at 11:51
  • how cound i define a new command \origintext{} to show the original text with section*{}'s format:font,size,... – Zeno Shuai Sep 06 '15 at 11:53
  • actually, origintext from a documentclass{article} – Zeno Shuai Sep 06 '15 at 11:55
  • 1
    Sorry, your question is incomprehensible to me –  Sep 06 '15 at 11:56
  • i only want to show some article's text in a frame, but the section's in beamer not function, because beamer explain section as structure – Zeno Shuai Sep 06 '15 at 11:59
  • 1
    this is a guess ... you want to show what the "original text" looks like when it is on a page in an article. if that's what you want, then the easiest way i know of is to set just that sample separately using the document class of the original (making sure to set \thispagestyle{empty}), then insert the result in the beamer file with \includegraphics. some techniques for cropping the image are suggested in answers to this question: Compile a LaTeX document into a PNG image that's as short as possible – barbara beeton Sep 06 '15 at 12:25
  • 3
    Please don't vote to close a question asked less than 1 hour ago: give the author a chance to improve it in response to comments. Especially when it is the OP's first question and some code is presented. I know this question is unclear in its current form and that the code is not a complete example, but the OP is engaging with discussion in comments and, even if they weren't, an hour would be much too soon to assume they won't! – cfr Sep 06 '15 at 12:39

1 Answers1

3

You can try this

\documentclass{beamer}
\makeatletter
\newcommand{\origintext}[1]{%
\begingroup
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries}}
#1
\endgroup}
\makeatother
\begin{document}

\section{aaa}

\subsection{bbb}


%%%%%%%%%%%%%%%%%%%  frame 1


\frame{test frame 1}


%%%%%%%%%%%%%%%%%%%%%%% frame 2
\frame{
\origintext{

\section*{sec title}

\subsection*{subsec title}

sadsadf
asfsaf


asfasf

}}

%%%%%%%%%%%%%%%%%%%%%%%%  frame

\frame{test frame 3}

\end{document}
touhami
  • 19,520