emacs - 投影仪导出中的 Tikz 字体
问题描述
我正在从包含 tikz 代码块的 org 文件中导出演示文稿。这是我最小的工作示例:
#+TITLE: Beamer Question
#+AUTHOR: J. Doe
#+OPTIONS: H:2 toc:t
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation, aspectratio=169]
#+LATEX_HEADER: \usepackage{graphicx}
#+BEAMER_THEME: Hannover
#+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col)
* Introduction
** Problem
*** Normal text
:PROPERTIES:
:BEAMER_col: 0.4
:END:
This is how normal text looks; with sans serif font
*** Tikz image
:PROPERTIES:
:BEAMER_col: 0.6
:END:
#+begin_src latex :file tikz.pdf :packages '(("" "tikz")) :border 1pt :results raw % Define block styles
\begin{tikzpicture}[ text/.style={text width=5cm, align=center}]
\node (n) [text] at (0,0) {But if I write text in a tikz picture, it uses the default Latex font (serif)};
\end{tikzpicture}
#+end_src
导出它M-x org-beamer-export-to-pdf
会产生这张幻灯片:
我的问题是,我如何告诉 tikz 使用与投影仪演示的其余部分相同的字体?
我尝试过的事情:
在线搜索。什么也没找到
导出到乳胶文件。结果是 orgmode 执行 tikz 代码,生成 pdf(字体错误)并将生成的 pdf 作为图像插入。问题依然存在
编辑:根据要求,这是 orgmode 生成的乳胶代码
% Created 2020-03-29 dom. 09:45
% Intended LaTeX compiler: pdflatex
\documentclass[presentation, aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{graphicx}
\usetheme{Hannover}
\author{J. Doe}
\date{\today}
\title{Beamer Question}
\hypersetup{
pdfauthor={J. Doe},
pdftitle={Beamer Question},
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs 26.1 (Org mode 9.1.9)},
pdflang={English}}
\begin{document}
\maketitle
\begin{frame}{Outline}
\tableofcontents
\end{frame}
\section{Introduction}
\label{sec:org689fb7a}
\begin{frame}[label={sec:org3b759e9}]{Problem}
\begin{columns}
\begin{column}{0.4\columnwidth}
This is how normal text looks; with sans serif font
\end{column}
\begin{column}{0.6\columnwidth}
\includegraphics[width=.9\linewidth]{tikz.pdf}
\end{column}
\end{columns}
\end{frame}
\end{document}
解决方案
问题是使用 src 块会导致 org 在该块上调用 LaTeX,这不会从文档继承任何设置。如果您更改begin_src...end_src
为begin_export latex
...end_export
怎么办?
推荐阅读
- javascript - Ag - 使用 processCellCallback 将网格中的网格导出下拉到 excel
- python-3.x - Python将列表解析为列表列表
- azure-devops - Azure Devops 回归测试用例管理
- c# - Visual Studio 2019 中没有 GitHub 的连接选项
- python - 在 pygame -Python 上删除绘图而不覆盖以前的绘图
- logging - 为 ProFTPd 设置详细日志记录
- python - 为什么最后一个向量被复制到python中列表的所有元素
- spring - @RequestParam 上的约束验证似乎不起作用
- python - pandas to_numeric(..., downcast='float') 失去精度
- r - 如何根据 r 中的日期/日期拆分和制作新的 csv 文件?