您現在的位置是:首頁 > 垂釣

Latex寫科研報告:圖表+公式+參考文獻,N多知識點

  • 由 星未007 發表于 垂釣
  • 2022-01-02
簡介comp356438078}{citet{Xingwei2021}, Journal of Zhihu, 001, 00}}end{frame}%%%#########################################

參考文獻中的等等怎麼寫

Beamer 是一個用於建立簡報LaTeX 的文件類。它同時支援LaTeX + dvips、pdfLaTeX、LuaLaTeX以及XeLaTeX。它的名稱取自德語詞彙Beamer,意思是影像演示[引自維基百科]。

本文蒐集和整理了網上的beamer教程,在別人模板的基礎上,實現諸多內容,比如:

(1)報告題目用 圖片 展示,這樣可以極大豐富僅僅在報告題目上的創新。最簡單的應用就是在想講一篇已發表的文章時,替代手打題目和作者,使用者可以將正式發表文章的題目和作者部分截圖,並作為ppt的報告題目,這樣可以保留正式的形式。

(2)展示了圖表的基本使用。如圖片的位置,表格內整行顏色的調整,以及單元格的顏色等等。

(3)

藉助MNRAS期刊模板的bst和cls檔案,實現了使用bibtex對文章的引用

(4)展示如何載入程式設計程式碼。

(5)可以使用自定義背景圖片。

下邊先展示編譯後的結果,最後放程式碼和分享檔案。

Latex寫科研報告:圖表+公式+參考文獻,N多知識點

編譯後的結果

%%% 本示例參考了大量網上教程,在此一併感謝!但鑑於引用之處繁瑣故不一一列出引用,報以歉意。%%% 請將參考文獻的bibtex格式放入template。bib中。%%% 使用xelatex編譯template。tex, bibtex 編譯template。bib,如:%%% xelatex template。tex%%% bibtex template%%% xelatex template。tex%%% xelatex template。tex %%多編譯一遍,引用才正確。\documentclass[10pt, mathserif,hidelinks,hyperref={pdfpagelabels=false}]{beamer} % font and size\mode{ \setbeamercolor{normal text}{fg=black,bg=white} \setbeamercolor{alerted text}{fg=red} \setbeamercolor{example text}{fg=green!50!black} \setbeamercolor{structure}{fg=beamer@blendedblue} \setbeamercovered{dynamic} % translucent when using pause \setbeamertemplate{navigation symbols}{} % hide navigation bars \setbeamertemplate{caption}[numbered] % numerate captions \setbeamertemplate{background}{\includegraphics[height=\paperheight]{logo-bg/bg-orange}} % set background image \setbeamertemplate{footline}{\textcolor{light-gray}{\scriptsize \insertframenumber/\inserttotalframenumber} \hfill} % display page number at bottom left corner }\usepackage{natbib}\usepackage{ctex} %\usepackage{amsmath, amsfonts, amssymb} % math equations, symbols\usepackage[english]{babel}\usepackage{color,colortbl} % color content\usepackage{graphicx} % import figures\usepackage{url} % hyperlinks\usepackage{bm} % bold type for equations\usepackage{hyperref} % bookmarks\usepackage{mhchem}\usepackage[absolute,overlay]{textpos}\usepackage{wrapfig}\usepackage{colortbl}\usepackage{multicol}\usepackage{nicematrix}\usepackage{pgfplots}\usepackage{tikz}\usepackage{listings}\usepackage{xcolor}\definecolor{codegreen}{rgb}{0,0。6,0}\definecolor{codegray}{rgb}{0。5,0。5,0。5}\definecolor{codepurple}{rgb}{0。58,0,0。82}\definecolor{backcolour}{rgb}{0。95,0。95,0。92}\lstdefinestyle{mystyle}{ backgroundcolor=\color{backcolour}, commentstyle=\color{codegreen}, keywordstyle=\color{magenta}, numberstyle=\tiny\color{codegray}, stringstyle=\color{codepurple}, basicstyle=\ttfamily\footnotesize, breakatwhitespace=false, breaklines=true, captionpos=b, keepspaces=true, numbers=left, numbersep=5pt, showspaces=false, showstringspaces=false, showtabs=false, tabsize=2}\lstset{style=mystyle}\hypersetup{bookmarks, unicode} % unicode\newcommand{\ftitle}[1]{\frametitle{#1}} % userdefine frametitle\definecolor{light-gray}{gray}{0。90}\newcommand \mnras {MNRAS} %如果引用的期刊有縮寫的話,可以這樣定義。\hypersetup{ colorlinks, linkcolor={red!50!black}, citecolor={blue!50!black}, urlcolor={blue!80!black}}%%%########################################################################\begin{document}%\begin{CJK}{UTF8}{song} % all Chinese should be enclosed between the commands\title[abbreviation]{\hspace{-20pt} \begin{figure} \centering \includegraphics[width=1。0\textwidth]{figs/title。png} \end{figure}} %your title \\%%%或者%\title[abbreviation]{your title} \author{ {\color{blue} Speaker:} Your name \\ xxxxx@email。com }\institute[ISEE]{\normalsize \\ 單位/組織/公司等}\date{\today} %\today%\AtBeginSection[]%{%\begin{frame}[t] %\ftitle{Outline} % contents for better review %\tableofcontents[section]%\end{frame}%}\AtBeginSection[]{\begin{frame}[t] \ftitle{Outline} % contents for better review \tableofcontents[currentsection, currentsubsection]\end{frame}}%%%########################################################################\begin{frame} \titlepage % make the cover page here \hspace{60pt} {\small Ref: \href{https://zhuanlan。zhihu。com/p/356438078}{\citet{Xingwei2021}, Journal of Zhihu, 001, 00}}\end{frame}%%%########################################################################\section{圖片}\begin{frame}[fragile]{1:單純的圖片示例} \begin{figure}\centering\includegraphics[scale=0。2]{figs/plot。png}\caption{Gnuplot 畫的圖}\label{fig:gnu}\end{figure}\end{frame}%%%########################################################################\begin{frame}[fragile]{2:不單純的圖片,位置+程式碼}\begin{columns} %%%%%%%%%%%%%%%%%%%%%%\column{0。6\textwidth}方法1:\begin{lstlisting}[language=Gnuplot]set terminal pngcairoset output “plot。png”\end{lstlisting}方法2:\lstinputlisting[language=Gnuplot,firstline=14, lastline=23]{code/plot。gp}%%%%%%%%%%%%%%%%%%%%%\column{0。4\textwidth}\includegraphics[scale=0。13]{figs/plot。png}\begin{figure} \resizebox{4cm}{!} %%%{Horizontal length}{vertical length} { \begin{tikzpicture} \begin{axis} \addplot3[surf,]{exp(-x^2-y^2)*x}; \end{axis} \end{tikzpicture} } \caption{Tikz figure} \label{fig:tikz}\end{figure}\end{columns}完整的Gnuplot例子請點選:\href{https://zhuanlan。zhihu。com/p/356438078}{一張圖急速入門科研繪圖 Gnuplot}\end{frame}%%%########################################################################\section{表格}\begin{frame}[t]{酷酷的表格} %\newcolumntype{g}{>{\columncolor{gray}}c}\begin{table} \centering{} \caption{表格示例} \label{tab:exam} \begin{tabular}{|c|cccc|ccc|} \hline \rowcolor{blue!20} Q&\multicolumn{4}{c}{\cellcolor{gray!20} Column-1 } & \multicolumn{3}{c}{\cellcolor{red!20} Column-2} \\ \hline \rowcolor{blue!20} &A & B & C & D & E & F & G \\ \rowcolor{blue!20} & ($\alpha$) & ($\beta$) & ($\gamma$) & ($\tau$) & ($\theta$) & ($\zeta$) & ($\phi$) \\ \hline Q1 & xxx & 3。6 & 3。2$\times 10^8$ & yyy & 3。6 & 3。2$\times 10^8$ & 0。004 \\ Q2 & xxx & 4。3 & 5。9$\times 10^6$ & yyy & 4。3 & \cellcolor{blue!20} 4。4$\times 10^6$ & 0。020\\ Q3 & xxx & 1。8 & 2。8$\times 10^6$ & yyy & 1。8 & 2。8$\times 10^6$ & 0。006\\ Q4 & xxx & 3。1 & 1。9$\times 10^5$ & yyy & {\color{red} 1。5} & {\color{red} 1。0$\times 10^5$ }& {\color{red} 0。036 }\\ \hline \end{tabular} \\ 說明:。。。。\end{table} \end{frame}%%%########################################################################\section{公式}\begin{frame}[t]{\colorbox{blue!20}{拉風的公式}\colorbox{gray!20}{的}\colorbox{red!20}{使用}} \begin{equation}\frac{dn}{dt} = \int_{\Omega=0}^{\Omega=\Phi} \sqrt{ \alpha \cdot \exp(\Omega) + \beta \odot \Omega } d\Omega{}\label{eq:1}\end{equation}\begin{equation}I= \begin{bmatrix} I & am & a \\ M & a & t \\ r & i & x \end{bmatrix} \label{eq:2}\end{equation}\begin{textblock*}{10cm}(0。1cm,6cm) % {block width} (coords) \begin{equation}i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>\label{eq:3}\end{equation}\end{textblock*}\begin{textblock*}{5cm}(1cm,8cm) % {block width} (coords) \ce{H2O -> H2 + O}\end{textblock*}\end{frame}%%%########################################################################\section{引用}\begin{frame}[fragile]{\colorbox{blue!20}{正經的引用:}\colorbox{gray!20}{圖表}\colorbox{red!20}{參考文獻}}%Here begins the 3d plot\begin{itemize}\item {\bf 參考文獻:} \citet{Xingwei2021} and XXX \citep[e。g。][after]{Xingwei2021}。\item {\bf 圖表:} See Fig。~\ref{fig:gnu} and \ref{fig:tikz} and Eq。~(\ref{eq:1}-\ref{eq:3}) and Table~\ref{tab:exam}。\end{itemize}\begin{table}\small %%% for font\caption{對應表}\begin{tabular}{|l|l|}\hline \verb|\citet{Xingwei2021} | & \citet{Xingwei2021} \\\hline \verb|\citep[e。g。][after]{Xingwei2021}| & \citep[e。g。][after]{Xingwei2021}\\\hline \verb|Fig。~\ref{fig:gnu} and \ref{fig:tikz}| & Fig。~\ref{fig:gnu} and \ref{fig:tikz}\\\hline \verb|Eq。~(\ref{eq:1}-\ref{eq:3})| & Eq。~(\ref{eq:1}-\ref{eq:3})\\\hline \verb|Table~\ref{tab:exam}| & Table~\ref{tab:exam} \\\hline \verb|\href{https://zhuanlan。zhihu。com/| $\hookleftarrow$ & \href{https://zhuanlan。zhihu。com/p/356438078}{zhihu link} \\ \verb|p/356438078}{zhihu link}| & \\\hline\end{tabular}\end{table}\end{frame}%%%########################################################################%\section{Thanks}\begin{frame} Thanks for your listening。 \\\end{frame}%%%########################################################################%\section{References}\begin{frame}[fragile]{References:} %\ftitle{References:} %\label{Reference} \bibliographystyle{mnras} % different styles, such as ieee \bibliography{template} % make reference list \url{https://zhuanlan。zhihu。com/p/356438078}\lstinputlisting[language=Gnuplot,captionpos=t,caption=“template。bib裡的內容”]{template。bib}\end{frame}%%%########################################################################\end{document}

使用xelatex編譯template。tex, bibtex 編譯template。bib,如:

xelatex template。tex

bibtex template

xelatex template。tex

xelatex template。tex %%多編譯一遍,引用才正確。

本文基於網上搜集的模板,資料和問答內容,整理而成。對所有分享者致以敬意。鑑於引用參考之處頗多,不一一列出引用,抱以歉意。

Top