1210
1210
道阻且长,行则将至,行而不辍,未来可期

注册于 4年前

回答
54
文章
0
关注者
2

删掉par即可

\documentclass{ctexart}
\usepackage{amsmath,amsfonts}

\begin{document}

1.这是一段占满一整行的内容,这是一段占满一整行的内容,这是一。\par\hfill $\square$

2.这是一段占满一整行的内容,这是一段占满一整行的内容。\hfill $\square$

\end{document}

本地环境: win11 23H2 + TeX Live 2024 + XeLaTeX 编译通过
image.png

你给的代码不能复现你的问题,建议做MWE.

\documentclass[10pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[width=210mm, height=297mm, left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{minted}
\usepackage{ctex}
\usepackage{minted}
\usepackage{lipsum}
% 缩短代码前后的距离
\BeforeBeginEnvironment{minted@colorbg}{\vspace{-0.3cm}}
\AfterEndEnvironment{minted@colorbg}{\vspace{-1cm}}

\definecolor{bg}{rgb}{0.95,0.95,0.95}
% 设置全局参数
\setminted[sql]{
    xleftmargin=1.4mm,
    xrightmargin=1.4mm,
    bgcolor=bg,
    breaklines,
    %breakanywhere=true,
    linenos=false,
    numbersep=10pt,
    gobble=0,
    %baselinestretch=1,
    tabsize=4,
    %frame=none,
    fontfamily=mycode,
    fontsize=\small,
    framesep=2mm,
    breaksymbolleft={},
    breakindent={15pt}
}
\begin{document}
\lipsum[1-5]
\begin{minted}{sql}
select
    ts_code,
    trade_date,
    close,
    case 
        when close > lastday_close and close > nextday_cose then '波峰'
        when close < lastday_close and close < nextday_cose then '波谷'
        else '其他' end as point_type
from 
(
    select
        ts_code,
        trade_date,
        close,
        lag(close, 1) over (partition by ts_code order by trade_date) as lastday_close,
        lead(close, 1) over (partition by ts_code order by trade_date) as nextday_cose
    from t_stock_test
) t;
\end{minted}
\end{document}

本地环境: win11 23H2 + TeX Live 2024 + XeLaTeX编译
image.png

找论文的作者要是最简单的方法,不然就是氪金,找人给你重新排版下,如果不想氪金,自己重新排一下即可!

这模板难改,可能是我太菜了,不过为啥不直接修改PDF文件呢,这可比改模板轻松多了

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage{subfig}
\usepackage{mwe}
\newsavebox{\tempbox}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\begin{document}

\begin{figure}%
\centering
\sbox{\tempbox}{\includegraphics[width=0.3\textwidth]{example-image-golden-upright}}%
\subfloat[Big figure]{\usebox{\tempbox}}%
\subfloat[Small figure]{%
\vbox to \ht\tempbox{%
\vfil
\includegraphics[width=0.5\textwidth]{example-image-golden}
\vfil}}%
\caption{Two more sub-floats.}
    \end{figure}
\end{document}

凑合用吧!

tk问题:
导言区:

\usepackage{xeCJKfntef}
\xeCJKsetup{underline={format=\color{red},textformat=\color{red},skip=false}}

修改tk命令:

\newcommand{\tk}[1]{%
                \ifanswer
                \CJKunderline{#1}%
                \else
                \phantom{#1}%
                \fi}
\newcommand{\kh}[1]{\hfill【\  {{%
            \ifanswer
            {\makebox[0.4cm][c]{\textcolor{red}{#1}}}%
            \else
            \phantom{\makebox[0.4cm][c]{#1} }%
            \fi}\  】}}

hk也改了下,
至于你说的mhchem宏包问题,这宏包没啥问题,
你可以使用下elegantbook模板的最新版,然后在再试试

简单写写,

\documentclass{ctexart}
\usepackage{tabularray}
\begin{document}
   
\begin{tblr}{colspec={|Q[c,0.5\linewidth]|Q[r,0.45\linewidth]|},rowspec={Q[c]Q[l]},
cell{2}{2}={c}}
    \hline
A    &  B        \\
    \hline
C    &       D    \\
    \hline
\end{tblr}
\end{document}

可以这样,一种全局,一种局部!xeCJKfntef宏包

\documentclass{ctexart}
\usepackage{xcolor}

\usepackage{xeCJKfntef}
\xeCJKsetup { underline={format = \color{red} } }
\def\mathunderline#1#2{\color{#1}\underline{{\color{black}#2}}\color{black}}
\begin{document}
    
\mathunderline{red}{这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本}

\CJKunderline{这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本}

\CJKunderline[skip = false, format=\color{cyan},]{这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本这是一段长文本}
\end{document}

image.png

  1. 如果这是一张图片的话,那么你可以指定图片的长和宽,从而实现上述效果!
  2. 规范提问,什么系统,什么发行版,什么编译方式,用的什么模板,问题是什么?需要实现什么样的效果?目前做到哪一步了?
  3. 这玩意可以用tabularry宏包实现,导言区自己加载,下面是一种实现方式:
\begin{table}[h]
\hspace{-.7cm}
\begin{tblr}{
width=1.1\textwidth,
colspec=X[gray9]X[gray9],
vline{2} = {6}{1pt,solid},
hline{3} = {1}{2pt,solid},
hline{3} = {2}{2pt,gray9},
rows = {abovesep=1pt,belowsep=5pt},
columns = {leftsep=4pt,rightsep=4pt},
}
\SetCell[c=2]{h,.9\linewidth} ~  \\
\SetCell[c=2,]{valign=b,.9\linewidth} {\Huge Chapter - Fungi} 
\\
\SetCell[c=2,]{valign=t,.9\linewidth} \emph{\\[-3pt] \Huge What Role Does \textbf{Fungi} Play}  \\
\SetCell[c=2]{f,1\linewidth} \emph{\huge \\[-3pt] In The Geochemical Cycle Of The Earth?} \\
\SetCell[c=2]{h,.9\linewidth}
{~\\
\qquad  This  system can be used for many types of airplanes, and it also
solves the interference during  the procedure of the boarding
airplane,as described above we can get to the  optimization
boarding time.We also know that all the service is automate. }
\\ [10pt]
{This  system can be used for many types of airplanes, and it also
solves the interference during  the procedure of the boarding
airplane,as described above we can get to the  optimization
boarding time.We also know that all the service is automate.
\\
\qquad This  system can be used for many types of airplanes, and it also
solves the interference during  the procedure of the boarding
airplane,as described above we can get to the  optimization
boarding time.We also know that all the service is automate.
\\[2pt]
\qquad\includegraphics[width=.8\linewidth]{2323.png}
\\
\qquad This  system can be used for many types of airplanes, and it also
solves the interference during  the procedure of the boarding
airplane,as described above we can get to the  optimization
boarding time.We also know that all the service is automate.
\\
\qquad This  system can be used for many types of airplanes, and it also
solves the interference during  the procedure of the boarding.
}
& 
{\qquad Balancing the cost of the cost and the benefit, it will bring in
more convenient  for airport and passengers.It also saves many
human resources for the airline.  Balancing the cost of the cost and the benefit, it will bring in
more convenient  for airport and passengers.It also saves many
human resources for the airline. \\[2pt]
\qquad\includegraphics[width=.8\linewidth]{2233.png}\\
\qquad  Balancing the cost of the cost and the benefit, it will bring in
 more convenient  for airport and passengers.It also saves many
 human resources for the airline.  Balancing the cost of the cost and the benefit, it will bring in
 more convenient  for airport and passengers.It also saves many
 human resources for the airline.
 \\}
\end{tblr}
\end{table}

图片需要自己出了成无底的矢量图,不然会很难看!
2233.png
2323.png

我觉得你可以规范下提问,这样子别人也可以看得到!
关于那个目录问题,我把目录的样式简单重写了,这是代码:

\usepackage{titletoc}
\titlecontents{section}[2em]{\bfseries \hspace{-4pt} \vspace{-1pt}}{\contentslabel{2em}}{\hspace*{-2em}}{~\titlerule*[0.6pc]{$.$}\contentspage}
\titlecontents{subsection}[4em]{ \vspace{-1pt}}{\contentslabel{2em}}{\hspace*{-2em}}{~\titlerule*[0.6pc]{$.$}\contentspage}

把这段放到导言区就好了,
本地环境:
Win11 + TeXLive2021 + pdflatex编译

MWE呢,使用的发行版是什么,模板是什么,现在效果是什么?想要的效果是什么?

整理下:
使用: turnstile宏包

\xlongequal[r_{4}-r_{3}]{\substack{r_{3}-r_{2} \\ r_{3}-r_{2}}}

使用:extarrows宏包

\ndtstile{{r_{4}-r_{3}}}{\substack{r_{3}-r_{2} \\ r_{3}-r_{2}}}

image.png

    \documentclass[10pt,a4paper]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}
    \usepackage{graphicx}
    \usepackage{extarrows}
    \usepackage{turnstile}
    \usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}
    \begin{document}
    
    \[
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    1 & 3 & 4 & 1 \\
    1 & 4 & 1 & 2 \\
    1 & 1 & 2 & 3
    \end{array}\right|
    \begin{aligned}
    & \xlongequal{\begin{array}{c}
    r_{3}-r_{2} \\[-2pt]
    r_{3}-r_{2} 
    \end{array}}\\[-7pt]
    &\begin{array}{c}
    ~ ~r_{4}-r_{3}
    \end{array} 
    \end{aligned}
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    0 & 1 & 1 & -3 \\
    0 & 1 & -3 & 1 \\
    0 & -3 & 1 & 1
    \end{array}\right|
    \]
    
    \[
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    1 & 3 & 4 & 1 \\
    1 & 4 & 1 & 2 \\
    1 & 1 & 2 & 3
    \end{array}\right|
    \xlongequal[r_{4}-r_{3}]{\substack{r_{3}-r_{2} \\ r_{3}-r_{2}}}
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    0 & 1 & 1 & -3 \\
    0 & 1 & -3 & 1 \\
    0 & -3 & 1 & 1
    \end{array}\right|
    \]
    
    \[
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    1 & 3 & 4 & 1 \\
    1 & 4 & 1 & 2 \\
    1 & 1 & 2 & 3
    \end{array}\right|
    \ndtstile{\displaystyle r_{4}-r_{3}}{\begin{array}{c}
    r_{3}-r_{2} \\[-2pt]
    r_{3}-r_{2} 
    \end{array}}
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    0 & 1 & 1 & -3 \\
    0 & 1 & -3 & 1 \\
    0 & -3 & 1 & 1
    \end{array}\right|
    \]
    
    
    \[
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    1 & 3 & 4 & 1 \\
    1 & 4 & 1 & 2 \\
    1 & 1 & 2 & 3
    \end{array}\right|
    \ndtstile{{r_{4}-r_{3}}}{\substack{r_{3}-r_{2} \\ r_{3}-r_{2}}}
    \left|\begin{array}{cccc}
    1 & 2 & 3 & 4 \\
    0 & 1 & 1 & -3 \\
    0 & 1 & -3 & 1 \\
    0 & -3 & 1 & 1
    \end{array}\right|
    \]
    
    \end{document}

发布
问题