我使用 tcolorbox 制作了一个半透明的框,如所解释的那样在此链接中。我需要的是让这个框偏离文本宽度的中心,这意味着要稍微超出文本宽度的边界。有没有办法用 tcolorbox 来实现这一点?我尝试了 flushright 环境,但框没有超出文本宽度的边界。
任何提示都值得赞赏,提前致谢,
tcolorbox代码:
\documentclass{report}
\usepackage{tcolorbox}
\usepackage{showframe}
\newtcolorbox{frontcoverbox}[1][]{
width=0.7\textwidth,
%arc=3mm,
%auto outer arc,
boxsep=0cm,
toprule=1pt,
leftrule=1pt,
bottomrule=1pt,
rightrule=1pt,
colframe=white,
fontupper=\raggedleft\fontsize{14pt}{14pt}\itshape,
breakable,
nobeforeafter,
enhanced jigsaw,
opacityframe=0.35,
opacityback=0.35
}
\begin{document}
\begin{frontcoverbox}[]
\textbf{Photo:} yaba daba du\\
\textbf{Place:} de la refurinfunflai\\
\textbf{Provided by:} Krusty the Clown
\end{frontcoverbox}
\end{document}
更新:
根据此代码,添加enlarge left by=5cm
到 frontcoverbox 就可以了,感谢 Harish Kumar!
答案1
\documentclass{report}
\usepackage[many]{tcolorbox} %% you left [many], needed for breakable option
\usepackage{showframe}
\newtcolorbox{frontcoverbox}[1][]{
width=0.7\textwidth,
before=\hskip2.5\textwidth,
%arc=3mm,
%auto outer arc,
boxsep=0cm,
toprule=1pt,
leftrule=1pt,
bottomrule=1pt,
rightrule=1pt,
colframe=white,
fontupper=\raggedleft\fontsize{14pt}{14pt}\itshape,
breakable,
nobeforeafter,
enhanced jigsaw,
opacityframe=0.35,
opacityback=0.35,
enlarge left by=1in, %% this one here pushed to right
}
\begin{document}
\begin{frontcoverbox}[]
\textbf{Photo:} yaba daba du\\
\textbf{Place:} de la refurinfunflai\\
\textbf{Provided by:} Krusty the Clown
\end{frontcoverbox}
\end{document}