[LaTeX] box algorithm adjustbox subfigures, textwidth
algorithm
\begin{figure}[!t]
\vspace*{\dimexpr\fboxsep+\fboxrule}
\fbox{%
\parbox{\dimexpr\linewidth-2\fboxsep-2\fboxrule}{\raggedright
\begin{algorithmic}[1]
\STATE $L(p) = -1$, $p = 1,\ldots,N$.
\STATE $D(p) = +\infty$, $p = 1,\ldots,N$.
\FOR{$t=1$ to $T$}
\FOR{$k=1$ to $K$}
\FOR{$p \in S^t(k)$}
\IF{$D(p,k) < D(p)$}
\STATE $D(p) = D(p,k)$
\STATE $L(p) = k$
\ENDIF
\ENDFOR
\ENDFOR
\STATE Update new cluster center.
\STATE Update new search space.
\ENDFOR
\end{algorithmic}%
}}
\caption{caption.}
\label{fig:lkm_algo}
\end{figure}
adjustbox
% user@host:~/$ pdflatex
%\usepackage{graphicx} % graphicx must before adjustbox!!
%\usepackage{adjustbox}
\begin{figure}[!ht]
\centering
\adjustbox{width=\columnwidth,trim={.05\width} 0 {.09\width} {.05\height},clip}%
{%
\includegraphics[width=\columnwidth]{test.png}%
}
\caption{Caption here.}
\label{fig:lb}
\end{figure}
subfigures cross column
% \usepackage{graphicx}
\begin{figure*}[!ht]
\centering
\subfloat[]
{\includegraphics[width=0.32\linewidth]{1.png}%
\label{fig:m_r1}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{2.png}%
\label{fig:m_r2}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{3.png}%
\label{fig:m_r3}}\\
\subfloat[]
{\includegraphics[width=0.32\linewidth]{4.png}%
\label{fig:m_f1}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{5.png}%
\label{fig:m_f2}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{6.png}%
\label{fig:m_f3}}
%
\caption{caption here!}
\label{fig:m}
\end{figure*}
subfigure with adjustbox
\documentclass{IEEEtran}
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{lipsum}
\ifCLASSOPTIONcompsoc
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\else
\usepackage[caption=false,font=footnotesize]{subfig}
\fi
%%
\begin{figure}[!htb]
\centering
\vfill
\subfloat[]%
{\adjustbox{width=\columnwidth,trim={.04\width} 0 {.09\width} {.05\height},clip}%
{%
\includegraphics[width=\columnwidth]{1.jpg}%
}}\\
\subfloat[]%
{\adjustbox{width=\columnwidth,trim={.04\width} 0 {.09\width} {.05\height},clip}%
{%
\includegraphics[width=\columnwidth]{1.jpg}%
}}
\caption{caption}
\label{fig:kalkuebr}
\end{figure}
text width
\hsize
is the main parameter that TeX uses when typesetting: whenever it finishes a paragraph it looks at the current value of \hsize
for breaking it into horizontal boxes. Next, there are \leftskip
and \rightskip
and possibly other paragraph shape parameters (\hangindent
and \hangafter
or the more general \parshape
).
LaTeX uses an indirect approach and maintains many \...width
parameters.
\textwidth
is generally the global width of the text area, while \columnwidth
is the width of a column of text (it will be different from \textwidth
when typesetting in two or more columns). However, inside a minipage, \textwidth
will be set to the given argument along with \hsize
, \columnwidth
, and \linewidth
(they will revert to the previous values at the end of the minipage because it forms a group). Note that \parbox
doesn’t reset \textwidth
; the size is available as \linewidth
.
The parameter \linewidth
contains the line length inside a list (or derived) environment and it may change in a nested list (while \hsize
, \textwidth
and \columnwidth
don’t change).
When we have to specify a length depending on current conditions, we have to use the correct parameter. For example, the width of a figure should be specified in terms of \columnwidth
in a figure environment and of \textwidth
in a figure* environment; however this is done rarely when it’s known that the document will be typeset in one column format. The same should be for a tabular* or tabularx environment.
Instead, when we need something centered with respect to a line in a list, we should use \linewidth
:
\begin{enumerate}
\item some text that contains a `here' table
\begin{center}
\begin{tabularx}{.9\linewidth}{lXX}
...
\end{tabularx}
\end{center}
and some other text that follows.
\item ...
\end{enumerate}
In this case it would be wrong to use \textwidth
or \columnwidth
, as the line length is “unknown” at typing time.
Notice that LaTeX uses \hangindent
only for typesetting sectional titles and \leftskip
and rightskip
for \centering
, \raggedright
and \raggedleft
; the indentation of a list environment is obtained via \parshape
.
[LaTeX] box algorithm adjustbox subfigures, textwidth的更多相关文章
- Latex 算法Algorithm
在计算机科学当中,论文当中经常需要排版算法.相信大家在读论文中也看见了很多排版精美的算法.本文就通过示例来简要介绍一下 algorithms 束的用法.该束主要提供了两个宏包,包含两种进行算法排版的环 ...
- Latex Notes
latex Table of Contents 1. Presentation/Slides with Beamer 2. Drawing in LaTex With TikZ 3. Tracked ...
- POJ 1442 Black Box
第k大数维护,我推荐Treap..谁用谁知道.... Black Box Time ...
- Black Box 分类: POJ 栈和队列 2015-08-05 14:07 2人阅读 评论(0) 收藏
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8754 Accepted: 3599 Description ...
- 【POJ1442】【Treap】Black Box
Description Our Black Box represents a primitive database. It can save an integer array and has a sp ...
- Black Box《优先队列》
Description Our Black Box represents a primitive database. It can save an integer array and has a sp ...
- 数据结构(堆):POJ 1442 Black Box
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10658 Accepted: 4390 Descri ...
- [ACM] POJ 1442 Black Box (堆,优先队列)
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7099 Accepted: 2888 Descrip ...
- 【优先队列-求第Ki大的数】Black Box
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8637 Accepted: 3542 Descrip ...
随机推荐
- (CLR-Via-C#) 类型基础
CLR要求每个类型最终都派生自System.Object Object提供的公共方法: Equals: 如果两个对象具有相同的值,就返回true GetHashCode: 返回对象的哈希码 ToStr ...
- Java中Set集合是如何实现添加元素保证不重复的?
Java中Set集合是如何实现添加元素保证不重复的? Set集合是一个无序的不可以重复的集合.今天来看一下为什么不可以重复. Set是一个接口,最常用的实现类就是HashSet,今天我们就拿HashS ...
- C#之读写压缩文件
在处理文件时,常常会发现文件中有许多空格,耗尽了硬盘空间,.net的类提供了GZIP/Deflate算法可以压缩文件.这里只介绍了文件的压缩,但在实际应用更多的是压缩文件夹 压缩文件 解压文件 可以使 ...
- 去除Eclipse中js报错的问题
第一步: 去除eclipse的JS验证: 将windows->preference->Java Script->Validator->Errors/Warn ...
- [LeetCode] Contiguous Array 邻近数组
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. ...
- UVALive - 3942:Remember the Word
发现字典里面的单词数目多且长度短,可以用字典树保存 f[i]表示s[i~L]的分割方式,则有f[i]=∑f[i+len(word[j])] 其中word[j]为s[i~L]的前缀 注意字典树又叫前 ...
- 【luogu2161】【SHOI2009】Booking会场预约
原题传送门 题意简析:你需要写一个数据结构,维护一个时间轴,支持如下操作: 1)插入1个新区间,删除所有时间轴上与它有交的区间并输出个数. 2)查询当前时间轴上的区间个数. 解题思路:裸的无旋trea ...
- Linux上安装Libssh2
由于项目需要使用libssh2,在安装时,遇到一些问题,发现网上的都是互相抄,把自己遇到的问题,记下来,希望可以帮助到别人,自己下次使用时候,也方便查找,节约时间. 安装的流程: 1.下载源码,wge ...
- Intellij idea: java.lang.ClassNotFoundException:javax.el.ELResolver异常解决办法
使用Intellij idea编译过程中遇到的问题及解决办法. 由于编译时候报javax.servlet不存在,我把tomcat下的servlet-api.jar放到了External Librari ...
- 谷歌开发者:看可口可乐公司是怎么玩转TensorFlow的?
在这篇客座文章中,可口可乐公司的 Patrick Brandt 将向我们介绍他们如何使用 AI 和 TensorFlow 实现无缝式购买凭证. 可口可乐的核心忠诚度计划于 2006 年以 MyCoke ...