光束和森林

光束和森林

我正在使用森林准备投影仪演示文稿和流程图。出于某种原因,它建议额外}或问题\end{frame}。以下是代码:

\documentclass[12pt,a4paper]{beamer}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{forest}
\usetheme{CambridgeUS}
\usefonttheme{professionalfonts}
\author{Dr Vaibhav Banait, }
\title{Hepatitis B and C (For healthcare workers)}
\begin{document}

\begin{frame}
\centering


\begin{forest}
[Exposure to infected blood
[acute hepatitis b
[recovery]
[Carrier state]
[Chronic hepatitis B
[Cirrhosis][Liver Cancer]
]]
[acute hepatitis c
[recovery]
[chronic hepatitis c
[Cirrhosis][Liver Cancer]
]

]
]
\end{forest}
\end{frame}
\end{document}

答案1

forest该问题是由于环境中留下的空行造成的:

[Cirrhosis][Liver Cancer]
]

]
]

删除它,一切正常。

完整的示例(由于树不适合框架,因此已被缩放):

\documentclass{beamer}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{lmodern}
\usepackage{amssymb}
\usepackage{forest}
\usetheme{CambridgeUS}
\usefonttheme{professionalfonts}
\author{Dr Vaibhav Banait, }
\title{Hepatitis B and C (For healthcare workers)}
\begin{document}

\begin{frame}
\centering
\scalebox{0.825}{
\begin{forest}
[Exposure to infected blood
[acute hepatitis b
[recovery]
[Carrier state]
[Chronic hepatitis B
[Cirrhosis][Liver Cancer]
]]
[acute hepatitis c
[recovery]
[chronic hepatitis c
[Cirrhosis][Liver Cancer]
]
]
]
\end{forest}
}
\end{frame}
\end{document}

结果:

在此处输入图片描述

相关内容