您好,我正在尝试在 Latex 文档中添加内联代码块。我知道如何使用 lstlisting 添加单独的代码块,但我想添加一个内联代码块。我附上我期望的输出的屏幕截图。
正如您在同一行中看到的,添加了一个包含表达式的代码块print(g)
。我想要那样的东西。所以它应该是可定制的,即框的背景颜色,框的宽度和高度,边框宽度等。此外,内联代码块内的代码文本也应该是可定制的。有没有办法在乳胶中实现这一点?
几天前我买了一台装有 Windows 10 Pro 操作系统的新电脑,并决定安装TeXstudio + MiKTeX。
\n我在编译 LaTeX 文件时遇到了问题。问题是,当我尝试添加\\usepackage{hyperref}
或编码与此行类似的内容(在带有注释行的代码中更详细% problem is here if I add this line
)时,我收到一条错误消息:Argument of \xef\xbf\xbd has an extra }. \\end{document}
。
我的代码:
\n\\documentclass[10pt,a4paper]{report}\n\\usepackage{cmap}\n\\usepackage{setspace}\n\\onehalfspacing\n\\usepackage{multicol}\n\\usepackage{textcomp}\n\\usepackage{verbatim}\n\\usepackage{floatrow,calc}\n\\DeclareFloatSeparators{mysep}{\\hspace{3cm}}\n\\thisfloatsetup{floatrowsep=mysep}\n\\usepackage{ucs}\n\\usepackage[pdftex]{graphicx}\n\\usepackage{epstopdf}\n\\usepackage{amssymb,amsmath}\n\\DeclareGraphicsExtensions{.pdf, .png, .jpg}\n\\usepackage[labelsep=period]{caption}\n\\usepackage[utf8x]{inputenc}\n\\usepackage[T2A]{fontenc}\n\\usepackage[russian, english]{babel}\n\\usepackage[left=3cm, right=1.5cm, top=1.5cm, bottom=2cm]{geometry}\n\\usepackage{indentfirst}\n\\usepackage{color}\n\\definecolor{Black}{rgb}{0,0,0}\n\n\\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line\n\\usepackage{xcolor}\n\\definecolor{linkcolor}{HTML}{000000}\n\\definecolor{urlcolor}{HTML}{000000}\n\\hypersetup{pdfstartview=FitH, linkcolor=linkcolor, urlcolor=urlcolor, colorlinks=True} % problem is here if I add this line\n\\fontfamily{ptm}\n\\parindent=1cm\n\\sloppy\n\\bibliographystyle{unsrt}\n\\usepackage{hyperref} % problem is here if I add this line\n\n\\usepackage{fancyhdr}\n\\pagestyle{fancy}\n\\fancyhf{}\n\\lhead{\\leftmark}\n\\cfoot{\\thepage}\n\\renewcommand{\\headrulewidth}{1pt}\n\n\\usepackage{subfig}\n\n\\usepackage{epigraph} %%% to make inspirational …
Run Code Online (Sandbox Code Playgroud) 问题陈述
我正在处理乳胶文档,并使用R的pdf()
功能创建绘图。为了匹配文档的字体,我在pdf函数中指定了字体系列:pdf(family = "LM Roman 12")
。但是,在图形(森林图)中,我par(font = ..)
用来更改为粗体字体以突出显示标题。不幸的是,这已经不起作用了,因为我已经在中指定了字体系列pdf()
。
范例程式码
### Required packages
library(metafor)
library(extrafont)
### My dataset reproduced with: dput()
data.rct.forest <- structure(list(study = c("Fellmeth et al. (2015)", "Gaffney, Ttofi et al. (2019)",
"Jiménez-Barbero et al. (2016)", "Gaffney, Farrington et al. (2019)",
"Moy & Hazen (2018)", "Park-Higgerson et al. (2008)"), rct_es = c(1.227,
1.235, 1.243, 1.333, 0.947, 1.037), rct_es_low = c(0.948, 1.124,
1.115, 1.087, 0.881, 0.696), rct_es_up = c(1.586, 1.389, 1.361,
1.669, …
Run Code Online (Sandbox Code Playgroud) 我正在研究乳胶背页。我正在使用 IEEE 访问模板,它有两列。我必须将表格修复为单列。你能告诉我我该怎么做吗?
代码:
\begin{table}[h]
\centering
\caption{Comparison table}
\label{tab2}
\begin{tabular}{@{}p{3cm}lllll@{}}
\toprule
\multicolumn{1}{}{}Metric
&\cite{dagher2018ancile} &\cite{tripathi2020sms} &\cite{zheng2018blockchain} &\cite{gordon2018blockchain}
&Our architecture\\ \midrule
User Centric & Y & N & Y & Y & Y\\
User Authentication & N & N & N & N & Y \\
Privacy of data owner & Y & Y & Y & Y & Y\\
Store personal data into blockchain & N & N & N & N & Y\\
Transparent policy & N & N & …
Run Code Online (Sandbox Code Playgroud) 我想删除包中的contfoot
,conthead
和(我使用过)。caption
tabularray
longtblr
\\documentclass{article}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T5]{fontenc}\n\\usepackage{tabularray}\n\\usepackage{parskip}\n\\usepackage[fontsize=14pt]{scrextend}%font m\xe1\xba\xb7c \xc4\x91\xe1\xbb\x8bnh\n\\usepackage[paperheight=29.7cm,paperwidth=21cm,right=2cm,left=3cm,top=2cm,bottom=2cm]{geometry}%font a4\n\\usepackage[bookmarks]{hyperref}%T\xe1\xba\xa0O BOOKMARK PDF\n\\usepackage{bookmark}\n\\usepackage{mathptmx}%ng\xc3\xb4n ng\xe1\xbb\xaf time new roman\n\\usepackage{titlesec}%chinh section\n\\titleformat{\\section}[block]{\\normalfont\\fontsize{16pt}{0}\\bfseries\\filcenter}{}{1em}{}\n\\titlespacing\\section{0}{0pt}{0pt}\n\\usepackage{ragged2e}%c\xc4\x83n \xc4\x91\xe1\xbb\x81u 2 b\xc3\xaan\n\\usepackage{fancyhdr}\n\\fancyhf{}\n\\fancyhead[C]{\\small\\thepage}\n\\begin{document}\n \\section*{DANH S\xc3\x81CH NG\xc6\xaf\xe1\xbb\x9cI M\xe1\xbb\xaaNG PHONG B\xc3\x8c C\xc6\xaf\xe1\xbb\x9aI S\xc6\xa0N - DI\xe1\xbb\x84M}\n\\noindent\n\\begin{longtblr}{width=1\\linewidth,rowhead=1,hlines,vlines,\n colspec={X[1,c]X[4,l]X[2,c]X[2,c]X[2,c]}, \n colsep=6pt,\n rowsep=3pt,\n rows={1.5cm,m},row{1}={font=\\bfseries,c}}\n STT&T\xc3\xaan ng\xc6\xb0\xe1\xbb\x9di& {S\xe1\xbb\x91 ti\xe1\xbb\x81n\\\\(Ngh\xc3\xacn \xc4\x91\xe1\xbb\x93ng)}&Ng\xc3\xa0y x\xc6\xb0a c\xc3\xb3 \xc4\x91i kh\xc3\xb4ng&\xc4\x90i bao nhi\xc3\xaau\\\\\n 1& Ch\xe1\xbb\x8b Nhung Kd Ph\xc3\xbac Y\xc3\xaan&300\\\\\n 2& Ch\xe1\xbb\x8b Nh\xc3\xa0n Kd Tam D\xc6\xb0\xc6\xa1ng&300\\\\\n 3& E Hi\xe1\xbb\x81n Kd S\xe1\xba\xa3n Nhi&300\\\\\n 4& Ch\xe1\xbb\x8b Nga Kd Ph\xc3\xbac Y\xc3\xaan&300\\\\\n 5& Ch\xe1\xbb\x8b V\xc3\xa2n Vi\xe1\xbb\x87n 9&500\\\\\n 6& Ch\xe1\xbb\x8b …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在浏览器上测试 katex 的渲染。它渲染正确,但是当我尝试使用\\newline来表示换行符时,它会抛出一个错误:
\n\n\n\n\nParseError:KaTeX 解析错误:预期 \'EOF\',在位置 45 处得到 \'\\newline\':\xe2\x80\xa6)-\\tfrac{1}{2}x\\\xcc\ xb2n\xcc\xb2e\xcc\xb2w\xcc\xb2l\xcc\xb2i\xcc\xb2n\xcc\xb2e\xcc\xb2 \\Righta\xe2\x80\xa6
\n
<body>\n <div class="maths">\n \\Rightarrow\\quad F(x)-\\tfrac{1}{2}x\n \\Rightarrow\\quad F(x)-F(a)\\leq\\tfrac{1}{2}(x-a)[2ex]\n</div> \n<script>\n// Get all <div class ="maths"> elements in the document\n var x = document.getElementsByClassName(\'maths\'); \n for (var i = 0; i < x.length; i++) {\n try {\n if (x[i].tagName == "DIV") {\n t = katex.render(x[i].textContent, x[i], { displayMode: true });\n } else {\n t = katex.render(x[i].textContent, x[i]);\n }\n }\n catch (err) {\n x[i].style.color = \'red\';\n x[i].textContent …
Run Code Online (Sandbox Code Playgroud) 我想在 Jupyter 笔记本的 Markdown 单元中定义一个宏。但我们似乎无法定义它。
例如,我想定义一个格式化向量的宏。单元格中的代码是:
\newcommand{\vect}[1]{{\mathbf{\boldsymbol{{#1}}}}}
This is the vector $\vect{x}$.
Run Code Online (Sandbox Code Playgroud)
渲染效果是:
PS 这个问题是在https://tex.stackexchange.com/questions/281535/latex-macros-in-markdown提出的,但它与 LaTeX 没有直接关系,并且该问题被标记为偏离主题。
我在将 gif 添加到我的 Beamer 时遇到问题。我一直在寻找答案,但我还没有找到在 Adobe 淘汰 Flash Player 后编写的答案。我尝试过使用animate包,它确实编译了文件,但它不允许我播放它(控件出现,但如果我单击它们,什么也不会发生)。我尝试过media9和movie15软件包,但显然它们已经过时了。所以,我现在对如何添加动画感到非常困惑。老实说,我什至不知道缺少 Adobe Flash Player 是否是问题所在。我知道必须有一个简单的答案。
我认为没有必要添加我的代码,因为我觉得这是一件微不足道的事情。
提前致谢!
我对 LaTeX 有一个大问题,因为我无法删除新章节之前的边距
我已经尝试了一切,但我很新,而且没能成功。我的代码:
\documentclass[polish,12pt,oneside]{mwbk}
\usepackage[a4paper,includeheadfoot,inner=3.0cm,outer=2.5cm,top=3cm,bottom=3cm]{geometry}
\linespread{1.416}
\usepackage{lipsum}
\clubpenalty=10000
\widowpenalty=10000
\usepackage{fancyhdr}
\pagestyle{plain}
\setlength{\headsep}{2em}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\usepackage[utf8]{inputenc}
\usepackage[polish]{babel}
\usepackage{polski}
\usepackage[pagebackref=false]{hyperref}
\bibliographystyle{plplain}
\usepackage{dirtree}
\usepackage{varwidth}
\usepackage[labelsep=period]{caption}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepackage{subcaption}
\usepackage{float}
\usepackage{wasysym}
% THE CODE I'VE TRIED
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
% --- Patch \chapter
\patchcmd{\@makechapterhead}{50\p@}{\chapheadtopskip}{}{}% Space from top of page to CHAPTER X
\patchcmd{\@makechapterhead}{20\p@}{\chapheadsep}{}{}% Space between CHAPTER X and CHAPTER TITLE
\patchcmd{\@makechapterhead}{40\p@}{\chapheadbelowskip}{}{}% Space between CHAPTER TITLE and text
% --- Patch \chapter*
\patchcmd{\@makeschapterhead}{50\p@}{\chapheadtopskip}{}{}% Space from top of page to CHAPTER TITLE
\patchcmd{\@makeschapterhead}{40\p@}{\chapheadbelowskip}{}{}% …
Run Code Online (Sandbox Code Playgroud) 我在 Overleaf 上使用以下设置:
\documentclass[%
aip,
jmp,%
amsmath,amssymb,
%preprint,%
reprint,%
nofootinbib,
nobibnotes,
%author-year,%
%author-numerical,%
10pt
]{revtex4-2}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{tabularx}
\usepackage[a4paper, total={6.5in, 9in}]{geometry}
\usepackage{microtype}
\usepackage[english]{babel}
\usepackage[utf8]{inputenx}
\usepackage{bm}
\usepackage{amsbsy}
\usepackage{fixmath}
\usepackage{commath}
\usepackage{float}
\usepackage{siunitx} % notazione \num{e-}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
%\usepackage{subcaption}
\usepackage{hyperref}
\usepackage{curve2e}
%\usepackage{caption}
\usepackage{subcaption}
%\usepackage{silence}
%\WarningFilter{caption}{Unsupported document class}
%\usepackage[center]{subfigure}
\usepackage{comment}
%\usepackage[mathlines]{lineno}% Enable numbering of text and display math
%\linenumbers\relax % Commence numbering lines
Run Code Online (Sandbox Code Playgroud)
我收到以下警告:
Package caption Warning: Unknown document class (or …
Run Code Online (Sandbox Code Playgroud)