Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ซอฟต์แวร์ >> Office

Advanced LaTeX & LyX Tips: สร้างเอกสารเงาเงาสวยงาม

ไม่กี่เดือนก่อน เรามี Damn Good Article เรื่อง Popular Tricks ใช้ Improve Quality และ Beauty ของ LaTeX-made Documents 无论你喜歡 Semi-office-suite-like Frontend เช่น LyX 或 Code Directly in LaTeX End Result เหมือนกัน เราได้ Prettier, More Elegant, More Professional Documents

เราเรียนรู้ Multiple Columns, Aligning Bulleted/Numbered Lists, Fancy Footnotes/Captions, Splitting Long Titles, Image Adjustments, Watermarks, Table Cell Padding, Programming Language Syntax, Vertical/Horizontal Spacers, และ LaTeX Source วันนี้เราจะเรียนรู้เพิ่มเติม รวมถึง Rather Basic Tips ที่ผม Took for Granted ในบทความแรก หวังว่าไม่ Disappointed

Document Settings > LaTeX Preamble

กล่าวถึงมาก่อน แต่ Preamble คือที่ Set Document Globals Input Commands 使用 LaTeX Syntax 換句話說 如果願意 Create Styles/Changes Apply to Entire Piece 這是 One Location

Titles & Fonts

如果想改變 Title Layout 包括 Justification, Font Size, Sub-title Decorations 有 Several Options 可以 Select Text 任何ตัว แล้ว Manual Apply Desired Font Weight/Size 也 Insert Ragged 和 Justified Line Breaks Maintain Style 多 Lines Good Example: My Crash Book 如果 Wonder How Things Look Behind Scenes 可以 Open Source Viewer Examine LyX Code Directly

Eliminate Unneeded Layout Elements

當寫 Document 有 Various Pre-formatted Styles: Chapter, Section, Sub-section, Paragraph, Standard Text, Others One Element: Abstract ซึ่ง Reader หนึ่งชี้出來 可能不想要 So How to Get Rid of It?

可以 Configure Class of Document 在 Document Settings Window Remember Preamble? Well, Look Up Document Class 讓你選 Default Layout for Project Think of it as Document Template in Typical Word Processor Class Dictates Parameters 多數 包括 Availability of Various Styles Some Documents 有 Abstracts, Others Won't Same Applies to Parts, Chapters, etc.

Dates & Author Names

By Default Document Features Date, และ某些情況 Your Name Printed on First Page 可能不想要 No Problem Eliminate Both Easily Time to Combine Power of Document Classes 和 Preamble

在 Preamble 可以 Set NULL Date 寫 \date{} 這 Effectively Remove Date from Front Page 此外 可以 Create Header/Footer Decorations Feature Your Name, Article Name, Additional Styles 然而這也 Necessitates 使用 Fancy Headers Package 可能需要 Separate Installation 我書的例子:

\usepackage{fancyhdr}
\lhead{\small{www.dedoimedo.com}}
\rhead{\small{all rights reserved}}

Multiple (Two) Column Format

談過這 قبل 但如果想 Place Graphical Element Span Both Columns? How to Go About? 提到但也許 Clarification Needed Anyway, Standard Multiple-column Layout:

\begin{multicols}{}
content goes here as usual ...
\end{multicols}

如果想 Place Image Span Both Columns 則做:

some content goes here ...
\end{multicols}
place image or figure float here
\begin{multicols}{}
content continues here ...

Essentially, Stop Multiple-column Layout, Add Whatever Wish to Span Entire Page Width, Resume Document, Most Likely Same Multiple-column Format 我們學會 Span Images Across Page

Image Placement

但一件事可能需要 Special Attention 是 Placement of Images on Page 有時 LyX Shuffles Images Up/Down 如它見 Fit 造成 Paragraphs Jump Below/Above Image 不ใช่ Intended 可以 Work Around by Fixing Images to Absolute Position 有點像 CSS with HTML Elements

當 Place Float Element 可以 Change Settings Via Right-click 然後在 Advanced Placement Options 選 Best Settings Explanations Rather Self-explanatory Most Useful: Here Definitely 告訴 LyX Strictly Obey Styling Preferences 用 Scaling 和 Width Percentage Achieve Best Visual Result

Ragged Bottoms (或 Not)

這不是 British Pop Band 70s 名字 關於 End of Multi-column Document Looks Like 使用 \raggedbottom 將導致 LyX 填滿 Leftmost Columns Vertically Before Moving to Next Column 有些人可能 Dislike This 然而 LyX Default 嘗試 Balance Content Between All Columns Evenly 雖然可能 End Up 只有 Top Portion of Page Filled with Text 又 Combined with \vspace Clause 可以 Manipulate Layout As You See Fit

Reset Figure 和 Table Numbering

By Default Tables/Images Continuously Numbered from Start of Document 如果有 Multiple, Supposedly Independent Sections of Content 可能想 Reset Counter Once in a While 可以做如下:

\setcounter{object}{0} \renewcommand{\theobject}{A.\arabic{object}}

Replace Word Object with Either Figure or Table 這 Automatically Change Numbering Scheme in TOC Too 如果想 Different Numerals 可以 Change Arabic to Roman Others Options Available See Wiki Section for More Details

Track Changes

LyX 也ให้ Track Document Changes 就像 Fancy Office Suite 這 Particularly Useful 如果 Share Work with Others 或 Must Combine Multiple Documents in One Piece

Unrelated Bonus: For Super-geeks Only!

關於 Adding Feynman Diagrams 到 Document! Holy Banana!

\usepackage{feyn}

看起來像這樣:

ข้อสรุป

Well, That Would Be All 承認 Tutorial 這 Tame 比 First Piece 但應該 Appeal to New/Intermediate LaTeX/LyX Users 掙扎於 Documents 特別 Guide 置 Focus 於 Visual Layout 和 Tiny Issues with Classes, Titles, Dates, Image Placement, 等等 可以用 Graphical Interface 或 Work Directly with LaTeX Code Directives ichever You Prefer

希望你 Like This 非常快 會有另一篇 LaTeX/LyX Article 但不能 Disclose Contents 會 Spoil Surprise 但 Guarantee 你會 Like Whatever It Has to Offer 一如既往 如果感覺 Missing 讓我知道 可能有另一個 Tutorial Thanks to Harold for His Ideas!

Cheers.