LaTeXStudio
LaTeXStudio
这家伙很懒,什么也没写!

注册于 4年前

回答
474
文章
292
关注者
199

与其这样不如给版面画个背景呢,用margin的方式实现批注。

完整的代码在哪里?最好有个复现代码,方便给出答案!

代码不完整,我这里整体调整如下:

\documentclass{article}
\usepackage{pgf,tikz}
\usetikzlibrary{shapes}
\makeatletter
\pgfdeclareshape{document}{
\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
% ... and possibly more
\backgroundpath{% this is new
% store lower right in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
% compute corner of ``flipped page''
\pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter
\pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
% construct main path
\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathclose
% add little corner
\pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
}
}
\makeatother
\begin{document}
\begin{tikzpicture}
\node[shade,draw,shape=document,inner sep=2ex]  (x)  {Remark};
\node[fill=yellow!80!black,draw,ellipse,double]
at ([shift=(-80:3cm)]x) (y) {Use Case};
\draw[dashed] (x) -- (y);
\end{tikzpicture}

\end{document}

image.png

没看懂问题是什么,看看这个代码:

 \documentclass{IEEEtran}

\usepackage{algorithm}
\usepackage{algorithmic}
\begin{document}

 \begin{algorithm}[H]
 \caption{Algorithm for ...}
 \begin{algorithmic}[1]
 \renewcommand{\algorithmicrequire}{\textbf{Input:}}
 \renewcommand{\algorithmicensure}{\textbf{Output:}}
 \REQUIRE in
 \ENSURE  out
 \\ \textit{Initialisation} :
  \STATE first statement
 \\ \textit{LOOP Process}
  \FOR {$i = l-2$ to $0$}
  \STATE statements..
  \IF {($i \ne 0$)}
  \STATE statement..
  \ENDIF
  \ENDFOR
 \RETURN $P$
 \end{algorithmic}
 \end{algorithm}

\end{document} 

image.png

什么信息都没有,就这样的问题,无法回答。

第二行明显少了一个单元格,加上就好了。

\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}*{姓名} & \multicolumn{3}{c|}{成绩} & \multirow{2}{*}{总分} \\ \cline{2-4}
&语文&数学&英语& \\ \hline
张三 &98 &100&92 & 290 \\ \hline
李四 &99 &91 &99 & 289 \\ \hline
\end{tabular}
\begin{question}

image.png

你的参数就没加 breakable :

\tcbset{%
 %enhanced,
 breakable,
    colback      = white,
    tikz         = {opacity=0.8,transparency group},
    colframe     = black,
    title filled = false,
    colbacktitle = white,
}%%

这样设置。

公式只有类 Times 字体。如果你需要可以看看 mathtime 字体,需要付费:https://www.pctex.com/mtpro2.html

现在用得比较多的是 newtxmath 宏包,还有用 unicode-math 宏包 setmathfont 来设置字体。

实际很简单,你只需要new一个float就好了,这样定理都放在一个float里你的需求都满足了。
粗略一个示例

\documentclass{article}
\usepackage{amsthm}
\newtheorem{thm}{Theorem} 
\usepackage{lipsum}
 
\usepackage{xcolor}
 
    
\usepackage{newfloat}
\DeclareFloatingEnvironment{fthem}
\newenvironment{fthm}{% 
\begin{fthem}\begin{thm}
}
{\end{thm}\end{fthem}}
\begin{document}

\lipsum[1-4]

 
\begin{fthm}[$insts_P^{abs}(expr, ctx), relevant(a_{var}, \omega)$] $\ $\\\label{alg:cell:inst}

\begin{verbatim} 
let $insts_P^{abs}$ expr ctx =
  let $a_{var}$ = new_variable () in (* We need $a_{var}$ to be unused in expr and ctx*)
  let R = relevant $a_{var}$ ($a_{var} = expr \wedge \neg ctx$) in
  ler R' = filter (fun e -> e $\ne \top$) R in (*We remove $\top$*)
  if R = [] then [(($\bot$, expr[$\bot$]), ())] (*We need $R$ non-empty*)
  else map (fun e -> ((e, expr[e]), ())) R
  Blabla

\end{verbatim}
Some result about this function
\bigskip
\begin{verbatim} 
let relevant $a_{var}$ $\omega$ =
  (*We add two parameters that we set in first position
    to keep track of full context and visited variables*)
  relevant_impl $\omega$ [] $a_{var}$ $\omega$
 Blabla
\end{verbatim}
Some result about this function
\end{fthm} 

\lipsum[1-3]

\end{document} 

简单一点的方法就是 \\[距离] 实用,定义也可以修改公式的间距的,比如

\addtolength{\jot}{1em}

但是注意作用域,弄不好,都变了。用括号或者群组包围起来。
另外,求求大家学会用 md 语法,多行代码用三个 ` 上下包裹起来。

图片可以复制粘贴到编辑器里,就可以自动上传也可以展示了。

发布
问题