LaTeX一些用法实例(并列图片 & 并列表格 & 算法代码示例 & 页眉太长 & 下划线,等)
2019-01-22 09:37
6274 查看
版权声明:转载请注明出处。 https://blog.csdn.net/sinich__eveen/article/details/86561883
目录
LaTeX页眉显示:Title Suppressed Due to Excessive Length
横向并列两个图片
[code]\begin{figure} \begin{minipage}{0.49\linewidth} \centering \includegraphics[width=6.5cm]{Simulation_Figures/Fig1_eps} \caption{The average outage probability versus $\gamma$} \label{Fig1} \end{minipage} \begin{minipage}{0.49\linewidth} \centering \includegraphics[width=6.5cm]{Simulation_Figures/Fig2_eps} \caption{Resource allocation among CSBSs for different algorithms} \label{Fig2} \end{minipage} \end{figure}
其中【0.49\linewidth】控制双栏中每一栏的宽度
指定图片的大小【\includegraphics[width=4cm, height=3cm]{xxx.eps}】
显示效果:
竖向并列多个图片
[code]\begin{figure} \centering \subfigure[During the day] { \label{Fig8a} \begin{minipage}[b]{0.5\textwidth} \includegraphics[width=3.0in,height=3.0in]{Simulation_figures/Fig8a_pdf} \end{minipage} } \subfigure[At night] { \label{Fig8a} \begin{minipage}[b]{0.5\textwidth} \includegraphics[width=3.0in,height=3.0in]{Simulation_figures/Fig8b_pdf} \end{minipage} } \caption{Tidal effect} \label{Fig8} \end{figure}
显示效果:
并列两个表格
[code]\begin{table} \begin{minipage}{0.5\linewidth} \center \caption{CQET} \begin{tabular}{|l|l|l|} \hline {SN} & {Channel ID} & {Channel Quality} \\ \hline 1 & $N$ & $Q_1^i$ \\ 2 & $N-1$ & $Q_2^i$ \\ 3 & $N-2$ & $Q_3^i$ \\ \dots & \dots & \dots \\ $K_i$ & $N-K_i+1$ & $Q_{K_i}^i$ \\ \hline \end{tabular} \label{CQET} \end{minipage} \begin{minipage}{0.5\linewidth} \center \caption{SIT} \begin{tabular}{|l|l|} \hline {Parameters} & {Description}\\ \hline $N_D^i$ & No. of total required channels\\ $N_{Init}^i$ & No. of initial service channels\\ $N_N^i$ & No. of still needed channels\\ $N_A^i$ & No. of available channels\\ $N_S^i$ & No. of current serving channels\\ $K_i$ & No. of current serving users\\ $PL_A^i$ & $N_D^i/N_S^i$\\ $PL_B^i$ & $N_D^i/K_i$\\ \hline \end{tabular} \label{SIT} \end{minipage} \end{table}
显示效果:
输入下划线,双下划线,波浪线,删除线,斜删除线
[code]\usepackage{ulem} .... \uline{我是一个兵} 下划线 \uuline{我是一个兵} 双下划线 \uwave{我是一个兵} 波浪线 \sout{我是一个兵} 删除线 \xout{我是一个兵} 斜删除线
算法伪代码
宏包
[code]\usepackage{algorithmic} \usepackage{algorithm}
代码实例:
[code]\begin{algorithm}[!t] \caption{Fairness-based Distributed Resource Allocation Algorithm} \begin{algorithmic}[1] \STATE Let ${\cal G} = \left\{ {1,2, \ldots ,{\rm{G}}} \right\}$ denotes the set of CSBSs involved in the algorithm. \FOR{all CSBSs within ${\cal G}$} \IF{CSBS $i$ $N_S^i=0, N_A^i=1, K_i \ne 0$} \STATE Select the first rank channel in the CQET of CSBS $i$ \STATE Update CQET and SIT for the CSBS in ${\cal G}$ \ELSE \STATE Select the CSBS $i = argmax[PL_A^i]$ \IF{There are multiple CSBSs with the same $PL_A^i$} \STATE Select the CSBS $i = argmax[PL_B^i]$ \IF{There are multiple CSBSs with the same $PL_B^i$} \STATE Select the CSBS $i = argmax[Q_1^i]$ \STATE Select the first rank channel in the CQET of CSBS $i$ \STATE Update CQET and SIT for the CSBS in ${\cal G}$ \ELSE \STATE Select the first rank channel in the CQET of CSBS $i$ \STATE Update CQET and SIT for the CSBS in ${\cal G}$ \ENDIF \ELSE \STATE Select the first rank channel in the CQET of CSBS $i$ \STATE Update CQET and SIT for the CSBS in ${\cal G}$ \ENDIF \ENDIF \ENDFOR \STATE \textbf{output}: Channel allocation results $\left\{ {\tau _{i,k,n}^*} \right\}$. \end{algorithmic} \label{FDRA} \end{algorithm}
显示效果:
LaTeX页眉显示:Title Suppressed Due to Excessive Length
例如:
解决方案:
用相应的【\authorrunning{}】和【\titlerunning{}】生成短一点的作者列表和标题。
代码实例:
更改页边距
[code]\usepackage{geometry} \geometry{left=4.5cm,right=4.5cm,top=2.3cm,bottom=2.3cm}
标题中强制换行
[code]\caption{short text \protect\\ long text}
【\\】是脆弱命令,需要保护,必须在其前面加上【\protect】
相关文章推荐
- latex的一些编译问题--表格--页眉页脚
- Latex编辑算法伪代码示例
- Latex:基本用法、表格、公式、算法(持续更新)
- Latex中的一些表格用法总结(二)
- Latex中的一些表格用法总结(二)
- Latex编辑算法伪代码示例
- mysql中的一些稍微复杂用法实例代码
- 使用 Node.js 实现图片的动态裁切及算法实例代码详解
- 一个伪ajax图片上传代码实现示例
- Android仿网易新闻图片详情下滑隐藏效果示例代码
- css3背景图片透明叠加属性cross-fade简介及用法实例
- Jquery图片滚动与幻灯片的实例代码
- Android编程图片加载类ImageLoader定义与用法实例分析
- angular实现图片懒加载实例代码
- 简化Python的Django框架代码的一些示例
- Android实现图片轮播切换实例代码
- 一组PHP可逆加密解密算法实例代码
- Java基础系列:(4)多线程的一些用法示例
- 一些有意思的算法代码
- Latex 嵌套 表格 示例