请问在使用 pdflatex
编译时, texhigh
怎样不打印「显式空格」?我希望 texhigh
能在 pdflatex
下使用「不可见空格」。
\documentclass{article}
\usepackage{texhigh}
\begin{document}
\begin{texhigh}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
\end{texhigh}
\end{document}
默认就是不打印显式空格,不过某些字体下,LaTeX 会把字符码为 32,类别码为 12 的字符显示为非空白。
新版本里,我修改了实现,可以更新一下(只需更新 texhigh.sty
这个文件)。但是这个问题始终是和字体有关的。
提到的 texhigh 已经设置 \THSetCharReplacement{\ }{\textvisiablespace}
就是字面意思,这是设置字符要被替换为哪些代码,它只设置而不启用,要靠 char-replacements
键来启用。
texhigh
还额外设置了 \raggedright
,所以一般是靠左而不是默认分散的,可以设置 font=\ttfamily
移除这个,也可使用 ragged2e
宏包的 \justifying
:font+=\justifying
。
其它问题可以参考 Sagittarius Rover 的回答。
just curious: 这个链接究竟问了几个问题(?)
在 texhigh
环境中,怎样不打印「显式空格」?我希望能使用「不可见空格」
%\THSetCharReplacement{\ }{\ }%%\textvisiblespace
手册写道:texhigh
已设置。这是什么意思?
在texhigh
使用打字机族时,是否支持两端对齐?
问题一:
对于你的mwe
,直接使用latexmk -pdf --shell-escape
编译即可得到不可见空格
\documentclass{article}
\usepackage{texhigh}
\begin{document}
\begin{texhigh}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
\end{texhigh}
\end{document}
而若根据文档3.3
节中的内容加上char-replacements={\ =\textvisiblespace}
,可以局部设置texhigh
环境显示visable space
\documentclass{article}
\usepackage{texhigh}
\begin{document}
\begin{texhigh}[char-replacements={\ =\textvisiblespace}]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
\end{texhigh}
\end{document}
清除所有辅助文件后编译可以得到:
问题二:
你似乎没有指出具体是在文档的哪个部分(?)例如(?):
问题三:
补充点儿信息
这里的「新版本里,我修改了实现,可以更新一下」是指在这个commit里,更新了
v0.4.1-a
版本的texhigh