【问题标题】:Tikz font in beamer export投影仪导出中的 Tikz 字体
【发布时间】:2020-03-29 14:12:25
【问题描述】:

我正在从包含 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}

【问题讨论】:

  • 你能显示生成的 .tex 代码吗?没看代码,这只是猜测:\tikzset{ font=\sffamily }
  • @samcarter_is_at_topanswers.xyz 我编辑了问题以包含乳胶代码。如您所见,orgmode 执行代码 tiks code 并将结果存储在 pdf 文件中,然后将该 pdf 文件插入到生成的演示文稿中

标签: emacs latex org-mode beamer


【解决方案1】:

问题是使用 src 块会导致 org 在该块上调用 LaTeX,这不会从文档继承任何设置。如果将begin_src...end_src 更改为begin_export latex ... end_export 会怎样?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-01
    • 1970-01-01
    • 2011-03-13
    • 2011-03-12
    • 1970-01-01
    • 1970-01-01
    • 2022-06-21
    相关资源
    最近更新 更多