-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何实现居中环境下文本左对齐 #240
Comments
假设是这样的居中+左对齐:所有行先左对齐,再整体移动,达到让最宽那行居中的效果。 问题来了,(在同一个居中环境里)「最宽行」的记录,新段落开始时、新页面开始时,需要刷新吗? |
“刷新”是什么意思? |
根据当前段落、当前页面最宽行进行居中,还是根据当前 比如有属于同一个段落的文字
只居中,排成
居中+左对齐,排在同一页,
居中+左对齐,如果在第二行后换页了,是排成这样(可以用可跨页的、只有一列、单元格左对齐的表格实现)
还是这样 % 第一页,第一行最宽,按它居中来左对齐
空空 字字字字字字 空空
空空 字字字字 空空空空
% 第二页,第四行最宽,按它居中来左对齐
空 字字 空空空空空空空
空 字字字字字字字字 空 我不知道第二种情况怎么实现,只是好奇问一下,因为想到了一些极端例子。 |
第二种情况是最理想的 |
如果用表格来处理的话,第一种情形对应于 \documentclass{ctexart}
\usepackage[paperheight=8em,height=7em]{geometry}
\usepackage{supertabular,longtable}
\setlength\parindent{0pt}
\begin{document}
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
\begin{longtable}{l}
字字字字字字 \\
字字字字 \\
字字 \\
字字字字字字字字 \\
\end{longtable}
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
\newpage
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
\begin{center}
\begin{supertabular}{l}
字字字字字字 \\
字字字字 \\
字字 \\
字字字字字字字字 \\
\end{supertabular}
\end{center}
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
\end{document} |
按照是否在分段后重新计算、是否在分页后重新计算,共有四种情况。这只是理论上的数量,不一定每种都有实际需求。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
各位大佬,现有如下代码
我要实现居中环境下,文本左对齐,虽然嵌套一个varwidth环境可以实现,但它不能跨页!请问有更好的实现方式吗?
The text was updated successfully, but these errors were encountered: