使用Emacs Org制作PDF文档

mac OS X 10.9.3 上emacs 24.1 org-mode8.26 利用beamer 输出中文ppt 上篇讲mac OS X 10.9.3 上emacs 24.1 org-mode8.26 输出中文pdf 阅读详情

Emacs Org 是什么,这里就不介绍了。

记得前不久我还用muse做笔记的,而现在就要用org,还是相当的纠结的。制作PDF最烦的就是中文显示了,周六用一整天折腾,终于搞定,现将过程记录下来。(仅在windows下测试通过,linux还未测试。)

本文只关注于使用Emacs Org生成PDF文档(尤其是中文显示问题),并假设读者对Emacs以及Emacs Org有一定的使用经历。

有任何问题,欢迎交流。邮件:wuyao721@163.com 微博:weibo.com/wuyao721 QQ:289811390 技术博客:blog.csdn.net/wuyao721 

1 工具包

1.1 Linux(Emacs + texlive + gbk2uni)

除了Emacs之外,还要安装texlive,它是Latex在Linux下的一个发行版,我们要用到它的一个程序pdflatex,用它将tex文件转成pdf。在ubuntu下这样安装:

sudo apt-get install emacs23 texlive-latex-recommended latex-cjk-chinese

1.2 Windows(Emacs + MinGW + CTeX + gbk2uni)

CTeX是Latex在Windows下的一个发行版,同样的,它提供了程序pdflatex。

MinGW是GNU在Winodws下的一个发行版,我们要用到它的一个程序iconv。如果字符编码是GBK,就不用iconv了。

2 把org给黑了

既然org-mode没有考虑中文问题,那么只能黑它一下了。1

2.1 添加新的latex文档类型

latex默认的文档类型有article, report, book和beamer,我们这里要新建一个支持中文的article,叫cjk-article,这个类型里,我们不使用默认的latex package(也就是org-export-latex-default-packages-alist),而使用自己定义的latex package(也就是org-export-latex-packages-alist)。

(add-to-list 'org-export-latex-classes
                  '("cjk-article"
                    "\\documentclass{article}
 [NO-DEFAULT-PACKAGES]
 [PACKAGES]
 [EXTRA]"
         ("\\section{%s}" . "\\section*{%s}")
         ("\\subsection{%s}" . "\\subsection*{%s}")
         ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
         ("\\paragraph{%s}" . "\\paragraph*{%s}")
         ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

2.2 自定义latex package

上面说到,要用自定义latex package,那么它是怎样的呢,请看:

(setq org-export-latex-packages-alist '(
    (""   "CJK"   t)
    (""     "indentfirst"  nil)
    ("pdftex"     "graphicx"  t)
    (""     "fancyhdr" nil)
    ("CJKbookmarks=true"     "hyperref"  nil)
"%% Define a museincludegraphics command, which is
%%   able to handle escaped special characters in image filenames.
\\def\\museincludegraphics{%
  \\begingroup
  \\catcode`\\\|=0
  \\catcode`\\\\=12
  \\catcode`\\\#=12
  \\includegraphics[width=0.75\\textwidth]
}"))

考察上面的配置,我们关注两个要点:latex包CJK提供了中文支持,CJKbookmarks=true让中文书签得以显示。这样生成的tex文件就大概是下面的样子:

\usepackage{CJK}
\usepackage{indentfirst}
\usepackage[pdftex]{graphicx}
\usepackage{fancyhdr}
\usepackage[CJKbookmarks=true]{hyperref}

2.3 重定义生成pdf的命令

用pdflatex生成的pdf书签会有乱码问题,使用gbk2uni能解决这个问题。流程大概是这样的:

  1. pdflatex生成乱码书签的pdf
  2. iconv将utf-8格式的书签文本(也就是.out文件)转成gbk格式
  3. gbk2uni将书签文本转成指定格式
  4. pdflatex使用正确的书签文本生成没有乱码书签的pdf

如果org文件的格式是GBK,那么就不用第二步了。

(setq org-latex-to-pdf-process
  '("pdflatex -interaction nonstopmode -output-directory %o %f"
    "iconv -f utf-8 -t gbk %b.out > %b.out.bak"
    "mv %b.out.bak %b.out"
    "gbk2uni %b.out"
    "pdflatex -interaction nonstopmode -output-directory %o %f"
    "rm %b.out.bak %b.tex"))

2.4 其它的小小改动

到目前为止,生成的tex文件头部分已经没有问题了,下面就要解决正文的问题。生成的tex文件正文必须是这样的:

\begin{document}
\begin{CJK*}{UTF8}{gbsn}
.....
\end{CJK*}
\end{document}

参考函数org-export-latex-make-header和org-export-as-latex,我们可以看到要插入=\begin{CJK*}{UTF8}{gbsn}=这样的tex代码的正确的位置,还是比较麻烦的。2 所以,我们要对这两个函数做小小的修改。(修改的el配置在后面贴出)

2.5 配置汇总(org-hack.el)

(require 'org)
(require 'org-latex)

(add-to-list 'org-export-latex-classes
                  '("cjk-article"
                    "\\documentclass{article}
 [NO-DEFAULT-PACKAGES]
 [PACKAGES]
 [EXTRA]"
         ("\\section{%s}" . "\\section*{%s}")
         ("\\subsection{%s}" . "\\subsection*{%s}")
         ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
         ("\\paragraph{%s}" . "\\paragraph*{%s}")
         ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

(setq org-export-latex-packages-alist '(
    (""   "CJK"   t)
    (""     "indentfirst"  nil)
    ("pdftex"     "graphicx"  t)
    (""     "fancyhdr" nil)
    ("CJKbookmarks=true"     "hyperref"  nil)
"%% Define a museincludegraphics command, which is
%%   able to handle escaped special characters in image filenames.
\\def\\museincludegraphics{%
  \\begingroup
  \\catcode`\\\|=0
  \\catcode`\\\\=12
  \\catcode`\\\#=12
  \\includegraphics[width=0.75\\textwidth]
}"))

(setq org-latex-to-pdf-process
  '("pdflatex -interaction nonstopmode -output-directory %o %f"
    "iconv -f utf-8 -t gbk %b.out > %b.out.bak"
    "mv %b.out.bak %b.out"
    "gbk2uni %b.out"
    "pdflatex -interaction nonstopmode -output-directory %o %f"
    "rm %b.out.bak %b.tex"))

(defun org-export-latex-make-header (title opt-plist)
  "Make the LaTeX header and return it as a string.
TITLE is the current title from the buffer or region.
OPT-PLIST is the options plist for current buffer."
  (let ((toc (plist-get opt-plist :table-of-contents))
        (author (org-export-apply-macros-in-string
                 (plist-get opt-plist :author)))
        (email (replace-regexp-in-string
                "_" "\\\\_"
                (org-export-apply-macros-in-string
                 (plist-get opt-plist :email)))))
    (concat
     (if (plist-get opt-plist :time-stamp-file)
         (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
     ;; insert LaTeX custom header and packages from the list
     (org-splice-latex-header
      (org-export-apply-macros-in-string org-export-latex-header)
      org-export-latex-default-packages-alist
      org-export-latex-packages-alist nil
      (org-export-apply-macros-in-string
       (plist-get opt-plist :latex-header-extra)))
     ;; append another special variable
     (org-export-apply-macros-in-string org-export-latex-append-header)
     ;; define alert if not yet defined
     "\n\\providecommand{\\alert}[1]{\\textbf{#1}}"

     ;; changed by wuyao721@163.com
     ;; beginning of the document
     "\n\\begin{document}\n\n"
     "\n\\begin{CJK*}{UTF8}{gbsn}\n\n"
     ;; insert the title
     (format
      "\n\n\\title{%s}\n"
      (org-export-latex-fontify-headline title))
     ;; insert author info
     (if (plist-get opt-plist :author-info)
         (format "\\author{%s%s}\n"
                 (org-export-latex-fontify-headline (or author user-full-name))
                 (if (and (plist-get opt-plist :email-info) email
                          (string-match "\\S-" email))
                     (format "\\thanks{%s}" email)
                   ""))
       (format "%%\\author{%s}\n"
               (org-export-latex-fontify-headline (or author user-full-name))))
     ;; insert the date
     (format "\\date{%s}\n"
             (format-time-string
              (or (plist-get opt-plist :date)
                  org-export-latex-date-format)))
     ;; insert the title command
     (when (string-match "\\S-" title)
       (if (string-match "%s" org-export-latex-title-command)
           (format org-export-latex-title-command title)
         org-export-latex-title-command))
     "\n\n"
     ;; table of contents
     (when (and org-export-with-toc
                (plist-get opt-plist :section-numbers))
       (funcall org-export-latex-format-toc-function
                (cond ((numberp toc)
                       (min toc (plist-get opt-plist :headline-levels)))
                      (toc  (plist-get opt-plist :headline-levels))))))))

(defun org-export-as-latex (arg &optional hidden ext-plist
                                to-buffer body-only pub-dir)
  "Export current buffer to a LaTeX file.
If there is an active region, export only the region.  The prefix
ARG specifies how many levels of the outline should become
headlines.  The default is 3.  Lower levels will be exported
depending on `org-export-latex-low-levels'.  The default is to
convert them as description lists.
HIDDEN is obsolete and does nothing.
EXT-PLIST is a property list with
external parameters overriding org-mode's default settings, but
still inferior to file-local settings.  When TO-BUFFER is
non-nil, create a buffer with that name and export to that
buffer.  If TO-BUFFER is the symbol `string', don't leave any
buffer behind but just return the resulting LaTeX as a string.
When BODY-ONLY is set, don't produce the file header and footer,
simply return the content of \\begin{document}...\\end{document},
without even the \\begin{document} and \\end{document} commands.
when PUB-DIR is set, use this as the publishing directory."
  (interactive "P")
  (when (and (not body-only) arg (listp arg)) (setq body-only t))
  (run-hooks 'org-export-first-hook)

  ;; Make sure we have a file name when we need it.
  (when (and (not (or to-buffer body-only))
             (not buffer-file-name))
    (if (buffer-base-buffer)
        (org-set-local 'buffer-file-name
                       (with-current-buffer (buffer-base-buffer)
                         buffer-file-name))
      (error "Need a file name to be able to export")))

  (message "Exporting to LaTeX...")
  (org-unmodified
   (let ((inhibit-read-only t))
     (remove-text-properties (point-min) (point-max)
                             '(:org-license-to-kill nil))))
  (org-update-radio-target-regexp)
  (org-export-latex-set-initial-vars ext-plist arg)
  (setq org-export-opt-plist org-export-latex-options-plist
        org-export-footnotes-data (org-footnote-all-labels 'with-defs)
        org-export-footnotes-seen nil
        org-export-latex-footmark-seen nil)
  (org-install-letbind)
  (run-hooks 'org-export-latex-after-initial-vars-hook)
  (let* ((wcf (current-window-configuration))
         (opt-plist
          (org-export-process-option-filters org-export-latex-options-plist))
         (region-p (org-region-active-p))
         (rbeg (and region-p (region-beginning)))
         (rend (and region-p (region-end)))
         (subtree-p
          (if (plist-get opt-plist :ignore-subtree-p)
              nil
            (when region-p
              (save-excursion
                (goto-char rbeg)
                (and (org-at-heading-p)
                     (>= (org-end-of-subtree t t) rend))))))
         (opt-plist (setq org-export-opt-plist
                          (if subtree-p
                              (org-export-add-subtree-options opt-plist rbeg)
                            opt-plist)))
         ;; Make sure the variable contains the updated values.
         (org-export-latex-options-plist (setq org-export-opt-plist opt-plist))
         ;; The following two are dynamically scoped into other
         ;; routines below.
         (org-current-export-dir
          (or pub-dir (org-export-directory :html opt-plist)))
         (org-current-export-file buffer-file-name)
         (title (or (and subtree-p (org-export-get-title-from-subtree))
                    (plist-get opt-plist :title)
                    (and (not
                          (plist-get opt-plist :skip-before-1st-heading))
                         (org-export-grab-title-from-buffer))
                    (and buffer-file-name
                         (file-name-sans-extension
                          (file-name-nondirectory buffer-file-name)))
                    "No Title"))
         (filename
          (and (not to-buffer)
               (concat
                (file-name-as-directory
                 (or pub-dir
                     (org-export-directory :LaTeX ext-plist)))
                (file-name-sans-extension
                 (or (and subtree-p
                          (org-entry-get rbeg "EXPORT_FILE_NAME" t))
                     (file-name-nondirectory ;sans-extension
                      (or buffer-file-name
                          (error "Don't know which export file to use")))))
                ".tex")))
         (filename
          (and filename
               (if (equal (file-truename filename)
                          (file-truename (or buffer-file-name "dummy.org")))
                   (concat filename ".tex")
                 filename)))
         (buffer (if to-buffer
                     (cond
                      ((eq to-buffer 'string) (get-buffer-create
                                               "*Org LaTeX Export*"))
                      (t (get-buffer-create to-buffer)))
                   (find-file-noselect filename)))
         (odd org-odd-levels-only)
         (header (org-export-latex-make-header title opt-plist))
         (skip (cond (subtree-p nil)
                     (region-p nil)
                     (t (plist-get opt-plist :skip-before-1st-heading))))
         (text (plist-get opt-plist :text))
         (org-export-preprocess-hook
          (cons
           `(lambda () (org-set-local 'org-complex-heading-regexp
                                      org-export-latex-complex-heading-re))
           org-export-preprocess-hook))
         (first-lines (if skip "" (org-export-latex-first-lines
                                   opt-plist
                                   (if subtree-p
                                       (save-excursion
                                         (goto-char rbeg)
                                         (point-at-bol 2))
                                     rbeg)
                                   (if region-p rend))))
         (coding-system (and (boundp 'buffer-file-coding-system)
                             buffer-file-coding-system))
         (coding-system-for-write (or org-export-latex-coding-system
                                      coding-system))
         (save-buffer-coding-system (or org-export-latex-coding-system
                                        coding-system))
         (region (buffer-substring
                  (if region-p (region-beginning) (point-min))
                  (if region-p (region-end) (point-max))))
         (text
          (and text (string-match "\\S-" text)
               (org-export-preprocess-string
                text
                :emph-multiline t
                :for-backend 'latex
                :comments nil
                :tags (plist-get opt-plist :tags)
                :priority (plist-get opt-plist :priority)
                :footnotes (plist-get opt-plist :footnotes)
                :drawers (plist-get opt-plist :drawers)
                :timestamps (plist-get opt-plist :timestamps)
                :todo-keywords (plist-get opt-plist :todo-keywords)
                :tasks (plist-get opt-plist :tasks)
                :add-text nil
                :skip-before-1st-heading skip
                :select-tags nil
                :exclude-tags nil
                :LaTeX-fragments nil)))
         (string-for-export
          (org-export-preprocess-string
           region
           :emph-multiline t
           :for-backend 'latex
           :comments nil
           :tags (plist-get opt-plist :tags)
           :priority (plist-get opt-plist :priority)
           :footnotes (plist-get opt-plist :footnotes)
           :drawers (plist-get opt-plist :drawers)
           :timestamps (plist-get opt-plist :timestamps)
           :todo-keywords (plist-get opt-plist :todo-keywords)
           :tasks (plist-get opt-plist :tasks)
           :add-text (if (eq to-buffer 'string) nil text)
           :skip-before-1st-heading skip
           :select-tags (plist-get opt-plist :select-tags)
           :exclude-tags (plist-get opt-plist :exclude-tags)
           :LaTeX-fragments nil)))

    (set-buffer buffer)
    (erase-buffer)
    (org-install-letbind)

    (and (fboundp 'set-buffer-file-coding-system)
         (set-buffer-file-coding-system coding-system-for-write))

    ;; insert the header and initial document commands
    (unless (or (eq to-buffer 'string) body-only)
      (insert header))

    ;; insert text found in #+TEXT
    (when (and text (not (eq to-buffer 'string)))
      (insert (org-export-latex-content
               text '(lists tables fixed-width keywords))
               "\n\n"))

    ;; insert lines before the first headline
    (unless (or skip (string-match "^\\*" first-lines))
      (insert first-lines))

    ;; export the content of headlines
    (org-export-latex-global
     (with-temp-buffer
       (insert string-for-export)
       (goto-char (point-min))
       (when (re-search-forward "^\\(\\*+\\) " nil t)
         (let* ((asters (length (match-string 1)))
                (level (if odd (- asters 2) (- asters 1))))
           (setq org-export-latex-add-level
                 (if odd (1- (/ (1+ asters) 2)) (1- asters)))
           (org-export-latex-parse-global level odd)))))

    ;; changed by wuyao721@163.com
    ;; finalization
    ;;(unless body-only (insert "\n\\end{document}"))
    (unless body-only (insert "\n\\end{CJK*}")(insert "\n\\end{document}"))

    ;; Attach description terms to the \item macro
    (goto-char (point-min))
    (while (re-search-forward "^[ \t]*\\\\item\\([ \t]+\\)\\[" nil t)
      (delete-region (match-beginning 1) (match-end 1)))

    ;; Relocate the table of contents
    (goto-char (point-min))
    (when (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
      (goto-char (point-min))
      (while (re-search-forward "\\\\tableofcontents\\>[ \t]*\n?" nil t)
        (replace-match ""))
      (goto-char (point-min))
      (and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
           (replace-match "\\tableofcontents" t t)))

    ;; Cleanup forced line ends in items where they are not needed
    (goto-char (point-min))
    (while (re-search-forward
            "^[ \t]*\\\\item\\>.*\\(\\\\\\\\\\)[ \t]*\\(\n\\\\label.*\\)*\n\\\\begin"
            nil t)
      (delete-region (match-beginning 1) (match-end 1)))
    (goto-char (point-min))
    (while (re-search-forward
            "^[ \t]*\\\\item\\>.*\\(\\\\\\\\\\)[ \t]*\\(\n\\\\label.*\\)*"
            nil t)
      (if (looking-at "[\n \t]+")
          (replace-match "\n")))

    (run-hooks 'org-export-latex-final-hook)
    (if to-buffer
        (unless (eq major-mode 'latex-mode) (latex-mode))
      (save-buffer))
    (org-export-latex-fix-inputenc)
    (run-hooks 'org-export-latex-after-save-hook)
    (goto-char (point-min))
    (or (org-export-push-to-kill-ring "LaTeX")
        (message "Exporting to LaTeX...done"))
    (prog1
        (if (eq to-buffer 'string)
            (prog1 (buffer-substring (point-min) (point-max))
              (kill-buffer (current-buffer)))
          (current-buffer))
      (set-window-configuration wcf))))

3 注意要点

如果你怎么整都是乱码的pdf,那么考虑以下几点

3.1 字符编码是否一致

看看是否把org文件保存成了GBK格式,而配置里却用了UTF-8。

3.2 分步实现

试试先生成tex文件,再用命令pdflatex生成pdf。这样能帮你发现问题所在。

3.3 emacs能否调用pdflatex,mv等命令

设置好环境变量,确保emacs能调用到这些命令

4 未解问题

有一些未解问题,请高手指点

4.1 示例超出pdf界限

以下的示例生成的pdf超出界限,怎么办呢?

apt-get install texlive-latex-base texlive-latex-recommended latex-cjk-chinese latex-cjk-chinese latex-cjk-chinese 

4.2 pdf超链接有红色框框

pdf超链接有红色框框,这样的显示效果不怎么好。怎么办?

Date: 2012-06-17 02:07:17 中国标准时间

Author: 吴遥

Org version 7.7 with Emacs version 24

Validate XHTML 1.0
C++学习:0、CPP 学习概述 目录一、汇编的重要性1、学习建议2、代码本质的挖掘3、编程语言的本质区别二、开发环境的搭建 路线大纲: 常用语法: 面向对象: 项目实战: 特点: 通过反汇编,通过底层来观察 C++ 的本质 CPP 的应用领域 思考一个问题:既然 C ++ 执行效率这么高,为什么还要出现新的编程语言?所有地方都用 C++ 不就好了吗? 首先每一门编程语言都有自己的优缺点,都有自己的擅长的领域。 比如 python 适合数学家来进行算法开发,适合分析师进行数据分析,如果让数学家和分析师再学习C++ 那就太 阅读详情

相关推荐

盘点由中国人开发的编程语言

创造易语言的初衷是进行用中文来编写程序的实践,方便中国人以中国人的思维编写程序,并不用再去学习西方思维。OpenBlock 是可视化块编程语言,是一门希望通过将编程简化、将业务逻辑可视化的图形化编程语言,语言特性上有 Erlang 和 Smalltalk 的影子,语法层面借鉴了 Scratch,使用 Blockly 作为语言前端。CovScript 是一门跨平台、开放源代码的动态类型脚本编程语言,具有高效、易懂、可靠的特点,充分吸收了现代编程语言研究的成果,与 C、C++ 等现代语言有良好的可交互性。

AI天才研究院 3万+

如何emacs org转换为标准tex pdf

如何emacs org转换为标准tex pdf #+LATEX_CLASS: article #+LATEX_CLASS_OPTIONS: [12pt] #+LATEX_HEADER: \usepackage[UTF8]{ctex} #+LATEX_HEADER: \usepackage[margin=2.5cm]{geometry}

严谨死板君的专栏 1037

C++编程新手到高手:CS42Cpp课程学习之路

本文还有配套的精品资源,点击获取 简介:"CS42Cpp"课程设计为初学者提供了一个系统的C++学习路径,涵盖了从基础知识到高级概念的全面内容。课程分为两个部分:前4周的基础阶段,后16周的深入阶段,逐渐引导学员掌握C++的语法、面向对象编程、高级特性如模板和STL使用。课程利用"CS42Cpp-master"资源包提供实践材料,帮助学员通过实际编码提高编程技能和解决问题的...

weixin_35982453的博客 1627

emacs终于能导出中文pdf了

<!-- html {font-family:Times,serif; font-size:12pt} .title {text-align:center} .todo {color:red} .done {color:green} .tag {background-color:#add8e6; font-weight:normal} .timestamp

yivanus的专栏 3381

pdf-tools:Emacs PDF文件支持库

PDF工具自述文件 关于这个包裹 除其他事项外,PDF Tools是DocView for PDF文件的替代品。 关键区别在于页面不是由例如ghostscript预先渲染并存储在文件系统中,而是按需创建并存储在内存中。 这种渲染由一个名为poppler的特殊库(在任何程序中运行)执行,该库在服务器程序中运行。 该程序称为epdfinfo ,其作用是连续读取Emacs的请求并产生适当的结果,即PDF页面的PNG图像。 实际上,显示PDF文件只是PDF工具的一部分。 由于poppler可以为我们提供有关文档的各种信息,并且还可以对其进行修改,因此我们可以做更多的事情。 也请阅读有关 特征 看法 使用类似DocView的绑定在缓冲区中查看PDF文档。 我搜索 与其他缓冲区一样,以交互方式搜索PDF文档,以查找字符串或PCRE。 发生 列出与一个或多个PDF文档中的字符串或正则表达式匹配

基于MuJoCo的六轴机械臂动力学参数辨识全流程详解

在机器人控制领域,动力学模型是轨迹跟踪和力控交互等高级控制算法的基石。其核心原理是通过牛顿-欧拉方程或拉格朗日方程,建立关节力矩与运动状态(位置、速度、加速度)及物理参数(如质量、惯性)之间的数学关系。精确的模型能显著提升控制性能,是实现高精度作业的关键技术价值。在实际应用中,出厂模型参数常存在误差或随负载变化,因此需要通过参数辨识技术进行校准。动力学参数辨识通过设计激励轨迹、采集运动与力矩数据,并利用最小二乘等优化方法反推真实参数。本文以MuJoCo高保真仿真环境为平台,完整演示了从激励轨迹设计、仿真数据

weixin_34212762的博客 505

emacs使用org-mode导出中文pdf

0x01. issue: C-c C-e lp导出pdf中文乱码 org-mode pdf wasn't produced 0x02. 安装LaTeX sudo apt-get install texlive-full ➜ ~ sudo apt-get install texmaker 0x03. 安装字库 将C:/windows/fonts下你喜欢的字体拷贝到...

iamcxl 5048

Flink on k8s 环境搭建(一)

Flink on Yarn的环境搭建过程中,需要进行配置较多,且需要搭建zookeeper Hadoop Yarn 等相关组件,安装流程比较复杂,集群出现问题重新安装的流程也比较复杂,且Yarn的3个节点中 只能起了 3个resourceManager和1个NodeManager,Flink 作业申请资源时只能 向NodeManager的节点申请资源,整体有资源瓶颈的隐患(后继flink作业会越来越多),现在尝试进行Flink on k8s 的环境搭建。

wangqiaowq的博客 3420

那些意欲取代 C++ 的编程语言,成功了吗?

一文总结目前 C++ 继任语言的技术状况。

CSDN资讯 6163

机械臂视觉抓取避坑指南:如何正确计算手眼标定矩阵(附Numpy代码)

本文详细解析了机械臂视觉抓取中手眼标定矩阵的计算方法,特别针对'眼在手上'配置下的常见错误提供了解决方案。通过Numpy代码示例和坐标转换原理,帮助开发者避免矩阵计算错误和坐标转换偏差,提升工业自动化系统的精度和效率。

weixin_29081703的博客 250

基于STM32L4XX、HAL库的RTL8201F 以太网收发器(PHY)驱动程序设计

define PHY_RESET_DELAY 1000 // PHY复位延迟(ms)#define PHY_AUTONEGO_DELAY 3000 // 自动协商延迟(ms)/* 检查PHY ID (RTL8201F的ID为0x001CC816) *//* 系统时钟配置,确保ETH有50MHz时钟 *//* 初始化CPU, AHB和APB总线时钟 */

zhusl6688的博客 836

为什么C++是最难学的编程语言?

很多已经做了几年的C++程序员已经很自信觉得这门编程语言算是熟悉阶段了,但是当重新对这门语言来个彻底大扫除的时候发现,又有新的语法出现,最糟糕的是之前掌握的很多套路未必是对的。以至于很多程序员段子手留下了很多精彩的话语 你会发现等你把C++用熟练了,再去学习别的语言,那感觉爽呆了。 难在你因为很懂她,最后还不知道为啥莫名其妙的生气。 c++最大的缺点是让你花费大量时间学习这门语言的语法上,而不是解...

qq_43351159的博客 1万+

扩展 SAP 物料主数据时,真正要理解的不是 MM01,而是视图、组织层级和生效日期

SAP物料主数据扩展的业务逻辑与技术实现 物料主数据扩展在SAP系统中看似简单,实则蕴含复杂的业务逻辑。其核心在于如何在已有物料记录基础上,通过扩展新视图和组织层级实现多部门协同,而非创建新物料。扩展操作涉及采购、销售、库存、财务等多个业务部门的数据维护,系统通过物料号识别已有记录并追加数据。技术实现上需区分创建与扩展场景,注意S/4HANA中Clean Core原则对数据操作的限制。项目实施中常见的错误包括:未输入物料号导致误创建、组织层级配置不完整、字段必填校验失败等。正确理解物料主数据的多层结构(从跨

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 160

做黑客需要懂几种编程语言?

C语言是面向过程的,而C++是面向对象的 C和C++的区别: C是一个结构化语言,它的重点在于算法和数据结构。C程序的设计首要考虑的是如何通过一个过程,对输入(或环境条件)进行运算处理得到输出(或实现过程(事务)控制)。 C++,首要考虑的是如何构造一个对象模型,让这个模型能够契合与之对应的问题域,这样就可以通过获取对象的状态信息得到输出或实现过程(事务)控制。 所以C与C++的最大区别在于它们的用于解决问题的思想方法不一样。之所以说C++比C更先进,是因为“ 设计这个概念已经被融入到C++之中 ”。

Hsuesh的博客 1万+

Linux(31)Rockchip RK3568 Ubuntu22.04上部署 Docker: 问题与解决方案

本博客在总结这些问题及其解决方案,为遇到类似问题的兄弟提供参考,如果我后续有碰到其他Docker 问题也会在此更新补充。

我其实什么都不会 1660

RDKit | 基于Pytorch和RDKit建立QSAR模型

QSAR 定量构效方法(quantitative structure-activity relationship, QSAR)是应用最为广泛的药物设计方法。所谓定量构效方法就是通过一些数理统计方法建立其一系列化合物的生理活性或某种性质与其物理化学性质之间的定量关系,通过这些定量关系。可以预测化合物的生理活性或某些性质,指导我们设计出具有更高活性的化合物。 早在...

DrugOne 5090

[PHP-CPP]使用C++来扩展PHP的能力

一个使用C++来开发PHP扩展的开源项目 什么是PHP-CPP? 它是一个C++库,用来开发PHP的扩展.它提供了一个文档丰富且易于使用的类库,可以使用这些类库开发PHP的扩展.也就是说我们可以用C++来开发PHP的扩展了. 为什么要使用PHP-CPP? 使用这个C++库,可以非常享受的开发出一个PHP的扩展,使用它编写的代码简单易懂,并且能为你的软件带来很大的提升. 使用PHP-CPP的特性和原因 1.性能更快 使用C++编写的代码相比PHP的代码来说,非常非常快,在官网给出的一个冒

PHP武器库 1545

【人工智能】提示词工程:让大模型精准响应的核心技术,提示词的基础框架 以及 常见提示词框架及场景

编写提示词的基础原则包括:简单、明确、详细,提示词拥有零样本提示、少样本提示、分配角色、提示写作风格、限定输出格式等技巧。

奶爸的编程之路,也就一周冷个三天 1162

那些程序猿才懂的梗~~~

代码敲累了?上班回家了?来看看属于程序员的段子吧!

wuli1024的博客 3490

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

CPP=C++

CPP = c plus plus =C++

天天的CSDN 1146

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Node_INLINE_CPP 项目常见问题解决方案

Node_INLINE_CPP 项目常见问题解决方案 基础介绍 Node_INLINE_CPP 是一个开源项目,它允许开发者直接在 Node.js 中内联 C++ 代码。这种技术可以简化原生模块的原型设计,并允许 Node.js REPL 中使用原生代码。项目的主要编程语言是 JavaScript 和 C++。 新手常见问题及解决方案 问题一:如何安装 Node_INLINE_CPP 问题描述: ...

gitblog_00553的博客 946

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Cppfront与Cpp2语法:探索C++的简洁安全新范式

Cppfront是一个实验性编译器项目,旨在为C++提供全新的语法形式(称为Cpp2或"C++语法2"),同时保持与现有C++生态系统的完全兼容。该项目由著名C++专家Herb Sutter发起,其核心理念是通过语法层面的创新,使C++代码编写变得更简单、更安全。 ## Cpp2语法特性解析 ### 设计哲学 Cpp2并非要创建一门全新的编程语言,而是作为C++的"另一种语法皮肤"。它保留了...

gitblog_01066的博客 670

探索C++编程语言的全新学习平台:cpp-lang.net

探索C++编程语言的全新学习平台:cpp-lang.net 项目介绍 cpp-lang.net 是一个专为C++编程语言打造的官方网站,由Paweł Syska(@PoetaKodu)创建并维护。这个项目的目标是为C++提供一个设计精良、内容丰富且开源的在线学习平台。无论你是C++的初学者,还是希望深入了解这门语言的高级开发者,cpp-lang.net都能为你提供所需的知识和资源。 项目技术分析 ...

gitblog_01129的博客 845

【亲测免费】 Tokenizers-CPP 项目常见问题解决方案

Tokenizers-CPP 项目常见问题解决方案 项目基础介绍 Tokenizers-CPP 是一个开源项目,提供了一套跨平台的 C++ 令牌化器绑定库,可以广泛应用于不同的平台。该项目包装并绑定了 HuggingFace 的 tokenizers 库和 sentencepiece,提供了一套简洁的 C++ 接口。主要目标是使得令牌化器可以方便地部署到原生平台,同时最小化依赖,降低跨语言绑定的难...

gitblog_00864的博客 1464
上一篇: nginx + naxsi 搭建web应用防火墙(ubuntu系统)
下一篇: nginx指令之——tcp_nodelay
吴遥
博客等级 码龄19年 90粉丝 93原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址