Skip to content

Latex: multiple columns with different/uneven width

March 18, 2018

Different methods that do not work:

First,

\usepackage{multicol}
\begin{multicols}{2}
\end{multicols}

The problem of this method is that you cannot adjust the column width, which is automatically calculated by the package.

Second,

\usepackage{vwcol}
\begin{vwcol}[widths={0.6,0.4}]
\end{vwcol}

The problem is that it simply does not work properly and I didn’t spend too much time digging out. The supporting websites are not many.

Third,

using tables. The problem is that when I insert sections or other environments in tables, there were errors. I guess table is after all a local environment. It is not suitable to put all the document in tables.

Method that works:

minipage:

\noindent
\begin{minipage}[c]{0.6\linewidth}
xxx
\end{minipage} % no space if you would like to put them side by side
\begin{minipage}[c]{0.3\linewidth}
xxx
\end{minipage}

 

 

 

Advertisements

Latex支持中文和修改中文字体

January 30, 2018

如何设置CTex使之支持中文:

很好的文章:

http://gaolei786.github.io/latex/helloctex.html

https://wenku.baidu.com/view/dbd74b5b1611cc7931b765ce05087632311274b2.html

上面两个链接是一个文章。

要点是:

  1. 保存类型:类型选”UTF-8”,后缀选择***.tex。
  2. \usepackage{ctex}  %加载包,因为我们在用中文写文档,所以必须加载这个包,否则不支持中文
  3. 就可以直接在WinEdit中对它编译。首先要选择合适的编译器:XeLatex,这个编译器对中文支持比较好

我已经成功实现中文输入。不过每次需要点击XeLatex编译,而且不会自动弹出来PDF,需要手动点击PDF预览按钮。

如何修改中文字体:

下面是我测试完的管用的:

http://blog.csdn.net/programchangesworld/article/details/51429138

要点:

1. 改变字体分为两种,一种是全局改变,一种是局部改变。

\usepackage{CJK}
% 用于全局修改字体
\setCJKmainfont{STXingkai}
% 用于局部修改字体
\setCJKfamilyfont{hwxk}{STXingkai}
\newcommand{\huawenxingkai}{\CJKfamily{hwxk}}

局部修改的方法:{\huawenxingkai 测试字体}

2. 哪些字体可选择:上面是STXingkai是行楷,还有

STCaiyun,华文彩云:style=Regular
YouYuan,幼圆:style=Regular
STHupo,华文琥珀:style=Regular
KaiTi_GB2312,楷体_GB2312:style=Regular
NSimSun,新宋体:style=Regular
FangSong_GB2312,仿宋_GB2312:style=Regular
SimSun,宋体:style=Regular
STXinwei,华文新魏:style=Regular
SimHei,黑体:style=Regular
STXingkai,华文行楷:style=Regular
LiSu,隶书:style=Regular

我上面测试成功的包括:FangSong, SimSun, NSimSun, STXinwei, SimHei

关于字体代码,参见http://kuing.is-programmer.com/posts/32555.html

Latex: usage of subfloat minipage

November 11, 2017
\begin{figure*}
 \centering
\subfloat[]{
\begin{minipage}[b][][t]{.3\textwidth} % [b] bottom [t] top
\centering
\includegraphics[width=\linewidth]{fig_sim_singleIntegrator_noIntegralStationary_traj}
\includegraphics[width=\linewidth]{fig_sim_singleIntegrator_noIntegralStationary_bearingerror}
\end{minipage}}%
\subfloat[]{
\begin{minipage}[b][][t]{.3\textwidth} % [b] bottom [t] top
\centering
\includegraphics[width=\linewidth]{fig_sim_singleIntegrator_noIntegralMoving_traj}
\includegraphics[width=\linewidth]{fig_sim_singleIntegrator_noIntegralMoving_bearingerror}
\end{minipage}}%
\subfloat[]{
\begin{minipage}[b][][t]{.3\textwidth} % [b] bottom [t] top
\centering
\includegraphics[width=\linewidth]{fig_sim_singleIntegrator_PIMoving_traj}
\includegraphics[width=\linewidth]{fig_sim_singleIntegrator_PIMoving_bearingerror}
\end{minipage}}%
 \caption{The bearing error is $\sum_{(i,j)\in\E}\|g_{ij}-g_{ij}^*\|$.}
 \label{fig_sim_PI_noIntegral}
\end{figure*}

Feedback linearization of Unicycle Model

November 5, 2017

Keywords: unicycle, single integrator, double integrator, feedback linearization

There are two types of feedback linearization of unicycle models. The first is to obtain a single-integrator model. The second is to obtain a double-integrator model (reference for the double integrator model: Automatica “Distributed formation control of nonholonomic mobile robots without global position measurements”).

my memo: unicycle linearization

Get Euler angles from a rotation matrix

July 26, 2017
Matlab function:

function rho=fcn_EulerFromRotation(R)
% R is the rotation from body to world frame

% assume -pi/2<tht<pi/2

%R31=-sin(tht)
tht=-asin(R(3,1));

%R32=sin(phi)*cos(tht), R33=cos(phi)*cos(tht)
phi=atan2(R(3,2),R(3,3));

%R21=cos(tht)*sin(psi), R11=cos(tht)*cos(psi)
psi=atan2(R(2,1),R(1,1));

rho=[phi,tht,psi]';

matlab generate the same random number everytime

June 16, 2017

use the following command before the rand function, you will get the same random number everytime you run the m file.

rand(‘seed’, 0);

rand

Set latex font

June 12, 2017

The command is:

\renewcommand*\rmdefault{ptm} %ppl

if you want to understand the three letter word: ptm or ppl. Read the table III of this document: http://tug.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf

Here is a good introduction:

https://www.tug.org/pracjourn/2006-1/schmidt/schmidt.pdf