latex

forloop and table in LaTeX

我是研究僧i 提交于 2019-12-06 01:28:14
Here is the LaTeX code for my table: \begin{table}{| c || c | c | c || c | c | c | } \caption{Examples of the concepts. \label{tab:conceptsimgs}}\\ \hline \backslashbox{Concept}{Class} &\multicolumn{3}{|c||}{Negative Class} & \multicolumn{3}{|c|}{Positive Class} \\ \hline \forloop{themenumber}{1}{\value{themenumber} < 4}{ %\hline \arabic{themenumber} \forloop{classnumber}{0}{\value{classnumber} < 2}{ \forloop{imagenumber}{1}{\value{imagenumber} < 4}{ & 0 } } \\ \hline } \end{table} Something is wrong in the result however. There is some extra thing at the end of the table, as shown in here:

Table layouts for use with Pandoc

∥☆過路亽.° 提交于 2019-12-06 00:57:40
I'm trying to create a document generation workflow (professional documents). The goal is to write as much as possible in Markdown. The resulting document should be PDF, while still being able to export to .docx if necessary. I've settled on Pandoc, for which I'll create a Latex template and use a YAML document to hold the document metadata. So far so good. However, from time to time I need to use tables, ranging from very simple ones to more complex layouts with e.g. column spanning. Markdown is hardly usable for anything but the most simple tables. I tried HTML to define a more complex table

How do you write special characters (“\\n”,“\\b”,…) to a file in Python?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 00:22:15
I'm using Python to process some plain text into LaTeX, so I need to be able to write things like \begin{enumerate} or \newcommand to a file. When Python writes this to a file, though, it interprets \b and \n as special characters. How do I get Python to write \newcommand to a file, instead of writing ewcommand on a new line? The code is something like this ... with open(fileout,'w',encoding='utf-8') as fout: fout.write("\begin{enumerate}[1.]\n") Python 3, Mac OS 10.5 PPC One solution is to escape the escape character ( \ ). This will result in a literal backslash before the b character

Matplotlib latex working directory / search path

泄露秘密 提交于 2019-12-06 00:07:55
问题 Matplotlib doesn't seem to find files in the current working directory when running latex. Does anyone know where it looks for files? The background is: I have a huge preamble that I \input into latex before processing (lots of macros, various usepackages, etc.). In a stand-alone paper, I do \input{BigFatHeader.tex} . So when I use matplotlib, I try to just input this file in the preamble. The python code to do this is matplotlib.rcParams['text.latex.preamble'].append(r'\input{BigFatHeader

Editor showdown: Maintain newlines at the ends of sentences

南笙酒味 提交于 2019-12-06 00:00:17
问题 When editing non-WYSIWYG (LaTeX, HTML, etc) prose you probably want to have newlines at the ends of your sentences. This has several advantages: Easier to rearrange sentences. Easier to comment out sentences. Easier to spot run-on / overly long sentences. Easier to comment on sentences. For example: % The following isn't strictly true; maybe excise or comment out for now: After all, people who use Word or other WYSIWYG editors are aiding and abetting terrorists. And probably the most

latex: printing a variable in roman numerals

最后都变了- 提交于 2019-12-05 23:35:41
问题 I'm typesetting in LaTeX, and I'd like to display a "variable" (in my case, a reference \ref{blah} to an item number in list) in roman rather than the default arabic. Is there an easy way to do this? Thanks for any pointers! 回答1: You can try \def\theenumi{\roman{enumi}} inside an enumerate environment -- this changes both labels and refs, but you'll have to then explicitly undo it (if you want to). 回答2: lowercase \romannumeral 0\ref{blah}\relax uppercase \uppercase\expandafter{\romannumeral 0

R Markdown pdf Partially color cell background (data bar)

故事扮演 提交于 2019-12-05 23:00:51
Excel has this function called "data bar" that allow conditional formatting based on the cell value with respective length. This function can be done with "formattable" in R using the formatter and color_bar. however, the result of this is a html widget which cannot be shown in pdf. Here's some options I have tried: webshot: takes a screenshot of the widget and then I can import into pdf as an image. Not very efficient also formattable is not the best option as it doesn't allow for nested tables xtable/pander - doesn't allow me to add conditional formatting kable + kableExtra: this one I had

How to type tilde in formulas in RMarkdown

谁说胖子不能爱 提交于 2019-12-05 22:51:38
问题 I am trying to type equations on RMarkdown to create a PDF and I want to use a tilde, how can I go about it. I am trying this but throws back a pandoc.exe: Error producing PDF from TeX source .... --- title: "See" date: "24 September 2016" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` follows a Bernouli distribution $$y_i \~ Bernouli(p_i)$$ 回答1: I believe if you do $$ \sim $$ This should produce the ~ you are attempting to place in your formula.

How to box a formula in MathJax?

落花浮王杯 提交于 2019-12-05 22:30:33
问题 How do I draw a box around a formula in MathJax? I've seen \boxed{} recommended for LaTeX in general, but MathJax doesn't support that operation. Is there an alternative that does the trick? 回答1: \boxed is in the AMSmath extension, so if you put "TeX/AMSmath.js" in the extensions array of your configuration, you will be able to use the \boxed{} macro. Alternatively, try \fbox{}. 来源: https://stackoverflow.com/questions/5184977/how-to-box-a-formula-in-mathjax

关于申基金和写专利

被刻印的时光 ゝ 提交于 2019-12-05 22:17:24
最近刚把入职的事基本办完。。包括很多报告,很多入职培训。然后一看时间已经马上12月。这里的经验就是从面试到入职基本要三个半月。 去年去北辰做报告的一个白俄罗斯回来的老师讲了一次基金申请,跟今年其他老师说的似乎大相径庭:说投大同行比小同行机会多;期间学院有的老师问是不是用latex合适,他说大家都用的模板是word,用其他的标新立异没必要。而今年无论是天大其他学院的一些优青,还是重大的长江、山大、中科院的老师,甚至本人硕士的老板,都认为还是精准地投自己认为应该选择的学科方向。但是总归到的,是本子的内容,看具体到实际情况再选择合适的投递方向。我是觉得既然latex社区有程明明老师的模板以及后来的改进版,国内的牛导既然推荐,应该不会是差劲的选择。 另外就是专利。专利局来了三个工作人员,balabala讲了一通,专利审查时间要至少一年半。 来源: https://www.cnblogs.com/ubiwind/p/11947385.html