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}
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
762 | oblivoir 3.0의 은 글꼴 [1] | noname | 2021.03.15 | 2221 |
761 | 설 잘 쇠세요 [1] | Progress | 2021.02.12 | 2242 |
760 | ksbaduk 2021 [8] | noname | 2021.03.16 | 2245 |
759 | 텍 문서들을 한 파일에 담아 두고 심심할 때 꺼내 보기 [7] | yihoze | 2021.02.23 | 2273 |
758 | [취미] DOSBOX에서 WinLaTeX (1994) [7] | noname | 2021.07.02 | 2297 |
757 | [제안] 문서 샘플을 공유해주십시오 [11] | noname | 2021.03.19 | 2309 |
756 | 올려주신 HzGuide를 템플릿으로 Rmarkdown 연결한 문서 아웃풋입니다. [3] | 이삭 | 2021.03.20 | 2316 |
755 | 구결 조판 시도 [5] | noname | 2021.05.18 | 2428 |
754 | 시험지, 문제지, 학습지 제작에 필요한 몇 가지 [10] | noname | 2021.03.29 | 2516 |
753 | 가입인사드립니다 | 김세훈 | 2020.12.18 | 2552 |
752 | 삼각형과 원 [7] | 김퍼프 | 2021.05.02 | 2635 |
751 | 유클리드 호제법 [8] | noname | 2021.04.24 | 2646 |
750 | hzguide 설명서 [16] | yihoze | 2021.01.28 | 2767 |
749 | [잡담] latex 실행 시간 [2] | noname | 2021.04.03 | 2801 |
748 | LaTeX으로 편집한 이상한 책 하나 [4] | 판돌이 | 2021.05.19 | 2845 |
747 | ktug 사설 저장소 tl2015 지원 [4] | nanim | 2015.04.15 | 2988 |
746 | 설 명절 잘 보내십시오 [5] | Progress | 2015.02.17 | 2994 |
745 | "만약에"로 할 수 있는 수많은 것들 가운데 하나 [2] | yihoze | 2015.04.17 | 2995 |
744 | 사이트 접속이 며칠 안 되고 나서 [2] | Dennis | 2015.01.29 | 2996 |
743 | 크누스 교수의 수표 받는 법 [1] | 작나 | 2015.02.23 | 3007 |
memoir에서 abnormalparskip을 썼을 때는 그렇게 됩니다.
원래 레이텍은 minipage 안의 parskip을 0pt로 강제 설정합니다.
이에 memoir는 minipage 바깥의 parskip을 minipage가 승계할 수 있도록 가능성을 열어두고 있는데,
그냥 parskip 명령만으론 안 되고 abnormalparskip을 써야만 승계가 이루어집니다.
tikz node가 마침 minipage 환경을 이용하고 있으므로 abnormalparskip이 작동하게 된 것입니다.
이걸 회피하려면 매크로 작성시 tikz node 직전에 abnormalparskip을 0pt로 재지정하면 됩니다.