惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
F
Fortinet All Blogs
爱范儿
爱范儿
博客园 - Franky
MyScale Blog
MyScale Blog
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
B
Blog
P
Proofpoint News Feed
IT之家
IT之家
宝玉的分享
宝玉的分享
D
DataBreaches.Net
S
SegmentFault 最新的问题
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
M
MIT News - Artificial intelligence
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
雷峰网
雷峰网
Stack Overflow Blog
Stack Overflow Blog
量子位
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH 更改 Adsense 邮寄地址,重新寄送 PIN Mintty Tips and Configurations
Nifty LaTeX Techniques -- Series 1
2019-10-22 · via jdhao's digital space

Change font size#

By default, LaTeX provides several command to change the font size to predefined size. Those command include \scriptsize, \large, \Huge etc. However, even the font size provided by the \Huge command may not be large enough.

In this case, we can use the \fontsize command to change the font size to what we want. The signature of \fontsize command is:

\fontsize{<font_size>}{<baseline_skip>}

The first parameter is the font size and the second parameter is baseline skip. The default font used by LaTeX does not support arbitrary font size, and we have to use another font such as Latin Modern. A minimal example is the follows:

\documentclass{article}
% use the Latin Modern font
\usepackage{lmodern}
\begin{document}
% turn off page numbering
\pagenumbering{gobble}

{\flushleft \fontsize{50}{10}\selectfont 50pt}

{\flushleft \fontsize{100}{10}\selectfont 100pt}

{\flushleft \fontsize{150}{10}\selectfont 150pt}

{\flushleft \fontsize{200}{10}\selectfont 200pt}

\end{document}

In the above code, \selectfont is used to make the font change take effect.

References#

Produce vertical text#

Sometimes, we want to produce a vertical text line. This can be achieved by using the \rotatebox box command provided by the graphicx package. A small runnable script is provided below:

% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{graphicx}

\begin{document}
% turn off page numbering
\pagenumbering{gobble}

\rotatebox[origin=c]{90}{\fontsize{50}{5}\selectfont \textbf{Test text.}}
\end{document}

Another way to rotate texts is to use the rotating package, which provides a turn environment to rotate texts to certain angles:

% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{lmodern}
\usepackage{rotating}

\begin{document}
% turn off page numbering
\pagenumbering{gobble}

% rotate the text to 90 degrees counterclockwise
\begin{turn}{90}
    \fontsize{50}{5}\selectfont \textbf{Test text.}
\end{turn}

\end{document}

References#