34
votes
Accepted
How many lines of code does the original TeX contain?
The tex.web file contains 24985 lines at the moment. This is in the literate-programming style, so has a lot of what you might call comments.
When passed through tangle (e.g. tangle tex.web), you get ...
23
votes
Accepted
Sentences are crossing the margin. Is there any solution?
The solution here is usually to enforce the hyphenation of the faulty words.
Since you are using a blind text, some words are not properly hyphenated.
In your case, adding \hyphenation{Do-nec} to ...
23
votes
Sentences are crossing the margin. Is there any solution?
Adding \usepackage[latin]{babel} will also help in your case.
\documentclass[12pt,a5paper,twoside]{book}
\usepackage{ebgaramond} % main font
\usepackage[utf8]{inputenc}
\usepackage[latin]{babel}
\...
15
votes
Accepted
dashed signature
There's no “official” LaTeX interface to leaders, so we need some low level programming.
\documentclass{article}
\newcommand{\signaturespace}[2]{%
% #1 = width of the dotted line
% #2 = legend
...
14
votes
Change all line width proportionally
The line widths thin, thick, etc. are defined liked this (taken from here):
\tikzset{
ultra thin/.style= {line width=0.1pt},
very thin/.style= {line width=0.2pt},
thin/.style= {...
14
votes
Accepted
Horizontal Line in Array
You're missing the vertical line | in the column specification and a \multicolumn{1}{r} for the element in the top left corner:
\documentclass{article}
\begin{document}
\[
\left(
\begin{array}...
12
votes
Accepted
dotted line with appropriate length for answering a question?
What you are probably looking for is \dotfill. Like \hfill, it spreads as much as possible, but inserting dots instead of white space. If you lock \dotfill into a box of fixed width, you get dots of a ...
12
votes
Accepted
Custom line style with custom decoration
Two approaches are demonstrated here. Both repeatedly use the preaction key with different line widths and colors to draw the pipe (and also the flange). The first approach uses the markings ...
12
votes
Accepted
Commenting an equation with a vertical bar
Yes, it's possible:
\documentclass{article}
\usepackage{amsmath,array}
\begin{document}
\begin{equation*}
\renewcommand{\arraystretch}{1.2}
\setlength{\arraycolsep}{0pt}
\begin{array}{
>{\...
12
votes
Accepted
How to draw parts of a line dotted with TikZ?
Inspired by Mark Wibrow
\documentclass[tikz, border=5]{standalone}
\usetikzlibrary{decorations.pathreplacing,calc}
\tikzset{%
middle dotted line/.style={
decoration={show path construction,
...
11
votes
Accepted
What's the dotted line equivalent of \rule?
There is a canonical TeX command: \leaders
https://www.tug.org/utilities/plain/cseq.html#leaders-rp
For example \hbox to 5cm{\leaders\hbox to 10pt{\hss . \hss}\hfil}
UPD:
example explanation
\...
10
votes
thick line in array environment
They all work within the array environment. Here is a demo with makecell, boldline and booktabs. \cmidrule can even be used in the xmatrix environments:
\documentclass{article}
\usepackage{...
10
votes
How many lines of code does the original TeX contain?
To supplement ShreevatsaR excellent answer, here is the beginning of tex.p, the “tangled” form of tex.web
{4:}{9:}{$C-,A+,D-}{[$C+,D+]}{:9}program TEX;label{6:}1,9998,9999;
{:6}const{11:}memmax=30000;...
10
votes
Horizontal Line in Array
With nicematrix. The environments of nicematrix create PGF/Tikz nodes under the rows, columns and cells and the array and it's possible to use them to draw whatever you want with Tikz.
\documentclass{...
9
votes
Centred and flushed right on the same line
If the text elements are short, you could divide the line into several boxes:
\documentclass{article}
\begin{document}
\noindent
\makebox[.32\textwidth][l]{}%
\hfill%
\makebox[.32\textwidth][c]{...
9
votes
Centred and flushed right on the same line
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\noindent\mbox{}\hfill centered stuff\hfill\mbox{}\makebox[0pt][r]{right}
\lipsum[1]
\end{document}
9
votes
Two equations on the same line
I propose this solution, with a code borrowed on this site from @DavidCarlisle:
\documentclass{article}
\usepackage[utf8]{inputenc}%
\usepackage{tabularx}
\usepackage{mathtools, nccmath}
\...
9
votes
Using Chinese in a table
You want to set a couple of line break parameters, if you use XeLaTeX.
\documentclass{article}
\usepackage{fontspec}
\usepackage{array}
%\setmainfont{NSimSun}
\setmainfont{SimSong}
\...
8
votes
Accepted
tcolorbox tcbline style
Just define the segmentation style that you need as is explained under tcbline definition in tcolorbox documentation.
\documentclass{article}
\usepackage[many]{tcolorbox}
\newtcolorbox{results}[1][]{...
8
votes
How to draw and label vertices of a polygon?
You can see the explanation why it is not working in the Heiko Oberdiek's answer.
To overcome this you can replace node[position] (n) {n} by coordinate[label=position:n] (n). Here is the full code:
\...
8
votes
Remove intersect line for one circle using venndiagram2sets
A solution with "plain tikz":
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds,positioning}
\usepackage{float}
\usepackage{showframe}
\begin{document}
\begin{figure}[H]
\...
8
votes
Accepted
Drawing a long dashed line
Yes, even with many lengths in a pattern:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [very thick,dash pattern={on 10pt off 2pt on 5pt off 2pt}] (0,0) -- (6,...
7
votes
Accepted
Line Wrap Siunitx's \num macro
The following example allows line breaks between digit groups by smuggling a line break penalty in group-separator. Also the surrounding \hbox is removed from the text mode number is removed, ...
7
votes
Accepted
How to create a table with double line column?
to my taste the the following table is more nice:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}[ht]
\centering
\caption{Caption for the table}
\label{tab:table1}
...
7
votes
Accepted
Varying thickness hrule
That doesn't look like a varying width rule, just two rules:
\documentclass{article}
\begin{document}
\noindent\rule{\textwidth}{.5pt}
\nointerlineskip
\noindent\rule{3cm}{5pt}
\end{document}
For ...
7
votes
dashed signature
tikz to the rescue
\documentclass{article}
\usepackage{tikz}
\newcommand{\sig}[1]{\begin{tikzpicture} \draw[ultra thick,densely dotted] (0,0)--(4,0) (2,0) node[below]{#1}; \end{tikzpicture}}
\...
7
votes
Accepted
Vertical lines only in certain columns
Here it is. I slightly simplified and improved your code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{booktabs, caption, multirow, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
line × 337tikz-pgf × 60
tables × 48
vertical × 24
spacing × 22
diagrams × 19
pgfplots × 14
line-breaking × 13
rules × 12
line-spacing × 11
matrices × 10
horizontal × 10
math-mode × 9
horizontal-alignment × 9
margins × 8
graphics × 7
equations × 7
pdftex × 7
arrays × 7
macros × 6
formatting × 6
header-footer × 6
columns × 6
longtable × 5
titles × 5