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

注册于 4年前

回答
470
文章
292
关注者
196

看看 listings 文档,用 frame = L 就是双线了。颜色自己查查手册了。示例如下:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.c}
(function (__global) {
     var tmp0, tmp1,....;
     tmp13 = function (a) {
         var tmp14;
         tmp14 = a;
         return tmp14;
     };
     ...
     tmp16 = function (flag) {
        ...
        tmp20 = tmp21 == tmp22;
        if (tmp20) {
             tmp26 = 'x';
             tmp24 = __global[tmp26];
             tmp25 = 1;
             tmp23 = tmp24 * tmp25;
             return tmp23;
         }
     ...
     tmp7 = tmp16(tmp10, tmp11);
     ...
}(typeof global === 'undefined' ? this : global));
\end{filecontents*}


\documentclass{scrartcl}

\usepackage{listings}
\usepackage{xcolor}


\lstdefinelanguage{HTML5}{
    sensitive=true,
    keywords={%
    % JavaScript
    typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break,
    % HTML
    html, title, meta, style, head, body, script, canvas,
    % CSS
    border:, transform:, -moz-transform:, transition-duration:, transition-property:,
    transition-timing-function:
    },
    % http://texblog.org/tag/otherkeywords/
    otherkeywords={<, >, \/},
    %ndkeywords={class, export, boolean, throw, implements, import, this},
    comment=[l]{//},
    % morecomment=[s][keywordstyle]{<}{>},
    morecomment=[s]{/*}{*/},
    morecomment=[s]{<!}{>},
    morestring=[b]',
    morestring=[b]",
    alsoletter={-},
    alsodigit={:}
}
\lstset{%
    % Basic design
    %backgroundcolor=\color{white},
    basicstyle={\ttfamily},
    frame=L,
    % Line numbers
    xleftmargin={0.75cm},
    numbers=left,
    stepnumber=1,
    firstnumber=1,
    numberfirstline=true,
    % Code design
    identifierstyle=\color{black},
    keywordstyle=\bfseries,
    ndkeywordstyle=\color{blue}\bfseries,
    stringstyle=\color{black}\ttfamily,
    commentstyle=\color{darkgray}\ttfamily,
    % Code
    language={HTML5},
    tabsize=2,
    showtabs=false,
    showspaces=false,
    showstringspaces=false,
    extendedchars=true,
    breaklines=true
}


\begin{document} 
\lstinputlisting{\jobname.c}
\clearpage
The following lines lines shows how to~\dots
\lstinputlisting[firstline=1,lastline=7]{\jobname.c}
The following lines shows that \dots
\lstinputlisting[firstline=9,firstnumber=10]{\jobname.c}
\end{document} 

效果:
image.png

不需要,安装了texlive 之后,安装 WinEdt 自动就通过环境变量关联好了,如果是 11 版本自带了 pdf 阅读器,直接使用即可。

学会用 md 语法来输入代码。编辑器也有提醒。

我测试的代码正常,看看 multitoc 的说明:

\documentclass{ctexbook}
\usepackage{tabularray}
\usepackage[lot]{multitoc}
\begin{document}
    \listoftables\let\cleardoublepage\clearpage

\NewTblrTheme{fancy}{
    \SetTblrStyle{firsthead}{font=\bfseries}
    \SetTblrStyle{firstfoot}{fg=blue2}
    \SetTblrStyle{middlefoot}{\itshape}
    \SetTblrStyle{caption-tag}{red2}
}
\begin{longtblr}[
    theme = fancy,
    caption = {A Table},
    entry = {Caption},
    ]{
        colspec = {XXX}
    }
    Head & Head & Head \\
\end{longtblr}
\end{document}

image.png

可以看看这个宏包 extarrows,但是箭头并没有分开,分开的话,可以自己定义了。

\documentclass[a4paper]{article}
\usepackage{amsmath}

\makeatletter
\newcommand*{\doublerightarrow}[2]{\mathrel{
  \settowidth{\@tempdima}{$\scriptstyle#1$}
  \settowidth{\@tempdimb}{$\scriptstyle#2$}
  \ifdim\@tempdimb>\@tempdima \@tempdima=\@tempdimb\fi
  \mathop{\vcenter{
    \offinterlineskip\ialign{\hbox to\dimexpr\@tempdima+1em{##}\cr
    \rightarrowfill\cr\noalign{\kern.5ex}
    \rightarrowfill\cr}}}\limits^{\!#1}_{\!#2}}}
\newcommand*{\triplerightarrow}[1]{\mathrel{
  \settowidth{\@tempdima}{$\scriptstyle#1$}
  \mathop{\vcenter{
    \offinterlineskip\ialign{\hbox to\dimexpr\@tempdima+1em{##}\cr
    \rightarrowfill\cr\noalign{\kern.5ex}
    \rightarrowfill\cr\noalign{\kern.5ex}
    \rightarrowfill\cr}}}\limits^{\!#1}}}
\makeatother

\begin{document}
$A\doublerightarrow{a}{bcdefgh}B$

$A\triplerightarrow{d_0,d_1,d_2}B$
\end{document}

image.png
选自:https://tex.stackexchange.com/questions/25053/easy-way-to-type-more-kinds-of-arrows

看不明白是啥意思?eqref?还是什么?

网站已经很多例子了,封面的找找基本就知道了,基本就是背景图加上 TikZ 辅助,或者 tcolorbox 辅助。

要进行设置的,下面给个例子,代码来自这里:https://www.latexstudio.net/index/details/index/mid/755.html

\documentclass{beamer}
\mode<presentation> {
    \usetheme{CambridgeUS}
}
\usepackage{listings,color}

% Matlab highlight color settings
%\definecolor{mBasic}{RGB}{248,248,242}       % default
\definecolor{mKeyword}{RGB}{0,0,255}          % bule
\definecolor{mString}{RGB}{160,32,240}        % purple
\definecolor{mComment}{RGB}{34,139,34}        % green
\definecolor{mBackground}{RGB}{245,245,245}   % lightgrey
\definecolor{mNumber}{RGB}{134,145,148}       % gray

\definecolor{Numberbg}{RGB}{237,240,241}     % lightgrey

% Python highlight color settings
%\definecolor{pBasic}{RGB}{248, 248, 242}     % default
\definecolor{pKeyword}{RGB}{228,0,128}        % magenta
\definecolor{pString}{RGB}{148,0,209}         % purple
\definecolor{pComment}{RGB}{117,113,94}       % gray
\definecolor{pIdentifier}{RGB}{166, 226, 46}  %
\definecolor{pBackground}{RGB}{245,245,245}   % lightgrey
\definecolor{pNumber}{RGB}{134,145,148}       % gray


\lstset{language=Matlab,               % choose the language of the code
  %frame=tlbr,
  xleftmargin=30pt,
  xrightmargin=10pt,
  frame=l,
  framesep=15pt,%framerule=0pt,  % sets the frame style
  %frame=shadowbox,rulesepcolor=\color{red!20!green!20!blue!20},
  basicstyle=\small\ttfamily,
  keywordstyle={\color{mKeyword}},     % sets color for keywords
  stringstyle={\color{mString}},       % sets color for strings
  commentstyle={\color{mComment}},     % sets color for comments
  backgroundcolor=\color{mBackground}, % choose the background color 
  keywords={break,case,catch,classdef,continue,else,elseif,end,for,
  function,global,if,otherwise,parfor,persistent,return,spmd,switch,try,while},
  showspaces=false,                    % show spaces adding particular underscores
  showstringspaces=false,              % underline spaces within strings
  showtabs=false,                      % show tabs within strings adding particular underscores
  tabsize=4,                           % sets default tabsize to 2 spaces
  captionpos=t,                        % sets the caption-position to bottom
  breaklines=true,                     % sets automatic line breaking
  framexleftmargin=5pt,
  fillcolor=\color{Numberbg},
  rulecolor=\color{Numberbg},
  numberstyle=\tiny\color{mNumber},
  numbersep=9pt,                      % how far the line-numbers are from the code
  numbers=left,                        % where to put the line-numbers
  stepnumber=1,                        % the step between two line-numbers.
}  
\begin{document}
\begin{frame}[fragile]
    %    \frametitle{用Lingo求解LP}
    \begin{block}{Lingo代码}
        \begin{lstlisting}
model:
max=50*x1+100*x2;
x1+x2<=300;
2*x1+x2<=400;
x2<=250;
x1>=0;
x2>=0;
end
\end{lstlisting}
    \end{block}
\end{frame}
\end{document}

image.png

excel?还是 tikz?tikz 可以用 pgfplots 宏包:

\documentclass[border=3mm]{standalone}
    \usepackage{pgfplots}

\begin{document}
    \begin{tikzpicture}
\begin{axis}[
    title=Title,
    width=7.8cm,
    enlargelimits=0.15,
    legend style={at={(0.5,-0.15)},
      anchor=north,legend columns=-1},
    ylabel={Pages},
    bar width=7mm, y=4mm,
    symbolic x coords={Firm 1, Firm 2, Firm 3, Firm 4, Firm 5},
    xtick=data,
    x tick label style={rotate=45,anchor=east},
    nodes near coords align={vertical},
    ]
\addplot[ybar, nodes near coords, fill=black!10] 
    coordinates {(Firm 1,3) (Firm 2,7) (Firm 3,8) (Firm 4,13) (Firm 5,16)};
\addplot[draw=blue,ultra thick,smooth] 
    coordinates {(Firm 1,3) (Firm 2,7) (Firm 3,8) (Firm 4,13) (Firm 5,16)};
\end{axis}
    \end{tikzpicture}
\end{document}

image.png

正确代码如下:

\documentclass{beamer}

\usepackage[export]{adjustbox}
\begin{document}

\begin{frame}[t]
\frametitle{Introduction}
\centering
{  \textbf{Quantum Information Processing}}

\begin{itemize}[<+->]

    \item \includegraphics<1->[width=0.9cm,valign=c]{example-image-duck} University of Oxford
    \item \includegraphics<2->[width=2.5cm,valign=c]{example-image-duck} Université de Montréal
    \item \includegraphics<3->[width=2cm,valign=c]{example-image-duck} Université du Quebec

\end{itemize}
\end{frame}

\end{document}

效果如下:
Z95Xc.gif

这种只能自己造轮子了。
看看下面的代码:

\documentclass[preview]{standalone}
\usepackage{unicode-math}
\usepackage{amsmath}
\makeatletter
\newcommand{\simedot}{\mathbin{\mathpalette\simedot@\relax}}
\newcommand{\simedot@}[2]{%
  \ooalign{$\m@th#1\simeq$\cr\hidewidth\raise-.1em\hbox{$\m@th#1.$}\hidewidth\cr}%
}
\makeatother
\begin{document}
    \[A \simedot B\]
\end{document}

image.png

发布
问题