Hot answers tagged

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 ...
user avatar
  • 42.6k
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 ...
user avatar
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} \...
user avatar
  • 3,443
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 ...
user avatar
  • 994k
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= {...
user avatar
  • 7,339
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}...
user avatar
  • 567k
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 ...
user avatar
  • 44.9k
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 ...
user avatar
  • 69.1k
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}{ >{\...
user avatar
  • 994k
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, ...
user avatar
  • 128k
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 \...
user avatar
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{...
user avatar
  • 261k
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;...
user avatar
  • 994k
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{...
user avatar
  • 25.6k
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]{...
user avatar
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}
user avatar
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} \...
user avatar
  • 261k
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} \...
user avatar
  • 994k
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][]{...
user avatar
  • 128k
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: \...
user avatar
  • 22.3k
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] \...
user avatar
  • 18.8k
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,...
user avatar
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, ...
user avatar
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} ...
user avatar
  • 255k
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 ...
user avatar
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}} \...
user avatar
  • 13.2k
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, ...
user avatar
  • 261k

Only top scored, non community-wiki answers of a minimum length are eligible