Emacs Orgmode,如何删除代码块描述?

Emacs Orgmode,如何删除代码块描述?,emacs,latex,org-mode,Emacs,Latex,Org Mode,我有一个带有latex代码块的orgmode文档: So: #+BEGIN_SRC latex Hello #+END_SRC 但当我生成pdf时,我得到: 如何删除此“Latex”描述,并仅显示“So:Hello”? 谢谢大家! 从评论来看,我认为org-latex类不太正确。在里面 特别是,\usepackage*位看起来不正确 该变量状态的C-hv Alist of LaTeX classes and associated header and str

我有一个带有latex代码块的orgmode文档:

    So:
    #+BEGIN_SRC latex 
    Hello
    #+END_SRC
但当我生成pdf时,我得到:

如何删除此“Latex”描述,并仅显示“So:Hello”?
谢谢大家!

从评论来看,我认为org-latex类不太正确。在里面 特别是,\usepackage*位看起来不正确

该变量状态的C-hv

Alist of LaTeX classes and associated header and structure.
If #+LATEX_CLASS is set in the buffer, use its value and the
associated information.  Here is the structure of each cell:

  (class-name
    header-string
    (numbered-section . unnumbered-section)
    ...)

The header string
-----------------

The HEADER-STRING is the header that will be inserted into the
LaTeX file.  It should contain the \documentclass macro, and
anything else that is needed for this setup.  To this header, the
following commands will be added:

- Calls to \usepackage for all packages mentioned in the
  variables ‘org-latex-default-packages-alist’ and
  ‘org-latex-packages-alist’.  Thus, your header definitions
  should avoid to also request these packages.

- Lines specified via "#+LATEX_HEADER:" and
  "#+LATEX_HEADER_EXTRA:" keywords.

If you need more control about the sequence in which the header
is built up, or if you want to exclude one of these building
blocks for a particular class, you can use the following
macro-like placeholders.

 [DEFAULT-PACKAGES]      \usepackage statements for default packages
 [NO-DEFAULT-PACKAGES]   do not include any of the default packages
 [PACKAGES]              \usepackage statements for packages
 [NO-PACKAGES]           do not include the packages
 [EXTRA]                 the stuff from #+LATEX_HEADER(_EXTRA)
 [NO-EXTRA]              do not include #+LATEX_HEADER(_EXTRA) stuff

So a header like

  \documentclass{article}
  [NO-DEFAULT-PACKAGES]
  [EXTRA]
  \providecommand{\alert}[1]{\textbf{#1}}
  [PACKAGES]

will omit the default packages, and will include the
#+LATEX_HEADER and #+LATEX_HEADER_EXTRA lines, then have a call
to \providecommand, and then place \usepackage commands based
on the content of ‘org-latex-packages-alist’.
所以我认为你不应该在那里有\packages*行。还有,你是 最好使用自定义接口设置此变量或将其作为 初始化文件中的setq。我认为没有任何理由必须加载它 在加载后的评估调用中

使用上述文档中提到的组织变量添加/删除包。你 需要注意这一点,因为我发现这是一个区域组织模式可以是 小脆弱-存在一些不同的包依赖关系 根据您是否将整个组织文件导出为latex
文件/树或块

我将上面的代码片段导出到latex/PDF,我得到了您想要的,而不是您得到的。我建议您尝试使用最小的init文件,该文件只适当地加载组织模式,但不包含任何自定义设置。您还可以尝试检查生成的TeX文件,查看是否包含任何奇怪的包。\lstset{language=latex,label=,caption=,captionpos=b,numbers=none}是在latex中生成的。我可以用orgmode提供参数来修改这一行吗?不包括奇怪的包。啊,我明白了:我使用minted,而不是listings:这解释了我认为的不同行为。可能需要添加
#+latex_头:\usepackage{listings}
。@rvf0068:确实应该以这种或那种方式出现(请参阅文档中变量
org latex listings
,该变量建议将其添加到
org latex packages
),但如果没有,latex运行将根本不会生成PDF:它应该抱怨未定义的设置。但也许我太天真了,这会解决问题。