日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

latex textbf没有用_LaTeX排版软件札记 Win10 LyX+TeXLive

發布時間:2024/9/19 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 latex textbf没有用_LaTeX排版软件札记 Win10 LyX+TeXLive 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我使用的是LyX+TeXLive。

LyX界面直觀,類似于Word??梢园丫Ω嗉性趦热?#xff0c;而不是在代碼上。

TeXLive庫齊全。

安裝

  • 安裝TeXLive
  • Index of /tex-archive/systems/texlive/Images?mirror.las.iastate.edu

    texlive2019-20190410.iso (~3.3G)

    雙擊打開iso,加載到虛擬光驅。運行install-tl-advanced.bat,按提示安裝。

    2. 安裝LyX

    https://www.lyx.org/Download?www.lyx.org

    安裝Installer,即LyX-2352-Installer-4.exe (~58 MB)

    latex.exe選擇TexLive latex.exe所在文件夾

    3. 配置中文環境

    運行LyX,文檔→首選項

    • 文檔類:Chinese Article (CTex)
    • 語言:中文(繁體),文件編碼:Unicode(XeTeX)(utf8)
    • Formats 輸出格式 PDF(XeTeX)

    LyX自帶拼寫檢查:工具→首選項→語言設置,拼寫檢查器,勾選spellcheck continuously。切換拼寫檢查默認語言:文檔→首選項→語言 。拼寫檢查擴充詞庫

    https://wiki.lyx.org/Windows/SpellChecker?wiki.lyx.org

    4. Enjoy


    Note

    1. TeXLive必要宏包

    documentclass{article}

    usepackage{ctex}

    usepackage[namelimits]{amsmath}

    usepackage{amssymb}

    usepackage{amsfonts}

    usepackage{mathrsfs}

    usepackage{algpseudocode,algorithm,algorithmicx}

    2. 論文模板

    TeXLive自帶大量宏包,比如prl的RevTeX,直接調用即可,但仍推薦去官網下載完整版,可參考其模板改寫。編譯格式為pdfLaTeX,需要將LyX文件導出為tex(pdfLaTeX)格式

    https://journals.aps.org/revtex?journals.aps.org

    3. 數學符號

    數學公式用$ $括住

    常用數學符號:

    • <= leq 或 le
    • >= geq 或 ge
    • << ll
    • >> gg
    • ≠ neq 或者 ne
    • ∈ in
    • 不屬于 notin
    • × times
    • ± pm
    http://mohu.org/info/symbols/symbols.htm?mohu.orghttps://blog.csdn.net/gsww404/article/details/78684278?blog.csdn.net

    4. 算法模板

    使用algorithmicx宏包生成偽代碼算法圖

    完整教程:

    http://tug.ctan.org/macros/latex/contrib/algorithmicx/algorithmicx.pdf?tug.ctan.org

    4.1 第一例

    在TeXworks中使用pdfLaTeX或XeLaTeX執行編譯,編譯效果:

    documentclass{article}
    usepackage{algpseudocode,algorithm,algorithmicx}
    newcommand*DNA{textsc{dna}}
    newcommand*Let[2]{State #1 $gets$ #2}
    algrenewcommandalgorithmicrequire{textbf{Precondition:}}
    algrenewcommandalgorithmicensure{textbf{Postcondition:}}
    begin{document}
    begin{algorithm}
    caption{Counting mismatches between two packed DNA{} strings
    label{alg:packed-dna-hamming}}
    begin{algorithmic}[1]
    Require{$x$ and $y$ are packed DNA{} strings of equal length $n$}
    Statex
    Function{Distance}{$x, y$}
    Let{$z$}{$x oplus y$} Comment{$oplus$: bitwise exclusive-or}
    Let{$delta$}{$0$}
    For{$i gets 1 textrm{ to } n$}
    If{$z_i neq 0$}
    Let{$delta$}{$delta + 1$}
    EndIf
    EndFor
    State Return{$delta$}
    EndFunction
    end{algorithmic}
    end{algorithm}
    end{document}

    以上來源自Sam Estep的回答:

    https://tex.stackexchange.com/questions/1375/what-is-a-good-package-for-displaying-algorithms?tex.stackexchange.com

    注1:可利用以下代碼實現Input/Output

    algrenewcommandalgorithmicrequire{textbf{Input:}}

    algrenewcommandalgorithmicensure{textbf{Output:}}

    注2:可使用State、Statex實現代碼帶編號/不帶編號換行。

    4.2 第二例

    在TeXworks中使用pdfLaTeX或XeLaTeX執行編譯,編譯效果:

    documentclass{article}
    usepackage{algorithm} % float wrapper for algorithms.
    usepackage{algpseudocode} % layout for algorithmicx
    usepackage{amsmath} % AMS mathematical facilities for LATEX
    % Nice looking for empty set
    usepackage{amssymb} % provides an extended symbol collection
    letoldemptysetemptyset
    letemptysetvarnothing
    begin{document}
    % algorithm
    begin{algorithm}
    begin{algorithmic}%[1]
    caption{CDS with betweenness centrality} label{algorithm: cds bw}
    Require A connected graph $G(V, E)$
    State $d gets {v : bw(v)}, v in V$, sort by BW on ascending order
    State $V' gets emptyset$, connected dominating sets
    ForAll{$v$ : $bw(v), v notin V'$}
    If{$bw(v) = 0$ OR $G(V-{v})$ is connected}
    State $V' gets V' cup MAX-BW(N(v))$
    Else
    State $V' gets V' cup {v}$
    EndIf
    State $V gets V-{v}$
    EndFor
    end{algorithmic}
    end{algorithm}
    end{document}

    以上來源自論壇

    LaTeX Application Notes: Pseudocode (with examples) | | Spark & Shine?sparkandshine.net

    總結

    以上是生活随笔為你收集整理的latex textbf没有用_LaTeX排版软件札记 Win10 LyX+TeXLive的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。