投影仪导出中的Tikz字体

问题描述 投票:0回答:1

我正在从包含tikz代码块的组织文件中导出演示文稿。这是我的最小工作示例:

#+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导出此幻灯片:enter image description here

我的问题是,我如何告诉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}
emacs latex org-mode beamer
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.