Computer >> Hướng Dẫn Máy Tính >  >> Phần Mềm >> Office

Mẹo LaTeX & LyX Nâng Cao Cho Document Hoàn Hảo

Vài tháng trước, chúng ta có bài damn good về trick phổ biến cải thiện quality và beauty document LaTeX. Dù bạn thích frontend semi-office-suite như LyX hay code trực tiếp LaTeX, kết quả như nhau. Chúng ta có document prettier, elegant, professional hơn.

Chúng ta học: multiple columns, căn bullet/numbered list, fancy footnote/caption, tách title dài, adjust ảnh, watermark, table cell padding, programming syntax, vertical/horizontal spacer, LaTeX source. Hôm nay, học thêm vài thứ, bao gồm basic tips tôi coi granted (cho 당연) bài 1. Hy vọng không disappoint.

Document Settings > LaTeX Preamble

Tôi nhắc trước, nhưng Preamble là nơi set document globals, input command dùng LaTeX syntax. Nói cách khác, nếu muốn tạo style và thay đổi apply toàn bộ piece, đây là one location.

Title & Font

Nếu muốn thay đổi layout title, bao gồm justification, font size, sub-title decoration, có vài option. Bạn select text bất kỳ, manual apply font weight/size mong muốn. Cũng insert ragged và justified line breaks để maintain style multi-line. Ví dụ tốt: cuốn Crash book của tôi. Nếu wonder behind the scenes, mở Source viewer xem LyX code trực tiếp.

Loại bỏ layout element không cần

Khi viết document, bạn có các pre-formatted style: chapter, section, sub-section, paragraph, standard text, và khác. Element có là abstract, mà một reader chỉ ra, bạn có thể không muốn. Làm sao remove?

Bạn configure class document trong Document Settings window. Nhớ Preamble? Look up. Document Class cho chọn default layout project. Nghĩ như document template trong word processor. Class dictate số parameter, bao gồm availability các style. Một số document có abstract, số không. Tương tự parts, chapters.

Date & Author name

Mặc định, document có date, và some cases, tên bạn in trang đầu, có thể không muốn. No problem. Loại bỏ cả 2 dễ dàng. Combine power của document classes và Preamble.

Trong Preamble, set NULL date bằng \date{}. Loại bỏ date khỏi front page. Hơn nữa, tạo header/footer decoration feature tên bạn, article name, additional styles. Tuy nhiên, cần fancyhdr package, có thể cần cài riêng. Ví dụ sách tôi:

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

Format Multiple (Hai) Column

Chúng ta nói trước. Nhưng nếu muốn đặt graphical element span cả 2 cột? Làm sao? Tôi nhắc, nhưng clarification needed. Standard multiple-column layout:

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

Nếu muốn ảnh span cả 2 cột:

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

Tức là stop multiple-column layout, thêm gì span toàn page width, resume document, likely same multi-column format. Và chúng ta học span ảnh across page.

Image placement (Đặt ảnh)

Một điều cần attention đặc biệt: placement ảnh trên trang. Đôi khi, LyX shuffle ảnh lên/xuống như nó thấy fit, khiến paragraph jump below/above ảnh, không phải intended. Workaround: fix ảnh ở absolute position, như CSS với HTML element.

Khi đặt float element, đổi settings via right-click. Trong Advanced Placement Options, chọn best. Giải thích self-explanatory. Useful nhất: Here definitely, báo LyX strictly obey styling preference. Dùng scaling và width percentage cho best visual result.

Ragged bottoms (hoặc không)

Không phải tên band pop Anh 70s. Về cách cuối multi-column document trông. \raggedbottom khiến LyX fill leftmost column vertically trước khi next column. Someone may dislike. Tuy nhiên, LyX default balance content giữa columns evenly, dù chỉ top portion page filled. Kết hợp \vspace, bạn manipulate layout as you see fit.

Reset figure và table numbering

Mặc định, table và image continuously numbered từ đầu document. Nếu có multiple, supposedly independent content sections, bạn muốn reset counter. Làm như sau:

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

Thay "object" bằng figure hoặc table. Tự động đổi numbering scheme trong TOC. Nếu muốn numeral khác, đổi arabic thành roman. Options khác: xem wiki section.

Track changes (Theo dõi thay đổi)

LyX cũng cho track document changes, như office suite fancy. Hữu ích nếu share work hoặc combine multiple documents.

Bonus không liên quan: cho super-geeks only!

Về thêm Feynman diagrams vào document! Holy banana!

\usepackage{feyn}

Trông như thế này:

Kết luận

Đó là tất cả. Tôi thừa nhận tutorial này tame so với piece 1, nhưng appeal đến new/intermediate LaTeX/LyX user struggle với document. Đặc biệt, guide focus visual layout và tiny issues: classes, titles, dates, image placement. Bạn dùng GUI hoặc trực tiếp LaTeX code directives, tùy thích.

Tôi hy vọng bạn thích. Rất sớm, bài LaTeX/LyX khác, nhưng không disclose contents, spoil surprise. Tôi guarantee bạn sẽ thích. Như luôn, nếu feel missing, cho tôi biết, có thể tutorial khác. Thanks Harold cho ideas!

Chào.