latex

Increment section numbers in PDF output

雨燕双飞 提交于 2019-12-05 21:22:17
I'm trying to increment the section headers in my rMarkdown (PDF output) file by 1. Instead of # First resulting in 1 First , I'd like 2 First. I found a way to define the offset in html_output using the following syntax, but it doesn't work for pdf_output. --- title: "Untitled" author: "author" date: "date" output: html_document: toc: true pandoc_args: [ "--number-sections", "--number-offset=1" ] --- # First Header # First SubHeader This results in 2 First Header 2.1 First Subheader However, this syntax does not work for PDF documents: --- title: "Untitled" author: "author" date: "date"

How to underline section-headings in LaTeX?

*爱你&永不变心* 提交于 2019-12-05 20:35:54
问题 EDIT : As I see in the first answer, underline is the wrong word. I want a line under the section heading, separating the heading from the following text. I want to separate section headings from the following text with a horizontal line. At the moment I use the following: \newcommand{\tmpsection}[1]{} \let\tmpsection=\section \renewcommand{\section}[1]{\tmpsection{#1}\hrule\nobreak} But that produces a line, that is too far away from the section-heading and to near to the following text. Has

Trying to understand the workflow between latex, sweave and R

試著忘記壹切 提交于 2019-12-05 19:31:57
Let's say I have written the following tiny .Rnw file: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{Sweave} \usepackage{tikz} \usepackage{pgf} \begin{document} <<>>= sessionInfo() @ \end{document} I then can go to R and use sweave to translate the .Rnw file into a .tex file Once this is done the latex interpreter can be called and because I used \usepackage{Sweave} Latex knows how to handle the sweave specific code tags. When I first did this procedure I got the common error that the Sweave.sty file could not be found. I googled and could solve the problem by typing the

Latex: \\bibliographystyle{abbrv} order citations based on appearance [closed]

前提是你 提交于 2019-12-05 18:55:16
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am using Latex's \bibliographystyle{abbrv} command for references. But the order of citations is not in the sequence they appear in the document. Is there anyway, I can get citations in the order they appear in my document using abbrv style? Thanks! The sorting=none option disables sorting: \usepackage[sorting=none]{biblatex} From the biblatex manual (Section 3.1.2.1 General): The sorting order of the

Coverpage and copyright notice before title in R bookdown?

穿精又带淫゛_ 提交于 2019-12-05 18:11:45
Back in March, I asked a question and got an answer to including coverpage in a pdf document rendered by R bookdown: R bookdown - cover page and appendix I tried the solution and came up with the following results: using in index.rmd yaml: output: pdf_document: includes: before_body: frontpage.tex number_sections: yes toc: yes toc_depth: 3 site: bookdown::bookdown_site documentclass: book classoption: letterpaper The title still appeared before the coverpage AND the Chapter 'wording' in chapter titles (ie 'Chapter 1' before the actual words for chapter title) disappeared. And the section

How to define two ispell dictionaries in Emacs for LaTeX mode?

蓝咒 提交于 2019-12-05 18:09:14
I have a document with many quotations in a second language. How can I define this second language to Ispell? I have this in file top: %% Local IspellDict: brasileiro I tried this, but it didn't work: %% Local IspellDict: brasileiro, english Adobe I have a way to toggle between two languages: ;; You should have aspell-ru and aspell-en packages installed (let ((langs '("english" "russian"))) (setq lang-ring (make-ring (length langs))) (dolist (elem langs) (ring-insert lang-ring elem))) (defun cycle-ispell-languages () (interactive) (let ((lang (ring-ref lang-ring -1))) (ring-insert lang-ring

LaTeX学习笔记1

旧时模样 提交于 2019-12-05 18:02:34
2019.11.26 1.求和公式使用 $p = \sum\limits_{n=1}^Na_n$ , \sum 为求和公式, \limits 为取消限制在单行中。 2.多行对齐使用align,例如: \begin{align} 1. \quad & g(X) = x_1 - x_2 + 1 \ 2.\quad & g(X) = -x_1 + x_2 + 1 \end{align} 3.梯度符号为 \nabla 多数符号详见 https://blog.csdn.net/caiandyong/article/details/53351737 4.在gather环境中可以使用 pmatrix 生成矩阵。注意:在gather环境中不会自动换行。 \begin{gather} X_1 = \begin{pmatrix} 2 \ 2 \end{pmatrix} \text{,}X_2 = \begin{pmatrix} -1 \ -1 \end{pmatrix} \text{,}X_3 = \begin{pmatrix} 1 \ 1 \end{pmatrix} \text{,}X_4 = \begin{pmatrix} 2 \ 2 \end{pmatrix} \end{gather} 5.使用TiKz宏包可以实现画图功能。(未学习) https://logiclife.wordpress

store a text string in latex and then add other text to it (concatenate)

孤街浪徒 提交于 2019-12-05 17:37:06
问题 I start by defining a command to store the string "Hello": \newcommand{\textstring}{Hello} I would like to append the string " world" but unfortunately this code causes an error: \renewcommand{\textstring}{\textstring world} 回答1: You can accomplish this by using \expandafter . For example: % redefine \textstring by appending " world" to it \expandafter\def\expandafter\textstring\expandafter{\textstring { }world} If you don't use \expandafter then you end up with a recursion problem. You can

Align LaTeX math text in matplotlib text box

我们两清 提交于 2019-12-05 17:28:46
I'm trying to generate a text box with lines of LaTeX code correctly aligned in a matplotlib frame. I tried using the format alignment method (ie: {:<11} ) but it does not seem to work on math mode. Here's the output I get: where the = symbols should all be aligned to the right (see MWE below). How can I produce such a text box with the = signs correctly aligned? MWE : (Never mind the weird figure proportions and text box placing, this is part of a much larger code which I cropped to generate this MWE) import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib

Publishing toolchain

大城市里の小女人 提交于 2019-12-05 17:16:44
问题 I have a book project which I'd like to start sooner than later. This would follow an agile-like publishing workflow, i.e: publish early and often. It is meant to be self-publsihed by me and I'm not really looking to paper-publish it, even though we never know. If I weren't a geek, I'd probably have already started writting in Word or any other WYSIWYG tool and just export to PDF. However, we know it is not the best solution, and emacs rules my text-editing life, so, the output format should