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

推荐订阅源

F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
Last Week in AI
Last Week in AI
V
V2EX
博客园_首页
IT之家
IT之家
Jina AI
Jina AI
博客园 - 叶小钗
The Cloudflare Blog
T
Tailwind CSS Blog
腾讯CDC
B
Blog
D
Docker
L
LangChain Blog
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI

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#