latex

LaTeX自定义宏包、类文件的默认搜索路径设置方法

被刻印的时光 ゝ 提交于 2019-12-15 13:44:03
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>   对于自定义的LaTeX宏包与类,在调用时可以通过在命令\documentclass{}与\usepackage{}命令中指定完整路径或者相对路径,这样确实可以调用,但是编译时总是有烦人的警告信息,让人不爽。还好有一个办法可以解决。 操作系统:Ubuntu 18.04.3 桌面版 LaTeX工具:TeXstudio 2.12.6 1、打开终端,输入以下命令 kpsewhich -var-value=TEXMFHOME   这个命令会查询到默认的宏包与类搜索路径,我的电脑上显示结果为:home/lotus/texmf。 2、创建目录   上面显示的目录,不一定会存在,如果没有的话就自己创建一个,然后再继续创建三个目录,最后的目录结构是:~/texmf/tex/latex/commonstuff。 3、放入宏包与类文件   把自己定义的宏包或类文件放入上面创建的目录中即可,放文件的链接也可以。示意如下:   做完上述工作后,再打开TeXstudio编译文件就没有警告信息了。此外,要注意的是在宏包与类的\ProvidesClass{}命令中,不用加路径,直接声明名字,在调用时也是如此,就与调用系统提供的宏包一样。 来源: oschina 链接: https://my.oschina.net/lakeside

Latex参考文献

蹲街弑〆低调 提交于 2019-12-15 13:29:07
\begin{thebibliography}{30} bibitem{bi:1} G. Royle, C. Godsil, Algebraic graph theory, Springer-Verlag, New York, 2001. \end{bibliography} 其中{30}指最多有30个参考条例。 {bi:1}指marker,读者可以自己定义,与cite中的maker匹配即可。 如何在正文中引用他呢? \cite{bi:1}即可。 应用效果是这样:xxx[1] 如果改成上标引用呢? 方法:在文档开始前加上下面的语句命令 \newcommand{\upcite}[1]{\textsuperscript{\textsuperscript{\cite{#1}}}} 然后引用的时候使用 \upcite {}的格式(一般的正常引用格式为\cite{}) 如何使连续的参考文献能够中间用破折号连起来?比如[6,7,8,9]变成[6-9]? 方法:在文档开始前加上下面的语句命令 \usepackage[numbers,sort&compress]{natbib} 不但可以压缩参考文献标号,还可以进行排序,即无论正文里面的顺序怎样,显示出来都是先后顺序。 若要修改参考文献的名字,默认名为:Biliography。如果要改称References,这可以在\end{document

Align environment in R Markdown which works for both docx and pdf output?

﹥>﹥吖頭↗ 提交于 2019-12-14 03:57:26
问题 QUESTION: In R Markdown, what is the right way to add a LaTeX align -like environment (with and without equation numbering) which will compile and display for both docx and pdf output? DETAIL: Option 1 below is what I'm going with. But I'd still like the option to have equation numbering and not give up that functionality when I move between docx and pdf output. This compiles and displays in both docx and pdf output. Hooray! But what if I want equation numbering? \[ \begin{aligned} AR(p): Y_i

Add markers and hyperlinks for citations in pandoc

倾然丶 夕夏残阳落幕 提交于 2019-12-14 03:44:13
问题 I put references in a yaml metadata-header: references: - id: fenner2012a title: One-click science marketing author: - family: Fenner given: Martin ... (described here: http://johnmacfarlane.net/pandoc/README.html#extension-citations) and I can cite this reference with See [@fenner2012a]... . This will create an output in the pdf like this: See ("One-click science marketing")... with no hyperlink on the reference. Instead of the title I want to have auto-incremented number: See [1] with [1]

Remove section number but display the number in table of contents in LaTeX

丶灬走出姿态 提交于 2019-12-14 02:22:32
问题 I am new to LateX. I know how to remove the section number by using \section*{heading} instead of \section{heading} . But when I display the section heading in the Table of Contents , it does not print the section number. I want the section number to be displayed before "Introduction to Project" and "Introduction to company" in the Table of Contents shown below. 回答1: The titlesec package is very useful to modify your chapter and section titles. An important command is \titleformat , which is

How can I use matplotlib's mathtext rendering outside of matplotlib in another tk widget?

自古美人都是妖i 提交于 2019-12-14 01:28:49
问题 I know that matplotlib can render math expressions readily with, for instance, txt=Text(x,y,r'$\frac{1}{2}') which would make the fraction 1 over 2 at x,y. However, instead of placing the text at x,y I would like to use the rendered string in a separate tk application (like an Entry or Combobox). How can I obtain the rendered string from matplotlib's mathtext and put it into my tk widget? Of course I would welcome other options that would render the latex strings into my tk widget without

Resize matrix in LaTeX beamer

情到浓时终转凉″ 提交于 2019-12-14 00:32:14
问题 Hi I was wondering how to resize matrices in a beamer environment. Currently I am writing the following code: \begin{align*} \left( \begin{array}{ccccccc} 0 & 1 & & & & & \\ -1 & 0 & & & & & \\ & & 0 & 1 & & & \\ & & -1 & 0 & & & \\ & & & & \ddots & & \\ & & & & & 0 & 1 \\ & & & & & -1 & 0 \end{array} \right) \end{align*} and the matrix takes up almost a whole page. I would like it to be about half a page in height. 回答1: See this answer for how to change font dimensions in LaTeX's math mode.

Using sympy's latex() function without calculating the input

不问归期 提交于 2019-12-14 00:26:43
问题 I want to get latex output from a sympy expression without calculating the expression. For instance if I do latex((2+3)/7) the output would be 5/7 (with latex), but what I am after is for it to just output (2+3)/7 with latex. Like this: \frac{2+3}{7} 回答1: You can manually adjust the long_frac_ratio long_frac_ratio: The allowed ratio of the width of the numerator to the width of the denominator before we start breaking off long fractions. The default value is 2. >>> latex(e,long_frac_ratio=3)

LaTeX: Use some characters in a string

蓝咒 提交于 2019-12-13 21:25:56
问题 I need a macro that extracts pairs of number from a string that looks like this: n1-m1,n2-m2,n3-m3,n4-m4 (it could be longer) where n1,m1,n2,m2,... are numbers from 0 - 15. How can I go about getting the pairs (n1,m1), and (n2,m2), (n3,m3), etc inside my macro? I will need to use each pair once, after which I can, if needed, disregard the pair. Assuming each digit is a 2-digit number (not an elegant thing to do), and butchering a code I found by Debilski in this forum, I managed to get the

Pandoc's environment cslreferences undefined when knitting RMarkdown to PDF in RStudio

ⅰ亾dé卋堺 提交于 2019-12-13 20:41:45
问题 Knitting (in RStudio version 1.2.1335) an RMarkdown file to PDF fails when trying to create citations (for pandoc version 2.8.0.1, and R version 3.6.1). (This does not happen when knitting to HTML, for example.) Here is a small rep. ex. in RMarkdown: --- title: "Rep. Ex. for 'LaTeX Error: Environment cslreferences undefined'" output: pdf_document: default bibliography: report.bib --- ```{r generate-bibtex-file, include=FALSE} knitr::write_bib(file = "report.bib", prefix = "") ``` # Used R