
Latex
Latex
search_star
个人博客seekstar.github.io
展开
-
解决Latex soul ul参数中有宏时报错的问题
这种方案是非侵入式的。原创 2023-09-14 22:52:59 · 1236 阅读 · 2 评论 -
latex打出算法复杂度里的O波浪线
\tilde{O}O~\tilde{O}O~来源:https://tex.stackexchange.com/questions/66418/tilde-over-a-symbol-phi原创 2021-10-17 15:26:36 · 1903 阅读 · 0 评论 -
latex bib注释
我这里//和%都不管用,bibtex都会报错。解决方法是在不想要的域的名字前面加上_,例如不想要这行doi = {10.14778/3389133.3389134},就改成_doi = {10.14778/3389133.3389134},参考:https://tex.stackexchange.com/questions/21709/comments-in-bibtex...原创 2021-06-23 13:48:30 · 1469 阅读 · 2 评论 -
pgf放缩
用scalebox:\scalebox{0.6}{\input{m1.pgf}}原文:https://tex.stackexchange.com/questions/117042/set-the-size-of-pgf-picture翻译 2021-06-21 10:26:32 · 124 阅读 · 0 评论 -
解决draw.io生成的pdf插入到latex后偏小的问题
latex中正文的字号设置成了10pt,所以将图中的字号也设置成10pt,但是导出pdf插入到latex里之后发现图偏小了,图中的字比正文里的字小得多。原本以为是draw.io和latex的字号标准不一样,但是导出为jpg再插入到latex之后却发现这个时候字体大小差不多了。所以原因就是draw.io生成的pdf本身就偏小了。解决方案就是在latex里设置scale=1.34,把这个偏差拉回来,其中1.34是目测出来的值。...原创 2021-06-13 16:23:23 · 1692 阅读 · 5 评论 -
algorithm2e包参数
完整参数见官方文档:http://tug.ctan.org/macros/latex/contrib/algorithm2e/doc/algorithm2e.pdf这里介绍几个常用的。测试代码:\documentclass[UTF8]{ctexart}\usepackage[linesnumbered, ruled]{algorithm2e}\begin{document}\begin{algorithm} \DontPrintSemicolon \caption{2333} \If原创 2021-06-04 15:58:28 · 605 阅读 · 0 评论 -
texdoctk
装完texlive之后会有一个叫做texdoctk的软件,要安装perl-tk包才能使用。打开这个软件之后发现主要是一些文档。但是这个软件不能卸,卸载的话会把其他的像是xelatex也卸掉。原创 2021-05-26 13:08:14 · 613 阅读 · 0 评论 -
minted: Undefined control sequence. \PYG
把_minted*目录删掉。原文:https://tex.stackexchange.com/questions/367332/minted-error-undefined-control-sequence-pyg-with-texmaker翻译 2021-05-22 16:57:02 · 249 阅读 · 0 评论 -
Latex algorithm Input Output
用\Statex使其不占用行号即可。\begin{algorithm}\caption{2333}\label{233}\begin{algorithmic}[1]\Statex \textbf{Input:} 233\Statex \textbf{Output:} 23333\State 2233\end{algorithmic}\end{algorithm}参考文献:https://tex.stackexchange.com/questions/355937/how-to-add原创 2021-05-03 15:45:21 · 11968 阅读 · 6 评论 -
论文中引用github项目
参考:https://www.wikihow.com/Cite-a-GitHub-Repository作者和年份可以到copyright里找。如果项目所有者是组织,那作者就写组织的名字。原创 2021-04-30 15:32:01 · 25936 阅读 · 1 评论 -
Latex子表并列放置
\usepackage{caption}\usepackage{subcaption}\begin{table} \centering \begin{subtable}[t]{0.495\linewidth} \begin{tabular}{ccc} \toprule Dup(\%) & Tree & Array \\ \midrule 0 & &am原创 2021-04-29 18:45:08 · 15575 阅读 · 0 评论 -
Latex给含数字的单词断词
比方说SHA256,如果用\hyphenation{SHA-256}会报错Not a letter。这时直接在正文里想断词的地方加\-即可:SHA\-256原创 2021-04-21 20:21:01 · 249 阅读 · 0 评论 -
vscode: You must invoke LaTeX with the -shell-escape flag.
参考:https://blog.youkuaiyun.com/qq_45890199/article/details/105330856在.vscode/settings.json里写入:{ "latex-workshop.latex.magic.args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-shell-escape", "%DO原创 2021-04-13 23:59:34 · 1851 阅读 · 0 评论 -
! LaTeX Error: Command \CJKglue already defined.
把\usepackage{CJK}删掉,再编译就不会报错了,只会报字体不存在的warning,latex会自动替换成可用字体。Package fontspec Warning: Font "STFangsong" does not contain requested Script(fontspec) "CJK".LaTeX Font Warning: Some font shapes were not available, defaults substituted.原创 2021-04-12 15:40:50 · 3925 阅读 · 2 评论 -
/Volumes/TeXLive2019/install-tl: No binary platform specified/available, quitting.
我用的是TexLive2019,在macbook pro上运行sudo ./install-tl报这个错。我的解决方案是下载更新版本的TexLive 2021官网:http://www.tug.org/texlive/acquire-iso.html中科大源:http://mirrors.ustc.edu.cn/CTAN/systems/texlive/Images/清华源:https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Imag原创 2021-04-12 15:05:28 · 289 阅读 · 0 评论 -
Command \algorithmic already defined
algorithmic包是比较老的包,与algpseudocode不兼容。正确使用方法:\usepackage{algorithm}\usepackage{algorithmicx}\usepackage{algpseudocode}用algorithmicx替代algorithmic。algorithmic里的伪代码都是大写的,algorithmicx里的伪代码是驼峰命名的,例如algorithmic里的\ENDIF在algorithmicx里是\EndIf。algorithmicx文档原创 2021-03-30 22:30:34 · 8603 阅读 · 5 评论 -
Latex图片和图题之间有很大的空白
可能是因为图片超宽了,试着把图片宽度改小一点。原创 2021-03-10 11:08:03 · 5251 阅读 · 0 评论 -
hitszthesis Linux使用笔记
安装texlive# texlive-extra-utils: texdef# latex-cjk-all: Chinese font package# texlive-fonts-extra: Fonts such as consolas# evince: PDF readersudo apt install -y texstudio texlive-xetex texlive-extra-utils latex-cjk-all texlive-fonts-extra evince下载模板原创 2021-02-09 16:51:20 · 250 阅读 · 0 评论 -
Latex去掉lstlisting后面的空行
转自:https://tex.stackexchange.com/questions/167305/how-do-i-get-rid-of-the-extra-blank-line-at-the-end-of-my-listing例如 \begin{lstlisting}[numbers=none]mpirun -n 20 ./xhpl \end{lstlisting}后面有一个空行。这是因为\end{lstlisting}前仍然有一个newline。所以需要把\e转载 2021-01-01 19:21:02 · 2182 阅读 · 4 评论 -
Latex导入pgf图片
\begin{figure}\label{HPL} \resizebox{\textwidth}{!}{\input{img/HPL.pgf}} \caption{HPL} \end{figure}转载 2021-01-01 17:17:47 · 893 阅读 · 1 评论 -
latex tabular自动换行
转载自:https://tex.stackexchange.com/questions/166743/automatic-line-break-in-tabular使用tabularx\documentclass[danish,a4paper,twoside,11pt]{report}\usepackage{tabularx}\begin{document}\begin{table}[h]\begin{tabularx}{\textwidth}{|l|X|}Use Case Navn:转载 2021-01-01 13:20:23 · 2951 阅读 · 0 评论 -
latex tabular 单元格里换行
参考:https://blog.youkuaiyun.com/zjccsg/article/details/51926067\newcommand{\tabincell}[2]{ \begin{tabular}{@{}#1@{}} #2 \end{tabular}}@{}表示把这一侧的空格给去掉:https://tex.stackexchange.com/questions/233938/what-is-the-use-of/233957测试:\begin{table}[H]原创 2020-07-17 09:58:57 · 2581 阅读 · 0 评论 -
latex url自动换行
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}参考:https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url原创 2020-05-28 17:45:25 · 4145 阅读 · 0 评论 -
latex wrapfigure指定行数
网上很多都是错的。。。参考:https://www.jianshu.com/p/dc168489b0fc宏包:\usepackage{wrapfig}用法:\begin{wrapfigure}[行数]{位置}{超出长度}{宽度}<图形>\end{wrapfigure}注意,行数两边是方括号,不是花括号!其他的看上面的参考链接的就好了。...原创 2020-04-20 15:45:27 · 9736 阅读 · 2 评论 -
latex写论文
参考latex 中section的标题左对齐而不是居中作者单位Latex技巧:插入参考文献Latex/CTex/WinEdt 将参考文献设为上标引用,并加方括号latex代码% !TEX program = xelatex\documentclass[UTF8]{ctexart}\usepackage{authblk}\usepackage{cite}\CTEXsetup...原创 2020-04-18 00:24:34 · 476 阅读 · 0 评论 -
vscode latex 字数统计
安装插件LaTeX Utilities然后打开.tex文件,状态栏中就有总字数原创 2020-04-15 23:25:58 · 10629 阅读 · 4 评论 -
latex个人学习笔记
公式中插入中文\text{中文}左引号参考:https://blog.youkuaiyun.com/dyzok88/article/details/44222765左单引号(键盘上1左边那个)`左双引号(按两下键盘上1左边的按键)``...原创 2020-03-12 11:36:20 · 2294 阅读 · 0 评论 -
使用apt安装latex
测试环境:deepin 15.11由于xetex对中文的支持较好,为了节约磁盘空间和安装时间,就只安装xetex。在终端中粘贴以下代码sudo apt-get install -y texstudio perl-tk sudo apt-get install -y texlive-xetex#Install chinese font packagesudo apt-get instal...原创 2020-02-10 15:40:32 · 788 阅读 · 0 评论 -
解决linux下latex无法使用consolas的问题
在网上找了好久都没有合适的解决方案TT。结合报错信息,发现其实/usr/local/texlive/2019中已经有inconsolata,但是编译时xelatex找的是/usr/share/texlive,里面有一些字体没有(我也不懂为什么官方要这样搞)。于是我们只需要把/usr/share下的相关文件夹替换成/usr/local/texlive/2019中的相关文件夹即可。代码如下:su...原创 2019-09-25 02:31:30 · 883 阅读 · 0 评论 -
latex 定义带有方括号的command
来源:https://en.wikibooks.org/wiki/LaTeX/Macros方括号中的参数其实就是默认参数。使用方法:\newcommand{name}[num][default]{definition}例子:\newcommand{\wbalTwo}[2][Wikimedia]{This is the Wikibook about LaTeXsupported by ...转载 2019-09-19 16:42:11 · 1247 阅读 · 0 评论 -
latex退出batchmode
linux下有效显示OK, entering \batchmode后,按Ctrl+c,就会退出\batchmode并回到开头一个?的状态。然后输入X即可彻底退出。原创 2019-08-22 16:59:56 · 685 阅读 · 0 评论