KTUG마당은 KTUG를 방문하는 모든 이용자가 대화를 나누고 소식을 전하는 곳입니다.
- 로그인 없이 자유롭게 글을 읽고 쓸 수 있는 철학은 처음과 같이 계속됩니다.
- Team Blog의 글을 이곳 게시판의 "정보글"로 모았습니다. Team blog는 기고자가 올린 글에 질문을 받는 부담을 줄이기 위하여 댓글을 허용하지 않았습니다. 그러나 이곳 게시판으로 모으면서 댓글을 달 수 있습니다. 게시물을 작성하실 때 댓글을 원하지 않으시면 댓글을 허용하시지 않으시기를 바랍니다. 또한 불필요한 소모성 댓글을 달지 않도록 주의하여 주시기를 바랍니다.
- TeX과 관련된 질문이나 답변은 QnA 마당을 이용하십시오. TeX과 관련된 질문은 지웁니다
- MathJax를 이용한 수식조판을 사용하실 수 있습니다. 여기를 참조하세요.
- 스팸 글을 막기 위하여 짧은 시간 내에 다시 글이 등록되는 IP를 막거나, 광고 글을 막기 위하여 금지어로 .com, .net 등을 설정하고 있습니다. 다소간의 불편함이 있으시더라도 양해 바랍니다.
- 금지어에서 stackexchange, stackoverflow, ctan, overleaf, , github, google.com, gmail.com, .org, .io, sil.org, wiki.com, tistory.com등은 해제하였습니다.
- 사용하는 편집기는 CKeditor입니다. 편집기에서 [enter]를 누르면 <p> 태그가 들어가고, 문단으로 생각하고 한줄을 비웁니다. 글줄만 바꾸려면 shift-enter 를 누르시면 <BR>가 들어가므로 용도에 맞게 나누어 쓸 수 있습니다.
자유글 minipage의 parskip이 tikz에 미치는 영향
2009.12.23 13:27
질문게시판에 올려야 할 듯하지만, 문제의 원인을 알았기 때문에 달리 회피하는 방법을 취하여 일단 문제를 해결하였습니다.
재미삼아 봐주십시오.
일전에 재미삼아 만든 원문자 매크로에서
\abnormalparskip{.25\baselineskip} 등으로 minipage안에 \parskip을 달리 설정하여 주면 \tikz\node에 영향을 준다는 것을 알게 되었습니다.
파일 첨부가 안 되나요?
컴파일 해 보시고 각 단락에서 박스의 높이의 차이에 주목해 주시기 바랍니다.
\documentclass[openany,9pt,showtrims]{memoir}
%\usepackage{hoze-style}
\usepackage{ifluatex}
\usepackage{xkeyval}
\usepackage{xifthen}
\usepackage{xcolor}
\usepackage{tikz}
\makeatletter
\newcommand\wrapnumfont{\wrapnumbf}
\newcommand\wrapnumbf{\bfseries}
\newcommand\wrapnumbase{}
\newlength\wrapnumwidth
\newlength\wrapsep
\setlength\wrapsep{1.5pt}
\newcommand\wrapbgcolor{black}
\newcommand\wrapfgcolor{white}
\newcommand\cirnum[1]{%
\raisebox{-.25\baselineskip}{
\tikz\node[%
circle, draw=\wrapfgcolor, thin, inner sep=.1\wrapsep,
top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth,
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
}%
}
\newcommand\ovalnum[1]{%
\raisebox{-.15\baselineskip}{
\tikz\node[%
rectangle, draw=\wrapfgcolor, thin, inner sep=\wrapsep,
rounded corners=3pt,
top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth,
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
}%
}
\newcommand\recnum[1]{%
\raisebox{-.15\baselineskip}{
\tikz\node[%
rectangle, draw=\wrapfgcolor, thin, inner sep=\wrapsep,
top color=\wrapbgcolor, bottom color=\wrapbgcolor,
text width=\wrapnumwidth,
font=\wrapnumfont, text badly centered, \wrapfgcolor
]{#1};%
}%
}
\define@key{wrapnum}{base}{%
\renewcommand\wrapnumbase{#1}%
\setwrapnumwidth%
}
\define@key{wrapnum}{font}{%
\renewcommand\wrapnumfont{\wrapnumbf#1}%
\setwrapnumwidth%
}
\newcommand\setwrapnumwidth{%
\settowidth\wrapnumwidth{\wrapnumfont\wrapnumbase}%
}
\define@key{wrapnum}{type}[circle]{%
\ifthenelse{\equal{#1}{circle}}{\let\wrapnum\cirnum}{}%
\ifthenelse{\equal{#1}{rectangle}}{\let\wrapnum\recnum}{}%
\ifthenelse{\equal{#1}{oval}}{\let\wrapnum\ovalnum}{}%
}
\define@key{wrapnum}{background}{
\renewcommand\wrapbgcolor{#1}
}
\define@key{wrapnum}{foreground}{
\renewcommand\wrapfgcolor{#1}
}
\define@key{wrapnum}{color}{%
\ifthenelse{\equal{#1}{white}}{%
\renewcommand\wrapbgcolor{white}%
\renewcommand\wrapfgcolor{black}%
\renewcommand\wrapnumbf{}%
}{}%
\ifthenelse{\equal{#1}{black}}{%
\renewcommand\wrapbgcolor{black}%
\renewcommand\wrapfgcolor{white}%
\renewcommand\wrapnumbf{\bfseries}%
}{}%
}
\define@key{wrapnum}{wrapseparate}{%
\setlength\wrapsep{#1}%
}
\newcommand\setwrapnum[1]{%
\setkeys{wrapnum}{#1}%
}
\setwrapnum{%
type=rectangle,
base=99,
}
\ifluatex
\newcommand\wrapchar[2][]{%
\setwrapnum{#1}
\@wrapchar#2|%
}
\def\@wrapchar#1|{%
\directlua{%
local utf8 = unicode.utf8
str = "#1"
for i=1, utf8.len(str) do
char=utf8.sub(str, i, i)
if char==' ' then
macro = "\string\\hspace{0.25em}"
else
macro = "\string\\wrapnum{"..char.."}\string\\hspace{-0.25em}"
end
tex.print(macro)
end
}%
}
\fi
\makeatother
\begin{document}
\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.
\bigskip
\abnormalparskip{.25\baselineskip}
\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.
\abnormalparskip{2ex}
\wrapchar[type=rectangle, color=black]{There's a lady who's sure all that glitters is gold when she's buying a stairway to heaven.}
There's a lady who sure all that glitters is gold when she's buying a stairway to heaven.
\end{document}
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
264 | 크기가 다른 PDF 합치기 [3] | yihoze | 2019.08.06 | 6305 |
263 | expl3 학습자료 [2] | noname | 2019.08.18 | 6038 |
262 | tectonic 잠깐 사용 후기 [10] | noname | 2019.08.26 | 7955 |
261 | 네이버 손글씨 [2] | 에드 | 2019.10.10 | 5812 |
260 | 디자인하우스체 [1] | 에드 | 2019.10.14 | 5189 |
259 | 전자책 전용 글꼴 리디바탕 | 에드 | 2019.10.16 | 5067 |
258 | [참가신청] 문서작성 워크숍 2019 [6] | ischo | 2019.10.17 | 7466 |
257 | [공지] 서비스 일시 중지 | yihoze | 2019.11.11 | 4351 |
256 | [후기] 2019 공주대 문서작성 워크숍 [5] | Progress | 2019.11.17 | 29700 |
255 | 루아텍의 장점 [1] | yihoze | 2019.11.18 | 8361 |
254 | [과제] 공주대 워크숍 - 폰트 설정 | yihoze | 2019.11.18 | 4044 |
253 | 한글 플레인텍 사용시 에러 [2] | 작나 | 2019.11.20 | 4520 |
252 | 2020 lg그램 백슬래시 개선 [7] | Kriss | 2019.12.05 | 4583 |
251 | LaTeX 고대 페르시아어 입력 문제 해결 [4] | 김인동 | 2019.12.13 | 4122 |
250 | 기존 회원이 아닌데 회비를 납부하신 분 [1] | yihoze | 2019.12.13 | 128830 |
249 | XeLaTeX으로 고대 이집트어 구현하기 완성. [2] | 김인동 | 2019.12.15 | 4163 |
248 | G21C 국제 언어학 컨퍼런스 | yihoze | 2019.12.16 | 4305 |
247 | 2020 한국텍학회 학술대회 발표 공모 [5] | yihoze | 2019.12.17 | 4194 |
246 | Backus-Naur form (BNF) 문법을 간단히 표시해주는 패키지 [4] | Zeta | 2019.12.24 | 5467 |
245 | [공지] 2020 한국텍학회 제13차 정기총회 및 학술대회 [13] | yihoze | 2020.01.10 | 13290 |
memoir에서 abnormalparskip을 썼을 때는 그렇게 됩니다.
원래 레이텍은 minipage 안의 parskip을 0pt로 강제 설정합니다.
이에 memoir는 minipage 바깥의 parskip을 minipage가 승계할 수 있도록 가능성을 열어두고 있는데,
그냥 parskip 명령만으론 안 되고 abnormalparskip을 써야만 승계가 이루어집니다.
tikz node가 마침 minipage 환경을 이용하고 있으므로 abnormalparskip이 작동하게 된 것입니다.
이걸 회피하려면 매크로 작성시 tikz node 직전에 abnormalparskip을 0pt로 재지정하면 됩니다.