标签: latex

在Latex中,如何将两个单独的表格并排放在纸张上?

在 Latex 中,如何将两个单独的桌子(具有单独的队长)并排放在纸张上?

任何帮助都将受到高度赞赏。

latex

0
推荐指数
1
解决办法
3万
查看次数

knitr:新版本中fig.height必须是数字吗?

我下载了新版本的 knitr 包,当尝试在 Rnw 文件中包含绘图时突然出现以下错误:

Error in options[[sprintf("fig.%s", i)]] * options$dpi : 
  non-numeric argument to binary operator
Calls: knit ... process_group.block -> call_block -> fix_options -> %n%
Run Code Online (Sandbox Code Playgroud)

经过大量实验后,我发现问题出在命令 Fig.height 上,显然它应该是数字。此代码产生错误:

\documentclass{article}

\begin{document}

<<cat, fig.cap="dog", fig.height='\\textheight'>>=
plot(c(1, 2, 3), c(2, 1, 3))
@

\end{document}
Run Code Online (Sandbox Code Playgroud)

这段代码没有:

\documentclass{article}

\begin{document}

<<cat, fig.cap="dog", fig.height=6>>=
plot(c(1, 2, 3), c(2, 1, 3))
@

\end{document}
Run Code Online (Sandbox Code Playgroud)

不幸的是我不知道这个 6 的测量单位是什么。

这段代码:

\documentclass{article}

\begin{document}

<<cat, fig.cap="dog", fig.height=6cm>>=
plot(c(1, 2, 3), c(2, 1, 3))
@

\end{document}    
Run Code Online (Sandbox Code Playgroud)

产生不同的错误:

Error in base::parse(text = code, …
Run Code Online (Sandbox Code Playgroud)

latex knitr rnw

0
推荐指数
1
解决办法
704
查看次数

如何修复乳胶中算法的对齐问题

我需要修复这个 LaTeX 代码的对齐方式。

if当我编译它时,输出的, for,语句对齐错误else

\begin{algorithm}[H]
       \caption{:The $ASP\_Tree$ algorithm}     
       \SetKwInOut{Input}{Input}
       \SetKwInOut{Output}{Output}   
       \Input{TV database and min\_sup }
         \Output{Bla bla bla}
         \KwData{bla bla bla} 
         \Procedure{Tree}{$TV_i, min\_sup$}
        {
            \State {$[Root] \leftarrow [NULL]$} \newline
            \For {$i=1$ to $N$} {\label{forins} \newline
                {
                %\Statex \Comment {\%Comments: insert TV values into the tree based on rules}
                        \State {$Root \leftarrow TV_1$}
                        \State {$i \leftarrow i+1$} \newline                        
                        \If {TV_i \textgreater Root}
                    \State Root \gets TV_i
                        \ELSIF {TV_i\leq Root}
                    \State i\gets i+1
                        \ELSE
                              \State do something …
Run Code Online (Sandbox Code Playgroud)

latex

0
推荐指数
1
解决办法
2万
查看次数

LaTeX 中的小节编号

在第 3 章(节)中,我希望将小节编号为 3.1 、3.2 、3.3 等。但显示为2.4、2.5。我尝试使用\setcounter{subsection}{3},但没有帮助。

以下是代码:

%previous code

\cleardoublepage
\section*{Chapter 3}
\subsection*{Product Design}
\line(1,0){400}
\setcounter{subsection}{3}
\subsection{Product Perspective}

%rest of the code
Run Code Online (Sandbox Code Playgroud)


输出如下:

输出

latex

0
推荐指数
1
解决办法
3万
查看次数

如何保存vim中的所有缓冲区(即使它们没有改变)?

我遇到这个特殊问题,因为我使用 vim-latex-live-preview-plugin ,每次将 .tex 文档写入磁盘时都会重新编译它。所以我的工作流程如下:

  • 做一些改变
  • :w
  • 请参阅 pdf 中的更改。

但是,现在我正在处理一个更大的文档,在其中使用该\input{example_input}命令。我当前的工作流程是

  • 在 example_input.tex 中工作
  • 保存 example_input.tex 为:w
  • 将缓冲区切换到“根”tex 文件
  • 保存“根”文本文件 *)整个文档被重新编译 *)切换回我实际工作的缓冲区(example_input.tex)。

这显然是不可取的。首先,我认为:wa做了我想要的,但不幸的:wa是只有在缓冲区实际更改时才写入磁盘(与 不同:w)。是否有类似:wa(保存所有缓冲区)的行为:w(即使缓冲区没有更改也写入磁盘)?

vim latex

0
推荐指数
1
解决办法
997
查看次数

在 LaTeX 中布局平行列?

我正在寻求如下布局段落: 1. 在引言中,我将在所有列中包含段落。2.然后平行地分出两栏意见相反的栏目。它与两列布局不同,两列是平行的,并且左侧的内容将始终保留在左侧,右侧的内容始终位于多个页面的右侧。即使左列的参数量较短,右列的参数也不应该浮动到左列中。

以下是 HTML 格式的示例: https://www.biblegateway.com/passage/?search=1+Corinthians+15&version=CCB;KJ21 用于比较不同的翻译。

下面是我尝试实现的效果。

\documentclass{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\section{Introduction}
Here are the normal paragraph crossing colmuns.

\blindtext

\begin{minipage}[t]{0.5\textwidth}
  \section{Argument on the Left}
  Because I am on the left, so must I be not right?

\end{minipage}\begin{minipage}[t]{0.5\textwidth}
  \section{Argument on the Right}
  Because I am on the right, so I must be right!

  \blindtext
\end{minipage}
\end{document}
Run Code Online (Sandbox Code Playgroud)

几乎达到了效果,只不过两根柱子之间没有间隙了。

这是结果的屏幕截图: 在此输入图像描述

什么是更好的解决方案?

我如何在组织模式下通过导出为 PDF(通过 LaTex)实现相同的效果?

latex org-mode

0
推荐指数
1
解决办法
5419
查看次数

RMarkdown 中的两列增量投影仪幻灯片

我试图在beamer演示幻灯片中获得两列布局,其中rmarkdown逐项显示 A 和 B 之间的差异。MWE如下:

---
  title: "Presentation Title"
author: "Name"
institute: "Institute"
date: "date"
output:
  beamer_presentation:
  incremental: true
theme: "Berlin"
colortheme: "dove"
fonttheme: "structurebold"
classoption: "aspectratio=169"

# Section 1

## A vs B

::: columns

:::: column
### A
- Item A1
- Item A2
::::

:::: column
### B
- Item B1
- Item B2
::::

:::
Run Code Online (Sandbox Code Playgroud)

然而,这意味着先出现 A1,然后出现 A2,然后出现 B1,然后出现 B2。我正在寻找一种解决方案,先给出 A1,然后给出 B1;A2,然后 B2。beamer 和 rmarkdown 可以做到这一点吗?

谢谢

latex r beamer r-markdown

0
推荐指数
1
解决办法
826
查看次数

LaTeX-workshop:徽章不出现

我已经在 VSCode for Mac 上安装了 Latex-workshop,并且在 YouTube 上观看视频,屏幕左侧应该有一个“TeX”徽章(?),就在“扩展”徽章下方。没有。我错过了什么步骤?

扩展: https: //github.com/James-Yu/LaTeX-Workshop

latex visual-studio-code

0
推荐指数
1
解决办法
1102
查看次数

在表格 LATEX 中使用小型页面

我想在表格中使用迷你页,但内容的对齐方式不一样。我想让第一个输入位于右上角,第二个输入左对齐。我使用的代码是:

\newlength{\smallertextwidth}
\setlength{\smallertextwidth}{\textwidth}
\addtolength{\smallertextwidth}{-2cm}

\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}


\newcommand{\mytabb}[2]{
\begin{tabular}{R{1.5cm}L{1cm}} 
\textbf{#1} & 
\begin{minipage}{\smallertextwidth}
#2
\end{minipage} 
\end{tabular}
}
Run Code Online (Sandbox Code Playgroud)

使用此代码的输出是:

\mytabb{YEAR}{This is a long text. This is a long text.This is a long text.This is a long text.This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. \newline This is a long text. This is a long text.This is a long text.This is a long text. This …
Run Code Online (Sandbox Code Playgroud)

latex

0
推荐指数
1
解决办法
5137
查看次数

Pandas Styler.to_latex() - 如何传递命令并进行简单编辑

如何将以下命令传递到 Latex 环境中?

\centering(我需要横向表格居中)

\caption*(我需要跳过面板的表格编号)

此外,我需要在 t 统计量中添加括号星号,这意味着数据帧上的特定于行的格式。

例如:

当前的

多变的 价值
常量 2.439628
统计时间 13.921319
家族企业 0.114914
统计时间 0.351283
创始人 0.154914
统计时间 2.351283
调整后的 R 方 0.291328

我要这个

多变的 价值
常量 2.439628
统计时间 (13.921319)***
家族企业 0.114914
统计时间 (0.351283)
创始人 0.154914
统计时间 (1.651283)**
调整后的 R 方 0.291328

我正在 DataSpell 上写研究论文。所有实证工作都在 Python 中进行,然后我使用 Latex (TexiFy) 在 DataSpell 中创建 pdf。由于这个工作流程,我无法在乳胶代码中编辑表格,因为每次运行 jupyter 笔记本时它们都会被覆盖。

如果有帮助的话,下面是我如何将表传递到乳胶环境的示例:

# drop index to column
panel_a.reset_index(inplace=True)


# write Latex index and cut names …
Run Code Online (Sandbox Code Playgroud)

python latex pandas pandas-styles

0
推荐指数
1
解决办法
945
查看次数

标签 统计

latex ×10

beamer ×1

knitr ×1

org-mode ×1

pandas ×1

pandas-styles ×1

python ×1

r ×1

r-markdown ×1

rnw ×1

vim ×1

visual-studio-code ×1