parent_url
stringlengths
41
46
parent_score
stringlengths
1
4
parent_body
stringlengths
25
35.5k
parent_user
stringlengths
37
42
parent_title
stringlengths
12
150
accepted
bool
2 classes
body
stringlengths
4
36.7k
score
stringlengths
1
4
user
stringlengths
37
42
answer_id
stringlengths
1
6
__index_level_0__
int64
0
322k
https://tex.stackexchange.com/questions/682444
0
This MWE shows the problem: ``` \documentclass[11pt,a4paper]{report} \usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{tex4ebook} \usepackage[sortlocale=auto,bibstyle=authoryear,citestyle=authortitle-ticomp]{biblatex} \addbibresource{biblatex-examples.bib} \usepackage{pagenote} \makepagenote \let\footnote=\pagenote \begin{document} \section[Some section title]{Some section title\protect\pagenote{Some pagenote, see \fullcite{sigfridsson}} \\in two lines} This pagenote is shown correctly in pdflatex. But with tex4ebook it is shown twice in the printnotes and gives an error with epubcheck. \printnotes \end{document} ``` How to fix this situation? **Update 1 -- The myconfig.cfg file --** Wenn I do `not` use the `-e build.lua` the error remains. Wenn I do `not` use the `myconfig.cfg` the error disappears. `myconfig.cfg:` ``` \let\oldclrearpage\clearpage % define macro for newpage insertion \def\mypagebreak{\Configure{newpage}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="newpage"></div>}}} \Preamble{xhtml,no-cut,3,info} \Configure{CoverMimeType}{image/jpeg} \Configure{CoverImage}{}{} % % enforce newpage % % define it for \newpage % \mypagebreak \Css{.newpage{page-break-before:always;}} % modify \Configure{BODY} so our confiurations work on all extracted pages \Configure{@BODY}{\def\clearpage{\bgroup\mypagebreak\oldclrearpage\egroup}} \Configure{@/BODY}{\global\let\clearpage\oldclrearpage\Configure{newpage}{}} \begin{document} \Configure{DocumentLanguage}{de} \Configure{OpfScheme}{ISBN} \Configure{UniqueIdentifier}{3-0000-1111-X} \EndPreamble ``` Does it reproduce the error in epubcheck? And the doubling within the notes?
https://tex.stackexchange.com/users/292824
pagenote{} in section{} gives correct output in pdflatex, but not in tex4ebook output in epub
true
michal.h21 gave the decisive hint for the solution of this question: I `do not need` the two options `no-cut` and `3` in the `\Preamble{xhtml,no-cut,3,info}` of `myconfig.cfg` when using `tex4ebook`. So I deleted it and got adequate results and no error with `epubcheck`, so that this solved the case.
1
https://tex.stackexchange.com/users/292824
683499
317,116
https://tex.stackexchange.com/questions/683502
1
I am trying to check if a variable is defined without using extra packages (since I want ot use it in an .lco file) and if it is defined then check if it is empty. The definition check works but the check for empty content does not work: ``` \documentclass{scrlttr2} \newcommand{\stampfile}{} \begin{document} \ifdefined\stampfile \ifx\stampfile\empty \textbackslash stampfile is empty \else \textbackslash stampfile is not empty \fi \else \textbackslash stampfile is not defined \fi \end{document} ``` I has a look at [How to check if a macro value is empty or will not create text with plain TeX conditionals?](https://tex.stackexchange.com/questions/53068/how-to-check-if-a-macro-value-is-empty-or-will-not-create-text-with-plain-tex-co) but the solutions did work either... E.g. I tried: ``` \documentclass{scrlttr2} \newcommand{\stampfile}{} \newcommand{\checkempty}[1]{ \if\relax\detokenize{#1}\relax EMPTY% \else NON EMPTY% \fi } \begin{document} \ifdefined\stampfile \ifx\stampfile\empty \textbackslash stampfile is empty \else \textbackslash stampfile is not empty \fi \else \textbackslash stampfile is not defined \fi \checkempty{\stampfile} \end{document} ```
https://tex.stackexchange.com/users/281557
How to check if a command is empty?
true
`\empty` is not long. If you want to use it as comparision in a \ifx text you should define your stamp command with `\newcommand*`. It is imho easier to test for blankness: ``` \documentclass{scrlttr2} \newcommand*{\stampfile}{} %<-- not long \ExplSyntaxOn \cs_set_eq:NN\tlifblankTF\tl_if_blank:VTF \ExplSyntaxOff \begin{document} \ifdefined\stampfile \ifx\stampfile\empty \textbackslash stampfile is empty \else \textbackslash stampfile is not empty \fi \else \textbackslash stampfile is not defined \fi \tlifblankTF\stampfile{empty}{not empty} \renewcommand\stampfile{ } \tlifblankTF\stampfile{empty}{not empty} \renewcommand\stampfile{xxx} \tlifblankTF\stampfile{empty}{not empty} \end{document} ```
2
https://tex.stackexchange.com/users/2388
683506
317,118
https://tex.stackexchange.com/questions/683487
1
How do i get rid of the blue dot that is at the 0,0 coordinate of my graph? Note: This is a clustered graph with a separated line graph above the individual bars ``` \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{patterns} \usepackage{pgfplotstable} \begin{document} \pgfplotsset{ my axis style/.style={ width=\linewidth, ybar=2*\pgflinewidth, ybar=5pt, bar width=0.30cm, enlarge y limits=0.0, enlarge x limits=0.25, xticklabels from table={\data}{material}, xtick={data}, table/x expr={\coordindex}, xtick align=inside, minor y tick num=1, scaled y ticks=false, yticklabel style={/pgf/number format/fixed}, }, Name/.style={ nodes near coords, nodes near coords style={ coordinate, name=#1\coordindex, mark=*, % add red circle at node mark options={mark size=2pt, fill=red}, % set size and fill color of mark }, }, } \pgfplotstableread{ material d1 d2 d3 d4 d5 d6 T1 T2 T3 T4 T5 T6 CPU 0.25 0.21 0.23 0.33 0.25 0.28 75 63 71 85 70 80 GPU 0.18 0.16 0.17 0.22 0.18 0.20 77 65 72 84 69 79 FPGA 0.19 0.15 0.18 0.25 0.16 0.19 69 59 68 80 68 74 }{\data} \begin{tikzpicture} \begin{axis}[ my axis style, legend image code/.code={\draw[#1, draw=none, fill=none] (0cm,-0.1cm) rectangle (0.3cm,0.25cm); }, ymin=0, ymax=0.5, axis x line*=bottom, axis y line*=left, ylabel=Execution time (ms), cycle list={ {draw=black, pattern=north east lines, pattern color=black, fill=blue!20, postaction={pattern=north east lines}}, {draw=black, pattern=grid, pattern color=black, fill=blue!20,postaction={pattern=grid}}, {draw=black, pattern=horizontal lines, pattern color=black, fill=blue!20,postaction={pattern=horizontal lines}}, {draw=black, pattern=north east lines, pattern color=black, fill=red!20,postaction={pattern=north east lines}}, {draw=black, pattern=grid, pattern color=black, fill=red!20,postaction={pattern=grid}}, {draw=black, pattern=horizontal lines, pattern color=black, fill=red!20,postaction={pattern=horizontal lines}}, }, scaled y ticks=false, ] \addplot table [y=d1] {\data}; \addplot table [y=d2] {\data}; \addplot table [y=d3] {\data}; \addplot table [y=d4] {\data}; \addplot table [y=d5] {\data}; \addplot table [y=d6] {\data}; \legend{{Baseline}, {Datatype}, {Downsampling}} \end{axis} \begin{axis}[ my axis style, legend style={at={(0.5,-0.08)}, anchor=north,legend columns=-1}, ymin=0, ymax=100, axis y line*=right, ylabel=Accuracy (\%), xticklabels=\empty, only marks, scaled y ticks=false, ] \addplot [Name=a] table [y=T1] {\data}; \addplot [Name=b] table [y=T2] {\data}; \addplot [Name=c] table [y=T3] {\data}; \addplot [Name=d] table [y=T4] {\data}; \addplot [Name=e] table [y=T5] {\data}; \addplot [Name=f] table [y=T6] {\data}; \legend{{\color{blue!50}\rule{5mm}{2mm} \textcolor{black}{MobileNetV2}}, {\color{red!50}\rule{5mm}{2mm} \textcolor{black}{Resnet18}}} \end{axis} \foreach \i in {0,1,2,3,4,5} { \fill [red!90] (d\i) circle (2pt); \fill [blue!90] (a\i) circle (2pt); \draw [very thick,red!90] (d\i) -- (e\i) -- (f\i); \draw [very thick,blue!90] (a\i) -- (b\i) -- (c\i); \fill [red!90] (e\i) circle (2pt); \fill [red!90] (f\i) circle (2pt); \fill [blue!90] (b\i) circle (2pt); \fill [blue!90] (c\i) circle (2pt); } \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/214782
Getting rid of the blue dot at the bottom left of the graph, coordinate 0,0?
true
The problem is that you iterate over too many numbers in the `\foreach` loop at the end of your code. The table you define has only three rows. In the second `axis` environment, you define coordinates based on the six columns `T1` to `T6` and the three rows of this table, which are named `a0`, `a1`, `a2`, `b0`, `b1`, `b2` ... and so on up to `f2`. Now, in the `\foreach` loop at the end of your code, you iterate over `0,1,2,3,4,5`, but the coodinate `d3` (and all the following coordinates) has never been defined before. If Ti*k*Z is told to draw something at an undefined coordinate, it throws an error and draws at coordinate `(0,0)` instead. This is why you get these dots at the origin. The solution is quite simple: Replace `\foreach \i in {0,1,2,3,4,5}` by `\foreach \i in {0,1,2}` and everything should be fine: ``` \documentclass[border=10pt]{standalone} \usepackage{pgfplotstable} % pgfplotstable loads pgfplots, pgfplots loads tikz \pgfplotsset{compat=1.18} \usetikzlibrary{patterns} \begin{document} \pgfplotsset{ my axis style/.style={ width=\linewidth, ybar=2*\pgflinewidth, ybar=5pt, bar width=0.30cm, enlarge y limits=0.0, enlarge x limits=0.25, xticklabels from table={\data}{material}, xtick={data}, table/x expr={\coordindex}, xtick align=inside, minor y tick num=1, scaled y ticks=false, yticklabel style={/pgf/number format/fixed}, }, Name/.style={ nodes near coords, nodes near coords style={ coordinate, name=#1\coordindex, mark=*, % add red circle at node mark options={mark size=2pt, fill=red}, % set size and fill color of mark }, }, } \pgfplotstableread{ material d1 d2 d3 d4 d5 d6 T1 T2 T3 T4 T5 T6 CPU 0.25 0.21 0.23 0.33 0.25 0.28 75 63 71 85 70 80 GPU 0.18 0.16 0.17 0.22 0.18 0.20 77 65 72 84 69 79 FPGA 0.19 0.15 0.18 0.25 0.16 0.19 69 59 68 80 68 74 }{\data} \begin{tikzpicture} \begin{axis}[ my axis style, legend image code/.code={ \draw[#1, draw=none, fill=none] (0cm,-0.1cm) rectangle (0.3cm,0.25cm); }, ymin=0, ymax=0.5, axis x line*=bottom, axis y line*=left, ylabel=Execution time (ms), cycle list={ {draw=black, pattern=north east lines, pattern color=black, fill=blue!20, postaction={pattern=north east lines}}, {draw=black, pattern=grid, pattern color=black, fill=blue!20,postaction={pattern=grid}}, {draw=black, pattern=horizontal lines, pattern color=black, fill=blue!20,postaction={pattern=horizontal lines}}, {draw=black, pattern=north east lines, pattern color=black, fill=red!20,postaction={pattern=north east lines}}, {draw=black, pattern=grid, pattern color=black, fill=red!20,postaction={pattern=grid}}, {draw=black, pattern=horizontal lines, pattern color=black, fill=red!20,postaction={pattern=horizontal lines}}, }, scaled y ticks=false, ] \addplot table [y=d1] {\data}; \addplot table [y=d2] {\data}; \addplot table [y=d3] {\data}; \addplot table [y=d4] {\data}; \addplot table [y=d5] {\data}; \addplot table [y=d6] {\data}; \legend{{Baseline}, {Datatype}, {Downsampling}} \end{axis} \begin{axis}[ my axis style, legend style={ at={(0.5,-0.08)}, anchor=north, legend columns=-1 }, ymin=0, ymax=100, axis y line*=right, ylabel=Accuracy (\%), xticklabels=\empty, only marks, scaled y ticks=false, ] \addplot [Name=a] table [y=T1] {\data}; \addplot [Name=b] table [y=T2] {\data}; \addplot [Name=c] table [y=T3] {\data}; \addplot [Name=d] table [y=T4] {\data}; \addplot [Name=e] table [y=T5] {\data}; \addplot [Name=f] table [y=T6] {\data}; \legend{ {\color{blue!50}\rule{5mm}{2mm} \textcolor{black}{MobileNetV2}}, {\color{red!50}\rule{5mm}{2mm} \textcolor{black}{Resnet18}} } \end{axis} \foreach \i in {0,1,2} { \fill [blue!90] (a\i) circle (2pt); \fill [blue!90] (b\i) circle (2pt); \fill [blue!90] (c\i) circle (2pt); \draw [very thick,blue!90] (a\i) -- (b\i) -- (c\i); \fill [red!90] (d\i) circle (2pt); \fill [red!90] (e\i) circle (2pt); \fill [red!90] (f\i) circle (2pt); \draw [very thick,red!90] (d\i) -- (e\i) -- (f\i); } \end{tikzpicture} \end{document} ```
1
https://tex.stackexchange.com/users/47927
683516
317,121
https://tex.stackexchange.com/questions/683472
2
I have a very large figure that consists of 8 smaller figures. I'm not using the subfigure package as I think for my needs it's easier to create the big figure in another program (GraphPad Prism). The problem is that the figure is as big as a page, and I cannot make it smaller as it would decrease readability. I have forced the position of the figure on a new page with [H], if I don't do this the figure is moved to the end of my document. The caption of the figure now dissappears, I suspect because it's too big. Ideally, I'd want the caption to appear on the next page. Is this possible? The code for the figure looks like this: ``` \newpage \begin{figure}[H] \begin{adjustbox}{varwidth=\textwidth, fbox, left} \centering \includegraphics{Figures/Layout LDH CV 10k Fibro 3 days XY last two.png} \end{adjustbox} \caption{Relative LDH release (absorbance at 490nm / max LDH release) and Crystal Violet (CV) staining (absorbance at 550nm) were measured for primary fibroblasts cultured in growth medium supplemented with either (A, B) 1 g/L glucose (Control), (C, D) no glucose or galactose (No Glu), (E, F) 0.25 g/L glucose (Low Glu), (G, H) 4.5 g/L glucose (High Glu), or (I, J) 1 g/L (5.55 mM) galactose (Gal). The negative control is shown with a dashed line in the CV assays (0.0725). Data is shown as $mean \pm SD, n=3$ for each substrate} \label{fig:XY LDH CV 10k fibro 3 days substrates last two} \end{figure} ```
https://tex.stackexchange.com/users/294089
Figure is as big as a page, and caption dissappears
false
We neither need nor want your image, but we do need to know how big it is. Please run the following and report back. ``` \documentclass{article} \usepackage{graphicx} \begin{document} \sbox0{\includegraphics{Figures/Layout LDH CV 10k Fibro 3 days XY last two.png}}% width \the\wd0 height \the\ht0 \end{document} ```
1
https://tex.stackexchange.com/users/34505
683517
317,122
https://tex.stackexchange.com/questions/603188
1
It appears that MacKichan, the company behind the Scientific Word LaTeX editor, is going out of business (source: <https://www.mackichan.com/>) As a number of people using this software might be in this forum (there certainly have been questions about it in the past), I wonder whether somebody has looked into what the closest alternative software could be, with a focus on making the transition as seamless as possible? Do people have some pro/cons comparisons? I had looked into this question a few years back, but back then I had had the impression that Scientific Word (at least in Version 5.5) outclassed all other WYSIWYG editors *easily*. At any rate I don't think the appearance of a better software can possibly have been the reason for the shutdown, if anything completely redeveloping Version 6 was a mistake. The webpage says "We expect to make Scientific Word an open source product eventually." which would be great, but just in case this ultimately won't happen, I think the above questions have some relevance. Does anyone know more about this transition-to-open source process?
https://tex.stackexchange.com/users/245471
Scientific Word LaTeX editor + MacKichan going out of business
false
The open source version of Scientific Word is out, but they aren't making Scientific Workplace open-source. A friend of mine who uses Apple has been using SWP on a VMWare Fusion emulation software for years (it emulates Windows on Apple), and when he upgrades to a new computer he just moves the virtual machine directly over to his new computer, without reinstalling Scientific Workplace.
0
https://tex.stackexchange.com/users/295482
683523
317,123
https://tex.stackexchange.com/questions/683526
0
I have tried to use the methods learned here, but I get misalign as usual with split: ``` \begin{equation} \begin{split} \beta_k=\frac{1}{L}\int_{-3}^{2}f(t)\sin\frac{2k\pi}{5}t\text{d}t=\frac{4}{5}\int_{-3}^{-1.5}\sin\frac{2k\pi}{5}t\text{d}t+\frac{2}{5}\int_{-1.5}^{0.2}\sin\frac{2k\pi}{5}t\text{d}t+\\&\frac{4}{5}\int_{0.2}^{1}\sin\frac{2k\pi}{5}t\text{d}t+\frac{6}{5}\int_{1}^{2}\sin\frac{2k\pi}{5}t\text{d}t\longrightarrow\\& \beta_k=\frac{1}{k}\bigg(0.254648 \cos \left(\frac{\pi k}{2}\right)+0.509296 \cos \left(\frac{3 \pi k}{2}\right)\\&-0.254648 \cos \left(\frac{3 \pi k}{4}\right)+0.254648 \cos \left(\frac{\pi k}{10}\right)-0.763944 \cos (\pi k)\bigg) \end{split} \end{equation} ``` Any ideas what can be done to align this to the left? Thanks
https://tex.stackexchange.com/users/241518
Repeated problems when using "split"
true
Try this: ``` \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation} \begin{split} \beta_k=\;&\frac{1}{L}\int_{-3}^{2}f(t)\sin\frac{2k\pi}{5}t\text{d}t=\frac{4}{5}\int_{-3}^{-1.5}\sin\frac{2k\pi}{5}t\text{d}t+\frac{2}{5}\int_{-1.5}^{0.2}\sin\frac{2k\pi}{5}t\text{d}t+{}\\ &\frac{4}{5}\int_{0.2}^{1}\sin\frac{2k\pi}{5}t\text{d}t+\frac{6}{5}\int_{1}^{2}\sin\frac{2k\pi}{5}t\text{d}t\longrightarrow\\ \beta_k=\;&\frac{1}{k}\bigg(0.254648 \cos \left(\frac{\pi k}{2}\right)+0.509296 \cos \left(\frac{3 \pi k}{2}\right)-{}\\ &0.254648 \cos \left(\frac{3\pi k}{4}\right)+0.254648 \cos \left(\frac{\pi k}{10}\right)-0.763944 \cos (\pi k)\bigg) \end{split} \end{equation} \end{document} ``` Maybe the line-breaking position needs to be reconsidered since you have two `=` in the first line. Essentially, you align at the `&`, so you can adjust the position. Note the empty bracket at `+{}\\`, which ensures appropriate space before the + symbol. If you want the operator at the begin of the line, you need `&{}+` as well.
2
https://tex.stackexchange.com/users/234654
683530
317,124
https://tex.stackexchange.com/questions/683533
1
Consider this MWE: ``` \documentclass{beamer} \begin{filecontents}{\jobname.bib} @article{foobar, author={Bar, Foo}, title={Yadda yadda}, journal={Journal of whatever}, year=2023, volume=1} \end{filecontents} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} \begin{frame} \fullcite{foobar} {\scriptsize\fullcite{foobar}} \end{frame} \end{document} ``` It works correctly: the second line is presented in a smaller font than the first line. However, adding `\usetheme{metropolis}` causes the font on both lines to have the same size (the size of the larger one). I cannot figure out what in the metropolis theme code is causing this behaviour and how to get this right. (Scriptsize in general works with metropolis, just not in conjunction with fullcite).
https://tex.stackexchange.com/users/11362
Beamer theme metropolis does not allow different font size for fullcite
true
The difference between normal themes and metropolis is caused by metropolis explicitly setting normal size for various bibliography fonts. As a quick hack you can revert this by using: ``` \documentclass{beamer} \begin{filecontents}{\jobname.bib} @article{foobar, author={Bar, Foo}, title={Yadda yadda}, journal={Journal of whatever}, year=2023, volume=1} \end{filecontents} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \usetheme{metropolis} \setbeamerfont{bibliography entry title}{size=} \setbeamerfont{bibliography entry author}{size=} \setbeamerfont{bibliography entry location}{size=} \setbeamerfont{bibliography entry note}{size=} \begin{document} \begin{frame} \fullcite{foobar} {\scriptsize\fullcite{foobar}} \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
683540
317,127
https://tex.stackexchange.com/questions/683510
2
I have a 15x15 matrix which is large and impractical to format. All the elements except the main diagonal and the one under that diagonal is zero. How to format it correctly? Like I want to use two vectors instead. Here is the matrix. ``` \begin{bmatrix} 1.4142 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ -0.7071 & 1.2247 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & -0.8165 & 1.1547 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & -0.8660 & 1.1180 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & -0.8944 & 1.0954 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & -0.9129 & 1.0801 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & -0.9258 & 1.0690 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & -0.9354 & 1.0607 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & -0.9428 & 1.0541 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -0.9487 & 1.0488 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -0.9535 & 1.0445 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -0.9574 & 1.0408 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -0.9608 & 1.0377 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -0.9636 & 1.0351 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -0.9661 & 1.0328\\ \end{bmatrix} ```
https://tex.stackexchange.com/users/295476
Two diagonal matrix in a compact form
false
You can use a vector-like expression by making a list (using the `listofitems` package) and then retrieving the elements individually. The list are created using the `\readlist` command. The list is comma separated and the elements are recovered using the notation ``` \ListName[<order of the element>] ``` For convenience, two lists of 15 items were defined for this example. (Makes it easier to write the rows) As a refinement, you can replace multiple zeros with a large zero. ``` \documentclass[11pt, landscape]{article} \usepackage[left=2.00cm]{geometry} \usepackage{listofitems}% added <<< \usepackage{amsmath}% added <<< \setcounter{MaxMatrixCols}{15}% more columns allowed \begin{document} \small \readlist\DA{1.4142, 1.2247, 1.1547, 1.1180, 1.0954, 1.0801, 1.0690, 1.0607, 1.0541, 1.0488, 1.0445, 1.0408, 1.0377, 1.0351, 1.0328} % 15 elements \readlist\DB{0, -0.7071, -0.8165, -0.8660, -0.8944, -0.9129, -0.9258, -0.9354, -0.9428, -0.9487, -0.9535, -0.9574, -0.9608, -0.9636, -0.9661}% 15 elements $\begin{bmatrix} \DA[1] & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \DB[2] & \DA[2] & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & \DB[3] & \DA[3] & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & \DB[4] & \DA[4] & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 &\DB[5]& \DA[5] & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & \DB[6] & \DA[6] & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & \DB[7] & \DA[7] & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & \DB[8] & \DA[8] & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & \DB[9] & \DA[9] & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \DB[10]& \DA[10] & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \DB[11] & \DA[11] & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \DB[12] & \DA[12] & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \DB[13] & \DA[13] & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \DB[14] & \DA[14] & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \DB[15] &\DA[15] \end{bmatrix}$ \newpage $\begin{bmatrix} \DA[1] &&&&&&&&&&&&&&\\ \DB[2] & \DA[2] &&&&&&&&&&&&& \\ & \DB[3] & \DA[3] &&&&&&&&&&&&\\ && \DB[4] & \DA[4] &&&&&&&&&&&\\ &&&\DB[5]& \DA[5] &&&&&\makebox(0,0){\text{\Huge0}}&&&&&\\ &&&& \DB[6] & \DA[6] &&&&&&&&&\\ &&&&& \DB[7] & \DA[7] &&&&&&&&\\ &&&&&& \DB[8] & \DA[8] &&&&&&&\\ &&&&&&& \DB[9] & \DA[9] &&&&&&\\ &&&&&&&& \DB[10]& \DA[10] &&&&&\\ &&&&&&&&& \DB[11] & \DA[11] &&&&\\ &&&\makebox(0,0){\text{\Huge0}}&&&&&&& \DB[12] & \DA[12] &&&\\ &&&&&&&&&&& \DB[13] & \DA[13] &&\\ &&&&&&&&&&&& \DB[14] & \DA[14] &\\ &&&&&&&&&&&&& \DB[15] &\DA[15] \end{bmatrix}$ \end{document} ``` The final example shows the `pmatrix` using the `nicematrix` package and using horizontal, vertical and diagonal dotted lines: `\Cdots`, `\Vdots` and `\Ddots`. (It will compile twice) ``` \documentclass[11pt, landscape]{article} \usepackage[left=2.00cm]{geometry} \usepackage{listofitems}% added <<<<< \usepackage{nicematrix}% added <<<<< \setcounter{MaxMatrixCols}{15}% more columns allowed \begin{document} \small \readlist\DA{1.4142, 1.2247, 1.1547, 1.1180, 1.0954, 1.0801, 1.0690, 1.0607, 1.0541, 1.0488, 1.0445, 1.0408, 1.0377, 1.0351, 1.0328} % 15 elements \readlist\DB{0, -0.7071, -0.8165, -0.8660, -0.8944, -0.9129, -0.9258, -0.9354, -0.9428, -0.9487, -0.9535, -0.9574, -0.9608, -0.9636, -0.9661}% 15 elements $\setlength{\extrarowheight}{0.5ex} % expand the rows \begin{bNiceMatrix}[xdots/shorten=1em] % make line dots with shorter length \DA[1] & 0 & \Cdots & & & & & & & & & & & & 0 \\ \DB[2] &\DA[2] & \Ddots & & & & & & & & & & & & \Vdots\\ 0 & \DB[3] &\DA[3] & & & & & & & & & & & & \\ \Vdots & \Ddots & \DB[4]& \DA[4] & & & & & & & & & & & \\ & & & \DB[5] &\DA[5] & & & & & & & & & & \\ & & & & \DB[6] & \DA[6] & & & & & & & & & \\ & & & & & \DB[7] &\DA[7] & & & & & & & & \\ & & & & & & \DB[8] & \DA[8] & & & & & & & \\ & & & & & & & \DB[9] &\DA[9] & & & & & & \\ & & & & & & & & \DB[10] & \DA[10] & & & & & \\ & & & & & & & & & \DB[11] &\DA[11] & & & & \\ & & & & & & & & & & \DB[12] & \DA[12] & & & \\ & & & & & & & & & & & \DB[13] &\DA[13] & & \\ & & & & & & & & & & & & \DB[14] & \DA[14] & 0\\ 0 & \Cdots & & & & & & & & & & & 0 & \DB[15] &\DA[15] \end{bNiceMatrix}$ \end{document} ``` **Note.** The elements of the lists created here has, for clarity, a leading space, which is irrelevant in a tabular environment. To suppress such space use `\readlist*`.
3
https://tex.stackexchange.com/users/161015
683557
317,132
https://tex.stackexchange.com/questions/683549
3
The `csquotes` package changes the `\spacefactor` of several punctuation characters when they are used inside quotations. In `\nonfrenchspacing`, the `\spacefactor` of `?` and `!` are changed from `3000` to `3002` and `3001`, respectively. In `\frenchspacing`, the `\spacefactor` of `.` `?` `!` `:` `;` `,` change from `1000` to `1006`, `1008`, `1007`, `1005`, `1004`, and `1003`, respectively. I have verified this via testing (see my MWE) and lines `653` to `673` of the `csquotes.sty` file. Although the change in `\spacefactor` is small (<1%) and hard to observe visually, it is probably not typographically desirable. I cannot imagine any publisher or style guide seriously recommending such tiny changes in spacing. Furthermore, unless I am mistaken, I doubt the package authors actually want this change in spacing. Maybe it is a hack or funny way of programming the `csquotes` package. In my MWE below, I first display the `\spacefactor` of different punctuation characters. Notably, the closing double curly quote (`\textquotedblright`) has a `\spacefactor` of 1000 when it probably should be 0. (A `\spacefactor` of 0 means that the character is essentially ignored when calculating trailing interword space.) I haven't figured out how to change this. `\sfcode\textquotedblright=0` doesn't work for whatever reason. I use `\@savsf` to create a workaround by defining `\enquote` without using the `\csquotes` package. I define `\enquote` such that `\textquotedblright` acts as if its `\spacefactor` is 0. (I've used American English style quotations.) This lets me create quotations without unnecessarily changing the `\spacefactor` and producing ever-so-slightly suboptimal typography. Of course, it would likely be easier to just change the `\spacefactor` of the closing double curly quote to 0. ``` \documentclass{article} \def\pangram{The quick brown fox jumps over the lazy dog} \usepackage{stix2} \parindent=0pt \parskip=4pt \raggedright %\usepackage{csquotes} \makeatletter \NewDocumentCommand{\enquote}{ s m }{% \IfBooleanTF{#1}% {\textquoteleft#2\textquoteright}% % {\textquotedblleft#2\textquotedblright}%results in incorrect trailing spacefactor {% \textquotedblleft{}% #2% \@savsf\spacefactor%stores current spacefactor \textquotedblright{}% \spacefactor=\@savsf%outputs stored spacefactor %\textquotedblright has a spacefactor of 1000 and I haven't figured out how to change it to 0 }% } \makeatother %\sfcode\textquotedblright=0%doesn't work \begin{document} I display the \verb|\spacefactor| of different punctuation characters with \verb|\nonfrenchspacing|. \par period . = \the\sfcode`\. \par exclamation mark ? = \the\sfcode`\? \par question mark ! = \the\sfcode`\! \par colon : = \the\sfcode`\: \par semi-colon ; = \the\sfcode`\; \par comma , = \the\sfcode`\, \par single straight quote \textquotesingle{} = \the\sfcode`' \par double straight quote \textquotedbl{} = \the\sfcode\textquotedbl \par opening double curly quote \textquotedblleft{} = \the\sfcode\textquotedblleft \par closing double curly quote \textquotedblright{} = \the\sfcode\textquotedblright \par opening single curly quote \textquoteleft{} = \the\sfcode\textquoteleft \par closing single curly quote \textquoteright{} = \the\sfcode\textquoteright \par \medskip \nonfrenchspacing Testing \verb|\enquote{\pangram{}<punc char>}\the\spacefactor| with \verb|\nonfrenchspacing| \par \enquote{\pangram{}.}\the\spacefactor \par \enquote{\pangram{}?}\the\spacefactor \par \enquote{\pangram{}!}\the\spacefactor \par \enquote{\pangram{}:}\the\spacefactor \par \enquote{\pangram{};}\the\spacefactor \par \enquote{\pangram{},}\the\spacefactor \par \medskip Testing \verb|\enquote*{\pangram{}<punc char>}\the\spacefactor| with \verb|\nonfrenchspacing| \par \enquote*{\pangram{}.}\the\spacefactor \par \enquote*{\pangram{}?}\the\spacefactor \par \enquote*{\pangram{}!}\the\spacefactor \par \enquote*{\pangram{}:}\the\spacefactor \par \enquote*{\pangram{};}\the\spacefactor \par \enquote*{\pangram{},}\the\spacefactor \par \medskip \frenchspacing Testing \verb|\enquote{\pangram{}<punc char>}\the\spacefactor| with \verb|\frenchspacing| \par \enquote{\pangram{}.}\the\spacefactor \par \enquote{\pangram{}?}\the\spacefactor \par \enquote{\pangram{}!}\the\spacefactor \par \enquote{\pangram{}:}\the\spacefactor \par \enquote{\pangram{};}\the\spacefactor \par \enquote{\pangram{},}\the\spacefactor \par \medskip Testing \verb|\enquote*{\pangram{}<punc char>}\the\spacefactor| with \verb|\frenchspacing| \par \enquote*{\pangram{}.}\the\spacefactor \par \enquote*{\pangram{}?}\the\spacefactor \par \enquote*{\pangram{}!}\the\spacefactor \par \enquote*{\pangram{}:}\the\spacefactor \par \enquote*{\pangram{};}\the\spacefactor \par \enquote*{\pangram{},}\the\spacefactor \end{document} ``` EDIT: I found that I can change the `\spacefactor` of `\textquotedblright` from 1000 (default) to 0 via this code snippet: [Spacefactor & Unicode Curly Quotes](https://tex.stackexchange.com/questions/59390/spacefactor-unicode-curly-quotes) ``` \sfcode\csname\encodingdefault\string\textquotedblright\endcsname=0 ``` So ``` \NewDocumentCommand{\enquote}{ s m }{% \IfBooleanTF{#1}% {\textquoteleft#2\textquoteright}% {\textquotedblleft#2\textquotedblright} } ``` would have the correct trailing `\spacefactor` after the `\textquotedblright`.
https://tex.stackexchange.com/users/278534
Why does the csquotes package change the spacefactor?
true
Let's do an experiment: ``` \documentclass{article} \begin{document} \showboxbreadth=1000 \showboxdepth=1000 \tracingonline=1 \sfcode`?=3000 \setbox0=\hbox{a? x} \showbox0 \sfcode`?=3002 \setbox0=\hbox{a? x} \showbox0 \end{document} ``` The console will show ``` > \box0= \hbox(6.94444+0.0)x19.44449 .\OT1/cmr/m/n/10 a .\OT1/cmr/m/n/10 ? .\glue 4.44444 plus 4.99997 minus 0.37036 .\OT1/cmr/m/n/10 x ! OK. l.12 \showbox0 ? > \box0= \hbox(6.94444+0.0)x19.44449 .\OT1/cmr/m/n/10 a .\OT1/cmr/m/n/10 ? .\glue 4.44444 plus 5.0033 minus 0.37012 .\OT1/cmr/m/n/10 x ! OK. l.16 \showbox0 ``` The stretch component is increased by 0.00333pt, which is a tad less than 0.012 millimeters. It's indeed less than 1%, actually less than 0.001%. The space is not added as is, only a fraction of it would be used. Nothing to worry about. To the contrary, different space factors can be used to know what punctuation sign is the last character. The same strategy is used in `amsthm.sty`, which modifies `\frenchspacing` to be ``` \def\nopunct{\spacefactor 1007 } \def\frenchspacing{\sfcode`\.1006\sfcode`\?1005\sfcode`\!1004% \sfcode`\:1003\sfcode`\;1002\sfcode`\,1001 } ``` for the `\@addpunct` macro. The changes in the stretch and shrink components are negligible.
5
https://tex.stackexchange.com/users/4427
683558
317,133
https://tex.stackexchange.com/questions/683567
0
Is there a way to change the frame title font color in between `\begin{frame}` and `\end{frame}`? I would like this frame title to be a different font color than the rest of the frames.
https://tex.stackexchange.com/users/282065
How to change frame title font color in beamer?
true
You can change the `frametitle` beamer color. If you do this within a group it won't change the other frames: ``` \documentclass{beamer} \begin{document} { \setbeamercolor{frametitle}{bg=blue,fg=red} \begin{frame} \frametitle{title} normal text \end{frame} } \begin{frame} \frametitle{title} normal text \end{frame} \end{document} ```
0
https://tex.stackexchange.com/users/36296
683568
317,136
https://tex.stackexchange.com/questions/683555
2
I have a custom defined command that takes six arguments separated by commas as one argument, which I then separate into multiple arguments using `\SplitArgument`. I need a to define command which sums only inputs that are numbers and leaves out any text for example "-". I've tried to define a command using package `xstring`'s `\IsInteger`, but as I need to do some math operations with the resulting number (division, multiplication) that didn't work for me. Instead of performing the operation the command "printed" for example "021 / 24". I dont know why there is an extra zero before the summed number, but i suspect it had to do something with `xstring` not taking nested commands well. Anyway I pasted a simplified version of my code down below. If anyone could help I'd be grateful. ``` \documentclass{article} \usepackage{xparse} \NewDocumentCommand{\example}{ >{\SplitArgument{5}{,}} m}{\splitexample#1} \NewDocumentCommand{\splitexample}{mmmmmm}{% some text, #1, #2, #3, #4, #5, #6, some more text, value inserted by another cmd, value inserted by another cmd, the sum off all the inputs is: %insert sum command here% } \begin{document} \example{1,2,3,4,5,6} %expected output: 21 \example{1, -, 2, -, 3, 4} %expected output: 10 \end{document} ```
https://tex.stackexchange.com/users/295247
Summing up only number (integer) inputs
false
You can have any number of items. Of course the command cannot be fully expandable. ``` \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\example}{m} { \atjov_example:n { #1 } } \seq_new:N \l__atjov_example_items_seq \int_new:N \l__atjov_example_sum_int \cs_new_protected:Nn \atjov_example:n { \int_zero:N \l__atjov_example_sum_int \seq_set_from_clist:Nn \l__atjov_example_items_seq { #1 } \seq_map_function:NN \l__atjov_example_items_seq \__atjov_example_do:n \int_use:N \l__atjov_example_sum_int } \cs_new_protected:Nn \__atjov_example_do:n { \regex_match:nnT { \A [0-9]+ \Z } { #1 } {% #1 is an integer \int_add:Nn \l__atjov_example_sum_int { #1 } } } \ExplSyntaxOff \begin{document} \example{1,2,3,4,5,6} %expected output: 21 \example{1, -, 2, -, 3, 4} %expected output: 10 \example{a,,2,xyz,40} % expected: 42 \end{document} ``` We split the input at commas and then test whether each item is a nonnegative integer (a sequence of digits of length at least 1); in this case we add to the specific integer variable. Finally the sum is delivered.
3
https://tex.stackexchange.com/users/4427
683571
317,139
https://tex.stackexchange.com/questions/683563
0
I would like to use the defined variable - \arrows[#1] - from this tikz example: <https://texample.net/tikz/examples/overlapping-arrows/> ``` % Overlapping arrows % Author: Elena Botoeva \documentclass{article} \usepackage[margin=0.3cm, paperwidth=3.3cm, paperheight=3.3cm]{geometry} \usepackage{tikz} %%%< \usepackage{verbatim} %%%> \begin{comment} :Title: Overlapping arrows :Tags: Shadows;Decorative Drawings :Author: Elena Botoeva :Slug: overlapping-arrows \end{comment} \usetikzlibrary{shadows} \definecolor{darkblue}{rgb}{0.2,0.2,0.6} \definecolor{darkred}{rgb}{0.6,0.1,0.1} \definecolor{darkgreen}{rgb}{0.2,0.6,0.2} \def\arrow{ (10.75:1.1) -- (6.5:1) arc (6.25:120:1) [rounded corners=0.5] -- (120:0.9) [rounded corners=1] -- (130:1.1) [rounded corners=0.5] -- (120:1.3) [sharp corners] -- (120:1.2) arc (120:5.25:1.2) [rounded corners=1] -- (10.75:1.1) -- (6.5:1) -- cycle } \tikzset{ ashadow/.style={opacity=.25, shadow xshift=0.07, shadow yshift=-0.07}, } \def\arrows[#1]{ \begin{scope}[scale=#1] \draw[color=darkred, % drop shadow={ashadow, color=red!60!black}] \arrow; \draw[color=darkgreen, bottom color=green!90!black, top color=green!60, % drop shadow={ashadow, color=green!60!black}] [rotate=120] \arrow; \draw[color=darkblue, right color=blue, left color=blue!60, % drop shadow={ashadow, color=blue!60!black}] [rotate=240] \arrow; % to hide the green shadow \draw[color=darkred, left color=red, right color=red!60] \arrow; \end{scope} } \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \arrows[1]; \end{tikzpicture} \end{center} \end{document} ``` What I would like to do with it is draw multiple versions of the variable at specific locations in a tikz drawing, and I am not sure how to specify the locations.
https://tex.stackexchange.com/users/243069
How to place a defined variable at multiple locations
false
I am not sure this is the best or the most elegant way to do what I need, but here is what I came up with (`\redarrow` and `\bluearrow` are two different versions of the original in the example): ``` \begin{tikzpicture} \begin{scope} \redarrow[1]; \end{scope} \begin{scope}[shift={(2cm,0cm)}] \bluearrow[1]; \end{scope} \end{tikzpicture} ```
1
https://tex.stackexchange.com/users/243069
683572
317,140
https://tex.stackexchange.com/questions/683574
0
I am making a presentation in Beamer and want to change the color of the numbers in enumerate. I tried using `\setbeamertemplate{enumerate items}{bg=blue}` but it didn't work. What am i doing wrong?
https://tex.stackexchange.com/users/282065
How to change color of enumerate?
true
If you just want to change the colour, you want to use `\setbeamercolor` instead of overwriting the complete template. ``` \documentclass{beamer} \setbeamercolor{enumerate item}{fg=red} \begin{document} \begin{frame} \begin{enumerate} \item test \end{enumerate} \end{frame} \end{document} ```
2
https://tex.stackexchange.com/users/36296
683576
317,141
https://tex.stackexchange.com/questions/683575
1
I'm using the very elegant Boadilla theme and would like to keep its color schemes, but I would like to change the fields it uses. It presents: > > Author | Presentation title | Date + curr\_frame/Total Frame > > > I would prefer to use > > Presentation title | Section title | Date + curr\_frame/Total Frame > > > I already found a solution in [Insert sectiontitle in footer](https://tex.stackexchange.com/questions/369376/insert-sectiontitle-in-footer), but unfortunately it changes the color schemes. Unfortunately, `boadilla.sty` uses very terse Beamer reference that can't easily be understood by an eventual LaTeX user. I suppose part of the answer lies in the use of the `rose` color theme.
https://tex.stackexchange.com/users/151685
Beamer -- How to add section title to the footer and keep the color scheme
true
`Boadilla` uses the footline from the infolines outer theme. You can redefine it like this: ``` \documentclass{beamer} \usetheme{Boadilla} \author{names} \title{Title} \setbeamertemplate{footline} {% \leavevmode% \hbox{% \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}% \usebeamerfont{title in head/foot}\insertshorttitle \end{beamercolorbox}% \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}% \usebeamerfont{title in head/foot}\insertsectionhead \end{beamercolorbox}% \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,leftskip=2ex,rightskip=2ex,sep=0pt]{date in head/foot}% \hfill% \usebeamerfont{date in head/foot}% \insertshortdate{}% \hfill% \usebeamercolor[fg]{page number in head/foot}% \usebeamerfont{page number in head/foot}% \usebeamertemplate{page number in head/foot}% \end{beamercolorbox}}% \vskip0pt% } \begin{document} \section{section} \begin{frame} test \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
683577
317,142
https://tex.stackexchange.com/questions/15603
3
I have a LaTeX wide table generated from a data frame in R using `xtable`, but when the PDF is created not all the data is shown, just a part of it, and the other part is hidden on the right of the PDF. How this can be solved? ``` cat("\\documentclass{article}\n\begin{document}\n", file=txt) print(xtable(table), include.rownames=TRUE, floating=FALSE, file=txt, append=TRUE) cat("\\end{document}\n", file=txt, append=TRUE) ``` where should i place the scalebox thing ??
https://tex.stackexchange.com/users/4666
Wide table problem when generating PDF
false
``` cat("\\documentclass{article}\n\\usepackage{graphics}\n\\begin{document}\n", file="1.tex") cat("\\scalebox{0.7}{", file="1.tex", append=TRUE) print(xtable(tab), include.rownames=TRUE, floating=FALSE, file="1.tex", append=TRUE) cat("}", file="1.tex", append=TRUE) cat("\\end{document}\n", file="1.tex", append=TRUE) ```
1
https://tex.stackexchange.com/users/295513
683584
317,143
https://tex.stackexchange.com/questions/683583
2
I am trying to recreate this (link) and there is already a page for the double brackets distributive property. I have tried to modify it and change a few things but I keep getting errors. Here is the link to the page [How to illustrate double distributive property?](https://tex.stackexchange.com/questions/610895/how-to-illustrate-double-distributive-property) I have got this so far: ``` \usepackage{amsmath} \begin{document} \noindent The \textbf{distributive law} states that \begin{align*} a(b + c) &= a \times b + a \times c\\ & = ab + ac \end{align*} \end{document} ```
https://tex.stackexchange.com/users/292225
How to display single bracket distributive property using latex
true
* it is unknown, how you try to change answer in given link * If I understand correctly your problem, you only need to remove some arrows: ``` \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, quotes, tikzmark} \tikzset{ is/.style = {inner ysep=2pt, minimum height=2ex}, num/.style = {circle, draw, fill=white,font=\tiny, inner sep=0.5pt, outer sep=1pt}, every edge/.style = {draw, -Straight Barb}, every edge quotes/.append style = {num, anchor=center} } \begin{document} \[ \tikzmarknode[is]{A}{a}\cdot(\tikzmarknode[is]{B}{b} + \tikzmarknode[is]{C}{c}) = \tikzmarknode{AB}{ab}+\tikzmarknode{AC}{ac} \] \begin{tikzpicture}[remember picture, overlay, cyan] \draw (A.north) edge[out=60,in=120,looseness=2,"1"] (B.north) (A.north) edge[out=75,in=115,looseness=2,"2"] (C.north) ; \foreach \n [count=\i] in {AB,AC} \node[num,above=10pt] at (\n.south) {\i}; \end{tikzpicture} \end{document} ``` Note: `cdot` is inserted that between `a` and `b` is more space for drawing arrow. After three compilation above MWE produces: Is this what you after?
2
https://tex.stackexchange.com/users/18189
683586
317,144
https://tex.stackexchange.com/questions/683411
0
Let's say I have a section with several entries: 1 1.1 1.2 But, I want to recategorize this section all into a subsection (and all of its subsections to become subsubsections, etc.) rather than a section, so that it becomes: 1.1 1.1.1 1.1.2 Is there a way to do this quickly in LyX? I have a huge document and I've been unable to find a way to do this except for manually
https://tex.stackexchange.com/users/295399
LyX - How to lower ToC depth of multiple entries
true
I'm going to answer my own question in case it helps anyone in the future, as I just learned how to do it. There's probably a better approach to go about it, but it works. In your LyX toolbar (top of screen) click View > Outline Pane. You should have a new pane open on the left side of your screen, listing the different sections in your document. On the bottom of this pane, there are buttons to "increase/decrease nesting depth", which increments/decrements the depth of an item and anything nested in it.
1
https://tex.stackexchange.com/users/295399
683588
317,145
https://tex.stackexchange.com/questions/683585
1
The following is the source code of the Table, in which `[htbp]` indicates its typesetting mode. When you run this code, `[htbp]` will be printed right above the table, and even the numbers will be printed when htbp is replaced by other attributes. Unless I remove the `[]`, it will lead to my poor typesetting. ``` The details of the datasets are listed in Table \ref{tab:addlabel}. \begin{table}[htbp] \centering \caption{Details of benchmark datasets} \begin{tabular}{llllllll} \toprule No. & Dataset & & & \multicolumn{2}{l}{No. of instance} & \multicolumn{2}{c}{No. of features} \\ \midrule 1 & \multicolumn{3}{l}{Electrical Grid Data} & \multicolumn{2}{l}{10000} & \multicolumn{2}{l}{14} \\ 2 & \multicolumn{3}{l}{Online Shoppers} & \multicolumn{2}{l}{12330} & \multicolumn{2}{l}{18} \\ 3 & \multicolumn{3}{l}{Dry Bean} & \multicolumn{2}{l}{13611} & \multicolumn{2}{l}{17} \\ 4 & \multicolumn{3}{l}{MAGIC Telescope} & \multicolumn{2}{l}{19020} & \multicolumn{2}{l}{11} \\ 5 & \multicolumn{3}{l}{Letter Recognition} & \multicolumn{2}{l}{20000} & \multicolumn{2}{l}{16} \\ 6 & \multicolumn{3}{l}{Avila} & \multicolumn{2}{l}{20867} & \multicolumn{2}{l}{10} \\ 7 & \multicolumn{3}{l}{Default of Credit Card} & \multicolumn{2}{l}{30000} & \multicolumn{2}{l}{24} \\ 8 & \multicolumn{3}{l}{Bank Marketing} & \multicolumn{2}{l}{45211} & \multicolumn{2}{l}{17} \\ 9 & \multicolumn{3}{l}{Secondary Mushroom} & \multicolumn{2}{l}{61069} & \multicolumn{2}{l}{21} \\ 10 & \multicolumn{3}{l}{Clickstream Data} & \multicolumn{2}{l}{165474} & \multicolumn{2}{l}{14} \\ 11 & \multicolumn{3}{l}{Diabetes Health} & \multicolumn{2}{l}{253680} & \multicolumn{2}{l}{22} \\ 12 & \multicolumn{3}{l}{Linkage Comparison} & \multicolumn{2}{l}{574913} & \multicolumn{2}{l}{12} \\ \bottomrule \end{tabular}% \label{tab:addlabel}% \end{table}% ```
https://tex.stackexchange.com/users/295513
Why is there "[htbp]" above my table?
false
* We cant reproduce your problem, for this you should provide MWE (Minimal Working Example), a small but complete document which we can compile as it is * Structure of your table is quite streng. See @Mico comment. * Possible rewriting table, where is used tabularray`package with libraries`booktabs `and siunitx`˛, and for document class is used `article`, is: **Edit:** Ups somehow the sixth table row was lost. Now added and the table is a wee bit more sophisticated structured: ``` \documentclass[12pt]{article} \usepackage[skip=1ex]{caption} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \begin{document} The details of the datasets are listed in Table \ref{tab:addlabel}. \begin{table}[htbp] \centering \caption{Details of benchmark datasets} \label{tab:addlabel} \begin{tblr}{colspec = {Q[c, si={table-format=2.0}] l Q[c, si={table-format=6.0}] Q[c, si={table-format=2.0}] }, row{1} = {guard} rowsep = 1pt, row{eachfour} = {abovesep=1ex}, } \toprule No. & Dataset & No. of instance & No. of features \\ \midrule 1 & Electrical Grid Dat & 10000 & 14 \\ 2 & Online Shoppers & 12330 & 18 \\ 3 & Dry Bean & 13611 & 17 \\ 4 & MAGIC Telescope & 19020 & 11 \\ 5 & Letter Recognition & 20000 & 16 \\ 7 & Default of Credit Card & 30000 & 24 \\ 8 & Bank Marketing & 45211 & 17 \\ 9 & Secondary Mushroom & 61069 & 21 \\ 10 & Clickstream Dat & 165474 & 14 \\ 11 & Diabetes Health & 253680 & 22 \\ 12 & Linkage Comparison & 574913 & 12 \\ \bottomrule \end{tblr}% \end{table}% \end{document} ``` Note, rewriting of table will valid at any documentclass, but using of float `table` depends on used document class. See @Clara comment.
5
https://tex.stackexchange.com/users/18189
683592
317,147
https://tex.stackexchange.com/questions/683585
1
The following is the source code of the Table, in which `[htbp]` indicates its typesetting mode. When you run this code, `[htbp]` will be printed right above the table, and even the numbers will be printed when htbp is replaced by other attributes. Unless I remove the `[]`, it will lead to my poor typesetting. ``` The details of the datasets are listed in Table \ref{tab:addlabel}. \begin{table}[htbp] \centering \caption{Details of benchmark datasets} \begin{tabular}{llllllll} \toprule No. & Dataset & & & \multicolumn{2}{l}{No. of instance} & \multicolumn{2}{c}{No. of features} \\ \midrule 1 & \multicolumn{3}{l}{Electrical Grid Data} & \multicolumn{2}{l}{10000} & \multicolumn{2}{l}{14} \\ 2 & \multicolumn{3}{l}{Online Shoppers} & \multicolumn{2}{l}{12330} & \multicolumn{2}{l}{18} \\ 3 & \multicolumn{3}{l}{Dry Bean} & \multicolumn{2}{l}{13611} & \multicolumn{2}{l}{17} \\ 4 & \multicolumn{3}{l}{MAGIC Telescope} & \multicolumn{2}{l}{19020} & \multicolumn{2}{l}{11} \\ 5 & \multicolumn{3}{l}{Letter Recognition} & \multicolumn{2}{l}{20000} & \multicolumn{2}{l}{16} \\ 6 & \multicolumn{3}{l}{Avila} & \multicolumn{2}{l}{20867} & \multicolumn{2}{l}{10} \\ 7 & \multicolumn{3}{l}{Default of Credit Card} & \multicolumn{2}{l}{30000} & \multicolumn{2}{l}{24} \\ 8 & \multicolumn{3}{l}{Bank Marketing} & \multicolumn{2}{l}{45211} & \multicolumn{2}{l}{17} \\ 9 & \multicolumn{3}{l}{Secondary Mushroom} & \multicolumn{2}{l}{61069} & \multicolumn{2}{l}{21} \\ 10 & \multicolumn{3}{l}{Clickstream Data} & \multicolumn{2}{l}{165474} & \multicolumn{2}{l}{14} \\ 11 & \multicolumn{3}{l}{Diabetes Health} & \multicolumn{2}{l}{253680} & \multicolumn{2}{l}{22} \\ 12 & \multicolumn{3}{l}{Linkage Comparison} & \multicolumn{2}{l}{574913} & \multicolumn{2}{l}{12} \\ \bottomrule \end{tabular}% \label{tab:addlabel}% \end{table}% ```
https://tex.stackexchange.com/users/295513
Why is there "[htbp]" above my table?
false
Like @Zarko does in [his answer](https://tex.stackexchange.com/a/683592/5001), I would use the `S` column type for the third (real) column. In addition, I'd apply some visual grouping to the table's data rows and provide a bit more structure to the table's header line. A side benefit of the latter move is that the table becomes more compact, enhancing its overall readability. ``` \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} % for 'S' column type \begin{document} The details of the datasets are listed in Table \ref{tab:addlabel}. \begin{table}[htbp] \centering \caption{Details of benchmark datasets\strut} \label{tab:addlabel} \begin{tabular}{@{} ll S[table-format=6.0] c @{}} \toprule No. & Dataset & \multicolumn{2}{c@{}}{Number of} \\ \cmidrule(l){3-4} & & {Instances} & Features \\ \midrule 1 & Electrical Grid Data & 10000 & 14 \\ 2 & Online Shoppers & 12330 & 18 \\ 3 & Dry Bean & 13611 & 17 \\ 4 & MAGIC Telescope & 19020 & 11 \\ \addlinespace 5 & Letter Recognition & 20000 & 16 \\ 6 & Avila & 20867 & 10 \\ 7 & Default of Credit Card & 30000 & 24 \\ 8 & Bank Marketing & 45211 & 17 \\ \addlinespace 9 & Secondary Mushroom & 61069 & 21 \\ 10 & Clickstream Data & 165474 & 14 \\ 11 & Diabetes Health & 253680 & 22 \\ 12 & Linkage Comparison & 574913 & 12 \\ \bottomrule \end{tabular} \end{table} \end{document} ```
5
https://tex.stackexchange.com/users/5001
683595
317,148
https://tex.stackexchange.com/questions/451458
1
I have a document which has an associated .bib file that is created using Jabref. I include the ful; path to the .bib file in the Latex preamble using the commands: ``` \makeindex % used for the subject index % please use the style svind.ist with % your makeindex program \usepackage[style=authoryear,natbib=true,backend=biber]{biblatex} \setlength{\bibitemsep}{0.5\baselineskip} \DeclareNameAlias{sortname}{last-first} \addbibresource {C:/Users/tkpme/Dropbox/Book PCRM/mpsbookNew.bib} \renewcommand\cite{\citet} ``` In the past, I have had no difficulty choosing an item when I wanted to insert a citation. All of a sudden, no citations at all are available to choose from when I click on Insert > Citation! Oddly enough, citations I inserted in the past get processed correctly when I generate a pdf - I just can't insert any new citations. Any help would be greatly appreciated. Thomas Philips
https://tex.stackexchange.com/users/136135
No Citations visible in LyX 2.3.0
false
I had a similar issue. My setup was: Master document (e.g. thesis.lyx) with included child document, where the Bibtex Generated Bibliography resided (e.g. references.lyx). The references were not visible in the Lyx:Citation dialog in the master document nor in other child documents (chapters). Turned out, setting "Select default master document" in the settings of "references.lyx" to "thesis.lyx" made the difference.
0
https://tex.stackexchange.com/users/295516
683597
317,149
https://tex.stackexchange.com/questions/683190
1
I need an in-text reference in LaTeX to display the result as Author (Year: Page) **Desired result:** > > According to Scott & McFeaters (2011: 116), battlefield archaeology > has evolved into a reliable field of study. > > > **My main page includes the following package reference** ``` \RequirePackage[ backend=biber, style=authoryear, isbn=false, doi=false, url=false, giveninits=true ]{biblatex} \DeclareDelimFormat{finalnamedelim}{\addspace\&\space} ``` **My code is:** ``` According to \autocite[116]{scott_and_mcfeaters_2011}, battlefield archaeology has evolved into a reliable field of study ``` **The article in my bib file is:** ``` @article{scott_and_mcfeaters_2011, title = {The Archaeology of Historic Battlefields: A History and Theoretical Development in Conflict Archaeology}, volume = {19}, doi = {10.1007/s10814-010-9044-8}, pages = {103--132}, number = {1}, journaltitle = {Journal of Archaeological Research}, author = {Scott, Douglas and McFeaters, Andrew}, date = {2011}, } ``` **However I am getting the result:** > > According to (Scott & McFeaters 2011: 116), battlefield archaeology > has evolved into a reliable field of study > > > The above reference will be correct for the end-of-paragraph reference but I need the in-text reference to be Scott & McFeaters (2011: 116)
https://tex.stackexchange.com/users/295238
BibLaTeX in text reference Author (Year: Page)
true
You get the format you like with `\textcite`. Hence, you only need to set the `\autocite` to `\textcite` for inline citation with: ``` \DeclareAutoCiteCommand{inline}{\textcite}{\textcite} ``` You can have both citation types. You can get (Author, Year) with `\parencite`. Here is a complete MWE: ``` \begin{filecontents*}[overwrite]{references.bib} @article{scott_and_mcfeaters_2011, title = {The Archaeology of Historic Battlefields: A History and Theoretical Development in Conflict Archaeology}, volume = {19}, doi = {10.1007/s10814-010-9044-8}, pages = {103--132}, number = {1}, journaltitle = {Journal of Archaeological Research}, author = {Scott, Douglas and McFeaters, Andrew}, date = {2011}, } \end{filecontents*} \documentclass{article} \RequirePackage[ backend=biber, style=authoryear, isbn=false, doi=false, url=false, giveninits=true ]{biblatex} \DeclareDelimFormat{finalnamedelim}{\addspace\&\space} \DeclareAutoCiteCommand{inline}{\textcite}{\textcite} % from https://tex.stackexchange.com/a/66395/101651: \renewcommand*{\postnotedelim}{\addcolon\addspace} \DeclareFieldFormat{postnote}{#1} \DeclareFieldFormat{multipostnote}{#1} \addbibresource{references.bib} \begin{document} With text cite: \textcite[116]{scott_and_mcfeaters_2011} With auto cite: According to \autocite[116]{scott_and_mcfeaters_2011}, battlefield archaeology has evolved into a reliable field of study You can have both citation type \parencite[116]{scott_and_mcfeaters_2011}. \printbibliography \end{document} ```
1
https://tex.stackexchange.com/users/101651
683599
317,150
https://tex.stackexchange.com/questions/683578
2
[edited after egreg's answer] I want to store macros and their contents as pairs `macro {macro contents}` in a clist. The macros will be defined elsewhere, by the user or in another package, and will contain either numbers or mathematical formulas. The question is, given only the macro name, e.g. `\mymacro`, how can I see the contents stored in `\mymacro`? In the following example, `\exp_not:f` succeeds when the macro definition contains a leading space, but fails when it doesn't. ``` \documentclass{article} %\usepackage{amsmath} % space before \sin \NewDocumentCommand \myloosemacro {} { \sin(\pi/6) } % no space before \sin \NewDocumentCommand \mytightmacro {} {\sin(\pi/6)} \begin{document} \ExplSyntaxOn \cs_new_protected:Npn \__storemacros:N #1 { \clist_put_right:Nx \l_tmpa_clist { #1 { \exp_not:f #1 } } } \clist_clear:N \l_tmpa_clist \__storemacros:N \myloosemacro \__storemacros:N \mytightmacro \clist_show:N \l_tmpa_clist \ExplSyntaxOff \end{document} ``` This shows that `\l_tmpa_clist` contains the pairs: ``` \myloosemacro {\sin (\pi /6) } \mytightmacro {\protect \sin (\pi /6)} ``` The first is the desired result, the second contains an extra unwanted token -- not present in the definition of the macro. By uncommenting `\usepackage{amsmath}`, things get worse. The second of these becomes `\mytightmacro {\protect \qopname \relax o{sin}(\pi /6)}` with many extra tokens not present at time of definition. As mentioned earlier, the macros will come from other packages or user input, so I have no control over the presence or absence of an initial space.
https://tex.stackexchange.com/users/183147
Storing the unknown contents of a macro in a clist
false
You're using the wrong tools. With `\NewDocumentCommand{\foo}{}{<code>}`, you're defining a `\protected` macro, that will pass unchanged through `x`- or `e`-expansion. However, the `\protected` has no effect in `f`-expansion. If you do `\show\myloosemacro`, you see that the macro is defined as ``` > \myloosemacro=\protected macro: ->\__cmd_start_expandable:nNNNNn {}\myloosemacro \myloosemacro \myloosemacro code ?{}. ``` and the replacement text is stored in `\myloosemacro code` (yes, with a space in the name) ``` ? i\expandafter\show\csname myloosemacro code\endcsname > \myloosemacro code=\protected\long macro: -> \sin (\pi /6) . ``` If I do the same with `\mytightmacro`, I see ``` ? i\expandafter\show\csname mytightmacro code\endcsname > \mytightmacro code=\protected\long macro: ->\sin (\pi /6). ``` Here you see the initial space in the former. You apply `\exp_not:f` which does recursive one level expansions, stopping when an unexpandable token is found (and ignoring it if it's a space). The tokens in the definition of `\myloosemacro` are designed to produce nothing in `f`-expansion, until arriving to `\myloosemacro code ?{}`, which only produces the replacement text. Here's where the space is gobbled, because it stops the `f`-expansion. Essentially the same happens with `\mytightmacro`, but with an important difference: there is no space that blocks the `f`-expansion, so `\sin` is expanded. And `\show\sin` tells you that the definition is ``` > \sin=macro: ->\protect \sin . ``` (with a trailing space in the name of the last command). You're lucky, because at call time, `\protect` is `\relax` and so it blocks `f`-expansion (but it's not ignored). ``` \documentclass{article} %\usepackage{amsmath} \ExplSyntaxOn \NewDocumentCommand{\definevar}{mm} { \tl_new:N #1 \tl_set:Nn #1 { #2 } } \ExplSyntaxOff % space before \sin \definevar \myloosemacro { \sin(\pi/6) } % no space before \sin \definevar \mytightmacro {\sin(\pi/6)} \begin{document} \ExplSyntaxOn \cs_generate_variant:Nn \tl_trim_spaces:n { e } \cs_new_protected:Npn \__storemacros:N #1 { \clist_put_right:Nx \l_tmpa_clist { \exp_not:N #1 { \tl_trim_spaces:e { \exp_not:V #1 } } } } \clist_clear:N \l_tmpa_clist \__storemacros:N \myloosemacro \__storemacros:N \mytightmacro \clist_show:N \l_tmpa_clist \ExplSyntaxOff \end{document} ``` will show ``` The comma list \l_tmpa_clist contains the items (without outer braces): > {\myloosemacro {\sin (\pi /6)}} > {\mytightmacro {\sin (\pi /6)}}. ```
3
https://tex.stackexchange.com/users/4427
683600
317,151
https://tex.stackexchange.com/questions/509820
4
**UPDATE** [this website](https://www.pdfen.com/convert-to-pdf/convert-pdf-to-pdfa) worked. First, I added the pdfx (using a-2b option) and hyperref packages and compiled. Then I used the website to convert PDF->PDFA. Passed [this validator](https://www.pdf-online.com/osa/validate.aspx) --- I am following [this tutorial](https://www.mathstat.dal.ca/~selinger/pdfa/#2) for convert my MSc thesis; he uses ``` \usepackage[a-2b]{pdfx} \usepackage{hyperref} ``` My university suggests [this approach](http://etd.vt.edu/PDFA-1b_Tutorial_PC.pdf), but the result is very blurry; in short they ``` -> Download Acrobat Pro -> Open Thesis.pdf in latex (compiled without hyperref/pdfx packages} -> Save as postscript -> Use Adobe Distiller to go postscript to PDF/A -> Use Acrobat Pro verification and fix to output final file (very blurry) ``` Using the first method, I run A-1B/A-2B verifcation after compiling using verapdf. The program stalls after 10 seconds. When I shorten my pdf and rerun, I get a lot of errors. Eg, ``` Rule Status Specification: ISO 19005-2:2011, Clause: 6.2.8, Test number: 3 If an Image dictionary contains the Interpolate key, its value shall be false. For an inline image, the I key shall have a value of false. Failed 9 occurrences Hide PDXImage Interpolate == false root/document[0]/pages[10](220 0 obj PDPage)/contentStream[0](221 0 obj PDContentStream)/operators[34]/xObject[0](217 0 obj PDXForm)/contentStream[0](217 0 obj PDContentStream)/operators[806]/xObject[0](235 0 obj PDXImage)/SMask[0](257 0 obj PDSMaskImage) root/document[0]/pages[28](721 0 obj PDPage)/contentStream[0](722 0 obj PDContentStream)/operators[13]/xObject[0](707 0 obj PDXForm)/contentStream[0](707 0 obj PDContentStream)/operators[10]/xObject[0](727 0 obj PDXImage) root/document[0]/pages[11](277 0 obj PDPage)/contentStream[0](278 0 obj PDContentStream)/operators[51]/xObject[0](270 0 obj PDXForm)/contentStream[0](270 0 obj PDContentStream)/operators[14]/xObject[0](285 0 obj PDXForm)/contentStream[0](285 0 obj PDContentStream)/operators[4]/xObject[0](291 0 obj PDXImage)/SMask[0](294 0 obj PDSMaskImage) root/document[0]/pages[28](721 0 obj PDPage)/contentStream[0](722 0 obj PDContentStream)/operators[13]/xObject[0](707 0 obj PDXForm)/contentStream[0](707 0 obj PDContentStream)/operators[40]/xObject[0](730 0 obj PDXImage) root/document[0]/pages[11](277 0 obj PDPage)/contentStream[0](278 0 obj PDContentStream)/operators[51]/xObject[0](270 0 obj PDXForm)/contentStream[0](270 0 obj PDContentStream)/operators[14]/xObject[0](285 0 obj PDXForm)/contentStream[0](285 0 obj PDContentStream)/operators[4]/xObject[0](291 0 obj PDXImage) root/document[0]/pages[10](220 0 obj PDPage)/contentStream[0](221 0 obj PDContentStream)/operators[34]/xObject[0](217 0 obj PDXForm)/contentStream[0](217 0 obj PDContentStream)/operators[806]/xObject[0](235 0 obj PDXImage) root/document[0]/pages[28](721 0 obj PDPage)/contentStream[0](722 0 obj PDContentStream)/operators[13]/xObject[0](707 0 obj PDXForm)/contentStream[0](707 0 obj PDContentStream)/operators[20]/xObject[0](728 0 obj PDXImage) root/document[0]/pages[11](277 0 obj PDPage)/contentStream[0](278 0 obj PDContentStream)/operators[51]/xObject[0](270 0 obj PDXForm)/contentStream[0](270 0 obj PDContentStream)/operators[9]/xObject[0](284 0 obj PDXForm)/contentStream[0](284 0 obj PDContentStream)/operators[4]/xObject[0](290 0 obj PDXImage) root/document[0]/pages[28](721 0 obj PDPage)/contentStream[0](722 0 obj PDContentStream)/operators[13]/xObject[0](707 0 obj PDXForm)/contentStream[0](707 0 obj PDContentStream)/operators[30]/xObject[0](729 0 obj PDXImage) Specification: ISO 19005-2:2011, Clause: 6.2.11.5, Test number: 1 For every font embedded in a conforming file and used for rendering, the glyph width information in the font dictionary and in the embedded font program shall be consistent. Failed 2 occurrences Hide Glyph renderingMode == 3 || isWidthConsistent == null || isWidthConsistent == true root/document[0]/pages[36](837 0 obj PDPage)/contentStream[0](838 0 obj PDContentStream)/operators[185]/usedGlyphs[0](VLXJBU+PazoMathBlackboardBold 67 0 0) root/document[0]/pages[36](837 0 obj PDPage)/contentStream[0](838 0 obj PDContentStream)/operators[202]/usedGlyphs[0](VLXJBU+PazoMathBlackboardBold 82 0 0) Specification: ISO 19005-2:2011, Clause: 6.2.11.3, Test number: 2 ISO 32000-1:2008, 9.7.4, Table 117 requires that all embedded Type 2 CIDFonts in the CIDFont dictionary shall contain a CIDToGIDMap entry that shall be a stream mapping from CIDs to glyph indices or the name Identity, as described in ISO 32000-1:2008, 9.7.4, Table 117. Failed 2 occurrences Hide PDCIDFont Subtype != "CIDFontType2" || CIDToGIDMap != null root/document[0]/pages[36](837 0 obj PDPage)/contentStream[0](838 0 obj PDContentStream)/operators[231]/xObject[0](834 0 obj PDXForm)/contentStream[0](834 0 obj PDContentStream)/operators[406]/font[0](WQQTJP+LucidaSansUnicode)/DescendantFonts[0](WQQTJP+LucidaSansUnicode) root/document[0]/pages[36](837 0 obj PDPage)/contentStream[0](838 0 obj PDContentStream)/operators[231]/xObject[0](834 0 obj PDXForm)/contentStream[0](834 0 obj PDContentStream)/operators[418]/font[0](XPXPKK+Verdana)/DescendantFonts[0](XPXPKK+Verdana) ``` Here is my Thesis.tex file. ``` \documentclass[titlepage, openany, 11pt]{report} % for longer reports containing several chapters. Draft copy, with detached titlepage, chapter start on any page \usepackage{float} % to ensure tables and figures cannot be split across pages \usepackage{afterpage} \usepackage{mathpazo} \usepackage{tabularx} \usepackage{setspace} \usepackage{graphicx} \usepackage{xcolor} \usepackage{color} \usepackage{listings} \usepackage{float} \usepackage[toc, page]{appendix} \graphicspath{{fig/}} \usepackage[T1]{fontenc} \fontfamily{georgia} \usepackage{mathtools} \usepackage{bm} \usepackage{subcaption} \usepackage{url} \usepackage{pdflscape} \usepackage[toc,page]{appendix} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \newcommand{\hl}[1]{\textcolor{red}{#1}} \emergencystretch 3em \usepackage{cite} \usepackage{amssymb} \usepackage{framed} \usepackage[a-2b]{pdfx} \usepackage{hyperref} \include{abbr} \DeclarePairedDelimiter\abs{\lvert}{\rvert}% \definecolor{dkgreen}{rgb}{0,0.6,0} \definecolor{gray}{rgb}{0.5,0.5,0.5} \definecolor{mauve}{rgb}{0.58,0,0.82} \lstset{frame=tb, language=Python, aboveskip=3mm, belowskip=6mm, showstringspaces=false, columns=flexible, basicstyle={\small\ttfamily}, numbers=none, numberstyle=\tiny\color{gray}, keywordstyle=\color{blue}, commentstyle=\color{dkgreen}, stringstyle=\color{mauve}, breaklines=true, breakatwhitespace=true, tabsize=4 } %\pagestyle{plain} % page numbers at the bottom in the middle of the footer section \includeonly{titlepage, abstract, preface, acknowledgements, blankpage, 1introduction, 2relatedwork, 3background, 4experimentalresultsandanalysis, 5simulationapproximationmethodology, 6conclusion, appendices, abbr} %TEX WILL MAKE 'OVERFULL' LINES IF IT'S ALGORITHM CANNOT NICELY FORMAT A LINE. RESULTS IN BLACK BOX AT END OF LINE \begin{document} \onehalfspacing \pagenumbering{roman} \include{titlepage} \doublespacing \include{abstract} \onehalfspacing % \include{preface} \include{acknowledgements} \tableofcontents \listoffigures \listoftables \printglossary[type=\acronymtype,title=Abbreviations, nonumberlist] \printglossary[title=Symbols, nonumberlist] \glsresetall % reset glossary so abbreviations (ABBR) are re-defined in chapters \include{1introduction} \include{2relatedwork} \include{3background} \include{4experimentalresultsandanalysis} \include{5simulationapproximationmethodology} \include{6conclusion} \bibliographystyle{IEEEtran} % sorting bibliography alphebetically \bibliography{masters, IEEEabrv} % \include{appendices} \end{document} ``` 1. I tried using lualatex [to see if pdflatex was suppressing an error](https://tex.stackexchange.com/questions/436447/embedding-font-merriweather-into-a-valid-pdf-a-1b)... nope 2. I tried google the errors, but none of the suggestions are remotely in my wheelhouse to implement on two days notice ``` If an Image dictionary contains the Interpolate key, its value shall be false. For an inline image, the I key shall have a value of false. ``` ``` For every font embedded in a conforming file and used for rendering, the glyph width information in the font dictionary and in the embedded font program shall be consistent. ``` Does anyone see obvious issues in my Thesis.tex file? Or any suggestions at all are very appreciated. Also if there's a service/person I could pay to handle this I would be interested.
https://tex.stackexchange.com/users/198180
Trouble creating a PDF/ A-1B or A-2B compliant document using pdflatex
false
Having faced a similar issue, the solution in my case was to convert a specific PDF graphic with an embedded raster image (it was a `ggplot2` heatmap) to a JPG or a PNG format. For those who stumbled upon this thread while googling, I'd suggest removing every image one by one, generating the PDF file without each image, and running the PDF/A validation for each of these to pinpoint which of the graphics was causing the issue.
2
https://tex.stackexchange.com/users/295522
683605
317,153
https://tex.stackexchange.com/questions/683604
4
I want to create a automatically calculating invoice environment. The table fits to the page perfectly (of course) with `tabularx`. However, the calculation goes wrong since LaTeX creates the table multiple times to find out the width of the `X` column. The calculations work great with `tabular` but then the table is fully fitting on the page depending on the font settings. So I tried to manually calculate the width of the one variable column but it does not really work smoothly. Is there a better way to solve this? ``` \documentclass{scrlttr2} \usepackage{tgheros} \renewcommand\familydefault{\sfdefault} \RequirePackage{xspace} % ===================================== % correct number displaying \usepackage[mode=text, reset-text-series = false, separate-uncertainty, group-digits=integer, group-minimum-digits = 4]{siunitx} \sisetup{group-separator = {\,}, input-decimal-markers={,.}, output-decimal-marker = {,}} \newcommand{\EURsimple}[1]{ \sisetup{minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}} #1 \sisetup{minimum-decimal-digits=0, group-separator = {\,}, output-decimal-marker = {,}} } \newcommand{\EUR}[1]{ \num[minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}]{#1}\,€ } % ===================================== % automatic item numbering \newcommand{\startnumberedlist}{\newcounter{numberedlistcounter}} \newcommand{\numberedlistitem}{\stepcounter{numberedlistcounter}\thenumberedlistcounter} % ===================================== % calculation \RequirePackage{calculator} \newcommand{\resetinvoicesum}{\ADD{0}{0}{\invoicesum}} \newcommand{\addtoinvoicesum}[1]{\ADD{\invoicesum}{#1}{\invoicesum}\GLOBALCOPY{\invoicesum}{\invoicesum}} % ===================================== % trying to calculate the needed width of the variable width column \newlength{\invoicedescwidth} \setlength{\invoicedescwidth}{\textwidth} \newlength{\invoicerestwidth} \settowidth{\invoicerestwidth}{\textbf{Pos. Anzahl Rechnungsbetrag Gesamtpreis}} \addtolength{\invoicedescwidth}{-\invoicerestwidth} \addtolength{\invoicedescwidth}{-15ex} % <= this is not variable enough for different fonts. % ===================================== % invoice environment \RequirePackage{booktabs} \newenvironment{invoice}[1][]{\startnumberedlist\resetinvoicesum\par\noindent \centering\begin{tabular}{rp{\invoicedescwidth}S[table-format=5.1]S[table-format=5.4]r}% \toprule[0.7pt]\textbf{Pos.} & \textbf{Beschreibung} & \textbf{Anzahl} & \textbf{Einzelpreis} & \textbf{Gesamtpreis} \\ \toprule[0.7pt]} {\midrule[0.7pt] &&& \textbf{Rechnungsbetrag} & \textbf{\EUR{\invoicesum}} \\ \cmidrule[0.7pt]{4-5} \end{tabular}% } % invoiceitem, #1: description, #2: count, #3: price per item \newcommand{\invoiceitem}[3]{ \numberedlistitem & #1 & #2 & \EURsimple{#3} & \MULTIPLY{#2}{#3}{\tempsum} \ROUND[2]{\tempsum}{\tempsum} \addtoinvoicesum{\tempsum} \EUR{\tempsum}\\} % price calculation and sum up all prices \usepackage{Blindtext} \begin{document} \begin{letter}{recipient} \opening{Hello} \Blindtext[1] \begin{invoice} \invoiceitem{Arbeitszeit in h}{800}{15} \invoiceitem{Schrauben}{2134}{0.1} \invoiceitem{Strommenge in kWh}{303.5}{0.3175} \invoiceitem{Position C}{2}{1123.1} \end{invoice} \end{letter} \end{document} ``` P.S.: I also tried `tabularray` but that does not seem to work with `S` columns of `siunitx` to arrange the numbers correctly at the decimal point.
https://tex.stackexchange.com/users/281557
How to manually create X width of tabularx?
false
The environment `{NiceTabular}` of `nicematrix` provides the ability to use `X` columns similar to those of `tabularx`. Unlike `tabularx`, `nicematrix` does not compile several times the tabular within a scratch box during a run of LaTeX but writes information on the `aux` file (and requires several runs of LaTeX). ``` \documentclass{scrlttr2} \usepackage{nicematrix} \usepackage{tgheros} \renewcommand\familydefault{\sfdefault} \RequirePackage{xspace} % ===================================== % correct number displaying \usepackage[mode=text, reset-text-series = false, separate-uncertainty, group-digits=integer, group-minimum-digits = 4]{siunitx} \sisetup{group-separator = {\,}, input-decimal-markers={,.}, output-decimal-marker = {,}} \newcommand{\EURsimple}[1]{ \sisetup{minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}} #1 \sisetup{minimum-decimal-digits=0, group-separator = {\,}, output-decimal-marker = {,}} } \newcommand{\EUR}[1]{ \num[minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}]{#1}\,€ } % ===================================== % automatic item numbering \newcommand{\startnumberedlist}{\newcounter{numberedlistcounter}} \newcommand{\numberedlistitem}{\stepcounter{numberedlistcounter}\thenumberedlistcounter} % ===================================== % calculation \RequirePackage{calculator} \newcommand{\resetinvoicesum}{\ADD{0}{0}{\invoicesum}} \newcommand{\addtoinvoicesum}[1]{\ADD{\invoicesum}{#1}{\invoicesum}\GLOBALCOPY{\invoicesum}{\invoicesum}} % ===================================== % invoice environment \RequirePackage{booktabs} \newenvironment{invoice}[1][]{\startnumberedlist\resetinvoicesum\par\noindent \centering\begin{NiceTabular}{rX[l]S[table-format=5.1]S[table-format=5.4]r}% \toprule[0.7pt]\textbf{Pos.} & \textbf{Beschreibung} & \textbf{Anzahl} & \textbf{Einzelpreis} & \textbf{Gesamtpreis} \\ \toprule[0.7pt]} {\midrule[0.7pt] &&& \textbf{Rechnungsbetrag} & \textbf{\EUR{\invoicesum}}\\ \cmidrule[0.7pt]{4-5} \end{NiceTabular}% } % invoiceitem, #1: description, #2: count, #3: price per item \newcommand{\invoiceitem}[3]{ \numberedlistitem & #1 & #2 & \EURsimple{#3} & \MULTIPLY{#2}{#3}{\tempsum} \ROUND[2]{\tempsum}{\tempsum} \addtoinvoicesum{\tempsum} \EUR{\tempsum}\\} % price calculation and sum up all prices \usepackage{Blindtext} \begin{document} \begin{letter}{recipient} \opening{Hello} \Blindtext[1] \begin{invoice} \invoiceitem{Arbeitszeit in h}{800}{15} \invoiceitem{Schrauben}{2134}{0.1} \invoiceitem{Strommenge in kWh and some other long text}{303.5}{0.3175} \invoiceitem{Position C}{2}{1123.1} \end{invoice} \end{letter} \end{document} ``` You need several compilations (several tools, such as `latexmk` will do for you those compilations).
5
https://tex.stackexchange.com/users/163000
683608
317,155
https://tex.stackexchange.com/questions/683604
4
I want to create a automatically calculating invoice environment. The table fits to the page perfectly (of course) with `tabularx`. However, the calculation goes wrong since LaTeX creates the table multiple times to find out the width of the `X` column. The calculations work great with `tabular` but then the table is fully fitting on the page depending on the font settings. So I tried to manually calculate the width of the one variable column but it does not really work smoothly. Is there a better way to solve this? ``` \documentclass{scrlttr2} \usepackage{tgheros} \renewcommand\familydefault{\sfdefault} \RequirePackage{xspace} % ===================================== % correct number displaying \usepackage[mode=text, reset-text-series = false, separate-uncertainty, group-digits=integer, group-minimum-digits = 4]{siunitx} \sisetup{group-separator = {\,}, input-decimal-markers={,.}, output-decimal-marker = {,}} \newcommand{\EURsimple}[1]{ \sisetup{minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}} #1 \sisetup{minimum-decimal-digits=0, group-separator = {\,}, output-decimal-marker = {,}} } \newcommand{\EUR}[1]{ \num[minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}]{#1}\,€ } % ===================================== % automatic item numbering \newcommand{\startnumberedlist}{\newcounter{numberedlistcounter}} \newcommand{\numberedlistitem}{\stepcounter{numberedlistcounter}\thenumberedlistcounter} % ===================================== % calculation \RequirePackage{calculator} \newcommand{\resetinvoicesum}{\ADD{0}{0}{\invoicesum}} \newcommand{\addtoinvoicesum}[1]{\ADD{\invoicesum}{#1}{\invoicesum}\GLOBALCOPY{\invoicesum}{\invoicesum}} % ===================================== % trying to calculate the needed width of the variable width column \newlength{\invoicedescwidth} \setlength{\invoicedescwidth}{\textwidth} \newlength{\invoicerestwidth} \settowidth{\invoicerestwidth}{\textbf{Pos. Anzahl Rechnungsbetrag Gesamtpreis}} \addtolength{\invoicedescwidth}{-\invoicerestwidth} \addtolength{\invoicedescwidth}{-15ex} % <= this is not variable enough for different fonts. % ===================================== % invoice environment \RequirePackage{booktabs} \newenvironment{invoice}[1][]{\startnumberedlist\resetinvoicesum\par\noindent \centering\begin{tabular}{rp{\invoicedescwidth}S[table-format=5.1]S[table-format=5.4]r}% \toprule[0.7pt]\textbf{Pos.} & \textbf{Beschreibung} & \textbf{Anzahl} & \textbf{Einzelpreis} & \textbf{Gesamtpreis} \\ \toprule[0.7pt]} {\midrule[0.7pt] &&& \textbf{Rechnungsbetrag} & \textbf{\EUR{\invoicesum}} \\ \cmidrule[0.7pt]{4-5} \end{tabular}% } % invoiceitem, #1: description, #2: count, #3: price per item \newcommand{\invoiceitem}[3]{ \numberedlistitem & #1 & #2 & \EURsimple{#3} & \MULTIPLY{#2}{#3}{\tempsum} \ROUND[2]{\tempsum}{\tempsum} \addtoinvoicesum{\tempsum} \EUR{\tempsum}\\} % price calculation and sum up all prices \usepackage{Blindtext} \begin{document} \begin{letter}{recipient} \opening{Hello} \Blindtext[1] \begin{invoice} \invoiceitem{Arbeitszeit in h}{800}{15} \invoiceitem{Schrauben}{2134}{0.1} \invoiceitem{Strommenge in kWh}{303.5}{0.3175} \invoiceitem{Position C}{2}{1123.1} \end{invoice} \end{letter} \end{document} ``` P.S.: I also tried `tabularray` but that does not seem to work with `S` columns of `siunitx` to arrange the numbers correctly at the decimal point.
https://tex.stackexchange.com/users/281557
How to manually create X width of tabularx?
true
Some of the calculations in ``` \newlength{\invoicedescwidth} \setlength{\invoicedescwidth}{\textwidth} \newlength{\invoicerestwidth} \settowidth{\invoicerestwidth}{\textbf{Pos. Anzahl Rechnungsbetrag Gesamtpreis}} \addtolength{\invoicedescwidth}{-\invoicerestwidth} \addtolength{\invoicedescwidth}{-15ex} % <= this is not variable enough for different fonts. ``` are suspect. E.g., why aren't you casting the text portion in `\textsf`? Why are there spaces in the `Pos. Anzahl Rechnungsbetrag Gesamtpreis` string? Where does `15ex` come from? I suggest you replace the code block with ``` % manual calculation of required column width \newlength\mylenA \newlength\invoicedescwidth \settowidth\mylenA{% some text, some numbers, no spaces, all \textsf \textsf{\textbf{Pos.Gesamtpreis}22\,124,511.123,3175}} \setlength\invoicedescwidth{% \dimexpr\textwidth-\mylenA-8\tabcolsep\relax} ``` --- ``` \documentclass{scrlttr2} \usepackage{tgheros} \renewcommand\familydefault{\sfdefault} \usepackage{xspace} \usepackage{booktabs} \usepackage{blindtext} % correct number displaying \usepackage[mode=text, reset-text-series = false, separate-uncertainty, group-digits=integer, group-minimum-digits = 4 ]{siunitx} \sisetup{group-separator = {\,}, input-decimal-markers={,.}, output-decimal-marker = {,}} \newcommand{\EURsimple}[1]{ \sisetup{minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}} #1 \sisetup{minimum-decimal-digits=0, group-separator = {\,}, output-decimal-marker = {,}} } \newcommand{\EUR}[1]{ \num[minimum-decimal-digits=2, group-separator = {.}, output-decimal-marker = {,}]{#1}\,€% } % automatic item numbering \newcounter{numberedlistcounter} \newcommand{\resetnumberedlist}{% \setcounter{numberedlistcounter}{0}} \newcommand{\numberedlistitem}{% \stepcounter{numberedlistcounter}% \thenumberedlistcounter} % manual calculation of required column width \newlength\mylenA \newlength\invoicedescwidth \settowidth\mylenA{% \textsf{\textbf{Pos.Gesamtpreis}22\,124,511.123,3175}} \setlength\invoicedescwidth{% \dimexpr\textwidth-\mylenA-8\tabcolsep\relax} % calculations \RequirePackage{calculator} \newcommand{\resetinvoicesum}{\ADD{0}{0}{\invoicesum}} \newcommand{\addtoinvoicesum}[1]{\ADD{\invoicesum}{#1}{\invoicesum}\GLOBALCOPY{\invoicesum}{\invoicesum}} % invoice environment \newenvironment{invoice}{% \resetnumberedlist\resetinvoicesum \medskip\par\noindent \begin{tabular}{@{} l >{\raggedright}p{\invoicedescwidth} S[table-format=5.1] S[table-format=5.4] r @{}}% \toprule[0.7pt] \textbf{Pos.} & \textbf{Beschreibung} & {\textbf{Anzahl}} & {\textbf{Einzelpreis}} & \textbf{Gesamtpreis} \\ \midrule[0.7pt]}{% \bottomrule[0.7pt] \addlinespace \multicolumn{5}{r@{}}{% \textbf{Rechnungsbetrag}\hspace{0.75em}% \textbf{\EUR{\invoicesum}}} \\ \addlinespace \end{tabular} \par } \newcommand{\invoiceitem}[3]{ \numberedlistitem & #1 & #2 & \EURsimple{#3} & \MULTIPLY{#2}{#3}{\tempsum} \ROUND[2]{\tempsum}{\tempsum} \addtoinvoicesum{\tempsum} \EUR{\tempsum}\\} \begin{document} \begin{letter}{recipient} \opening{Hello} \Blindtext[1] \begin{invoice} \invoiceitem{Arbeitszeit in h}{800}{15} \invoiceitem{Schrauben}{2134}{0.1} \invoiceitem{Strommenge in kWh}{303.5}{0.3175} \invoiceitem{Position C}{2}{1123.1} \end{invoice} \end{letter} \end{document} ``` --- *Addendum* to address one of the OP's follow-up comments: If you use a non-default sans-serif font -- especially one that uses variable-width digits -- I suggest you delay calculating the length parameters `\mylenA` and `\invoicedescwidth` until after `\begin{document}` and change the code block to ``` \newlength\mylenA \newlength\invoicedescwidth \settowidth\mylenA{% \textsf{\textbf{Pos.Gesamtpreis}% \num[group-separator={\,}]{22222,2}% \num[group-separator={.}]{22222,2222}}} \setlength\invoicedescwidth{% \dimexpr\textwidth-\mylenA-8\tabcolsep\relax} ```
2
https://tex.stackexchange.com/users/5001
683610
317,157
https://tex.stackexchange.com/questions/683606
0
I need to create a list of my publications. This list should include a reference to the paper, the ranking of the venue and the paper's abstract. After the publication list, I want to include the papers. **Problem:** My main issue is that I don't want to have a dedicated reference section but rather want to use my custom publication list. Obviously, when using `\fullcite`, citing the paper (in the text before the publication list) does not work fully (clicking the link just jumps to the first page). Code (`main.tex`): ``` \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{pdfpages} \usepackage{hyperref} \usepackage{geometry} \geometry{ a4paper, total={170mm,257mm}, left=20mm, top=20mm, } \usepackage{enumitem} \usepackage[ backend=biber, % style=alphabetic, firstinits=true, bibstyle=ieee,citestyle=numeric-comp, maxnames=99, % citestyle=authoryear ]{biblatex} \addbibresource{bibliography.bib} % https://tex.stackexchange.com/a/412872/85103 START \def\makenamesetup{% \def\bibnamedelima{~}% \def\bibnamedelimb{ }% \def\bibnamedelimc{ }% \def\bibnamedelimd{ }% \def\bibnamedelimi{ }% \def\bibinitperiod{.}% \def\bibinitdelim{~}% \def\bibinithyphendelim{.-}} \newcommand*{\makename}[2]{\begingroup\makenamesetup\xdef#1{#2}\endgroup} \newcommand*{\boldname}[3]{% \def\lastname{#1}% \def\firstname{#2}% \def\firstinit{#3}} \boldname{}{}{} \boldname{Lamport}{Leslie}{L.} \usepackage[normalem]{ulem} \makeatletter \newcommand{\namehighighter}[1]{% \ifboolexpr{(test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}}) and test {\ifdefequal{\lastname}{\namepartfamily}}} {\uline{#1}} {#1}} \renewbibmacro*{name:given-family}[4]{% \usebibmacro{name:delim}{#2#3#1}% \usebibmacro{name:hook}{#2#3#1}% \namehighighter{% \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot\bibnamedelimd}% \ifdefvoid{#3}{}{% \mkbibnameprefix{#3}\isdot \ifprefchar {} {\ifuseprefix{\bibnamedelimc}{\bibnamedelimd}}}% \mkbibnamefamily{#1}\isdot \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}}} \makeatother % https://tex.stackexchange.com/a/412872/85103 END \newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}} % \pagestyle{empty} \begin{document} \section*{\huge My Awesome Papers} \subsection*{BLA 1} I want to cite this paper~\cite{lamport2019part} and jump directly to the fullcite entry on the second page. \subsection*{BLA 2} \vspace{1em} \noindent \emph{Time, clocks, and the ordering of events in a distributed system} \dotfill \hyperlink{page.1}{1} \noindent \textbf{Reference:} \cite{lamport2019time} \fullcite{lamport2019time} \noindent \textbf{Ranking:} A* \noindent \textbf{Abstract:} Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. \vspace{2em} \noindent \emph{The Byzantine generals problem} \dotfill \hyperlink{page.1}{1} \noindent \textbf{Reference:} \cite{lamport2019byzantine} \fullcite{lamport2019byzantine} \noindent \textbf{Ranking:} A* \noindent \textbf{Abstract:} Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. \vspace{2em} \noindent \emph{The part-time parliament} \dotfill \hyperlink{page.1}{1} \noindent \textbf{Reference:} \cite{lamport2019part} \fullcite{lamport2019part} \noindent \textbf{Ranking:} A* \noindent \textbf{Abstract:} Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In aliquam lacinia nulla quis convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris blandit, ligula vitae ornare tincidunt, mauris eros tincidunt diam, ac malesuada eros est ac turpis. In sed sollicitudin neque, eget malesuada leo. Phasellus gravida nisl ut mi dictum, sed pharetra metus fringilla. Ut laoreet suscipit consequat. Maecenas malesuada ex magna, quis hendrerit diam finibus eu. Nullam consectetur nunc sed rutrum consequat. Donec nulla leo, convallis et sagittis in, rhoncus eget arcu. \vspace{2em} % \includepdf[pages=-]{./papers/A.pdf} % \includepdf[pages=-]{./papers/B.pdf} % \includepdf[pages=-]{./papers/C.pdf} \end{document} ``` Bib (`bibliography.bib`): ``` @incollection{lamport2019time, title={Time, clocks, and the ordering of events in a distributed system}, author={Lamport, Leslie}, booktitle={Concurrency: the Works of Leslie Lamport}, pages={179--196}, year={2019} } @incollection{lamport2019byzantine, title={The Byzantine generals problem}, author={Lamport, Leslie and Shostak, Robert and Pease, Marshall}, booktitle={Concurrency: the works of leslie lamport}, pages={203--226}, year={2019} } @incollection{lamport2019part, title={The part-time parliament}, author={Lamport, Leslie}, booktitle={Concurrency: the Works of Leslie Lamport}, pages={277--317}, year={2019} } ``` Again, to clarify my problem: When I use, for instance, `\cite{lamport2019part}`, the ref does not jump to the respective `\fullcite` entry. Is there a way to achieve this?
https://tex.stackexchange.com/users/85112
Use `\fullcite` instead of bibliography for publication list
true
You can add the target. But naturally you should only use \fullcite once for every entry. ``` \documentclass{article} \usepackage[ firstinits=true, bibstyle=ieee,citestyle=numeric-comp, maxnames=99, ]{biblatex} \makeatletter \DeclareCiteCommand{\fullcite} {\usebibmacro{prenote}} {\MakeLinkTarget*{cite.\the\c@refsection @\thefield{entrykey}}{}% add target \usedriver {\DeclareNameAlias{sortname}{default}} {\thefield{entrytype}}} {\multicitedelim} {\usebibmacro{postnote}} \addbibresource{hyp.bib} \makeatother \usepackage{hyperref} \begin{document} I want to cite this paper~\cite{lamport2019part} and jump directly to the fullcite entry on the second page. \newpage \fullcite{lamport2019part} \end{document} ```
3
https://tex.stackexchange.com/users/2388
683612
317,158
https://tex.stackexchange.com/questions/682572
5
I don't get it. `Gill Sans MT` supports Small Caps without any issue in Word and Powerpoint. Font recognition apps event identify it. And yet, there is no way I can get them. ``` \documentclass{article} \usepackage{fontspec} \setmainfont{Gill Sans MT}[ SmallCapsFeatures={Letters=SmallCaps}, SmallCapsFont={*}, ] \begin{document} \textsc{Small Caps.} \end{document} ```
https://tex.stackexchange.com/users/262813
Small Caps with Gill Sans MT
false
As a follow-up to the accepted answer, the apostrophe issue can be addressed by defining instead ``` \cs_new_protected:Nn \__krebs_smartsc_letter:n { \int_compare:nTF { \char_value_lccode:n { `#1 } = `#1 } { \char_uppercase:N #1 } { {\currentfont #1} } } ``` It checks whether lowercases match (instead of checking uppercases).
3
https://tex.stackexchange.com/users/94293
683617
317,160
https://tex.stackexchange.com/questions/683621
5
I trying to run this code: ``` \begin{tikzpicture} \foreach \n/\p in {b/(1,1),c/(2,1)} \node[draw,circle] (\n) at (\p) {}; \end{tikzpicture} % This is *not* working ``` And I got error. I'm wondering if there is any way to put `\p` instead of `\x/\y`, i.e.: ``` \begin{tikzpicture} \foreach \n/\x/\y in {b/1/1,c/2/1} \node[draw,circle] (\n) at (\x,\y) {}; \end{tikzpicture} % This is working. ``` Thank you!
https://tex.stackexchange.com/users/29476
It is possible to make point as one variable?
true
You need to mask those `,` (using curly braces) that are *not* supposed to be a delimiter in the comma-separated list. So, the following would work: ``` \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \n/\p in {b/{(1,1)},c/{(2,1)}} \node[draw,circle] (\n) at \p {}; \end{tikzpicture} \end{document} ``` Or: ``` \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \n/\p in {b/{1,1},c/{2,1}} \node[draw,circle] (\n) at (\p) {}; \end{tikzpicture} \end{document} ``` Output of both MWE:
8
https://tex.stackexchange.com/users/47927
683622
317,162
https://tex.stackexchange.com/questions/683555
2
I have a custom defined command that takes six arguments separated by commas as one argument, which I then separate into multiple arguments using `\SplitArgument`. I need a to define command which sums only inputs that are numbers and leaves out any text for example "-". I've tried to define a command using package `xstring`'s `\IsInteger`, but as I need to do some math operations with the resulting number (division, multiplication) that didn't work for me. Instead of performing the operation the command "printed" for example "021 / 24". I dont know why there is an extra zero before the summed number, but i suspect it had to do something with `xstring` not taking nested commands well. Anyway I pasted a simplified version of my code down below. If anyone could help I'd be grateful. ``` \documentclass{article} \usepackage{xparse} \NewDocumentCommand{\example}{ >{\SplitArgument{5}{,}} m}{\splitexample#1} \NewDocumentCommand{\splitexample}{mmmmmm}{% some text, #1, #2, #3, #4, #5, #6, some more text, value inserted by another cmd, value inserted by another cmd, the sum off all the inputs is: %insert sum command here% } \begin{document} \example{1,2,3,4,5,6} %expected output: 21 \example{1, -, 2, -, 3, 4} %expected output: 10 \end{document} ```
https://tex.stackexchange.com/users/295247
Summing up only number (integer) inputs
true
### update as per comment request ``` \documentclass{article} \makeatletter \newcommand*\example[1]{\the\numexpr0\example@i{}#1,\hbox\relax} \def\example@i#1#2{% \ifcase \ifx\hbox#2\z@\else\ifx,#2\@ne\else\ifnum9<1\string#2 \tw@\else\@M\fi\fi\fi % hit end, nothing to do, \relax terminates \the\numexpr \expandafter\@gobbletwo \or % hit a comma after having seen only digits in this round #1+0\expandafter\@firstoftwo \or % a digit, accumulate it \expandafter\@secondoftwo \else % a non-digit gob to comma \expandafter\example@continue \fi {\example@i{}}{\example@i{#1#2}}% } \def\example@continue#1,{\example@i{}} \makeatother \makeatletter \newcommand*\example[1]{\the\numexpr0\example@i{}#1,\hbox\relax} \def\example@i#1#2{% \ifcase \ifx\hbox#2\z@\else\ifx,#2\@ne\else\ifnum9<1\string#2 \tw@\else\@M\fi\fi\fi % hit end, nothing to do, \relax terminates \the\numexpr \expandafter\@gobbletwo \or % hit a comma after having seen only digits in this round #1+0\expandafter\@firstoftwo \or % a digit, accumulate it \expandafter\@secondoftwo \else % a non-digit gob to comma \expandafter\example@continue \fi {\example@i{}}{\example@i{#1#2}}% } \def\example@continue#1,{\example@i{}} \makeatother \makeatletter \newcommand*\integerindices[1]{\expanded\integerindices@i0!{}#1,\hbox} \def\integerindices@i#1!#2#3{% \ifcase \ifx\hbox#3\z@\else\ifx,#3\@ne\else\ifnum9<1\string#3 \tw@\else\@M\fi\fi\fi % hit end \expandafter\@firstoffour \or % hit a comma directly, increase index and check next one \expandafter\@secondoffour \or % a digit, dispatch to second auxiliary \expandafter\@thirdoffour \else % the item starts with a non-digit gob to comma and continue \expandafter\@fourthoffour \fi {{\integerindices@tocsv#2\relax}}% produce in csv format {\expandafter\integerindices@i\the\numexpr1+#1!{#2}}% {\integerindices@ii#1!{#2}}% {\expandafter\integerindices@continue\the\numexpr1+#1!{#2}}% } \def\integerindices@continue#1!#2#3,{\integerindices@i#1!{#2}} \def\integerindices@ii#1!#2#3{% \ifcase \ifx\hbox#3\z@\else\ifx,#3\@ne\else\ifnum9<1\string#3 \tw@\else\@M\fi\fi\fi % hit end \expandafter\@firstoffour \or % hit a comma after having seen only digits \expandafter\@secondoffour \or % a digit, keep parsing \expandafter\@thirdoffour \else % a non-digit gob to comma \expandafter\@fourthoffour \fi % perennial problems of comma separated lists % I decided to produce the csv at very end {{\integerindices@tocsv#2\relax}}% convert to csv {\expandafter\integerindices@i\the\numexpr1+#1!{#2{#1}}}% {\integerindices@ii#1!{#2}}% {\expandafter\integerindices@continue\the\numexpr1+#1!{#2}}% } \long\def\@firstoffour#1#2#3#4{#1} \long\def\@secondoffour#1#2#3#4{#2} \long\def\@thirdoffour#1#2#3#4{#3} \long\def\@fourthoffour#1#2#3#4{#4} \def\integerindices@tocsv#1{\ifx\relax#1\else#1\expandafter\integerindices@tocsv@i\fi} \def\integerindices@tocsv@i#1{\ifx\relax#1\else, #1\expandafter\integerindices@tocsv@i\fi} \makeatother \begin{document} This works expandably: \example{a,,2,xyz,40}. The list of indices starting at zero is for \verb|a,,2,xyz,40|: \integerindices{a,,2,xyz,40}. \edef\foo{\integerindices{1,az,32,66,;,87e,35,,,,!!!,99}} The list of indices starting at zero for \verb|1,az,32,66,;,87e,35,,,,!!!,99| is stored in macro \verb|\foo| with meaning \texttt{\meaning\foo}. \end{document} ``` *edited* I have edited the code so that the comma separated list has spaces after the commas. New screenshot: ### initial answer I have composed this expandable solution according to specifications: * only non-negative integers, no plus sign, * explicit digits, not hidden in macros. You can have arbitrarily many items. ``` \documentclass{article} \makeatletter \newcommand*\example[1]{\the\numexpr0\example@i{}#1,\hbox\relax} \def\example@i#1#2{% \ifcase \ifx\hbox#2\z@\else\ifx,#2\@ne\else\ifnum9<1\string#2 \tw@\else\@M\fi\fi\fi % hit end, nothing to do, \relax terminates \the\numexpr \expandafter\@gobbletwo \or % hit a comma after having seen only digits in this round #1+0\expandafter\@firstoftwo \or % a digit, accumulate it \expandafter\@secondoftwo \else % a non-digit gob to comma \expandafter\example@continue \fi {\example@i{}}{\example@i{#1#2}}% } \def\example@continue#1,{\example@i{}} \makeatother \begin{document} This works expandably: \example{a,,2,xyz,40}. \begin{verbatim} This is now executed: \ttfamily\parindent0pt \edef\foo{\example{1,2,3,4,5,6}}% expected output: 21 \meaning\foo\par \edef\foo{\example{1, -, 2, -, 3, 4}}% expected output: 10 \meaning\foo\par \edef\foo{\example{a,,2,xyz,40}}% expected output: 42 \meaning\foo\par \edef\foo{\example{1,az,32,66,;,87e,35,,,,!!!,}}% expected output: 134 \meaning\foo\par \end{verbatim} \ttfamily\parindent0pt \edef\foo{\example{1,2,3,4,5,6}}%expected output: 21 \meaning\foo\par \edef\foo{\example{1, -, 2, -, 3, 4}}% expected output: 10 \meaning\foo\par \edef\foo{\example{a,,2,xyz,40}}% expected output: 42 \meaning\foo\par \edef\foo{\example{1,az,32,66,;,87e,35,,,,!!!,}}% expected output: 134 \meaning\foo\par \newcounter{mycounter} \setcounter{mycounter}{\example{,,,,45,!!,^$,&(,text,55}} \arabic{mycounter} \end{document} ``` I added the counter stuff demo afterwards: ``` \newcounter{mycounter} \setcounter{mycounter}{\example{,,,,45,!!,^$,&(,text,55}} \arabic{mycounter} ```
1
https://tex.stackexchange.com/users/293669
683624
317,164
https://tex.stackexchange.com/questions/683615
1
I'm trying to use the standalone package. The idea is to have a large collection of standalone TeX files each containing a 'problem' (all text), and to be able to compile larger documents, each containing several problems selected from the pool. Now, I also want to toggle the visibility of the 'solution' to each problem, both in the main file and subfiles. I accomplish this by using `if` conditional and the comment package. But the main file fails to compile. A minimal example is as follows: Subfile: ``` %!TeX root = sub.tex \documentclass[class=article,crop=false,12pt]{standalone} \usepackage{comment} \newif\ifsolution \solutiontrue \ifsolution \newenvironment{solution}{\medskip\textbf{Solution: }\ignorespaces}{} \else \excludecomment{solution} \fi \begin{document} \subsection{Title} Problem text. \begin{solution} Solution text. \end{solution} \end{document} ``` Main file: ``` \documentclass[12pt,a4paper,onecolumn]{article} \usepackage[subpreambles=false]{standalone} \usepackage{comment} \newif\ifsolution %\solutiontrue \ifsolution \newenvironment{solution}{\medskip\textbf{Solution: }\ignorespaces}{} \else \excludecomment{solution} \fi \title{Big Title} \begin{document} \maketitle \input{sub.tex} \end{document} ``` Note the the preambles in both files are identical. The statement `\solutiontrue` can be (un)commented to toggle the solution. While the subfile compiles fine, the main file does not, giving the error `Incomplete \iffalse; all text was ignored after line 17.` (Line 17 is just after `\title`, and the error occurs at the line containing `\input`. The error results from the `\newif`...`\fi` block in the subfile. It can be avoided by moving this block to a separate file and `\input`ing it in the subfile. I don't want to do that because I want to be able to easily toggle the solution. It appears that standalone can't handle this `if` in the preamble, although my understanding is that it should completely discard the subfile preamble until `\begin{document}`. Is this correct? Is there a way to resolve this?
https://tex.stackexchange.com/users/295534
Problem with Standalone package with if statements in subfile preamble
true
Low-level `\if` commands are rather special in TeX. Even if TeX skips over text and throws it away it sees them. So in your case when compiling main.tex TeX sees the `\ifsolution` in the sub.tex and is rather unhappy that it has no `\fi`. Use a boolean from etoolbox instead: ``` \usepackage{etoolbox} \newbool{solution} %\booltrue{solution} \ifbool{solution} {\newenvironment{solution}{\medskip\textbf{Solution: }\ignorespaces}{}} {\excludecomment{solution}} ```
1
https://tex.stackexchange.com/users/2388
683625
317,165
https://tex.stackexchange.com/questions/683629
1
I get the code below on the Internet. How can I change its colours? (i.e. yellow to green, grey to light green and also the two horizontal bars in title to dark green). The code is the following: ``` \documentclass[10pt,xcolor={dvipsnames}]{beamer} \mode<article> % only for the article version { \usepackage{fullpage} \usepackage{hyperref} } \makeatletter \usecolortheme{rose} \definecolor{progressbar@bgblue}{rgb}{0.75,0.75,0.95} % use structure theme to change \definecolor{progressbar@fgblue}{rgb}{0.1,0.1,0.9} % use structure theme to change \setbeamercolor*{palette primary}{fg=progressbar@fgblue,bg=progressbar@bgblue} \setbeamercolor*{palette secundary}{fg=progressbar@fgblue,bg=progressbar@bgblue} \setbeamercolor*{palette tertiary}{fg=progressbar@fgblue,bg=progressbar@bgblue} \setbeamercolor{section in head/foot}{parent=palette primary} \makeatother \mode<presentation> \usefonttheme{default} \setbeamerfont{title}{size=\Large,series=\bfseries,parent=structure} \setbeamertemplate{bibliography item}[mybibitem] \setbeamerfont{bibliography entry author}{shape=\upshape,series=\bfseries,size=\normalsize}% \setbeamerfont{bibliography entry title}{shape=\upshape,size=\small,series=\mdseries} \setbeamerfont{bibliography entry journal}{shape=\upshape,size=\small,series=\mdseries} \setbeamerfont{bibliography entry note}{shape=\upshape,size=\small,series=\mdseries} \setbeamerfont{itemize/enumerate body}{size=\small} \setbeamerfont{itemize/enumerate subbody}{size=\footnotesize} \setbeamerfont{itemize/enumerate subsubbody}{size=\scriptsize} \setbeamerfont{block title}{size=\normalsize,series=\bfseries,parent={structure,block body}} \setbeamerfont{section in head/foot}{size=\tiny,series=\bfseries} \renewcommand{\emph}[1]{\color{structure.fg}\textbf{#1}\color{fg}\xspace} \setbeamerfont{section in toc}{parent=structure,series=\bfseries} \mode <all> \RequirePackage{tikz} \useinnertheme{rounded} \defbeamertemplate*{bibliography item}{progressbar theme}{ \begin{tikzpicture} \useasboundingbox (0, 0.2) rectangle (0.5, 0.7); \fill[fill=bg!85!blue] (0, 0.25) rectangle (0.4, 0.5); \shade[bottom color=bg,top color=bg!85!blue] (0, 0) -- (0.3, 0) -- (0.4, 0.12) -- (0.4, 0.3) -- (0, 0.3) -- cycle; \shade[left color=bg,right color=bg!85!blue] (0,0.27) .. controls (0.25,0.25) .. (0.4,0.5) -- (0,0.5) -- cycle; \fill[fill=bg!90!blue] (0,0) rectangle (0.3,0.05); \shade[left color=bg!95!blue,right color=bg!90!blue] (0,0) rectangle (0.05,0.5); \shade[left color=bg,right color=bg!80!black,shading angle=45] (0.3,0) -- (0.3,0.12) -- (0.4,0.12) -- cycle; \draw[draw=fg!35!bg] (0,0) -- (0.3,0) -- (0.4,0.12) -- (0.4,0.5) -- (0,0.5) -- cycle; \draw[draw=fg!35!bg](0.3,0) -- (0.3,0.12) -- (0.4,0.12); \end{tikzpicture} } \defbeamertemplate*{frametitle}{progressbar theme}{ \begin{centering} \textbf{\insertframetitle} \par \end{centering} } \mode<all> \makeatletter \RequirePackage{tikz} \setbeamercolor{progressbar primary}{parent=palette primary} \setbeamercolor{progressbar secondary}{parent=palette secondary} \setbeamercolor{progressbar tertiary}{parent=palette tertiary} \setbeamercolor{progressbar quaternary}{parent=palette quaternary} \newdimen\progressbar@currentbarlength \newdimen\progressbar@framenumberrectangle \newdimen\progressbar@titlerectangle \newdimen\progressbar@leftbar \newdimen\progressbar@barlengthmm \newcount\progressbar@tmpresult \newcount\progressbar@numer \newcount\progressbar@denom \newcount\progressbar@barlength \progressbar@framenumberrectangle=\paperwidth \progressbar@titlerectangle=\paperwidth \advance\progressbar@framenumberrectangle by -0.9cm \advance\progressbar@titlerectangle by -1.1cm \progressbar@barlength=115 % (in millimeters) \progressbar@barlengthmm=\progressbar@barlength mm \progressbar@leftbar=\progressbar@titlerectangle \advance\progressbar@leftbar by -\progressbar@barlength mm \def\insertprogressbar{ \ifnum\inserttotalframenumber=1\else \progressbar@numer=\insertframenumber \advance\progressbar@numer by -1 \progressbar@denom=\inserttotalframenumber \advance\progressbar@denom by -1 \progressbar@tmpresult=\progressbar@barlength \multiply\progressbar@tmpresult by \progressbar@numer \divide\progressbar@tmpresult by \progressbar@denom \progressbar@currentbarlength=\progressbar@tmpresult mm \begin{tikzpicture} \shade[top color=bg, bottom color=bg!80!fg] (0, 0) rectangle (\paperwidth, 0.6cm); \shade[left color=bg,right color=bg!70!fg] (.5\paperwidth, 0.2cm) rectangle (\paperwidth, 0.22cm); \draw (\progressbar@framenumberrectangle, 0.21cm) node [anchor=mid west, draw=bg!70!fg, fill=bg] {\color{structure.fg!70!bg}\scalebox{0.85}{\insertframenumber/\inserttotalframenumber}}; \draw (\progressbar@titlerectangle, 0.32cm) node [anchor=south east] {\color{bg!70!fg}Teoremas limite fortes para somas de vari\'{a}veis aleat\'{o}rias}; \fill (\progressbar@leftbar, 0.12cm) [fill=bg, rounded corners=0.1cm] rectangle (\progressbar@titlerectangle, 0.3cm); \ifnum\insertframenumber=1\else \shade[left color=progressbar primary.fg!10!bg, right color=progressbar primary.fg!20!bg, rounded corners=0.1cm] (\progressbar@leftbar, 0.12cm) rectangle ++(\progressbar@currentbarlength, 0.2cm); \fi \draw (\progressbar@leftbar, 0.11cm) [draw=bg!70!fg, rounded corners=0.1cm] rectangle ++(\progressbar@barlengthmm, 0.2cm); \end{tikzpicture} \fi } \mode<presentation> \newlength\progressbar@sectionboxwidth \newlength\progressbar@sectionboxheight \newbox\progressbar@sectionbox \newbox\progressbar@sectionboxbox \usesectionheadtemplate {\hfill \setbox\progressbar@sectionbox=\hbox{\insertsectionhead}% \progressbar@sectionboxwidth=\wd\progressbar@sectionbox \advance\progressbar@sectionboxwidth by 4pt \setbox\progressbar@sectionbox=\hbox{\pgfinterruptpicture t \endpgfinterruptpicture}% \progressbar@sectionboxheight=\ht\progressbar@sectionbox \advance\progressbar@sectionboxheight by 4pt \begin{tikzpicture} \useasboundingbox (-0.5\progressbar@sectionboxwidth, 0pt) rectangle (0.5\progressbar@sectionboxwidth, \progressbar@sectionboxheight); \draw[anchor=base] (0pt, 2pt) node {\color{structure.fg!80!bg} \insertsectionhead}; \end{tikzpicture} } {\hfill \setbox\progressbar@sectionbox=\hbox{\pgfinterruptpicture\insertsectionhead\endpgfinterruptpicture}% \progressbar@sectionboxwidth=\wd\progressbar@sectionbox \advance\progressbar@sectionboxwidth by 4pt \setbox\progressbar@sectionboxbox=\hbox{\pgfinterruptpicture t \endpgfinterruptpicture}% \progressbar@sectionboxheight=\ht\progressbar@sectionboxbox \advance\progressbar@sectionboxheight by 4pt } \defbeamertemplate*{headline}{progressbar theme} {% \leavevmode% \begin{beamercolorbox}[wd=\paperwidth,ht=4ex,dp=1.125ex]{section in head/foot}% \insertsectionnavigationhorizontal{\paperwidth}{}{}%\hskip0pt plus1filll}{}% \end{beamercolorbox}% } \defbeamertemplate*{footline}{progressbar theme}{ \begin{beamercolorbox}[wd=\paperwidth,ht=0.6cm,dp=0ex]{progressbar in head/foot}% \insertprogressbar \end{beamercolorbox}% } \defbeamertemplate*{title page}{progressbar theme}{ \pgfdeclarehorizontalshading{separationtitlepagelineshading}{0.5pt}{color(0cm)=(bg); color(0.5\textwidth)=(structure.fg); color(\textwidth)=(bg)} \makeatletter \begin{center} \textbf{\textcolor{structure.fg}\large\inserttitle} \pgfuseshading{separationtitlepagelineshading} \vskip\baselineskip \footnotesize\insertauthor\\[\baselineskip] \ifx\insertinstitute\@empty \else\tiny\insertinstitute\\[\baselineskip]\fi \insertlogo \vskip\baselineskip \pgfuseshading{separationtitlepagelineshading} \vfill \footnotesize \insertdate \end{center} \makeatother } \setbeamertemplate{title page}[mytitlepage] \defbeamertemplate*{background canvas}{progressbar theme}{\pgfuseshading{background shading}}%[action] \AtBeginDocument{% { \usebeamercolor{progressbar primary} \pgfdeclareverticalshading{background shading}{\the\paperwidth}{color(0cm)=(normal text.bg); color(0.8\paperheight)=(normal text.bg); color(0.95\paperheight)=(progressbar primary.bg); color(\paperheight)=(progressbar primary.bg) } } } \mode <all> \makeatother \setbeamertemplate{blocks}[rounded][shadow=true] \setbeamertemplate{navigation symbols}{} \mode<presentation> { \setbeamercovered{transparent} \usefonttheme{serif} \usecolortheme{crane} } \setbeamercovered{dynamic} \setbeamertemplate{items}[circle] \title[]{\vspace*{0.5cm}\parbox{10.0cm}{\centering{\LARGE{\sc Title}}}} \author{\parbox{10.0cm}{\vfill \relax\ifvmode\centering\fi {\normalsize\textbf{Author}} \vfill} \\[10pt] {\normalsize\textit{Filiation}}} \date{{\footnotesize \vspace*{1.0cm} April 2023}} \begin{document} \begin{frame}[plain] \maketitle \end{frame} \begin{frame} My first slide \end{frame} \end{document} ``` Thanks in advance.
https://tex.stackexchange.com/users/295544
Colors of a Beamer template
false
* to change the color of the headline shading, you can use `\setbeamercolor{progressbar primary}{bg=green}` and `\setbeamercolor{section in head/foot}{bg=green}` * the lines on the title page use the `structure` color, you can change it like this: `\setbeamercolor{structure}{fg=green!50!black}` Note that this will change the colour of quite a lot of things in the presentation * the gray colour in the footline seems to be calculated form a mixture from the color of the text and the background. If you want to change it independently, you can choose another colour in the definition of `\insertprogressbar` --- ``` \documentclass[10pt,xcolor={dvipsnames}]{beamer} \mode<article> % only for the article version { \usepackage{fullpage} \usepackage{hyperref} } \makeatletter \usecolortheme{rose} \definecolor{progressbar@bgblue}{rgb}{0.75,0.75,0.95} % use structure theme to change \definecolor{progressbar@fgblue}{rgb}{0.1,0.1,0.9} % use structure theme to change \setbeamercolor*{palette primary}{fg=progressbar@fgblue,bg=progressbar@bgblue} \setbeamercolor*{palette secundary}{fg=progressbar@fgblue,bg=progressbar@bgblue} \setbeamercolor*{palette tertiary}{fg=progressbar@fgblue,bg=progressbar@bgblue} \setbeamercolor{section in head/foot}{parent=palette primary} \makeatother \mode<presentation> \usefonttheme{default} \setbeamerfont{title}{size=\Large,series=\bfseries,parent=structure} \setbeamertemplate{bibliography item}[mybibitem] \setbeamerfont{bibliography entry author}{shape=\upshape,series=\bfseries,size=\normalsize}% \setbeamerfont{bibliography entry title}{shape=\upshape,size=\small,series=\mdseries} \setbeamerfont{bibliography entry journal}{shape=\upshape,size=\small,series=\mdseries} \setbeamerfont{bibliography entry note}{shape=\upshape,size=\small,series=\mdseries} \setbeamerfont{itemize/enumerate body}{size=\small} \setbeamerfont{itemize/enumerate subbody}{size=\footnotesize} \setbeamerfont{itemize/enumerate subsubbody}{size=\scriptsize} \setbeamerfont{block title}{size=\normalsize,series=\bfseries,parent={structure,block body}} \setbeamerfont{section in head/foot}{size=\tiny,series=\bfseries} \renewcommand{\emph}[1]{\color{structure.fg}\textbf{#1}\color{fg}\xspace} \setbeamerfont{section in toc}{parent=structure,series=\bfseries} \mode <all> \RequirePackage{tikz} \useinnertheme{rounded} \defbeamertemplate*{bibliography item}{progressbar theme}{ \begin{tikzpicture} \useasboundingbox (0, 0.2) rectangle (0.5, 0.7); \fill[fill=bg!85!blue] (0, 0.25) rectangle (0.4, 0.5); \shade[bottom color=bg,top color=bg!85!blue] (0, 0) -- (0.3, 0) -- (0.4, 0.12) -- (0.4, 0.3) -- (0, 0.3) -- cycle; \shade[left color=bg,right color=bg!85!blue] (0,0.27) .. controls (0.25,0.25) .. (0.4,0.5) -- (0,0.5) -- cycle; \fill[fill=bg!90!blue] (0,0) rectangle (0.3,0.05); \shade[left color=bg!95!blue,right color=bg!90!blue] (0,0) rectangle (0.05,0.5); \shade[left color=bg,right color=bg!80!black,shading angle=45] (0.3,0) -- (0.3,0.12) -- (0.4,0.12) -- cycle; \draw[draw=fg!35!bg] (0,0) -- (0.3,0) -- (0.4,0.12) -- (0.4,0.5) -- (0,0.5) -- cycle; \draw[draw=fg!35!bg](0.3,0) -- (0.3,0.12) -- (0.4,0.12); \end{tikzpicture} } \defbeamertemplate*{frametitle}{progressbar theme}{ \begin{centering} \textbf{\insertframetitle} \par \end{centering} } \mode<all> \makeatletter \RequirePackage{tikz} \setbeamercolor{progressbar primary}{parent=palette primary} \setbeamercolor{progressbar secondary}{parent=palette secondary} \setbeamercolor{progressbar tertiary}{parent=palette tertiary} \setbeamercolor{progressbar quaternary}{parent=palette quaternary} \newdimen\progressbar@currentbarlength \newdimen\progressbar@framenumberrectangle \newdimen\progressbar@titlerectangle \newdimen\progressbar@leftbar \newdimen\progressbar@barlengthmm \newcount\progressbar@tmpresult \newcount\progressbar@numer \newcount\progressbar@denom \newcount\progressbar@barlength \progressbar@framenumberrectangle=\paperwidth \progressbar@titlerectangle=\paperwidth \advance\progressbar@framenumberrectangle by -0.9cm \advance\progressbar@titlerectangle by -1.1cm \progressbar@barlength=115 % (in millimeters) \progressbar@barlengthmm=\progressbar@barlength mm \progressbar@leftbar=\progressbar@titlerectangle \advance\progressbar@leftbar by -\progressbar@barlength mm \def\insertprogressbar{ \ifnum\inserttotalframenumber=1\else \progressbar@numer=\insertframenumber \advance\progressbar@numer by -1 \progressbar@denom=\inserttotalframenumber \advance\progressbar@denom by -1 \progressbar@tmpresult=\progressbar@barlength \multiply\progressbar@tmpresult by \progressbar@numer \divide\progressbar@tmpresult by \progressbar@denom \progressbar@currentbarlength=\progressbar@tmpresult mm \begin{tikzpicture} \shade[top color=bg, bottom color=green!80!fg] (0, 0) rectangle (\paperwidth, 0.6cm); \shade[left color=bg,right color=bg!70!fg] (.5\paperwidth, 0.2cm) rectangle (\paperwidth, 0.22cm); \draw (\progressbar@framenumberrectangle, 0.21cm) node [anchor=mid west, draw=bg!70!fg, fill=bg] {\color{structure.fg!70!bg}\scalebox{0.85}{\insertframenumber/\inserttotalframenumber}}; \draw (\progressbar@titlerectangle, 0.32cm) node [anchor=south east] {\color{bg!70!fg}Teoremas limite fortes para somas de vari\'{a}veis aleat\'{o}rias}; \fill (\progressbar@leftbar, 0.12cm) [fill=bg, rounded corners=0.1cm] rectangle (\progressbar@titlerectangle, 0.3cm); \ifnum\insertframenumber=1\else \shade[left color=progressbar primary.fg!10!bg, right color=progressbar primary.fg!20!bg, rounded corners=0.1cm] (\progressbar@leftbar, 0.12cm) rectangle ++(\progressbar@currentbarlength, 0.2cm); \fi \draw (\progressbar@leftbar, 0.11cm) [draw=bg!70!fg, rounded corners=0.1cm] rectangle ++(\progressbar@barlengthmm, 0.2cm); \end{tikzpicture} \fi } \mode<presentation> \newlength\progressbar@sectionboxwidth \newlength\progressbar@sectionboxheight \newbox\progressbar@sectionbox \newbox\progressbar@sectionboxbox \usesectionheadtemplate {\hfill \setbox\progressbar@sectionbox=\hbox{\insertsectionhead}% \progressbar@sectionboxwidth=\wd\progressbar@sectionbox \advance\progressbar@sectionboxwidth by 4pt \setbox\progressbar@sectionbox=\hbox{\pgfinterruptpicture t \endpgfinterruptpicture}% \progressbar@sectionboxheight=\ht\progressbar@sectionbox \advance\progressbar@sectionboxheight by 4pt \begin{tikzpicture} \useasboundingbox (-0.5\progressbar@sectionboxwidth, 0pt) rectangle (0.5\progressbar@sectionboxwidth, \progressbar@sectionboxheight); \draw[anchor=base] (0pt, 2pt) node {\color{structure.fg!80!bg} \insertsectionhead}; \end{tikzpicture} } {\hfill \setbox\progressbar@sectionbox=\hbox{\pgfinterruptpicture\insertsectionhead\endpgfinterruptpicture}% \progressbar@sectionboxwidth=\wd\progressbar@sectionbox \advance\progressbar@sectionboxwidth by 4pt \setbox\progressbar@sectionboxbox=\hbox{\pgfinterruptpicture t \endpgfinterruptpicture}% \progressbar@sectionboxheight=\ht\progressbar@sectionboxbox \advance\progressbar@sectionboxheight by 4pt } \defbeamertemplate*{headline}{progressbar theme} {% \leavevmode% \begin{beamercolorbox}[wd=\paperwidth,ht=4ex,dp=1.125ex]{section in head/foot}% \insertsectionnavigationhorizontal{\paperwidth}{}{}%\hskip0pt plus1filll}{}% \end{beamercolorbox}% } \defbeamertemplate*{footline}{progressbar theme}{ \begin{beamercolorbox}[wd=\paperwidth,ht=0.6cm,dp=0ex]{progressbar in head/foot}% \insertprogressbar \end{beamercolorbox}% } \defbeamertemplate*{title page}{progressbar theme}{ \pgfdeclarehorizontalshading{separationtitlepagelineshading}{0.5pt}{color(0cm)=(bg); color(0.5\textwidth)=(structure.fg); color(\textwidth)=(bg)} \makeatletter \begin{center} \textbf{\textcolor{structure.fg}\large\inserttitle} \pgfuseshading{separationtitlepagelineshading} \vskip\baselineskip \footnotesize\insertauthor\\[\baselineskip] \ifx\insertinstitute\@empty \else\tiny\insertinstitute\\[\baselineskip]\fi \insertlogo \vskip\baselineskip \pgfuseshading{separationtitlepagelineshading} \vfill \footnotesize \insertdate \end{center} \makeatother } \setbeamertemplate{title page}[mytitlepage] \defbeamertemplate*{background canvas}{progressbar theme}{\pgfuseshading{background shading}}%[action] \AtBeginDocument{% { \usebeamercolor{progressbar primary} \pgfdeclareverticalshading{background shading}{\the\paperwidth}{color(0cm)=(normal text.bg); color(0.8\paperheight)=(normal text.bg); color(0.95\paperheight)=(progressbar primary.bg); color(\paperheight)=(progressbar primary.bg) } } } \mode <all> \makeatother \setbeamertemplate{blocks}[rounded][shadow=true] \setbeamertemplate{navigation symbols}{} \mode<presentation> { \setbeamercovered{transparent} \usefonttheme{serif} \usecolortheme{crane} } \setbeamercovered{dynamic} \setbeamertemplate{items}[circle] \title[]{\vspace*{0.5cm}\parbox{10.0cm}{\centering{\LARGE{\sc Title}}}} \author{\parbox{10.0cm}{\vfill \relax\ifvmode\centering\fi {\normalsize\textbf{Author}} \vfill} \\[10pt] {\normalsize\textit{Filiation}}} \date{{\footnotesize \vspace*{1.0cm} April 2023}} \setbeamercolor{progressbar primary}{bg=green} \setbeamercolor{section in head/foot}{bg=green} \setbeamercolor{structure}{fg=green!50!black} %\setbeamercolor{normal text}{bg=red} \begin{document} \begin{frame}[plain] \maketitle \end{frame} \begin{frame} My first slide \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
683631
317,167
https://tex.stackexchange.com/questions/683578
2
[edited after egreg's answer] I want to store macros and their contents as pairs `macro {macro contents}` in a clist. The macros will be defined elsewhere, by the user or in another package, and will contain either numbers or mathematical formulas. The question is, given only the macro name, e.g. `\mymacro`, how can I see the contents stored in `\mymacro`? In the following example, `\exp_not:f` succeeds when the macro definition contains a leading space, but fails when it doesn't. ``` \documentclass{article} %\usepackage{amsmath} % space before \sin \NewDocumentCommand \myloosemacro {} { \sin(\pi/6) } % no space before \sin \NewDocumentCommand \mytightmacro {} {\sin(\pi/6)} \begin{document} \ExplSyntaxOn \cs_new_protected:Npn \__storemacros:N #1 { \clist_put_right:Nx \l_tmpa_clist { #1 { \exp_not:f #1 } } } \clist_clear:N \l_tmpa_clist \__storemacros:N \myloosemacro \__storemacros:N \mytightmacro \clist_show:N \l_tmpa_clist \ExplSyntaxOff \end{document} ``` This shows that `\l_tmpa_clist` contains the pairs: ``` \myloosemacro {\sin (\pi /6) } \mytightmacro {\protect \sin (\pi /6)} ``` The first is the desired result, the second contains an extra unwanted token -- not present in the definition of the macro. By uncommenting `\usepackage{amsmath}`, things get worse. The second of these becomes `\mytightmacro {\protect \qopname \relax o{sin}(\pi /6)}` with many extra tokens not present at time of definition. As mentioned earlier, the macros will come from other packages or user input, so I have no control over the presence or absence of an initial space.
https://tex.stackexchange.com/users/183147
Storing the unknown contents of a macro in a clist
false
``` The comma list \l_tmpa_clist contains the items (without outer braces): > {\myloosemacro { \sin (\pi /6) }} > {\mytightmacro {\sin (\pi /6)}} > {\myoldmacro {\frac {1}{2}}}. ``` is produced from ``` \documentclass{article} %\usepackage{amsmath} % space before \sin \NewDocumentCommand \myloosemacro {} { \sin(\pi/6) } % no space before \sin \NewDocumentCommand \mytightmacro {} {\sin(\pi/6)} \newcommand\myoldmacro{\frac{1}{2}} \begin{document} \ExplSyntaxOn \cs_new_protected:Npn \__storemacros:N #1 { \ifcsname \exp_after:wN \use_none:n\token_to_str:N#1~ code\endcsname \exp_after:wN\exp_after:wN\exp_after:wN \clist_put_right:Nn \exp_after:wN\exp_after:wN\exp_after:wN \l_tmpa_clist \exp_after:wN\exp_after:wN\exp_after:wN { \exp_after:wN\exp_after:wN\exp_after:wN #1 \exp_after:wN\exp_after:wN \exp_after:wN { \csname \exp_after:wN \use_none:n\token_to_str:N#1~ code\endcsname } } \else \exp_after:wN \clist_put_right:Nn \exp_after:wN \l_tmpa_clist \exp_after:wN { \exp_after:wN #1 \exp_after:wN { #1 } } \fi} \clist_clear:N \l_tmpa_clist \__storemacros:N \myloosemacro \__storemacros:N \mytightmacro \__storemacros:N \myoldmacro \clist_show:N \l_tmpa_clist \ExplSyntaxOff \end{document} ```
1
https://tex.stackexchange.com/users/1090
683640
317,168
https://tex.stackexchange.com/questions/683621
5
I trying to run this code: ``` \begin{tikzpicture} \foreach \n/\p in {b/(1,1),c/(2,1)} \node[draw,circle] (\n) at (\p) {}; \end{tikzpicture} % This is *not* working ``` And I got error. I'm wondering if there is any way to put `\p` instead of `\x/\y`, i.e.: ``` \begin{tikzpicture} \foreach \n/\x/\y in {b/1/1,c/2/1} \node[draw,circle] (\n) at (\x,\y) {}; \end{tikzpicture} % This is working. ``` Thank you!
https://tex.stackexchange.com/users/29476
It is possible to make point as one variable?
false
PGFFor treats a coordinate (i.e. something starting with a `(`) at the beginning of an item specially and everything up to the next `)` is considered to be one element of an item. Thus you can actually do ``` \foreach \p/\n in {(1,1)/b, (2,1)/c, (-10:2)/d} ``` which will allow you do mix “normal” coordinates in the *xy* coordinate system with those in the polar coordinate system or even use names of nodes/coordinates here. In the example below, I'm adding `\n` as the content of the node so that the circles are easier to differentiate. Code ---- ``` \documentclass[tikz]{standalone} \begin{document} \tikz \foreach \p/\n in {(1,1)/b, (2,1)/c, (-10:2)/d} \node[draw, circle] (\n) at \p {\n}; \end{document} ``` Output ------
4
https://tex.stackexchange.com/users/16595
683647
317,170
https://tex.stackexchange.com/questions/33874
17
After switching from the `report` class to the `book` class and starting to use the `fancyhdr` package to control headers/footers, the page numbers in my footers are no longer centered. This is my `fancyhdr` setup: ``` \usepackage{fancyhdr} \fancypagestyle{plain}{% \fancyhf{} % clear all header and footer fields \fancyfoot[C]{\thepage} % except the center \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}} %activate the style: \pagestyle{plain} \usepackage{geometry} \geometry{a4paper} %paper format \geometry{left=27.5mm,right=27.5mm,bottom=27.5mm,top=27.5mm} %margins ``` With this the page numbers are placed off-center. On even pages they are to the right of the center and on odd ones they are to the left of it. What I want is a perfectly centered (with respect to the page) pagenumber in the footer of even and odd pages alike (like it was when I used the `report` class and no `fancyhdr`s).
https://tex.stackexchange.com/users/3800
geometry, fancyhdr: \fancyfoot[C]{\thepage} is not really centered
false
It happens I redefined a geometry because the document requires it. So my headrule, fancyfoot and everything was not working really well. ``` \fancypagestyle{custom-fancy}{% \newgeometry{ top=25mm, left=30mm, right=30mm, bottom=25mm, includeheadfoot } \fancyhf{} \fancyhead[C]{Just a title} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{1pt} \renewcommand{\footrulewidth}{1pt} } ``` As you can see, it overflows and I read in the documentation it was because all the head and foot commands were defined by `\headwidth` > > \headwidth is a length parameter that defines the total width of the headers and footers. > > > But it is weird, because the package documentation says So the most practical solution I found was to redefine this value just adding `\setlength{\headwidth}{\linewidth}` to my fancy style. And voalá. ``` \fancypagestyle{custom-fancy}{% \newgeometry{ top=25mm, left=30mm, right=30mm, bottom=25mm, includeheadfoot } \fancyhf{} \setlength{\headwidth}{\linewidth} \fancyhead[C]{Just a title} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{1pt} \renewcommand{\footrulewidth}{1pt} } ```
0
https://tex.stackexchange.com/users/240558
683651
317,172
https://tex.stackexchange.com/questions/683648
5
I wanted to compile an old document on a new PC, so basically I switched from texlive 2021 to an up-to-date version of texlive 2023 for the compilation of a longer document (includes `glossaries-extra` among many other packages). This lead to the following error, which I have reproduced in a quite small example. But I have no idea what to do about it.... I use `glossaries-extra` for abbreviations (and other stuff). At some point in the document, I want to access only small cap versions, capitalized versions, or all cap versions. The following code uses the three macros `\glsfmtname`, `\Glsfmtname`, and `\GLSfmtname` to do that. The use of the last one gives an error when `\GLSfmtname` tries to use the macro `\GLSxtrtitlename`. But not always, only under two conditions, as far as I can tell: 1) The document class has to be e.g. book or scrbook (I also tried article and didn't observe it). 2) There has to be at least one `\chapter`or `\section` or similar in the document, otherwise it compiles just fine. ``` \documentclass{book} % also for scrbook %\documentclass{article} % NOT for article! (has no chapter, but same behavior for book+\section) \usepackage{glossaries-extra} \newabbreviation{xxx}{asa}{a simple abbreviation} \begin{document} %\chapter{A chapter} \section{A section} % uncomment for error \gls{xxx} \glsfmtname{xxx} \Glsfmtname{xxx} \GLSfmtname{xxx} % <- error: \GLSxtrtitlename undefined \end{document} ``` I get the error message: > > ! Undefined control sequence. > \GLSxtrtitlename > {xxx} > l.14 \GLSfmtname{xxx} > > > ? > > > Did I miss some setting? Or can this be a bug? Thank you for your help!
https://tex.stackexchange.com/users/44467
All-cap abbreviations lead to undefined control sequence when used chapters/sections of books
true
[`glossaries-extra`](https://www.ctan.org/pkg/glossaries-extra) stores certain definitions before `\markboth` and `\markright` to prevent case-changing from being applied in headings when `\glsfmt<field>` is used in `\section` (see "5.3. Entries in Sectioning Titles, Headers, Captions and Contents" for more information). Unfortunately that saving and restoring macros forgets to save a couple of definitions, this is why sectioning commands and `book` rather than `article` are required to demonstrate the bug in a minimal fashion. The issue is in `\glsxtrmarkhook`, which only stores the `\glsxtrtitlename` and `\Glsxtrtitlename` macros (not `\GLSxtrtitlename`) to be restored later by `\glsxtrrestoremarkhook`, instead `\glsxtrrestoremarkhook` ends up trying to restore `\GLSxtrtitlename` by setting it equal to an undefined `\@glsxtr@org@GLSxtrtitlename`. This can be patched (along with `\GLSfmtfirst` which is affected in the same way due to `\GLSxtrtitlefirst` not being saved) with ``` \documentclass{book} \usepackage{glossaries-extra} \newabbreviation{xxx}{asa}{a simple abbreviation} \makeatletter \apptocmd\glsxtrmarkhook{% \let\@glsxtr@org@GLSxtrtitlename\GLSxtrtitlename \let\@glsxtr@org@GLSxtrtitlefirst\GLSxtrtitlefirst }{}{} \makeatother \begin{document} \section{A section} \gls{xxx} \glsfmtname{xxx} \Glsfmtname{xxx} \GLSfmtname{xxx} \GLSfmtfirst{xxx} \end{document} ``` There is also be a related issue with `\GLSfmtlong` and `\GLSfmtlongpl` when used in sectioning commands (where the User Guide suggests they would be supported), as `\GLSxtrtitlelong` and `\GLSxtrtitlelongpl` are neither saved by `\glsxtrmarkhook` nor restored by `\glsxtrrestoremarkhook`. This can be patched as ``` \documentclass{book} \usepackage{glossaries-extra} \newabbreviation{xxx}{asa}{a simple abbreviation} \makeatletter \apptocmd\glsxtrmarkhook{% \let\@glsxtr@org@GLSxtrtitlelong\GLSxtrtitlelong \let\@glsxtr@org@GLSxtrtitlelongpl\GLSxtrtitlelongpl \let\GLSxtrtitlelong\GLSxtrheadlong \let\GLSxtrtitlelongpl\GLSxtrheadlongpl }{}{} \apptocmd\glsxtrrestoremarkhook{% \let\GLSxtrtitlelong\@glsxtr@org@GLSxtrtitlelong \let\GLSxtrtitlelongpl\@glsxtr@org@GLSxtrtitlelongpl }{}{} \makeatother \begin{document} \section{A section \GLSfmtlong{xxx}} \gls{xxx} \GLSfmtlong{xxx} \end{document} ```
5
https://tex.stackexchange.com/users/106162
683652
317,173
https://tex.stackexchange.com/questions/683658
4
I am using article class. There are no chapters in the document. I want the section numbers to read as 1.1, 1.2, .... and then 2.1, 2.2, ..., and then 3.1, 3.2, ... I have tried the code below ``` \documentclass{article} \begin{document} \renewcommand{\thesection}{1.\arabic{section}} % one block of sections \section{ section one} \section{second} \section{third} \renewcommand{\thesection}{2.\arabic{section}} % another block of sections \section{First section} \section{Second} \end{document} ``` The code above gives 1.1, 1.2, 1.3 and then 2.4, 2.5. What I want is 1.1, 1.2, 1.3 and then 2.1, 2.2. Is there any way to do this? Thank you in advance.
https://tex.stackexchange.com/users/295418
Formatting of displayed section numbers
true
I think that what you want is to define a counter called, say, `block`, and "tie" the `section` counter (that's the counter that's stepped each time the `\section` macro is executed) to the `block` counter. By "tie", I mean that (a) the `section` counter is reset to 0 each time the `block` counter is stepped and (b) the `section` number is shown as being subordinated to the `block` number. ``` \documentclass{article} \newcounter{block} \counterwithin{section}{block} % tie 'section' counter to 'block' counter \begin{document} \stepcounter{block} % one block of sections \section{ section one} \section{second} \section{third} \stepcounter{block} % another block of sections \section{First section} \section{Second} \end{document} ``` --- That said, I'd also like to suggest that you start using `\subsection` commands instead of `\section` commands, as the `subsection` counter is tied to the `section` counter by default. ``` \documentclass{article} \begin{document} \stepcounter{section} % first block \subsection{first} \subsection{second} \subsection{third} \stepcounter{section} % another block \subsection{First} \subsection{Second} \end{document} ```
4
https://tex.stackexchange.com/users/5001
683659
317,175
https://tex.stackexchange.com/questions/682572
5
I don't get it. `Gill Sans MT` supports Small Caps without any issue in Word and Powerpoint. Font recognition apps event identify it. And yet, there is no way I can get them. ``` \documentclass{article} \usepackage{fontspec} \setmainfont{Gill Sans MT}[ SmallCapsFeatures={Letters=SmallCaps}, SmallCapsFont={*}, ] \begin{document} \textsc{Small Caps.} \end{document} ```
https://tex.stackexchange.com/users/262813
Small Caps with Gill Sans MT
false
Just for comparison, what we can do in OpTeX: ``` \fontfam[dejavu] \def\fakecaps#1{\def\tmp{#1}\replstring\tmp{ }{{ }}% {\ea\let \ea\fupper \the\font \uccode`'=`' \setfontsize{mag.8}\setff{+upper;embolden=1.1}\setwordspace{1.25}\fontsel \ea\foreach\tmp\do{\ifnum\uccode`##1=`##1{\fupper##1}\else ##1\fi}}} Normal text. \fakecaps{Aren't it. Šmudla, že.} \bye ``` See also [OpTeX trick 0107](https://petr.olsak.net/optex/optex-tricks.html#fakecaps).
4
https://tex.stackexchange.com/users/51799
683662
317,176
https://tex.stackexchange.com/questions/683602
0
Is there a way to `\footfullcite` just the first time I cite a paper, and then point to that note in subsequent footnotes? Something like "See note X", I don't want to do it [manually](https://tex.stackexchange.com/q/167380/101651). I looked at [Biblatex "see note" not working with shorthand](https://tex.stackexchange.com/questions/235694/biblatex-see-note-not-working-with-shorthand), but it gives me this error: ``` Runaway argument? {\printtext [bibhyperlink]{\printfield {shorthand}} \setunit *{\addcomma \ETC. ! File ended while scanning use of \@argdef. ``` And I'd like to have just "See note", not the `shorthand`.
https://tex.stackexchange.com/users/286097
Automatically refer to an already cited paper with "See note X"
true
My answer is based on [my previous one](https://tex.stackexchange.com/a/683340/101651) and a [post by domwass](https://tex.stackexchange.com/a/38128/101651). With `footfullcite:save` you automatically set the label. With `footfullcite:seenote` you print the reference to it. ``` \begin{filecontents}[overwrite]{uni_bib.bib} @article{author, author = "A. Author", title = "A Title", journal = "A Journal", volume = "1", number = "2", year = "2023" } @article{buthor, author = "B. Buthor", title = "B Title", journal = "B Journal", volume = "3", number = "4", year = "2022" } @article{cuthor, author = "C. Cuthor", title = "C Title", journal = "C Journal", volume = "4", number = "5", year = "2021" } \end{filecontents} \documentclass[12pt]{report} \usepackage[T1]{fontenc} \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry} \usepackage[bottom]{footmisc} \usepackage[inline]{enumitem} \usepackage{array} \usepackage{booktabs} \usepackage[flushleft]{threeparttable} \usepackage{amsmath} \usepackage{svg} \usepackage{graphicx} \graphicspath{ {images/} } \usepackage{tabularx} \usepackage{blindtext} \usepackage[final]{microtype} \usepackage{setspace} \onehalfspacing \usepackage[ bibencoding=utf-8, natbib=true, style=authoryear-ibid, backend=biber, url=false, doi=false, isbn=false, eprint=false, ]{biblatex} \DefineBibliographyStrings{english}{% seenote = {See note\addspace} } \makeatletter % from https://tex.stackexchange.com/a/38128/101651 \newbibmacro*{footfullcite:save}{% \savefield{entrykey}{\cbx@lastkey}% \csxdef{cbx@\thefield{entrykey}}{\the\value{instcount}}% \label{cbx@\the\value{instcount}}} % modified from https://tex.stackexchange.com/a/38128/101651 \newbibmacro*{footfullcite:seenote}{% \ifnameundef{labelname} {\printfield{label}} {% \bibstring{seenote}\addnbspace% \ref{cbx@\csuse{cbx@\thefield{entrykey}}}% }% } \makeatother \DeclareCiteCommand{\footfullcite}[\mkbibfootnote] {\usebibmacro{prenote}} {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage} {\usebibmacro{footfullcite:seenote}} {\usebibmacro{footfullcite:save}\usedriver {\DeclareNameAlias{sortname}{default}} {\thefield{entrytype}}}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand{\cite} {\citetrackerfalse\usebibmacro{prenote}} {\usebibmacro{cite}} {\multicitedelim} {\usebibmacro{postnote}\citetrackertrue} \addbibresource{uni_bib.bib} \usepackage{hyperref} \nocite{*} \begin{document} cite: \cite{author} cite again: \cite{author} foot full cite: \footfullcite{buthor} foot full cite again: \footfullcite{buthor} cite: \cite{cuthor} foot full cite first: \footfullcite{cuthor} foot full cite second: \footfullcite{cuthor} cite: \cite{author} foot full cite third: \footfullcite{cuthor} foot full cite fouth: \footfullcite{cuthor} \newpage cite: \cite{author} cite again: \cite{author} foot full cite: \footfullcite{buthor} foot full cite again: \footfullcite{buthor} \printbibliography \end{document} ``` First page: Second page: Bibliography: P.S. = As is, your question is unanswerable. I was able to do it only because I had answered your previous one. You should learn to do an MWE (minimal working example): [How to write a MWEB (Minimal working example with Bibliography)?](https://tex.meta.stackexchange.com/questions/4407/how-to-write-a-mweb-minimal-working-example-with-bibliography).
1
https://tex.stackexchange.com/users/101651
683665
317,178
https://tex.stackexchange.com/questions/682050
3
I have an Overleaf file which includes tables I've inserted dotted lines into using \dotfill. I have changed the Tex Live compiler to the 2020 version, and am exporting the zipped source using the Overleaf "submit" button. The minimal working example at the bottom of this question compiles correctly for me in Overleaf, but fails when I submit it to arXiv, with the following error: > > ! Undefined control sequence. > > \@sharp ->\dotfill > > > l.13 \multicolumn{3}{c}{\dotfill} > > \\ > > ? > > ! Emergency stop. > > \@sharp ->\dotfill > > > Any idea how to fix this? Here is the MWE: ``` \documentclass{article} \usepackage{nicematrix,booktabs} \begin{document} \begin{table}[] \centering \setlength\tabcolsep{2.5pt} % \footnotesize \begin{NiceTabular}{lcc} \toprule Some & Content & Here\\[-4pt] \multicolumn{3}{c}{\dotfill}\\ More & Content & Here \\ \bottomrule \end{NiceTabular} \caption{A table with dotted lines } \label{tab:multi} \end{table} \end{document} ```
https://tex.stackexchange.com/users/294530
arXiv Submission Error with \dotfill
false
This bug has been corrected in the latest version of `nicematrix` (v 6.18 of 2023-04-19). ``` \documentclass{article} \usepackage{nicematrix,booktabs} \begin{document} \begin{table}[] \centering \setlength\tabcolsep{2.5pt} \begin{NiceTabular}{lcc} \toprule Some & Content & Here\\[-4pt] \multicolumn{3}{c}{\dotfill}\\ More & Content & Here \\ \bottomrule \end{NiceTabular} \caption{A table with dotted lines } \label{tab:multi} \end{table} \end{document} ``` Of course, with this example, there is no point using `{NiceTabular}`. The classical `{tabular}` will do the job. It's only an example.
3
https://tex.stackexchange.com/users/163000
683668
317,181
https://tex.stackexchange.com/questions/683316
1
i can't use Biber from my work computer because the biber.exe, although installed in my programs directory, gets started in users/myname/appdata/local/temp folder. Because of that, it gets blocked by my company. I have only two options for making it work: 1. Get Biber to stop working from this temp folder. When it would get executed from its program directory, where it is installed, it would probably work fine 2. Get a signature for biber.exe. A signature in that sense, that the provider of LaTeX signates this package like: This biber.exe is a legit biber.exe and not some malware disguised as such. I haven't found anything about the existence of such signatures for any LaTeX packages, I guess there are probably none, because there is no dedicated company behind LaTeX but rather the whole LaTeX community. So is there any way to stop biber from starting its exe in this temp folder? Thanks in advance!
https://tex.stackexchange.com/users/295322
Any way to avoid execution of biber.exe from temp directory? OR is there any way to get a signature for biber.exe?
false
`biber` isn't a normal program in some respects. The `biber.exe`, when executed for the first time, unpacks itself to a temp location which is OS dependent and then runs itself from the temp location, which is the behaviour you are seeing. You can customise this temp location by setting an environment variable called `PAR_GLOBAL_TEMP` in your windows environment (just search for information on setting user environment variables for Windows - there will be thousands of results for that). Once you have this environment variable set, `biber` will unpack to the location you set with the variable and will run from there. There will certainly be some location you can use for this that is not restricted by your IT department (perhaps a folder on your Desktop?)
1
https://tex.stackexchange.com/users/1657
683671
317,182
https://tex.stackexchange.com/questions/683654
4
I'm trying to make a simple queue using the `etoolbox` package by making my own custom macros `\listfront` and `\listfrontpop`. This is my very first time using TeX code to this level, so my understanding is tenuous at best. Here is what I have so far: ``` \documentclass{minimal} \usepackage{etoolbox} \newcommand{\listfront}[1]{% \renewcommand{\do}[1]{##1\listbreak}% \dolistloop{#1}% } \newcommand{\listpopfront}[1]{% \def\templistfront{\listfront{#1}}% \listgremove{#1}{\templistfront}% } \begin{document} \newcommand{\mylist}{}% \listgadd{\mylist}{potty}% \listgadd{\mylist}{sam}% \listfront{\mylist}% potty <- as expected \listpopfront{\mylist}% potty should be removed \listfront{\mylist}% potty <- expected sam! \end{document} ``` I expect to get `pottysam`, but get `pottypotty` instead. I *suspect* that the issue lies with the line ``` ... \begin{document} ... \listpopfront{\mylist}% ... \end{document} ``` because if I replace it with `\listgremove{\mylist}{potty}`, I do get `pottysam`. However, if I do something like `\def\potty{potty}` and then do `\listgremove{\mylist}{\potty}`, I get `pottypotty` once again. How do I get `\listpopfront` to work? What is going wrong? So far, my solution is to have `\listpopfront` defined as ``` \newcommand{\listpopfront}[1]{% \renewcommand{\do}[1]{% \listgremove{#1}{##1}\listbreak% }% \dolistloop{#1}% } ``` which solves my problem, but is incredibly inelegant.
https://tex.stackexchange.com/users/212919
Problem with macro expansion when making a custom queue container
true
Here is as solution which uses only the documentation of etoolbox and none of its internals, and develops from your MWE. I allowed myself usage of `\def` as you already used it. ``` \documentclass{article} \usepackage{etoolbox} \newcommand{\listfront}[1]{% \renewcommand{\do}[1]{##1\listbreak}% \dolistloop{#1}% } \newcommand{\listpopfront}[1]{% \begingroup \long\def\do##1{\long\def\templistfront{##1}\listbreak}% \dolistloop{#1}% \def\x{\endgroup\listgremove{#1}}% \expandafter\x\expandafter{\templistfront}% } \begin{document} \newcommand{\mylist}{}% \listgadd{\mylist}{potty}% \listgadd{\mylist}{sam}% \listfront{\mylist}% potty <- as expected \listpopfront{\mylist}% potty should be removed \listfront{\mylist}% sam <- as expected \end{document} ``` I am surprised etoolbox does not provided a "pop" for that purpose, because the usage of `\listgremove` looked to me potentially very inefficient but I checked a macro trace and I see it is based on using `\ifinlist` which uses delimited macros, not an item by item check, and besides it only removes the first found item (the documentation is not clear on that but I conclude from checking expansion). Note that LaTeX kernel already has built-in tools `\@car`, `\@cdr` and `\@tfor` (not to mention the LaTeX3 now incorporated layer...) which you could use to build your own, but I guess it is logical to use `etoolbox` if you plan on invoking its `\dolistloop`. Here is now code which uses the internal etoolbox structure. Fortunately, it is very simple and straightforward, but should it change in future, this code will be broken. ``` \documentclass{article} \usepackage{etoolbox} % this command is only good for typesetting, % it does not work expandably \newcommand{\listfront}[1]{% \renewcommand{\do}[1]{##1\listbreak}% \dolistloop{#1}% } \makeatletter \begingroup % definition of a "popfront" as per OP command name % it removes the first item globally \catcode`\|=3 % internal separator used by etoolbox \gdef\listpopfront#1{% \expandafter\listpopfront@i#1\@nil{#1}% } \long\gdef\listpopfront@i#1|#2\@nil#3{\long\gdef#3{#2}} % we also define for the fun an expandable \listexpandablefront % now that we are using internals of etoolbox \gdef\listexpandablefront#1{% \expandafter\listexpandablefront@i#1\@nil } \long\gdef\listexpandablefront@i#1|#2\@nil{#1} \endgroup \makeatother \begin{document} \newcommand{\mylist}{}% \listgadd{\mylist}{potty}% \listgadd{\mylist}{sam}% % \show\mylist \listfront{\mylist}% potty <- as expected \listpopfront{\mylist}% potty should be removed % \show\mylist \listfront{\mylist}% sam <- as expected \edef\foo{\listexpandablefront{\mylist}} \texttt{\meaning\foo} \end{document} ```
1
https://tex.stackexchange.com/users/293669
683672
317,183
https://tex.stackexchange.com/questions/679826
1
Its been a while that Ive been searching this issue here. Almost all the posts are old or cant go with my problem. The followings are my latex command that I need to be loaded: ``` \documentclass[12pt, a4 paper,twocolumn]{article} \usepackage[T1]{fontenc} \usepackage{times} \usepackage{amsmath,amssymb} \usepackage{newtxtext,newtxmath} \usepackage{graphicx} \usepackage{caption, subcaption} \usepackage[margin=2cm]{geometry} \usepackage{booktabs} \usepackage[english]{babel} \usepackage{authblk} \usepackage[colorlinks,allcolors=blue]{hyperref} \usepackage[authoryear,round]{natbib} \bibliographystyle{abbrvnat} \title{this is example} \date{} \begin{document} \twocolumn[ \maketitle \begin{abstract} here is abstract. \noindent \textbf{Keywords:} classics. \end{abstract} ] \section{Conclusion} Here is the citation \citep{Thomas}. \bibliography{my bib file} \end{document} ``` Now how do I use APA7 referencing style? I also want to cite with author name and year, say (Thomas, 2019). Any suggestion is appreciated.
https://tex.stackexchange.com/users/nan
How to use APA7 referencing?
false
To transition from your current setup for creating bibliographies to one that implements the APA7 formatting guidelines, you need to * replace ``` \usepackage[authoryear,round]{natbib} \bibliographystyle{abbrvnat} ``` with ``` \usepackage[style=apa]{biblatex} \addbibresource{mybibfile.bib} ``` where `mybibfile.bib` is the name of your bib file. * replace ``` \bibliography{mybibfile} ``` with ``` \printbibliography ``` * start using `\textcite` and `\parencite`, the `biblatex` equivalents of `natbib`'s `\citet` and `\citep` commands * start using `biber` instead of `bibtex` to create the formatted bibliography Be sure to run a full recompile cycle -- latex, biber, and latex -- after making these changes. Oh, and don't use the `times` package -- it's obsolete. In fact, since you also load the `newtxtext` and `newtxmath` packages, which provide Times Roman text and math fonts, there's no discernible purpose in loading the `times` package (even if it weren't obsolete). ``` \documentclass[12pt,a4paper,twocolumn]{article} % Create a bib file "on the fly": \begin{filecontents}[overwrite]{mybibfile.bib} @misc{Thomas, author = "John Thomas", title = "Thoughts", year = 3001, } \end{filecontents} \usepackage[T1]{fontenc} %%\usepackage{times} % 'times' package is obsolete \usepackage{amsmath,amssymb} \usepackage{newtxtext,newtxmath} % Times Roman text and math fonts \usepackage{graphicx} \usepackage{%caption, % 'caption' is loaded automatically by 'subcaption' subcaption} \usepackage[margin=2cm]{geometry} \usepackage{booktabs} \usepackage[english]{babel} \usepackage{authblk} \usepackage[colorlinks,allcolors=blue]{hyperref} %%\usepackage[authoryear,round]{natbib} %%\bibliographystyle{abbrvnat} \usepackage[style=apa]{biblatex} % 'backend=biber' is the default \addbibresource{mybibfile.bib} \begin{document} \noindent ``Textual'' citation call-out: \textcite{Thomas}. \noindent ``Parenthetical'' citation call-out: \parencite{Thomas}. %%\bibliography{mybibfile} \printbibliography \end{document} ```
1
https://tex.stackexchange.com/users/5001
683673
317,184
https://tex.stackexchange.com/questions/682480
0
I want to add a textual citation for three papers, two of which are by the same authors but in different years. I am using these codes in my preamble ``` \usepackage[style=apa,backend=biber]{biblatex} \DeclareCiteCommand{\textcite} {\boolfalse{cbx:parens}} {\usebibmacro{citeindex}% \printtext[bibhyperref]{\usebibmacro{textcite}}} {\ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}% \multicitedelim} {\usebibmacro{textcite:postnote}} ``` This is the code for printing the references section ``` \printbibliography[heading=bibnumbered] ``` This is the code for inserting the in-text citation ``` \textcite{azar2019measuring, azar2020concentration, azar2022labor} ``` But the output is "Azar et al. (2019); 2022; Azar et al. (2020)" Why is the 2022 paper listed by itself without parentheses? I want the output to be "Azar et al. (2019;2022); Azar et al. (2020)" Any help?
https://tex.stackexchange.com/users/293218
\textcite for same authors different years - Biblatex
false
Al alchemist suggested in their comment, the standard `\textcite` works, I only modified the delimiters. ``` \begin{filecontents}[overwrite]{bib.bib} @inproceedings{azar2019measuring, title={Measuring labor market power two ways}, author={Azar, Jos{\'e} and Marinescu, Ioana and Steinbaum, Marshall}, booktitle={AEA Papers and Proceedings}, volume={109}, pages={317--21}, year={2019} } @article{azar2020concentration, title={Concentration in US labor markets: Evidence from online vacancy data}, author={Azar, Jos{\'e} and Marinescu, Ioana and Steinbaum, Marshall and Taska, Bledi}, journal={Labour Economics}, volume={66}, pages={101886}, year={2020}, publisher={Elsevier} } @article{azar2022labor, title={Labor market concentration}, author={Azar, Jos{\'e} and Marinescu, Ioana and Steinbaum, Marshall}, journal={Journal of Human Resources}, volume={57}, number={S}, pages={S167--S199}, year={2022}, publisher={University of Wisconsin Press} } \end{filecontents} \documentclass{article} \usepackage[style=apa,backend=biber]{biblatex} \renewcommand*{\textcitedelim}{\addsemicolon\addspace} \renewcommand*{\compcitedelim}{\addsemicolon\addspace} \addbibresource{bib.bib} \begin{document} \textcite{azar2019measuring, azar2020concentration, azar2022labor} \printbibliography[heading=bibnumbered] \end{document} ``` P.S. = I downloaded the bibitems from Google Scholar, I don't know if they are the ones you're using. Next time please add a complete MWEB: [How to write a MWEB (Minimal working example with Bibliography)?](https://tex.meta.stackexchange.com/questions/4407/how-to-write-a-mweb-minimal-working-example-with-bibliography)
1
https://tex.stackexchange.com/users/101651
683679
317,186
https://tex.stackexchange.com/questions/683654
4
I'm trying to make a simple queue using the `etoolbox` package by making my own custom macros `\listfront` and `\listfrontpop`. This is my very first time using TeX code to this level, so my understanding is tenuous at best. Here is what I have so far: ``` \documentclass{minimal} \usepackage{etoolbox} \newcommand{\listfront}[1]{% \renewcommand{\do}[1]{##1\listbreak}% \dolistloop{#1}% } \newcommand{\listpopfront}[1]{% \def\templistfront{\listfront{#1}}% \listgremove{#1}{\templistfront}% } \begin{document} \newcommand{\mylist}{}% \listgadd{\mylist}{potty}% \listgadd{\mylist}{sam}% \listfront{\mylist}% potty <- as expected \listpopfront{\mylist}% potty should be removed \listfront{\mylist}% potty <- expected sam! \end{document} ``` I expect to get `pottysam`, but get `pottypotty` instead. I *suspect* that the issue lies with the line ``` ... \begin{document} ... \listpopfront{\mylist}% ... \end{document} ``` because if I replace it with `\listgremove{\mylist}{potty}`, I do get `pottysam`. However, if I do something like `\def\potty{potty}` and then do `\listgremove{\mylist}{\potty}`, I get `pottypotty` once again. How do I get `\listpopfront` to work? What is going wrong? So far, my solution is to have `\listpopfront` defined as ``` \newcommand{\listpopfront}[1]{% \renewcommand{\do}[1]{% \listgremove{#1}{##1}\listbreak% }% \dolistloop{#1}% } ``` which solves my problem, but is incredibly inelegant.
https://tex.stackexchange.com/users/212919
Problem with macro expansion when making a custom queue container
false
You seem to want FIFO lists. I'd use `expl3` rather than `etoolbox`; note that list names are without a backslash, which avoids the problem of choosing command names. ``` \documentclass{article} \ExplSyntaxOn %%% the user level commands % declare a list and optionally add items \NewDocumentCommand{\declarelist}{mo} { \daedsidog_list_declare:n { #1 } \IfValueT{#2} { \daedsidog_list_gadd:nn { #1 } { #2 } } } % add items to a list \NewDocumentCommand{\listgadd}{mm} { \daedsidog_list_gadd:nn { #1 } { #2 } } % deliver the front item (this is expandable) \NewExpandableDocumentCommand{\listfront}{m} { \daedsidog_list_front:n { #1 } } % pop the front item \NewDocumentCommand{\listpopfront}{m} { \daedsidog_list_popfront:n { #1 } } %%% the internal functions % declare a list \cs_new_protected:Nn \daedsidog_list_declare:n { \seq_new:c { g__daedsidog_list_#1_seq } } % add items to a list \cs_new_protected:Nn \daedsidog_list_gadd:nn { \clist_map_inline:nn { #2 } { \seq_gput_right:cn { g__daedsidog_list_#1_seq } { ##1 } } } % deliver the front item \cs_new:Nn \daedsidog_list_front:n { \seq_item:cn { g__daedsidog_list_#1_seq } { 1 } } % pop the front item \cs_new_protected:Nn \daedsidog_list_popfront:n { \seq_gpop_left:cN { g__daedsidog_list_#1_seq } \l_tmpa_tl } \ExplSyntaxOff \declarelist{mylist}[potty,sam] % could also be %\declarelist{mylist} %\listgadd{potty,sam} % or %\declarelist{mylist} %\listgadd{potty} %\listgadd{sam} \begin{document} \listfront{mylist}% potty <- as expected \listpopfront{mylist}% potty should be removed \listfront{mylist}% potty <- expected sam! \end{document} ``` You can add more than one item at a time (also when declaring a list).
1
https://tex.stackexchange.com/users/4427
683689
317,189
https://tex.stackexchange.com/questions/683677
1
I got a question regarding the usage of the `datetime2` package. I want to set some due date and to define a certain date such as `\paperdate` which is either `\today` when it's before the due date or the due date itself. I tried this based on an example from the package's documentation: ``` \documentclass{article} \usepackage[useregional, calc]{datetime2} \begin{document} \DTMsavedate{duedate}{2023-04-30} \DTMifdate {\today} {at most= \DTMfetchyear{duedate}-\DTMfetchmonth{duedate}-\DTMfetchday{duedate}} {\newcommand\paperdate{\today}}{\newcommand\paperdate{\DTMusedate{duedate}}} \end{document} ``` However, this code gives me the following error: `Package datetime2-calc Error: Unknown date `2023-04-23'.` Would anyone know a workaround? Thanks in advance for your help!
https://tex.stackexchange.com/users/255252
Define a `\DTMifdate` conditional using the `datetime2` package and `\today`
false
I found a solution myself! Based on the discussion [How to calculate previous month from \today using datetime2?](https://tex.stackexchange.com/questions/380370/how-to-calculate-previous-month-from-today-using-datetime2) : ``` \usepackage[useregional, calc]{datetime2} \begin{document} \DTMsavenow{today} \DTMsavedate{duedate}{2023-04-30} \DTMifdate {today} {at most= \DTMfetchyear{duedate}-\DTMfetchmonth{duedate}-\DTMfetchday{duedate}} {\newcommand\paperdate{\today}}{\newcommand\paperdate{\DTMusedate{duedate}}} \end{document} ```
1
https://tex.stackexchange.com/users/255252
683695
317,190
https://tex.stackexchange.com/questions/683688
6
I have just discovered with surprise that if a TeX file has a tilde `~` in its name, `xelatex` and `pdflatex` refuse to compile it: ``` $ cat te\~st.tex \documentclass{article} \begin{document} Hello. \end{document} ``` ``` $ pdflatex te\~st.tex This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode ! I can't find file `te'. <to be read again> \protect <*> te~ st.tex (Press Enter to retry, or Control-D to exit) Please type another input file name: ``` Meanwhile, this file compiles ok, even though the tilde is not escaped in any way: ``` % test.tex \documentclass{article} \begin{document} \input{hell~o.tex} \end{document} ``` Is this a bug? Is there an *easy* way to compile files with tilde in the name? I wanted to use tilde for readability, like in `arithmetic-1~natural-numbers.tex`. I am using TeXLive 2021 on Linux Mint 21.1.
https://tex.stackexchange.com/users/37291
How to compile a file with tilde (`~`) in the name?
true
Calling ``` pdflatex name ``` is the same as calling `pdflatex` and specifying `name` at the `**` prompt. The file name is passed unchanged to the TeX interpreter (`~` will not undergo shell expansion to the home directory name) and the usual rules of TeX will apply. Specifying tokens at the `**` prompt is (almost) the same as doing ``` \input name ``` (the primitive `\input`) and TeX follows its rules, namely to do full token expansion until finding something that's not a character. In your case, `~` expands to ``` \nobreakspace{} ``` and then ``` \protect\nobreakspace•{} ``` (where `•` stands for a trailing space in the name). Since at this time `\protect` is `\relax`, the file name is determined to be `te`. You need to protect the `~` from expansion at the TeX level, which can be done in several ways: ``` pdflatex te\\string~st pdflatex 'te\string~st' pdflatex '\input{\detokenize{te~st}}' pdflatex '\input{\unexpanded{te~st}}' ``` You might want to write a shell script for running `pdflatex` (or other engine) with “strange” file names.
8
https://tex.stackexchange.com/users/4427
683697
317,191
https://tex.stackexchange.com/questions/195152
8
I recently edited an existing document to create a new one from it (that is: I copied the whole folder to a new location and started from there). The early document had a lot of figures, but not all of them were used in the new version. Now I have a lot of unused files (jpg, pdf, png) under the `/fig` which I want to get rid of, because they are not called by any `\includegraphics` command. Is there a way to list used or unused files? (I'm not referring to auxiliary files, I'm fine with those.)
https://tex.stackexchange.com/users/177
How to clean unused files?
false
A bit Late to the party, but here is another Python approach. Workflow for this CLI application: * call `python3 move_unused_figures_from_latex_project.py` from latex project root directory * indicate in which folder the figures are located * specify a folder name to place unused figures in * specify per image if you really want to move it Note: To check if a figure is used in the latex project a function `string_found_in_tex_files` is called, it checks if there is any occurrence of the file path in a .tex file in the project. As a result, commented figures are not moved, just as any occurrence of the file path that is unrelated to the figure. move\_unused\_figures\_from\_latex\_project.py: ``` import shutil import os # NOTE: main function is down below def ask_existing_folder_name(default_folder_name=None) -> str: """ ask user for a folder name. """ if default_folder_name is None: folder_name = input('Please enter an existing directory name:') else: folder_name = input( f'Please enter an existing directory (default = {default_folder_name}):') if folder_name in ['', 'y', 'Y']: folder_name = default_folder_name if os.path.isdir(folder_name): return folder_name print('That folder does not exist!') return ask_existing_folder_name(default_folder_name=default_folder_name) def ask_new_folder_name(default_folder_name=None) -> str: """ ask user to input a new folder name. """ if default_folder_name is None: folder_name = input('Please enter a new directory name:') else: folder_name = input(f'Please enter a new directory name (default = {default_folder_name}):') if folder_name in ['', 'y', 'Y']: folder_name = default_folder_name if not os.path.isdir(folder_name): return folder_name print('That folder does already exist!') return ask_new_folder_name(default_folder_name=default_folder_name) def string_found_in_tex_files(string_to_search: str) -> bool: """ return True if there exist a .tex file in the current directory or any subdirectory that contains string_to_search. """ print(f"search string {string_to_search}") for root, _, files in os.walk("."): for filename in files: filepath = os.path.join(root, filename) if filepath.endswith('.tex') and os.path.isfile(filepath): with open(filepath) as file: if string_to_search in file.read(): return True return False def main(): """ interactive CLI that moves unused figures from latex project. """ print("welcome, we're going to remove all unused figures from this latex project") print('NOTE: make sure to run this function from latex project root\n') figures_folder_name = ask_existing_folder_name(default_folder_name='figures/') print('unused figures are moved to a new directory') unused_figures_folder_name = ask_new_folder_name(default_folder_name='unused_figures/') os.mkdir(unused_figures_folder_name) figure_file_paths = [] extensions = (".pdf", ".jpg", ".png", ".eps") # collect all relative paths to figures for root, _, files in os.walk(figures_folder_name): for filename in files: if filename.endswith(extensions): file_path = os.path.join(root, filename) figure_file_paths.append(file_path) only_used_figures_detected = True for file_path in figure_file_paths: # take away the extension (file_path_without_extension, _) = os.path.splitext(file_path) if not string_found_in_tex_files(file_path_without_extension): only_used_figures_detected = False answer = input(f'{file_path} is unused,'\ f'do you want to move it to {unused_figures_folder_name} (Y/n)?') if answer in ['n', 'N', 'no']: continue # move the file shutil.move(file_path, unused_figures_folder_name) print(f'{file_path} moved to {unused_figures_folder_name}') if only_used_figures_detected: print('all figures are used :)') if __name__ == '__main__': main() ```
1
https://tex.stackexchange.com/users/127899
683701
317,193
https://tex.stackexchange.com/questions/683712
1
I've got 2 elements in my document that I like to combine. First a box that wraps around a whole text line: ``` \usepackage[most]{tcolorbox} \newtcolorbox{frameT}{enhanced, colframe=black,colback=purple!2.5, boxrule=0.2pt,arc=0pt,outer arc=0pt,frame hidden} % in example \begin{frameT} **Text** \end{frameT} ``` And thanks to some neat packages a fancy title: ``` \usepackage[calcwidth,explicit]{titlesec} \usepackage[outline]{contour} \usepackage[table]{xcolor} \definecolor{dblue}{rgb}{0.2, 0.2, 0.6} \titleformat{\section}[block]{\huge\color{dblue!60}}{{{\thesection.\kern0.20em}}}{-0.15em}{\centering {\contour{npink!40}{\ul{#1}}}} % in example \section{fancy title} ``` What's is my mind is to, well, combine those two, thus having a box wrapping around a fancy title. I had some attempts, but none worked properly.
https://tex.stackexchange.com/users/216987
titelsec + tcolorbox: How to put a box around the whole title line?
true
If you want to apply the tcolorbox just to the section title: ``` \documentclass{article} \usepackage[table]{xcolor} \usepackage[most]{tcolorbox} \usepackage{titlesec} \usepackage[outline]{contour} \newtcbox{\frameT}{ on line, enhanced, coltext=dblue!60, colframe=black, colback=purple, boxrule=0.2pt, arc=0pt, outer arc=0pt, frame hidden, } \definecolor{dblue}{rgb}{0.2, 0.2, 0.6} \newcommand{\frametitle}[1]{\frameT{\contour{pink!40}{#1}}} \titleformat{\section}[block] {\huge\color{dblue!60}} {\thesection. } {0pt} {\frametitle} \begin{document} \section{Test} \end{document} ``` I used `purple` without mixing just to produce an explanatory picture and removed underlining that has no real place in typography. Personally, I'd use nothing of this kind. --- ### Edit after comments ``` \documentclass{article} \usepackage[table]{xcolor} \usepackage[most]{tcolorbox} \usepackage{titlesec} \usepackage[outline]{contour} \usepackage{showframe} \newtcolorbox{frameT}{ enhanced, coltext=dblue!60, colframe=black, colback=purple, arc=0pt, outer arc=0pt, frame hidden, left skip=-1.4pt, right skip=-1.4pt, } \definecolor{dblue}{rgb}{0.2, 0.2, 0.6} \newcommand{\frametitle}[2]{% \vbox{% \kern-\lineskip \kern-0.4pt \hbox{\begin{frameT}\huge#1\contour{pink!40}{#2}\end{frameT}}% }% } \titleformat{name=\section}[block] {} {} {0pt} {\frametitle{\thesection.\ }} \titleformat{name=\section,numberless}[block] {} {} {0pt} {\frametitle{}} \begin{document} \section*{Introduction} Filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text \section{Test} Filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text \section{Test} Filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text \end{document} ``` Take or leave. I don't like the code too much, but the interactions between `tcolorbox` and `titlesec` are a bit mysterious. Of course you'll remove `showframe`.
1
https://tex.stackexchange.com/users/4427
683715
317,199
https://tex.stackexchange.com/questions/4047
25
I'd like to to generate some metadata in the log file that I can copy to another application. But the log file is wrapped to 80 columns and I end up with newlines embedded in what I'm putting there. Is there a way around this? The two ways I know to write to the log file are `\message` and `\immediate\write17`. But both of these have the same effect. Is `\write17` a special filehandle that only writes wrapped text? My workaround so far is to write to the auxiliary file between `\iffalse`...`\fi`, but I know that's not what the aux file is for. I don't feel like writing this metadata to another file. Yes, I'm being stubborn, but TeX means you can usually get anything you want if you work hard enough. Can I do this? **Edit:** Here's something else that doesn't work. Open another filehandle with the same filename. ``` \newwrite\logfilenowrap \immediate\openout\logfilenowrap=\jobname.log ``` Then `\immediate\write\logfilenowrap{long text}` will not wrap lines. But it lops off everything that was in the logfile before this point (of course it does. Opening a file handle usually puts the pointer at the front). **Edit 2:** Thanks for all the replies. Consensus is that this is "probably" not possible. I'll go the route of writing metadata to a separate text file.
https://tex.stackexchange.com/users/1402
Write to log without wrapping
false
Try this: ``` $ max_print_line=14000 pdflatex hello.tex ``` The `14000` is just a big number. (This is in @shreevatsaR's comment, but it's easier to read if it is surfaced as an answer.)
1
https://tex.stackexchange.com/users/2562
683718
317,200
https://tex.stackexchange.com/questions/683736
1
This is not strictly a TeX-related question, but as `Concrete Roman` fonts were designed by DEK and distributed with TeX, I hope to find an answer here. I'd like to use the `Concrete Roman` fonts on a website. However, finding ttf/otf files on the internet isn't easy. Are they available in any modern (=possible to use as web fonts) format? If so, what license are they available under? On CTAN I could only find mf/tfm files (useless for web) and [Type 1](https://www.ctan.org/pkg/cm-super) files (same). Googling didn't help a lot, the Wikipedia page directed me to [this page with a non-working download link](https://cm-unicode.sourceforge.io/download.html), [this page](https://fontlibrary.org/en/font/cmu-concrete) suggests that the fonts are available under the SIL Open Font License (which AFAIR is rather permissive), but the download link leads to some other font catalogue apparently not containing Concrete Roman at all...
https://tex.stackexchange.com/users/5626
Where to find Concrete Roman TTF/OTF fonts
false
Run in a terminal `luafindfont`: ``` voss@H-MacBook ~ % luafindfont concret No. Filename Symbolic name Path 1. cmunobi.otf cmuconcrete /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/cm-unicode/ 2. cmunobx.otf cmuconcrete /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/cm-unicode/ 3. cmunorm.otf cmuconcrete /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/cm-unicode/ 4. cmunoti.otf cmuconcrete /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/cm-unicode/ 5. Concrete-Math.otf concretemath /usr/local/texlive/2022/texmf-dist/fonts/opentype/public/concmath-otf/ ```
3
https://tex.stackexchange.com/users/187802
683738
317,207
https://tex.stackexchange.com/questions/683505
0
I want to create an .lco file to customize some things for my `scrlttr2` document. I need to change the page dimensions like bottommargin and include graphics. I do know that you should not use `\usepackage` or `\RequirePackage` in .lco files since they could be used after `\begin{document}`. Therefore I tried to check in the .lco file if the package had been included before and if not provide a helpful warning. However, after trying this, this does also not work after `\begin{document}`... How do I check for previous loading of packages to give the user a helpful error message in .lco files? ``` \documentclass{scrlttr2} \begin{filecontents*}{mylco.lco} \ProvidesFile{mylco}[2023-04-21 my lco file] \@ifpackageloaded{geometry}{ \newgeometry{bottom=28mm}}{} \end{filecontents*} \begin{document} \LoadLetterOption{mylco} \end{document} ```
https://tex.stackexchange.com/users/281557
How to safely use packages in .lco files?
true
It does not work with older LaTeX distributions. Updating to a version from 2022 or later will allow calling `\@ifpackageloaded` also after `\begin{document}` and therefore allow easy checking.
0
https://tex.stackexchange.com/users/281557
683744
317,211
https://tex.stackexchange.com/questions/683743
0
The example below compiles and makes a clickable link, but in the printed version it is not clear where the link is going. I suppose to solve that, I could implement some kind of reverse link in a similar way, but I have a feeling there are much more elegant ways (maybe specialized packages?) to tackle this problem, especially if many of this kind of links are involved. As for how exactly these references look in the document I'm pretty open-minded. Could be line numbers, some kind of colored markers or something else entirely. Best case is the reference works back and forth both digitally and in print. Any suggestions? ``` \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage{lipsum} \begin{document} The most important thing to understand in this course is that dogs don't like cats \hyperref[ref:DogsCats]{(see here)}. % rest of the document \lipsum[1-10] % in appendix: Some wall of text that explains how animals don't always like each other. This text is really long so a reference to the section isn't precise enough, and it can't be changed or reformatted in any way. For example, monkeys don't like bats, crocodiles don't like pangolins, 50 other animals also don't like each other, dogs don't like cats \phantomsection\label{ref:DogsCats}, mice don't like rabbits, and a good 30 more examples. \end{document} ```
https://tex.stackexchange.com/users/45734
Good way to reference a specific part of a long text?
false
You can use the `\hypertarget{label#1}{sentence in appendix}` To reference this, use the `\hyperlink{label#1}{sentence that refers to appendix}` Notice the label is the same. The latter bracket in both cases, is what will be displayed in the texts
1
https://tex.stackexchange.com/users/270205
683749
317,212
https://tex.stackexchange.com/questions/482797
3
What is a local packages repository and how to create a local package repository? I need to add some `.sty` and `.cls` files of my own, I follow the instructions from some users of this forum but whatever I did mikTeX did not accept any diretory that I create! I get messages like the following: ``` MiKTeX Problem Report Message: C:\myextrapackages does not seem to be a local package repository. Data: C:\myextrapackages Source: Libraries\MiKTeX\UI\MFC\SiteWizLocal.cpp Line: 206 MiKTeX: 2.9 OS: Microsoft Windows Vista Business Edition, 32-bit Service Pack 2 (build 6002) Invokers: miktex-taskbar-icon SystemAdmin: no PowerUser: no Root0: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9 Root1: C:\myextrapackages UserInstall: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9 UserConfig: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9 UserData: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9 CommonInstall: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9 CommonConfig: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9 CommonData: C:\Users\Alain\Documents\UsbTex_1.5_1.6\USBTeX-1.6\programs\MiKTeX_2.9 ``` Thanks for help! Alain
https://tex.stackexchange.com/users/184876
Local package repository of MikTeX
false
Having experienced the misery of repeated errors with MikTeX on MS Windows, I felt compelled to say what eventually worked for me. **My problem**: Firewall at work prevented full download. With minimal installation, intermittent & frustrating issues with missing packages. (I use LyX which of course depends on TeX). **Attempted solution**: On home PC, while attempting to download full copy into directory, multiple issues with "MikTeX encountered an internal error", and bizarre failure to identify an 'appropriate' directory. Others appear to have had similar problems on the internet, with varying levels of frustration and a lot of vague/unhelpful advice. MikTeX console was actively hostile with messages like "MikTeX console is already running", or (when accessible) failing to update anything. **Solution**: This is a command line solution to downloading and eventually installing MikTeX. Open up a DOS console in Administrator mode. 1. First **remove** every vestige of MikTeX from home PC (Uninstall from Windows) 2. Made *C:\MikTeX* directory, with sensible-looking subdirectory called *C:\MikTeX\setup* (for all the .lzma and other files downloaded) 3. This is likely not vital, but also made potentially useful directories called *common\_config*, *common\_data*, *common\_install*, *common\_link\_target\_directory* 4. Downloaded setup (.zip) file from <https://miktex.org/download> 5. Extract executable from this zip: *miktexsetup\_standalone.exe*. Put this in *C:\MikTeX* 6. Run this as follows (Can all be on one line): `miktexsetup_standalone --common-config=/MikTeX/common_config` `--common-data=/MikTeX/common_data` `--common-install=/MikTeX/common_install` `--common-link-target-directory=/MikTeX/common_link_target_directory` `--local-package-repository=/MikTeX/setup` `--verbose` `--modify-path=yes` `--package-set=complete` `--remote-package-repository=https://mirror.cse.unsw.edu.au/pub/CTAN/systems/win32/miktex/tm/packages/` `--use-registry=yes download` The key parts are the download instruction; the local package repository specification; the complete package set; and the repository. Some of the other statements are likely unneeded but I was too frustrated at this point to play! This downloaded the full 4GB without a hiccough. I used the unsw.edu.au repo because it's close, but you can obtain a list of repositories and write this list to a text file using: `miktexsetup_standalone --list-repositories > repositories.txt` Once download completes, can copy this monster, and install for local user by saying: `miktexsetup_standalone --modify-path=yes --verbose --use-registry=yes` `--local-package-repository=/MikTeX/setup install` For more fancy considerations, try the command-line help: `C:\MikTeX>miktexsetup_standalone --help` Hope this helps some poor sufferer.
0
https://tex.stackexchange.com/users/161403
683750
317,213
https://tex.stackexchange.com/questions/683731
6
Regarding the command `\DeclareMathAlphabet`, looking at this @cfr's [answer](https://tex.stackexchange.com/questions/165621/how-to-insert-a-special-math-alphabet) (the usage), and [this webpage](https://mirror.gutenberg-asso.fr/tex.loria.fr/ctan-doc/macros/latex/doc/html/fntguide/node16.html#:%7E:text=Defines%20to,version%20by%20a%20%5CSetMathAlphabet%20command.) (the documentation), I have the following questions: 1- What are valid values for "family" and "series" arguments, and how I should know what combination represents what symbol? 2- Assuming that `\fontspec` and `unicode-math` are already added, let's say I have included a particular math font whose name is `<name>`. How can I import that name to this command (to fetch one of its symbols)? Should I first call `\DeclareFontFamily` to which `<name>` is fed? Any pointer to a more verbose documentation of the this command is appreciated.
https://tex.stackexchange.com/users/78499
What are "family" and "series" in \DeclareMathAlphabet command?
true
Fonts in LaTeX are characterized by four attributes (see [`fntguide.pdf`](https://texdoc.org/serve/fntguide/0) for more information): 1. encoding 2. family 3. series 4. shape If we look in `fontmath.ltx`, we see ``` \DeclareMathAlphabet{\mathbf}{OT1}{cmr}{bx}{n} ``` where the arguments after the command name are in the same order as outlined above. This is the math analog of asking ``` \usefont{OT1}{cmr}{bx}{n} ``` in text, where all four attributes are specified. It's different from `\bfseries` in that the latter only selects the `\bfdefault` attributes (usually `b` or `bx`). What family names are legal? You can define yourself a family in your document with ``` \DeclareFontFamily{<encoding>}{<name>}{<default commands>} ``` and supplement it with the appropriate `\DeclareFontShape` declarations to associate physical fonts to this family. If a font family name, say `foo`, is unknown to LaTeX, a search in the LaTeX trees is performed for files named `<enc>foo.fd`, where `<enc>` means the encoding current at the time of the font selection request (in uppercased or lowercased versions). If no such file is found, the family name will be substituted with the default `cmr`. Now you know what family names are legal: just browse your TeX distribution for files with extension `.fd`. And looking in them you can see what series and shape combinations are available. **Caveat.** Several `.fd` files depend on bits of information gathered elsewhere, because they are accompanying specific packages (an outstanding example are the `.fd` files that accompany `newtxtext` and `newtxmath`), so using them may not be possible “directly”, but the relevant information can usually be extracted without too much labor.
7
https://tex.stackexchange.com/users/4427
683754
317,215
https://tex.stackexchange.com/questions/358136
23
I want to cite an online news article, i.e. one that didn't also appear as a printed version, using BibLaTex with the authoryear style. Example: ``` \documentclass[12pt,paper=a4,bibtotocnumbered,abstract=on]{scrreprt} \usepackage[ngerman]{babel} \usepackage[backend=bibtex,style=authoryear,doi=false,isbn=false]{biblatex} \addbibresource{Export-Test.bib} \DefineBibliographyStrings{german}{ urlseen = {abgerufen am}, } \begin{document} Test \autocite{Darroch.2017}. \end{document} ``` with the corresponding entry in the `.bib` file: ``` @Online{Darroch.2017, author = {Darroch, Gordon}, year = {2017}, title = {Netherlands 'will pay the price' for blocking Turkish visit – Erdoğan }, journal = {The Guardian}, url = {https://www.theguardian.com/world/2017/mar/12/netherlands-will-pay-the-price-for-blocking-turkish-visit-erdogan}, urldate = {2017-03-12} } ``` The output looks like this: Darroch, Gordon (2017). *Netherlands 'will pay the price' for blocking Turkish visit – Erdoğan* URL: <https://www.theguardian.com/world/2017/mar/12/netherlands-will-pay-the-price-for-blocking-turkish-visit-erdogan> (abgerufen am 12.03.2017) I've tried multiple things instead of `journal`, but the name of the news website just doesn't want to appear. In the end, it should look like this: Darroch, Gordon (2017). Netherlands 'will pay the price' for blocking Turkish visit – Erdoğan In: *The Guardian*. URL: <https://www.theguardian.com/world/2017/mar/12/netherlands-will-pay-the-price-for-blocking-turkish-visit-erdogan> (abgerufen am 12.03.2017) Any ideas how to fix this? Thanks a lot!
https://tex.stackexchange.com/users/127486
Citing an online news article using BibLaTeX
false
I'm using EndNote so had to configure the export fields for a Newspaper Article as shown below. Using biblatex this seems to put everything in the right order. ``` @article{|Label,| |   `author = `{Reporter}, |   `title = `{Title}, |   `year = `{Year}, |   `journal = `{Newspaper}, |   `note = `{Available at: \url{URL} (Accessed: {Access Date})}, |   `month = `{Issue Date}, |   `type = `{Reference Type} ``` So the resulting bib entry is ``` @article{Allen2018, author = {Allen, Kate}, title = {African Development Bank turns to hedge fund to offset risk}, year = {2018}, journal = {Financial Times}, note = {Available at: \url{https://www.ft.com/content/6eba4d10-ba43-11e8-94b2-17176fbf93f5} (Accessed: {April 24th, 2023})}, month = {18 Sep}, type = {Newspaper Article} } ```
0
https://tex.stackexchange.com/users/294505
683762
317,220
https://tex.stackexchange.com/questions/683692
0
I want to create a footer on all pages except the first. After I had failed I tried with creating the same footer as on the first page and it still looks different. It seems to only show a footer at all when I add `\pagestyle{myheadings}` ``` \documentclass{scrlttr2} \renewcommand\familydefault{\sfdefault} \usepackage{tgheros} \setkomavar{firstfoot}{\hrulefill\\% \footnotesize \usekomavar{subject} \hfill \usekomavar{fromname}% } \setkomavar{nextfoot}{\usekomavar{firstfoot}} \pagestyle{myheadings} \usepackage{Blindtext} \begin{document} \begin{letter}{recipient} \setkomavar{subject}{Evaluation\\ student} \opening{Hello} \Blindtext \end{letter} \end{document} ``` What am I doing wrong? P.S.: Just to be sure: I only dsiplay the `firstfoot` to see if my definition was right and to show that the display is different between `firstfoot` and `nextfoot` even though they are identical...
https://tex.stackexchange.com/users/281557
Why does the same definition lead to a different footer on second page?
true
To print a footer with foot separation line at all pages but the first one, can for example use `\setkomavar{nextfoot}{<footer definition>}` and KOMA-Script option `footsepline`. But in this case note, that the foot line of the page style is specified to be a single line (inside horizontal box). So paragraphs, line breaks etc. won't work, unless you put them explicitly into a vertical box: ``` \documentclass[footsepline]{scrlttr2} \renewcommand\familydefault{\sfdefault} \usepackage{tgheros} \setkomafont{pagefoot}{\footnotesize} \setkomavar{nextfoot}{% \parbox{\linewidth}{% because it seems you want so have line breaks using \\ \usekomavar{subject} \hfill \usekomavar{fromname} }% } \pagestyle{myheadings} \usepackage{blindtext}% Note: Changed because Blindtext.sty cannot be found with case sensitive file names. \begin{document} \begin{letter}{recipient} \setkomavar{subject}{Evaluation\\ student} \opening{Hello} \Blindtext \end{letter} \end{document} ``` Alternatively you could set the page footer using the recommended KOMA-Script package `scrlayer-scrpage` as already shown before, e.g., in [scrlttr2: make second page footer match first page footer](https://tex.stackexchange.com/questions/196360). Note from the KOMA-Script author: Package `scrletter`, resp. class `scrletter`, which is a wrapper for class `scrartcl` and package `scrletter`, are not affected by the restriction to one line headers and footers. So another alternative would be: ``` \documentclass[footsepline,manualmark,footlines=2]{scrletter} \renewcommand\familydefault{\sfdefault} \usepackage{tgheros} \setkomafont{pagefoot}{\footnotesize} \setkomavar{nextfoot}{% \usekomavar{subject} \hfill \usekomavar{fromname}% } \renewcommand*{\letterpagestyle}{letter} \usepackage{blindtext}% Note: Changed because Blindtext.sty cannot be found with case sensitive file names. \begin{document} \begin{letter}{recipient} \setkomavar{subject}{Evaluation\\ student} \opening{Hello} \Blindtext \end{letter} \end{document} ```
3
https://tex.stackexchange.com/users/277964
683766
317,222
https://tex.stackexchange.com/questions/683504
-1
ETA: This is the original MWE in LyX [How to change margin of the document title?](https://tex.stackexchange.com/questions/222449/how-to-change-margin-of-the-document-title) and I have the exact same question, for LyX, just for KOMA article class instead of the standard article class. Unfortunately I can't switch to the standard class instead and I have been unable to figure out on my own how to adapt the code from the answer to KOMA article. Any help would be much appreciated! LaTeX MWE ``` \documentclass{scrartcl} \title{This is a fairly long title for the document which should start at the top of the page} \begin{document} \maketitle \end{document} ``` Images of the desired behaviour with solution for standard article class here: [How to change margin of the document title?](https://tex.stackexchange.com/questions/222449/how-to-change-margin-of-the-document-title)
https://tex.stackexchange.com/users/253448
How to change margin of document title in KOMA class?
true
So the problem appears to have simply been that in the `.cls`, the command is not `\newpage\null\vskip 2em`, but `\null\vskip 2em`. Therefore ``` \usepackage{etoolbox} \makeatletter \patchcmd{\@maketitle}% <cmd> {\newpage\null\vskip 2em}{}% <search><replace> {}{}% <success><failure> \makeatother ``` had to be changed to ``` \usepackage{etoolbox} \makeatletter \patchcmd{\@maketitle}% <cmd> {\null\vskip 2em}{}% <search><replace> {}{}% <success><failure> \makeatother ``` to make it work. The result now is precisely what it should be:
0
https://tex.stackexchange.com/users/253448
683768
317,224
https://tex.stackexchange.com/questions/675767
0
I am writing a Chinese book using `ctexbook`, but when I used the chapter command, it does not write the word "chapter" in Chinese. Here's my code: ``` \usepackage[a4paper, total={6in, 9in}]{geometry} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{multirow} \usepackage{longtable} \usepackage{array} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsthm} \usepackage{float} \usepackage{txfonts} \usepackage{pxfonts} \usepackage{lmodern} \usepackage[dvipsnames]{xcolor} \setlength{\parindent}{0pt} \usepackage{tkz-base} \usepackage{tikz} \usepackage{tkz-euclide} \pagestyle{plain} \setlength{\unitlength}{0.5cm} \usepackage{accents} \newcommand{\varvec}[1]{\underaccent{\tilde}{#1}} \newcommand{\placenum}[1]{\makebox(1,1){#1}} \newcommand*\circled[1]{\tikz[baseline=(char.base)]{ \node[shape=circle,draw,inner sep=1pt] (char) {#1};}} \usetikzlibrary{arrows} \makeatletter \pgfkeys{ /tkzlabelX/no zero/.style={ /tikz/xlabel style/.append style={ style/.expand once={\ifdim\tkz@pos pt=0pt shape=coordinate\fi}}}, /tkzlabelY/no zero/.style={ /tikz/ylabel style/.append style={ style/.expand once={\ifdim\tkz@pos pt=0pt shape=coordinate\fi}}}, /tkzAxeXY/no zero/.code=, /tkzdrawX/no zero/.code=, /tkzdrawY/no zero/.code=, /tkzlabelX/make an O/.style={ /tikz/xlabel style/.append style={ style/.expand once={\ifdim\tkz@pos pt=0pt shape=rectangle, fill=none, fill/.code=, % no filling, please pos=.5, yshift=+3pt, anchor=south east, % counter default xlabel style inner sep=+.3333em, /utils/exec=\def\tkz@Xresult{$O$}\fi}}}, /tkzAxeXY/make an O/.code=, /tkzlabelY/make an O/.code=, /tkzdrawX/make an O/.code=, /tkzdrawY/make an O/.code=} \makeatother \setlength{\parindent}{0pt} \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=black, filecolor=purple, urlcolor=RoyalBlue, pdfpagemode=FullScreen, } \newcommand{\nc}{\newcommand} \nc{\opta}{\textbf{A) }} \nc{\optb}{\textbf{B) }} \nc{\optc}{\textbf{C) }} \nc{\optd}{\textbf{D) }} \nc{\boxa}{\boxed{\textbf{A)}}} \nc{\boxb}{\boxed{\textbf{B)}}} \nc{\boxc}{\boxed{\textbf{C)}}} \nc{\boxd}{\boxed{\textbf{D)}}} \nc{\longdots}{\dots\dots\dots\dots} \nc{\q}{Question } \nc{\que}{\textbf{Question: }} \nc{\ans}{\textbf{Answer: }} \nc{\nms}{\normalsize} \nc{\underlinefive}{\underline{\ \ \ \ \ }} \nc{\underlineten}{\underline{\ \ \ \ \ \ \ \ \ \ }} \nc{\underlinetwenty}{\underlineten\underlineten} \nc{\underlinethirty}{\underlinetwenty\underlineten} \nc{\underlineforty}{\underlinethirty\underlineten} \nc{\qqquad}{\qquad\quad} \nc{\qqqquad}{\qquad\qquad} \usepackage{xcolor} \usepackage{sectsty} \sectionfont{\fontsize{18}{15}\selectfont} \subsectionfont{\fontsize{15}{15}\selectfont} \subsubsectionfont{\fontsize{13}{15}\selectfont} \usepackage{titlesec} \begin{document} \begin{titlepage} \begin{center} \vspace*{1cm} \Huge \textbf{中国高中数学}\\ \vspace{2cm} \LARGE \textbf{2023 高一上}\\ \vspace{1cm} 第1 -- 13课 \end{center} \end{titlepage} \newpage \phantom{a} \pagenumbering{gobble} \newpage \pagenumbering{roman} \LARGE \tableofcontents \newpage \phantom{a} \pagenumbering{gobble} \newpage \normalsize \pagenumbering{arabic} \chapter{集合中的常用思想} \section{元素与集合} \vspace{1cm} \subsection{知识点睛} \vspace{1em} \end{document} ``` Could anyone please help me? Thank you!
https://tex.stackexchange.com/users/267647
In ctexbook document class, when I write a chapter, the word "chapter" is in English
true
You should simplify your code and reduce unnecessary packages, otherwise you will get wrong results. ``` \documentclass{ctexbook} \begin{document} \chapter{test} \end{document} ``` Going back to your problem, your problem is that you loaded the `sectsty` package. ``` \documentclass{ctexbook} \usepackage{sectsty} \begin{document} \chapter{test} \end{document} ```
1
https://tex.stackexchange.com/users/209043
683778
317,227
https://tex.stackexchange.com/questions/683706
0
I have a section and within it several tables. Each one on a page. I intend that in the toc, the name of each one of these tables appears as if it were a subsection. I have tried the following command just above the code of the table: ``` \addcontentsline{toc}{subsection}{Text 1} ``` it appears in the toc, but the page number is not the one that corresponds to it. Does anyone know how I can fix this?
https://tex.stackexchange.com/users/191511
Make a subsection appear in the toc without a subsection existing
false
Tables are floats and can end on some other page. If you put the command `\addcontentsline` next to the caption, the page number will be correct. ``` \documentclass{article} \begin{document} \tableofcontents \listoftables \clearpage \section {Some Tables} \begin{table}[h!] \caption{Table I} \addcontentsline{toc}{subsection}{T-\thetable~Table I}% <<<<<<<<<<<< \end{table} \newpage \begin{table}[h!] \caption{Table II} \addcontentsline{toc}{subsection}{T-\thetable~Table II}% <<<<<<<<<<<< \end{table} \newpage \begin{table}[h!] \caption{Table III} \addcontentsline{toc}{subsection}{T-\thetable~Table III}% <<<<<<<<<<<< \end{table} \end{document} ```
2
https://tex.stackexchange.com/users/161015
683780
317,228
https://tex.stackexchange.com/questions/683782
0
Whenever I want to insert an image or a table, there are the same errors: > > \begin{figure} or \begin{table} -> Undefined control sequence. > \end{figure} or \end{table} -> \begin{document} ended by \end{figure}. Extra }, or forgotten \endgroup. Extra \endgroup. Too many }'s. > > > Somebody said there might be a package that's too old, or doesn't work with others, but I don't know where to start. ``` \documentclass[twoside,a4paper,11pt,openright]{report} \usepackage[utf8]{inputenc} % Einstellung der Eingabekodierung \usepackage[ngerman]{babel} % Deutsche Trennmuster \usepackage{newtxtext, newtxmath} % Schriftart Palatino & passende Mathe-Schrift \usepackage[T1]{fontenc} % Einstellung Schriftkodierung \usepackage{amsmath} % Mathematik-Erweiterungen \usepackage{microtype} % Verbesserte Mikrotypographie \usepackage{csquotes} % Kontextabhängige Anführungszeichen \usepackage{calc} % Berechnung von TeX-Maßen \usepackage[% inner=25mm,% outer=35mm,% top=20mm,% bottom=30mm,% ]{geometry} % Anpassung Satzspiegel \usepackage{parskip} % Kein Absatzeinzug \usepackage{emptypage} % Keine Seitenzahlen auf Leerzeiten \usepackage{array} % Tabellen-Erweiterung \usepackage[pdftex]{graphicx} % Einbindung von Grafiken \usepackage{float} % Anpassung von Gleitumgebungen \usepackage{fancyhdr} % Anpassung von Kopf- und Fußzeilen \selectlanguage{german} % Einstellung der Sprache \usepackage{textcomp} \usepackage{xcolor} % Farben \usepackage{subcaption} % Unternummerierung für Abbildungen \usepackage{listings} % Quelltextauszüge \usepackage{listingsutf8} \usepackage{siunitx} % Physikalische Einheiten \usepackage{chemformula} % chemische Symbole, Reaktionsgleichungen \usepackage[nohyperlinks]{acronym} % Abkürzungen \usepackage{tocloft} % eigene "list of things" \usepackage{caption} \usepackage[colorlinks=false, pdfborder={0 0 0}]{hyperref} \floatplacement{figure}{htb} \floatplacement{table}{htb} % Anpassungen für Gleitumgebungen \newenvironment{tucsimplesection}[2][\bigskipamount] { \par\centerline{\textbf{\Large #2}}\par \vspace*{#1} } {} % Einfache Überschriften für Aufgabenstellung usw. \makeatletter \let\@xfloat=\latex@xfloat \makeatother % Erweiterter Zeilenabstand in Gleitumgebungen, Fußnoten und Minpages \begin{document} % Römische Seitenzahlen für den Vorspann. \pagenumbering{roman} %\input{inhalt/titlepage} % Inhaltsverzeichnis %\tableofcontents \pagenumbering{arabic} \begin{figure}[h] % error: Undefined control sequence. \centering \includegraphics[width=0.8\textwidth]{bilder/inside_battery.jpg} \caption{Reaktionen in der Batterie} \label{fig:inside_battery} \end{figure} % error: \begin{document} ended by \end{figure}. Extra }, or forgotten \endgroup. Extra \endgroup. Too many }'s. % Tabelle mit Zeiten etc. \begin{table} [h] % error: Undefined control sequence. \captionsetup{labelformat=empty} \centering \caption{Messablauf} \label{tab:Messablauf} \begin{tabular}{p{2.5cm} p{2.5cm} p{2.5cm} p{5cm} p{2.5cm}} \hline $t_{on} / s$ & $t_{off}$ / s & $\dfrac{t_{on}}{t_{off}}$ & $R_{3}$ (Entladewiderstand) / \si\ohm & max. I / A \\ [1ex] \hline \hline 5 & 5 & 1 : 1 & & \\ \hline 50 & 50 & 1 : 1 & & \\ \hline \end{tabular} \end{table} % error: \begin{document} ended by \end{table}. Extra }, or forgotten \endgroup. Extra \endgroup. Too many }'s. \end{document} ```
https://tex.stackexchange.com/users/295637
Error: Undefined control sequence. \begin{figure} and \begin{table}
false
You did not show the error which is ``` ! Undefined control sequence. \@xfloat #1[#2]->\caption@ORI@xfloat {#1}[#2]\caption@settype {#1}\caption@s... l.66 \begin{figure}[h] % error: Undefined control sequence. ? ``` so the undefined command is `\caption@ORI@xfloat` You have loaded the caption package then broken its internal workings by doing ``` \makeatletter \let\@xfloat=\latex@xfloat \makeatother % Erweiterter Zeilenabstand in Gleitumgebungen, Fußnoten und Minpages ``` you should delete that. In general only have code in the preamble that you know you are using. It seems highly unlikely you are using all these packages, loading so many will lead to conflicts such as ``` Package tocloft Warning: \@starttoc has already been redefined; tocloft bailing out. on input line 1156. ```
4
https://tex.stackexchange.com/users/1090
683785
317,231
https://tex.stackexchange.com/questions/683779
0
I have been successfully using "split" to split up long equation, but now I get a new error: ``` \begin{equation} \begin{split} \alpha_0=\frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\text{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\text{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\text{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\text{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\text{d}t\\ \alpha_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi} \end{split} \end{equation} ``` gives a lot of errors I have tried many version, but can't get that $\alpha\_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi}$ to start at the second line, to the left... Any ideas welcomed! Thanks
https://tex.stackexchange.com/users/241518
Splitting equations using \begin{split} generates errors (again)
true
`\frac{3(\pi-\frac{\pi}{2}){\pi}` is giving an unmatched brace (this is presumably the [first error](https://tex.stackexchange.com/a/125404/106162) you are seeing, and once resolved should fix the subsequent errors) and should probably be `\frac{3(\pi-\frac{\pi}{2})}{\pi}`. Preferring `\mathrm{d}` ([Is there a preference of when to use \text and \mathrm?](https://tex.stackexchange.com/q/19502/106162)), then you simply need to set an alignment point on the first equals sign ``` \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} \alpha_0 &= \frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\mathrm{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\mathrm{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\mathrm{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\mathrm{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\mathrm{d}t\\ \alpha_0 &= \frac{5}{2}+\frac{3(\pi-\frac{\pi}{2})}{\pi} \end{split} \end{equation} \end{document} ```
4
https://tex.stackexchange.com/users/106162
683786
317,232
https://tex.stackexchange.com/questions/683717
1
I'm using chemfig environment inside Latex and I have a big molecule inside brackets. I need to put a plus sign outside the brackets. `\chemleft( \chemfig{*6(---=--)} \chemright)` (The plus sign must be here) Could you help me? Thanks in advance. J
https://tex.stackexchange.com/users/294867
Signs outside brackets in the chemfig environment
false
I think this is what you want to get ``` \documentclass[border=2mm]{standalone} \usepackage{chemfig} \begin{document} \chemleft( \chemfig{*6(---=--)} \chemright{)^{+}} \end{document} ```
3
https://tex.stackexchange.com/users/134993
683790
317,234
https://tex.stackexchange.com/questions/683805
0
I want to check a mutable variable against many possible values, so that a macro will behave differently based on that value. Since there are many variables, they are stored using pgfkeys. Testing against values is done with etoolbox and plenty of braces to make it more "functional". A minimal non-working example using pgfkeys and etoolbox: ``` \documentclass[12pt]{article} \usepackage{etoolbox} \usepackage{pgfkeys} \begin{document} \pgfkeys{/north/.default=a} \pgfkeyssetvalue{/north}{h} Current value of variable: \pgfkeysvalueof{/north} \ifdefstring{\pgfkeysvalueof{/north}}{h}{Value is h}{Value is not h} \end{document} ``` It does not work (prints "Value is not h"). I also couldn't make it work with other similar commands (like `\ifstrequal`, `\ifcsstrequal`, etc.). How to make it work?
https://tex.stackexchange.com/users/270680
Comparing pgfkey variable against a string
true
You could retrieve the value of your key first using `\pgfkeysgetvalue`. The following automatises this a bit for you inside a macro: ``` \documentclass{article} \usepackage{pgfkeys} \usepackage{etoolbox} \providerobustcmd*\mycmpvalue[1] {% \pgfkeysgetvalue{#1}\mytmp \ifdefstring\mytmp } \pgfkeys{/north/.initial=a} \begin{document} \mycmpvalue{/north}{h}{true}{false} \pgfkeyssetvalue{/north}{h} \mycmpvalue{/north}{h}{true}{false} \end{document} ``` Small aside: You most likely mixed up `.default` and `.initial` (the former will not store `a` inside your key but will be used if you omit the value inside of `\pgfkeys`). Note however that this still uses macros internally to store your value (those are just hidden by a layer of `pgfkeys`), instead of that indirection simply storing your values inside of macros seems not more complicated, but it will be faster and easier for you to code. Compare with the following: ``` \documentclass{article} \usepackage{etoolbox} \newcommand*\mynorth{a} \begin{document} \ifdefstring\mynorth{h}{true}{false} \renewcommand*\mynorth{h} \ifdefstring\mynorth{h}{true}{false} \end{document} ``` And if you still want to use a `key=value` interface to set your values (that part would be understandable), you could instead use the `.store in` handler if you want to stick to `pgfkeys`, or use a different key=value interface (your code will more or less become independent of the used key=value interface): ``` \documentclass{article} \usepackage{etoolbox} \usepackage{pgfkeys} \pgfqkeys{/my}{north/.store in=\mynorth,north=a} \begin{document} \ifdefstring\mynorth{h}{true}{false} \pgfkeys{/my/north=h} \ifdefstring\mynorth{h}{true}{false} \end{document} ``` Or the same with `expkv-def` (of which I'm the author, so I picked that one for the example, could use almost any other key=value implementation for this): ``` \documentclass{article} \usepackage{etoolbox} \usepackage{expkv-def} \ekvdefinekeys{my}{store north=\mynorth,initial north=a} \begin{document} \ifdefstring\mynorth{h}{true}{false} \ekvset{my}{north=h} \ifdefstring\mynorth{h}{true}{false} \end{document} ```
1
https://tex.stackexchange.com/users/117050
683807
317,241
https://tex.stackexchange.com/questions/683806
3
I am using the description style arrow label in Tikz-cd so that the label appears on top of the arrow with some white space around the label. The issue is, with small arrows and large labels, the white space eats up the entire arrow. Thus I would like to shrink the white space around the label. In the Tikz-cd documentation it says this can be accomplished with "inner sep," though I am not sure exactly how this is done. Here is a minimal working example where I try to (unsuccessfully) modify the white space around the arrow label using inner sep. ``` \documentclass{article} \usepackage{amsmath,amssymb,tikz-cd} \begin{document} $$ \begin{tikzcd} A \ar[r, "f" description] & B \end{tikzcd} $$ $$ \begin{tikzcd} A \ar[r, "f" description, inner sep = -2em] & B \end{tikzcd} $$ \end{document} ```
https://tex.stackexchange.com/users/38770
Tikz-cd: Adjust white space around "description" style arrow label
true
Put `inner sep` in the option `labels` of TikZ-CD. You can also set it locally, for one or some labels only, with: ``` "<labeltext>" {description, inner sep = <dimension>} ``` See the example: ``` \documentclass{article} \usepackage{amsmath,amssymb,tikz-cd} \begin{document} \[ \begin{tikzcd} A \ar[r, "f" description] & B \end{tikzcd} \] \[ \begin{tikzcd}[labels={inner sep = .5pt}] A \ar[r, "f" description] & B \end{tikzcd} \] In the following CD, the first label has a standard inner sep, the second has an inner sep of .5pt: \[ \begin{tikzcd} A \ar[r, "f" description] & B\\ A \ar[r, "f" {description, inner sep = .5pt}] & B\\ \end{tikzcd} \] \end{document} ``` Off-topic: don't use `$$...$$` in LaTeX, use `\[...\]`, see here: [Why is \[ ... \] preferable to $$ ... $$?](https://tex.stackexchange.com/questions/503/why-is-preferable-to)
6
https://tex.stackexchange.com/users/101651
683809
317,242
https://tex.stackexchange.com/questions/683799
3
In our team we are encountering an issue with the line break of Chinese text when using the packages babel and etoc and compiling with xelatex. The issue only occurs when the content is placed within a braces scope. Since we are using a loop to import files for a total of 16 languages into a document, we depend on that scope. It works fine for all other languages. So this actually occurred in a very complex setup in which we absolutely need the braces, but we were able to break it down to the following MWE: ``` \documentclass[a4paper]{article} \usepackage[english]{babel} \babelprovide[import]{chinese} \usepackage{fontspec} \setmainfont{FandolSong-Regular.otf} \usepackage{etoc} \begin{document} { % Usage of this brace triggers the problem \selectlanguage{chinese} \localtableofcontents \section{简体中文} 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 } % Usage of this brace triggers the problem \end{document} ``` Without the braces, the line break is fine. When introducing the braces, the lines run out of the page. (After the first compile run the line break is still fine. You have to compile twice.) Does Chinese need any additional option here? Is this a bug in babel or etoc? Note: We know that the problem does not occur when compiling with lualatex. Switching to lualatex however is currently not possible, because we are encountering massive performance issues with that engine - but that is a different topic ;)
https://tex.stackexchange.com/users/215495
Lines do not break for Chinese text in a braces scope
false
The linebreaking is controlled by the setting of `\XeTeXlinebreaklocale`. That is a global setting, and so ignores groups: ``` \documentclass[a4paper]{article} \usepackage{fontspec} \setmainfont{FandolSong-Regular.otf} \begin{document} \XeTeXlinebreaklocale "zh" 简体中文简体中文。简体中文,简体中文。简体中文简体 中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体 中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体 中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体 中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体 中文。简体中文,简体中文。 {\XeTeXlinebreaklocale "" 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。} 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中 文。 \end{document} ``` Now when you switch languages babel will write also suitable language switches to the toc (and the aux-file): ``` \babel@toc {english}{}\relax \babel@toc {chinese}{}\relax \etoc@startlocaltoc {1} \contentsline {section}{\numberline {1}简体中文}{1}{}% \babel@toc {english}{}\relax ``` If the last language in the toc is english, it will reset `\XeTeXlinebreaklocale` globally to empty and so your line breaking no longer works. In a complex document it is not easy to control which language switch is at the end of the toc, so the best is to reset the language after the toc to the right language.
3
https://tex.stackexchange.com/users/2388
683812
317,243
https://tex.stackexchange.com/questions/683806
3
I am using the description style arrow label in Tikz-cd so that the label appears on top of the arrow with some white space around the label. The issue is, with small arrows and large labels, the white space eats up the entire arrow. Thus I would like to shrink the white space around the label. In the Tikz-cd documentation it says this can be accomplished with "inner sep," though I am not sure exactly how this is done. Here is a minimal working example where I try to (unsuccessfully) modify the white space around the arrow label using inner sep. ``` \documentclass{article} \usepackage{amsmath,amssymb,tikz-cd} \begin{document} $$ \begin{tikzcd} A \ar[r, "f" description] & B \end{tikzcd} $$ $$ \begin{tikzcd} A \ar[r, "f" description, inner sep = -2em] & B \end{tikzcd} $$ \end{document} ```
https://tex.stackexchange.com/users/38770
Tikz-cd: Adjust white space around "description" style arrow label
false
Same result with `xy` package: ``` \documentclass[12pt]{article} \usepackage{amsmath,amssymb} \usepackage[cmtip,all]{xy} \begin{document} \[\xymatrix{ A \ar[r]|f & B } \] \end{document} ```
3
https://tex.stackexchange.com/users/117876
683815
317,244
https://tex.stackexchange.com/questions/683779
0
I have been successfully using "split" to split up long equation, but now I get a new error: ``` \begin{equation} \begin{split} \alpha_0=\frac{1}{\pi}\int_{-\pi}^{\pi}F(y)\text{d}y=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}\text{d}y+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}\text{d}y+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}\text{d}y+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}\text{d}t\\ \alpha_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi} \end{split} \end{equation} ``` gives a lot of errors I have tried many version, but can't get that $\alpha\_0=\frac{5}{2}+\frac{3(\pi-\frac{\pi}{2}){\pi}$ to start at the second line, to the left... Any ideas welcomed! Thanks
https://tex.stackexchange.com/users/241518
Splitting equations using \begin{split} generates errors (again)
false
Compiling using `aligned` enviroment you get the same result. ``` \documentclass[12pt]{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{aligned} \alpha_0 &= \frac{1}{\pi}\int_{-\pi}^{\pi}F(y)dy=\frac{2}{\pi}\int_{-\pi}^{-\frac{\pi}{2}}dy+\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{0}dy+\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}}dy+\frac{3}{\pi}\int_{\frac{\pi}{2}}^{\pi}dt\\ \alpha_0 &= \frac{5}{2}+\frac{3(\pi-\frac{\pi}{2})}{\pi} \end{aligned} \end{equation} \end{document} ```
3
https://tex.stackexchange.com/users/117876
683819
317,247
https://tex.stackexchange.com/questions/683799
3
In our team we are encountering an issue with the line break of Chinese text when using the packages babel and etoc and compiling with xelatex. The issue only occurs when the content is placed within a braces scope. Since we are using a loop to import files for a total of 16 languages into a document, we depend on that scope. It works fine for all other languages. So this actually occurred in a very complex setup in which we absolutely need the braces, but we were able to break it down to the following MWE: ``` \documentclass[a4paper]{article} \usepackage[english]{babel} \babelprovide[import]{chinese} \usepackage{fontspec} \setmainfont{FandolSong-Regular.otf} \usepackage{etoc} \begin{document} { % Usage of this brace triggers the problem \selectlanguage{chinese} \localtableofcontents \section{简体中文} 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 } % Usage of this brace triggers the problem \end{document} ``` Without the braces, the line break is fine. When introducing the braces, the lines run out of the page. (After the first compile run the line break is still fine. You have to compile twice.) Does Chinese need any additional option here? Is this a bug in babel or etoc? Note: We know that the problem does not occur when compiling with lualatex. Switching to lualatex however is currently not possible, because we are encountering massive performance issues with that engine - but that is a different topic ;)
https://tex.stackexchange.com/users/215495
Lines do not break for Chinese text in a braces scope
false
Not a direct answer to the OP's question, but a suggestion that a fairly straightforward solution may be at hand: Making the switch from XeLaTeX to LuaLaTeX. For sure, the OP's code compiles just fine under LuaLaTeX, with or without the curly braces. ``` % !TEX TS-program = lualatex \documentclass[a4paper]{article} \usepackage[english]{babel} \babelprovide[import]{chinese} \usepackage{fontspec} \setmainfont{FandolSong Regular} \usepackage{etoc} \begin{document} { % Usage of this brace no longer triggers the problem \selectlanguage{chinese} \localtableofcontents \vspace{7mm}\hrule % <-- new \section{简体中文} 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 } % Usage of this brace no longer triggers the problem \end{document} ```
1
https://tex.stackexchange.com/users/5001
683821
317,248
https://tex.stackexchange.com/questions/683374
1
I have the following latex file: ``` \documentclass{article} \usepackage[keeptemps, depythontex, runall=false, fvextfile=55]{pythontex}%rerun=always, \begin{document} computed by python: \pys[sname]{1+1=!{1+1}} \end{document} ``` and I call it `manualLMP.tex`. I have a standard config file for latexmk configured for `lualatex` so that pythontex works. Also this time, all is fine. If I call the same file `manualLatexMavenPlugin.tex` then it does not work. The important is that the name is a bit longer. It works still if I run ``` latexmk manualLatexMavenPlugin -lualatex="pdflatex %O %S" ``` or the same with xelatex, but not with lualatex. I must admit, that I don't understand the .latexmkrc file. The core is ``` $extra_rule_spec{'pythontex'} = [ 'internal', '', 'mypythontex', "%R.pytxcode", "pythontex-files-%R/%R.pytxmcr", "%R", 1 ]; ``` Unfortunately `$extra_rule_spec` is not mentioned in the latexmk documentation. Also I cannot find any information on the version of latexmk this documentation refers to. I use latexmk 4.79, luahbtex version 1.16. Distribution is texlive. Just an observation: Only if I run latexmk with lualatex i get the feedback: ``` Latexmk: Missing input file 'pythontex-files-manualLatexMavenPlugin/manualLatexMavenPlugin.pytxmcr.Run PythonTeX to create it' (or dependence on it) from following: ``` which may indicate that the `Run` is interpreted as the extension. Gluing together seems to occur only if the filename is long. It may be a bug also in lualatex or in latexmk. I think, the first step would be to do research on the mechanism latexmk uses.
https://tex.stackexchange.com/users/60463
latexmk with pythontex, lualatex and long name not working
false
Answering this question gives some information on what is happening "under the hood" in latexmk for a non-trivial case. **Context**: Pythontex allows a .tex document to run calculations in Python and then typeset the results. The basic workflow with pythontex is (a) Compile the .tex document with use of the pythontex *package*. (b) Run the pythontex *program* to read files generated in step (a) that specify the calculations. (c) Compile the .tex document again to use the results from step (b). **Configuration** of latexmk to use pythontex: The code needed is in the `pythontex-latexmkrc` file in the latexmk distribution. This sets up a "rule" for using the pythontex program. Its primary input file is file of extension pytxcode generated in the \*latex compilation of the tex document. Its primary output file has an extension pytxmcr, and is read by the the next compilation of the document. The rule uses a Perl subroutine to run the pythontex program with appropriate arguments, and then determine the dependencies: what files are read, and what files are written beyond the primary input and output? **Functioning**: On a first compilation of the .tex file by \*latex, the pythontex package writes a warning to the .log file that the pytxmcr file that it needs doesn't exist. Latexmk sees that warning and sees that the missing file can be made by the pythontex rule. So it links that rule into its rule network. The rule gets run, and generates the missing file. So latexmk recompiles the .tex file, and the missing files are read. After that information on what is read and written by the pythontex package appears in the fls file, which gives the main dependency information. **What went wrong with lualatex**: Latexmk (v. 4.80) ran lualatex, but didn't run pythontex or do the second run of lualatex. In the output, it states what it is doing and gives important information about what it found ``` Latexmk: Getting log file 'aux_dir/manualLatexMavenPlugin.log' Latexmk: Examining 'aux_dir/manualLatexMavenPlugin.fls' Latexmk: Examining 'aux_dir/manualLatexMavenPlugin.log' Latexmk: Missing input file 'pythontex-files/manualLatexMavenPlugin/manualLatexMavenPlugin.pytxmcr.Run PythonTeX to create it' (or dependence on it) from following: No file pythontex-files-manualLatexMavenPlugin/manualLatexMavenPlugin.pytxmcr.Run PythonTeX to create it. ``` Notice the exact placement single quotes in the line about the missing input file. Latexmk is reporting that it thinks that the log file tells it that there is a missing file. But the extension of the file is not the expected one with extension `.pytxmcr` but one with the very long extension `.pytxmcr.Run PythonTeX to create it` (!). Looking at the log file shows that latexmk has concatenated two neighboring lines together. The first line has length 78 bytes, and latexmk has assumed that the pair of lines is a single long line wrapped to keep it within the length limit on lines in log files. **Why there is a problem only with lualatex**: Unlike pdflatex and xelatex, lualatex is quite sloppy in its line wrapping, and latexmk allows for the sloppiness. Unfortunately this has caused a bug where latexmk thinks a line has been wrapped but in reality wasn't, and it wasn't programmed into the current version to deal with this. The use of pythontex accentuates the problem because the filenames it deals with are rather long. **Work-arounds**: (a) Change the name of the .tex filename to be slightly longer or shorter. (b) With the TeXLive distribution, set the environment variable `max_print_line` to a large value, e.g., 10000, to stop significant line wrapping. (c) Run pythontex manually once, then latexmk with the `-g` option. After that latexmk will work, because it now picks up dependency information from the .fls file. **Next version**: The next version (probably 4.81) of latexmk will have a fix for this problem, which is more general than just with pythontex.
2
https://tex.stackexchange.com/users/8495
683825
317,250
https://tex.stackexchange.com/questions/683827
2
I am seeking assistance with formatting my solution. Specifically, I am looking for a way to number each step of the solution without using the format "Step 1:", "Step 2:", and so on. I am hoping to find a more visually appealing way to number each step. Additionally, I would appreciate any help with formatting the solution neatly on Overleaf. If anyone has the skills to help me with these issues, please let me know. ``` \documentclass{article} \usepackage{amsmath} \begin{document} \section{Task} 1. Calculate the inverse of the matrix \[ B=\left[\begin{array}{lll} 0 & 2 & 3 \\ 2 & 4 & 0 \\ 3 & 5 & 1 \end{array}\right] \] \subsection{Solution} Gauss-Jordan elimination can be used to compute the inverse of the matrix $B$ . We start by augmenting the matrix B with an identity matrix to the right of the matrix $B$, so that we get it in the form $\left[B | I\right]$: \[ \left[\begin{array}{lll|lll} 0 & 2 & 3 & 1 & 0 & 0 \\ 2 & 4 & 0 & 0 & 1 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 1: Swap rows 1 and 2 \[ \left[\begin{array}{lll|lll} 2 & 4 & 0 & 0 & 1 & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 2: Divide row 1 by 2 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 3: Divide row 2 by 2 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 4: Multiply row 1 by 3 and subtract 3*row 1 from row 3 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & -1 & 1 & 0 & -\frac{3}{2} & 1 \end{array}\right] \] Step 5: Add row 3 with row 2 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] Step 6: Add $-2\cdot$ row 2 to row 1 \[ \left[\begin{array}{lll|lll} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] Step 7: $R_3' = 5/2 \cdot R_3$ \[ \left[\begin{array}{lll|lll} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] Step 8: $R_1' = 3R_3+R_1$ and $R_2' = -1.5\cdot R_3 + R_2$ \[ \left[\begin{array}{lll|lll} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\ 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] We now have the matrix in reduced stair step form, which means we have found its inverse. Thus is \[ \left[\begin{array}{lll|lll} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\ 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] \end{document} ```
https://tex.stackexchange.com/users/294191
How to number each step of a solution in a visually appealing manner?
false
* not really an answer ... * it seems that you may try to use `exam` documentclass which probably is more appropriate for your purposes * but design of your document is up to you * an example of possible document design, where is introduced `enumitem` package for your steps, is: ``` \documentclass{article} \usepackage{amsmath} \renewcommand\arraystretch{1.2} \usepackage{enumitem} \begin{document} \section{Task} Calculate the inverse of the matrix \[ B = \begin{bmatrix} 0 & 2 & 3 \\ 2 & 4 & 0 \\ 3 & 5 & 1 \end{bmatrix} \] \subsection*{Solution} Gauss-Jordan elimination can be used to compute the inverse of the matrix $B$. We start by augmenting the matrix B with an identity matrix to the right of the matrix $B$, so that we get it in the form $\left[B | I\right]$: \[ \left[\begin{array}{lll|lll} 0 & 2 & 3 & 1 & 0 & 0 \\ 2 & 4 & 0 & 0 & 1 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] To the solution then yield the following steps: \begin{enumerate}[leftmargin=*] \item Swap rows 1 and 2 \[ \left[\begin{array}{ccc|ccc} 2 & 4 & 0 & 0 & 1 & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] \item Divide row 1 by 2 \[ \left[\begin{array}{ccc|rrr} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] \item Divide row 2 by 2 \[ \left[\begin{array}{ccc|ccc} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] \item Multiply row 1 by 3 and subtract 3*row 1 from row 3 \[ \left[\begin{array}{rrr|rrr} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & -1 & 1 & 0 & -\frac{3}{2} & 1 \end{array}\right] \] \item Add row 3 with row 2 \[ \left[\begin{array}{rrr|rrr} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] \item Add $-2\cdot$ row 2 to row 1 \[ \left[\begin{array}{rrr|rrr} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] \item $R_3' = 5/2 \cdot R_3$ \[ \left[\begin{array}{rrr|rrr} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] \item $R_1' = 3R_3+R_1$ and $R_2' = -1.5\cdot R_3 + R_2$ \[ \left[\begin{array}{lll|rrr} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\ 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] We now have the matrix in reduced stair step form, which means we have found its inverse. Thus is \[ \left[\begin{array}{lll|rrr} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\ 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] \end{enumerate} \end{document} ```
4
https://tex.stackexchange.com/users/18189
683829
317,251
https://tex.stackexchange.com/questions/683827
2
I am seeking assistance with formatting my solution. Specifically, I am looking for a way to number each step of the solution without using the format "Step 1:", "Step 2:", and so on. I am hoping to find a more visually appealing way to number each step. Additionally, I would appreciate any help with formatting the solution neatly on Overleaf. If anyone has the skills to help me with these issues, please let me know. ``` \documentclass{article} \usepackage{amsmath} \begin{document} \section{Task} 1. Calculate the inverse of the matrix \[ B=\left[\begin{array}{lll} 0 & 2 & 3 \\ 2 & 4 & 0 \\ 3 & 5 & 1 \end{array}\right] \] \subsection{Solution} Gauss-Jordan elimination can be used to compute the inverse of the matrix $B$ . We start by augmenting the matrix B with an identity matrix to the right of the matrix $B$, so that we get it in the form $\left[B | I\right]$: \[ \left[\begin{array}{lll|lll} 0 & 2 & 3 & 1 & 0 & 0 \\ 2 & 4 & 0 & 0 & 1 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 1: Swap rows 1 and 2 \[ \left[\begin{array}{lll|lll} 2 & 4 & 0 & 0 & 1 & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 2: Divide row 1 by 2 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 3: Divide row 2 by 2 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] Step 4: Multiply row 1 by 3 and subtract 3*row 1 from row 3 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & -1 & 1 & 0 & -\frac{3}{2} & 1 \end{array}\right] \] Step 5: Add row 3 with row 2 \[ \left[\begin{array}{lll|lll} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] Step 6: Add $-2\cdot$ row 2 to row 1 \[ \left[\begin{array}{lll|lll} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] Step 7: $R_3' = 5/2 \cdot R_3$ \[ \left[\begin{array}{lll|lll} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] Step 8: $R_1' = 3R_3+R_1$ and $R_2' = -1.5\cdot R_3 + R_2$ \[ \left[\begin{array}{lll|lll} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\ 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] We now have the matrix in reduced stair step form, which means we have found its inverse. Thus is \[ \left[\begin{array}{lll|lll} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\ 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\ 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] \end{document} ```
https://tex.stackexchange.com/users/294191
How to number each step of a solution in a visually appealing manner?
false
You could load the `enumitem` package and use its machinery to create an enumerated list whose items start with the word "Step". ``` \documentclass{article} \usepackage{amsmath} % for 'bmatrix' environment \usepackage{enumitem} \newlist{stepenum}{enumerate}{1} \setlist[stepenum]{label={Step \arabic*.},wide=0pt} \begin{document} \section{Task} 1. Calculate the inverse of the matrix \[ B=\begin{bmatrix} 0 & 2 & 3 \\ 2 & 4 & 0 \\ 3 & 5 & 1 \end{bmatrix} \] \subsection{Solution} Gauss-Jordan elimination can be used to compute the inverse of the matrix $B$. We start by augmenting the matrix $B$ with an identity matrix to the right of the matrix $B$, so that we get it in the form $[B \mid I]$: \[ \left[\begin{array}{@{}rrr|rrr@{}} 0 & 2 & 3 & 1 & 0 & 0 \\ 2 & 4 & 0 & 0 & 1 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] \begin{stepenum} \item Swap rows 1 and 2 \[ \left[\begin{array}{@{}rrr|rrr@{}} 2 & 4 & 0 & 0 & 1 & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] \item Divide row 1 by 2 \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 2 & 3 & 1 & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] \item Divide row 2 by 2 \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 3 & 5 & 1 & 0 & 0 & 1 \end{array}\right] \] \item Multiply row 1 by 3 and subtract 3*row 1 from row 3 \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\ 0 & -1 & 1 & 0 & -\frac{3}{2} & 1 \end{array}\right] \] \item Add row 3 with row 2 \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 2 & 0 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\[\jot] 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] \item Add $-2\cdot$ row 2 to row 1 \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\[\jot] 0 & 0 & \frac{5}{2} & \frac{1}{2} & -\frac{3}{2} & 1 \end{array}\right] \] \item $R_3' = 5/2 \cdot R_3$ \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 0 & -3 & -1 & \frac{1}{2} & 0 \\ 0 & 1 & \frac{3}{2} & \frac{1}{2} & 0 & 0 \\[\jot] 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] \item $R_1' = 3R_3+R_1$ and $R_2' = -1.5\cdot R_3 + R_2$ \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\[\jot] 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\[\jot] 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] \end{stepenum} We now have the matrix in reduced stair step form, which means we have found its inverse. Thus is \[ \left[\begin{array}{@{}rrr|rrr@{}} 1 & 0 & 0 & -\frac{2}{5} & -\frac{13}{10} & \frac{6}{5} \\[\jot] 0 & 1 & 0 & \frac{1}{5} & \frac{9}{10} & -\frac{3}{5} \\[\jot] 0 & 0 & 1 & \frac{1}{5} & -\frac{3}{5} & \frac{2}{5} \end{array}\right] \] \end{document} ```
3
https://tex.stackexchange.com/users/5001
683830
317,252
https://tex.stackexchange.com/questions/683743
0
The example below compiles and makes a clickable link, but in the printed version it is not clear where the link is going. I suppose to solve that, I could implement some kind of reverse link in a similar way, but I have a feeling there are much more elegant ways (maybe specialized packages?) to tackle this problem, especially if many of this kind of links are involved. As for how exactly these references look in the document I'm pretty open-minded. Could be line numbers, some kind of colored markers or something else entirely. Best case is the reference works back and forth both digitally and in print. Any suggestions? ``` \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage{lipsum} \begin{document} The most important thing to understand in this course is that dogs don't like cats \hyperref[ref:DogsCats]{(see here)}. % rest of the document \lipsum[1-10] % in appendix: Some wall of text that explains how animals don't always like each other. This text is really long so a reference to the section isn't precise enough, and it can't be changed or reformatted in any way. For example, monkeys don't like bats, crocodiles don't like pangolins, 50 other animals also don't like each other, dogs don't like cats \phantomsection\label{ref:DogsCats}, mice don't like rabbits, and a good 30 more examples. \end{document} ```
https://tex.stackexchange.com/users/45734
Good way to reference a specific part of a long text?
true
Here's what I pieced together using `lineno` and a few other answers on this site. Doesn't do everything I wanted, but its relatively simple and good enough for me. ``` \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage[pagewise,right]{lineno} \usepackage{lipsum} \newcommand{\llabel}[1]{% \hypertarget{llineno:#1}{\linelabel{#1}}} \newcommand{\linepageref}[1]{% page~\hyperlink{llineno:#1}{\pageref*{#1}}\ % line~\hyperlink{llineno:#1}{\ref*{#1}}} \begin{document} \section{Document} The most important thing to understand in this course is that dogs don't like cats [\linepageref{ref:DogsCats}]. \section{Appendix} \begin{linenumbers} Some wall of text that explains how animals don't always like each other. This text is really long so a reference to the section isn't precise enough, and it can't be changed or reformatted in any way. For example, monkeys don't like bats, crocodiles don't like pangolins, 50 other animals also don't like each other, dogs don't like cats \llabel{ref:DogsCats}, mice don't like rabbits, and a good 30 more examples. \end{linenumbers} \end{document} ```
0
https://tex.stackexchange.com/users/45734
683836
317,253
https://tex.stackexchange.com/questions/367126
1
I am trying to modify this template: <https://www.sharelatex.com/templates/journals/iccv-2017---international-conference-on-computer-vision> I want the email below the respective author name and a common institution even further below. I got some errors. I changed the lines 30-44 into this: ``` \author{First Author\\ {\tt\small firstauthor@i1.org} % For a paper whose authors are all at the same institution, % omit the following lines up until the closing ``}''. % Additional authors and addresses can be added with ``\and'', % just like the second author. % To save space, use either the email address or home page, not both \and Second Author\\ {\tt\small secondauthor@i2.org} } %HERE I need the university name ``` I cannot make it work no matter what, haha this is so annoying!
https://tex.stackexchange.com/users/132276
change author block in iccv template
false
I found it helpful to change line 8 to the following, `\usepackage[cvprfinal]{cvpr}` from `\usepackage[review]{cvpr}`
1
https://tex.stackexchange.com/users/295676
683837
317,254
https://tex.stackexchange.com/questions/683835
5
It's in the title. I'm trying to make a command-creating macro which would quickly create a length and setting it to some `\settowidth{}{}` output, then making it a command for horizontal spacing. I also tried with `\csname#1\endcsname` but it doesn't work either. ``` \documentclass{article} \newcommand{\newspace}[2]{% \newlength{#1aux}% \settowidth{#1aux}{#2}% \newcommand{#1}{\hspace*{#1aux}}} \begin{document} \newspace{\QQspace}{QQ} AQQA A\QQspace A \end{document} ```
https://tex.stackexchange.com/users/262813
Problem with macro for creating and defining length using \settowidth and then making it an hspace command
true
The crux of the answer is given in [How to define a macro to create a new macro with a name passed as its argument?](https://tex.stackexchange.com/q/25452/106162) with the `#1aux` macro requiring additional `\csname`s and associated `\expandafter`s to ensure the `\csname` happens first. ``` \newcommand{\newspace}[2]{% \expandafter\newlength\expandafter{\csname#1aux\endcsname}% \expandafter\settowidth\expandafter{\csname#1aux\endcsname}{#2}% \expandafter\newcommand\expandafter{\csname#1\endcsname}{% \expandafter\hspace\expandafter*\expandafter{\csname#1aux\endcsname}}} ``` However with the aid of the `calc` package, `\widthof` circumvents a lot of unpleasant boilerplate code ``` \newcommand{\betternewspace}[2]{% \expandafter\newcommand\expandafter{\csname#1\endcsname}{\hspace*{\widthof{#2}}}} ``` `\hphantom{#2}` (which doesn't require `calc`) has a similar effect to `\hspace*{\widthof{#2}}` but acts as `\hspace` rather than `\hspace*`. ``` \documentclass{article} \usepackage{calc} \newcommand{\newspace}[2]{% \expandafter\newlength\expandafter{\csname#1aux\endcsname}% \expandafter\settowidth\expandafter{\csname#1aux\endcsname}{#2}% \expandafter\newcommand\expandafter{\csname#1\endcsname}{\expandafter\hspace\expandafter*\expandafter{\csname#1aux\endcsname}}} \newcommand{\betternewspace}[2]{% \expandafter\newcommand\expandafter{\csname#1\endcsname}{\hspace*{\widthof{#2}}}} \begin{document} \newspace{QQspace}{QQ} \betternewspace{QQspaceTwo}{QQ} \noindent% AQQA\\ A\QQspace B\\ A\QQspaceTwo B\\ \end{document} ```
4
https://tex.stackexchange.com/users/106162
683839
317,255
https://tex.stackexchange.com/questions/683835
5
It's in the title. I'm trying to make a command-creating macro which would quickly create a length and setting it to some `\settowidth{}{}` output, then making it a command for horizontal spacing. I also tried with `\csname#1\endcsname` but it doesn't work either. ``` \documentclass{article} \newcommand{\newspace}[2]{% \newlength{#1aux}% \settowidth{#1aux}{#2}% \newcommand{#1}{\hspace*{#1aux}}} \begin{document} \newspace{\QQspace}{QQ} AQQA A\QQspace A \end{document} ```
https://tex.stackexchange.com/users/262813
Problem with macro for creating and defining length using \settowidth and then making it an hspace command
false
Here is a solution based on `Dai Bowen`'s answer, but restablishing the `backslash` in the argument. Credit: [Martin Scharrer](https://tex.stackexchange.com/a/25453/262813). ``` \documentclass{article} \usepackage{calc} % Provides the useful \widthof command. \makeatletter % Makes the character "@" a normal letter (here needed to call the \@gobble macro). \newcommand{\newspace}[2]{% \expandafter\newcommand\csname\expandafter\@gobble\string#1\endcsname{% \hspace*{\widthof{#2}}% }% } \makeatother % Resets @'s catcode to default. \begin{document} \newspace{\QQspace}{QQ} AQQA A\QQspace A \end{document} ```
1
https://tex.stackexchange.com/users/262813
683840
317,256
https://tex.stackexchange.com/questions/47063
197
Is it better to use `\Rightarrow` or `\implies` to symbolize logical implications? Why? Also, if I write `\not \Rightarrow`, I get a symbol that means "does not imply." But if I type `\not \implies`, it doesn't look right. How do I get the corresponding "does not imply" symbol?
https://tex.stackexchange.com/users/9757
\Rightarrow vs. \implies, and "does not imply" symbol
false
It's my answer of your second question: ``` $A \rlap{\(\quad\not\)}\implies B$ ``` or ``` $$ A \rlap{$\quad\not$}\implies B $$ ``` whick looks like this: Perhaps, it's not the best solution, but it's short and doesn't need external packages.
2
https://tex.stackexchange.com/users/295682
683844
317,258
https://tex.stackexchange.com/questions/683831
2
I was just figuring out how to cite multiple lines to same footnote. I use `\usepackage{threeparttable}` to do so. However, the table I am making is quite large (over 70 lines), and this seems to have messed up with the `\centering` command. The table has shifted to the right. Now, I am using resizebox to fit the whole thing into one page, and I am not comfortable picking random `\renewcommand` because I am not always sure what that could do to my specific case. The table is still all in within the page, but I would really love to have it centered. Here is minimum viable code, and part of the table. ``` \documentclass[a4paper,12pt,twoside,BCOR=10mm]{scrbook} \usepackage[utf8]{inputenc} \usepackage[icelandic]{babel} % \usepackage{t1enc} \usepackage[T1]{fontenc} \usepackage[dvipsnames]{xcolor} \usepackage{graphicx,booktabs} \usepackage[intoc]{nomencl} \usepackage{enumerate,color} \usepackage{url} \usepackage{appendix} \usepackage{float} \usepackage{eso-pic} \usepackage{amsmath} \usepackage{amssymb} \usepackage{longtable} \usepackage{acronym} \usepackage{nicematrix} \usepackage{makecell} % \usepackage{tablefootnote} \usepackage{threeparttable} %\usepackage[sf,normalsize]{subfigure} \usepackage[format=plain,labelformat=simple,labelsep=colon]{caption} \usepackage{placeins} \usepackage{tabularx} \usepackage{multirow} \usepackage{adjustbox} \usepackage{subcaption} %\usepackage{subfig} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{external} % Packages used for title page layout \usepackage{tikz} \usetikzlibrary{positioning} \usepackage[pdfborder={0 0 0}]{hyperref} % \usepackage{scrextend} \begin{document \begin{table} \centering {\small\renewcommand{\arraystretch}{.8} \caption{Spá um raforkunotkun, forgangsorka og skerðanleg orka. Almenn notkun að meðtöldum dreifitöpum og núverandi og samþykktir nýir stórnotendur. \label{table:Orkuspá}} \resizebox{!}{.31\paperheight}{ \begin{threeparttable} \begin{NiceTabular}{lcccccccccc} \hline \Block{2-1}{Ár} & \Block{1-2}{Úttekt frá dreifikerfinu\\ forgangs- og skerðanleg\\ orka með dreifitöpum} & & \Block{1-2}{Úttekt frá\\ flutningskerfinu} & & \Block{1-2}{Flutningstöp} & & \Block{1-2}{Úttekt frá \\ vinnslufyrirtækjum} & & \Block{1-2}{Samtals} \\ & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW \\ \hline 2015 \tnote{1} & 3.604,74 & 618,46 & 14.356,34 & 1.685,89 & 369,56 & 57,11 & 468,32 & 75,40 & 18.798,96 & 2.383,25 \\ 2016 \tnote{1} & 3.383,99 & 590,10 & 14.334,19 & 1.695,96 & 360,42 & 57,05 & 470,86 & 71,46 & 18.549,46 & 2.378,51 \\ 2017 \tnote{1} & 3.519,13 & 608,86 & 14.869,95 & 1.750,87 & 373,07 & 61,49 & 476,38 & 84,74 & 19.238,53 & 2.443,61 \\ 2018 \tnote{1} & 3.682,07 & 623,26 & 15.259,88 & 1.838,28 & 398,09 & 70,47 & 489,75 & 70,71 & 19.829,79 & 2.519,53 \\ 2019 \tnote{1} & 3.506,86 & 596,63 & 15.145,31 & 1.829,48 & 365,82 & 63,40 & 476,84 & 85,11 & 19.494,83 & 2.495,07 \\ 2020 \tnote{1} & 3.473,77 & 596,83 & 14.830,70 & 1.790,95 & 353,09 & 60,54 & 469,74 & 72,27 & 19.127,30 & 2.408,28 \\ 2021 & 3.688,10 & 630,47 & 15.539,59 & 1.865,64 & 397,70 & 67,72 & 479,82 & 73,82 & 20.105,21 & 2.584,89 \\ 2022 & 3.785,98 & 647,81 & 16.099,28 & 1.875,76 & 416,40 & 69,68 & 490,14 & 75,41 & 20.791,80 & 2.615,29 \\ \hline \end{NiceTabular} \begin{tablenotes} \item[1] Rauntölur \end{tablenotes} \end{threeparttable}}} \end{table} \end{document} ``` I am sorry if I come off as dry, I am just tired after long day, and that same footnote over many lines took way too much time to figure out.
https://tex.stackexchange.com/users/289862
Table placement got messed up by using `threeparttable`
false
The phenomenon you describe as "the table shifting to the right" is almost certainly an optical illusion, caused by the fact that the table is very wide due to its having 11 columns. I would advise strongly against using either `\resizebox` or the `adjustbox` machinery to cram the table into a single page, as that trick will almost certainly result in the material being rendered so tiny as to make it utterly illegible and indecipherable. Instead, I suggest you use one or more landscape-mode pages to render the table. Just how many are needed depends on how many rows the real table has. The following screenshot shows the result of rendering the table provided in your code in a `sidewaystable` environment. Note that I've employed some of the machinery of the `siunitx` package to help auto-format the numerical data. If your table needs to be displayed across several `sidewaystable` environments, be sure to employ the `\ContinuedFloat` macro of the `\caption` package to help adjust the numbering of the table captions. I'm afraid I don't understand Icelandic, but I can't help but remark that it might be useful if you made the sub-header above data columns 1 and 2 less, well, wordy. :-) ``` \documentclass[a4paper,12pt,twoside,BCOR=10mm]{scrbook} % \usepackage[utf8]{inputenc} % that's the default nowadays \usepackage[icelandic]{babel} \usepackage[T1]{fontenc} \usepackage[dvipsnames]{xcolor} \usepackage{graphicx} \usepackage{booktabs} % for well-spaced horizontal rules \usepackage[intoc]{nomencl} \usepackage{enumerate} %,color \usepackage{xurl} % allow linebreaks at arbitrary points in a long URL string \usepackage{appendix} \usepackage{eso-pic} \usepackage{amsmath} \usepackage{amssymb} \usepackage{longtable} \usepackage{acronym} \usepackage{nicematrix} \usepackage{makecell} \usepackage[flushleft]{threeparttable} % <-- use 'flushleft' option \usepackage[format=plain,labelformat=simple,labelsep=colon]{caption} \usepackage{subcaption} \usepackage{placeins} \usepackage{tabularx} \usepackage{multirow} %%%%\usepackage{adjustbox} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{external} \usepackage{tikz} \usetikzlibrary{positioning} \usepackage[pdfborder={0 0 0}]{hyperref} % new code: \usepackage[figuresright]{rotating} % for 'sidewaystable' env. \usepackage{siunitx} \newcolumntype{T}[1]{S[table-format=#1]} \newcommand\mybox[1]{\multicolumn{2}{c}{% \begin{tabular}[t]{@{} c @{}} #1 \end{tabular}}} % \usepackage{scrextend} \begin{document} \begin{sidewaystable} \sisetup{group-minimum-digits =4, group-separator ={.}, output-decimal-marker={,}} \setlength\tabcolsep{0pt} % let LaTeX figure out intercol. separation \begin{threeparttable} \caption{Spá um raforkunotkun, forgangsorka og skerðanleg orka. Almenn notkun að meðtöldum dreifitöpum og núverandi og samþykktir nýir stórnotendur.\strut} \label{table:Orkuspá} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l T{4.2}T{3.2} T{5.2}T{4.2} *{2}{T{3.2}T{2.2}} T{5.2}T{4.2} } \toprule Ár & \mybox{Úttekt frá dreifikerfinu\\ forgangs- og skerðanleg\\ orka með dreifitöpum} & \mybox{Úttekt frá\\ flutningskerfinu} & \mybox{Flutningstöp} & \mybox{Úttekt frá \\ vinnslufyrirtækjum} & \mybox{Samtals} \\ \cmidrule{2-3} \cmidrule{4-5} \cmidrule{6-7} \cmidrule{8-9} \cmidrule{10-11} & {Orka GWh} & {Afl MW} & {Orka GWh} & {Afl MW} & {Orka GWh} & {Afl MW} & {Orka GWh} & {Afl MW} & {Orka GWh} & {Afl MW} \\ \midrule 2015\tnote{1} & 3604,74 & 618,46 & 14356,34 & 1685,89 & 369,56 & 57,11 & 468,32 & 75,40 & 18798,96 & 2383,25 \\ 2016\tnote{1} & 3383,99 & 590,10 & 14334,19 & 1695,96 & 360,42 & 57,05 & 470,86 & 71,46 & 18549,46 & 2378,51 \\ 2017\tnote{1} & 3519,13 & 608,86 & 14869,95 & 1750,87 & 373,07 & 61,49 & 476,38 & 84,74 & 19238,53 & 2443,61 \\ 2018\tnote{1} & 3682,07 & 623,26 & 15259,88 & 1838,28 & 398,09 & 70,47 & 489,75 & 70,71 & 19829,79 & 2519,53 \\ 2019\tnote{1} & 3506,86 & 596,63 & 15145,31 & 1829,48 & 365,82 & 63,40 & 476,84 & 85,11 & 19494,83 & 2495,07 \\ 2020\tnote{1} & 3473,77 & 596,83 & 14830,70 & 1790,95 & 353,09 & 60,54 & 469,74 & 72,27 & 19127,30 & 2408,28 \\ 2021 & 3688,10 & 630,47 & 15539,59 & 1865,64 & 397,70 & 67,72 & 479,82 & 73,82 & 20105,21 & 2584,89 \\ 2022 & 3785,98 & 647,81 & 16099,28 & 1875,76 & 416,40 & 69,68 & 490,14 & 75,41 & 20791,80 & 2615,29 \\ \bottomrule \end{tabular*} \smallskip\footnotesize \begin{tablenotes} \item[1] Rauntölur \end{tablenotes} \end{threeparttable} \end{sidewaystable} \end{document} ```
1
https://tex.stackexchange.com/users/5001
683850
317,261
https://tex.stackexchange.com/questions/683024
1
I had previously posted a question about Arara, with TeXlive 2022 and with specific reference to ConTeXt (see [ConTeXt and Arara, failure](https://tex.stackexchange.com/questions/679661/texworks-run-context-compiler-from-arara?noredirect=1#comment1691318_679661). That question has been closed due to "lack of clarity", and I have abandoned it in lieu of this new question. So: I now have TeXlive 2023 installed from ISO -> USB method (see [2023 TeXlive install failure](https://tex.stackexchange.com/posts/comments/1694457?noredirect=1). When I attempt to run Arara within TeXstudio, TeXworks, or Kile, arara simply gives me the 'splash' display, as so: ``` Usage: arara [OPTIONS] file... __ _ _ __ __ _ _ __ __ _ / _` | '__/ _` | '__/ _` | | (_| | | | (_| | | | (_| | \__,_|_| \__,_|_| \__,_| The cool TeX automation tool. arara executes the TeX workflow you tell it to execute. Simply specify your needs within your TeX file and let arara do the work. These directives feature conditional execution and parameter expansion. Options: -l, --log Generate a log output -v, --verbose / -s, --silent Print the command output -n, --dry-run Go through all the motions of running a command, but with no actual calls -S, --safe-run Run in safe mode and disable potentially harmful features. Make sure your projects uses only allowed features. -w, --whole-file Extract directives in the file, not only in the header -p, --preamble TEXT Set the file preamble based on the configuration file -t, --timeout INT Set the execution timeout (in milliseconds) -L, --language TEXT Set the application language -m, --max-loops INT Set the maximum number of loops (> 0) -d, --working-directory PATH Set the working directory for all tools -P, --call-property VALUE Pass parameters to the application to be used within the session. --generate-completion [bash|zsh|fish] Generate a completion script for arara. Add 'source <(arara --generate-completion <shell>)' to your shell's init file. -V, --version Show the version and exit -h, --help Show this message and exit Arguments: file The file(s) to evaluate and process ``` **NOTE:** I view this is an improvement of sorts when compared to the prior error that I had, wherein arara told me that it `**could not access the arara.jar file**` **NOTE:** I can successfully run arara from the terminal window, but ONLY if the terminal window is opened from the folder where the 'my\_document.tex' file resides: ``` username@username-computername:~/Documents/documents_2022_2023/specific_documents$ arara my_document.tex __ _ _ __ __ _ _ __ __ _ / _` | '__/ _` | '__/ _` | | (_| | | | (_| | | | (_| | \__,_|_| \__,_|_| \__,_| Processing "my_document.tex" (size: 7.1 kB, last modified: 2023-04-15 19:52:08), please wait. (LuaLaTeX) LuaLaTeX engine .............................. SUCCESS Total: 1.513 seconds username@username-computername:~/Documents/documents_2022_2023/specific_documents$ ``` IF, on the other hand, I execute the same command from the same directory, ***under Root control:*** ``` username@username-computername:~/Documents/documents_2022_2023/specific_documents# arara my_document.tex ``` the operation fails. It issues a reply, ``` root@username-computername:/home/username/Documents/documents_2022_2023/specific_documents# arara my_document.tex Error: Unable to access jarfile root@username-computername:/home/username/Documents/documents_2022_2023/specific_documents ``` It seems to me that the behavior in terminal mode must offer some clue(s) as to why I cannot get arara to run in any of the TeX-specific editors. Clearly, it has something to do with permissions. But, I cannot see and understand where it comes off the rails, so to speak.
https://tex.stackexchange.com/users/287274
New 2023 TeXlive, similar but different arara problem
false
After carefully examining the compiling commands (pdflatex, lualatex...etc) within each of the editors (TeXworks, TeXstudio, Kile), I have solved my own problem. A clue came from the fact that, although *Arara* would run from the terminal, when it was called from within these TeX editors, it would display the same "splash" screen as found at the terminal were you to run the command `$ arara`, ***without** specifying a target file to process*. I still have NO idea of how **all three** of these editors came to simultaneously have the same issue with running *Arara* (they were running fine previously). It will probably remain a mystery. As I hinted above, in every case the problem arose from within the editor because *Arara* was **not** supplied with a \***.tex** file-name to work on (NB: my intuition that the compiler would automatically [magically?] use the file that was "in progress", was *wrong*.) The editor must be set-up to supply the \***.tex** file-name when *Arara* is called. Here are the setup requirements for each editor that I've been experimenting with: **For TeXstudio:** Go to OPTIONS --> Configure TeXstudio --> Build --> User Commands; choose "+Add" , then add this Path to the *arara* program (placed inside double quotes, as shown below), to which it is appended **%.tex**: `"/usr/local/texlive/2023/bin/x86_64-linux/arara" %.tex` Click OK to exit. Check your editors function with a known-good \*.tex file that compiles with a known compiler (say, pdflatex); for example, add `% arara: pdflatex` as the first line of your preamble. **NOTE:** with ConTeXt, you will have to use the suffix **.tex** for your working file, even though the ConTeXt team doesn't recommend using the normal \*.tex extension (to distinguish them, my ConTeXt documents now appear as `my_filename.mkiv.tex`) \*\*\*\*. **For TeXworks:** from the menu, choose Edit --> Preferences -->Typesetting; Choose (or create anew) the Processing Tool from the list; then click Edit...; then in the Tool Configuration Menu enter Name: *arara* Program: *arara* Arguments: $fullname (you may choose to "view PDF after running") Click OK. Test your system with a known good \*.tex file, using *arara* as the compiler, as suggested above **For Kile:** From the menu, Settings --> Configure Kile --> Build Select the tool *arara* (or add it, if necessary); then you will have to configure the tool using the 3-tabbed menu on the right; Select: Default {<---See my note at \*\*\*, below} Under the "General" tab, choose Command: *arara* Options: %source Under the "Advanced" tab, Type: Run Outside of Kile Class: Compile Source Extension: (leave blank) Target Extension: PDF Target File: (leave blank) relative dir: (leave blank) (click OK) Test your Kile editor with *arara*, as outlined above **To recap:** the *.tex file to be compiled is tagged in three different ways: In TeXstudio, it is "***.tex**"; In TeXworks, it is "**$fullname**"; and, In Kile, it is "**%source**" \*\*\* A 2nd configuration might be added, specifically for ConTeXt using a specific engine (ConTeXt-Lualatex, for example), but I have not tested this \*\*\*\*It is likely that a 2nd User Command (named "arara-Context", for example) can be added, with a different file extension as the target (for example, **%.mkiv**), but I have not tested this yet
1
https://tex.stackexchange.com/users/287274
683853
317,263
https://tex.stackexchange.com/questions/683831
2
I was just figuring out how to cite multiple lines to same footnote. I use `\usepackage{threeparttable}` to do so. However, the table I am making is quite large (over 70 lines), and this seems to have messed up with the `\centering` command. The table has shifted to the right. Now, I am using resizebox to fit the whole thing into one page, and I am not comfortable picking random `\renewcommand` because I am not always sure what that could do to my specific case. The table is still all in within the page, but I would really love to have it centered. Here is minimum viable code, and part of the table. ``` \documentclass[a4paper,12pt,twoside,BCOR=10mm]{scrbook} \usepackage[utf8]{inputenc} \usepackage[icelandic]{babel} % \usepackage{t1enc} \usepackage[T1]{fontenc} \usepackage[dvipsnames]{xcolor} \usepackage{graphicx,booktabs} \usepackage[intoc]{nomencl} \usepackage{enumerate,color} \usepackage{url} \usepackage{appendix} \usepackage{float} \usepackage{eso-pic} \usepackage{amsmath} \usepackage{amssymb} \usepackage{longtable} \usepackage{acronym} \usepackage{nicematrix} \usepackage{makecell} % \usepackage{tablefootnote} \usepackage{threeparttable} %\usepackage[sf,normalsize]{subfigure} \usepackage[format=plain,labelformat=simple,labelsep=colon]{caption} \usepackage{placeins} \usepackage{tabularx} \usepackage{multirow} \usepackage{adjustbox} \usepackage{subcaption} %\usepackage{subfig} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{external} % Packages used for title page layout \usepackage{tikz} \usetikzlibrary{positioning} \usepackage[pdfborder={0 0 0}]{hyperref} % \usepackage{scrextend} \begin{document \begin{table} \centering {\small\renewcommand{\arraystretch}{.8} \caption{Spá um raforkunotkun, forgangsorka og skerðanleg orka. Almenn notkun að meðtöldum dreifitöpum og núverandi og samþykktir nýir stórnotendur. \label{table:Orkuspá}} \resizebox{!}{.31\paperheight}{ \begin{threeparttable} \begin{NiceTabular}{lcccccccccc} \hline \Block{2-1}{Ár} & \Block{1-2}{Úttekt frá dreifikerfinu\\ forgangs- og skerðanleg\\ orka með dreifitöpum} & & \Block{1-2}{Úttekt frá\\ flutningskerfinu} & & \Block{1-2}{Flutningstöp} & & \Block{1-2}{Úttekt frá \\ vinnslufyrirtækjum} & & \Block{1-2}{Samtals} \\ & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW \\ \hline 2015 \tnote{1} & 3.604,74 & 618,46 & 14.356,34 & 1.685,89 & 369,56 & 57,11 & 468,32 & 75,40 & 18.798,96 & 2.383,25 \\ 2016 \tnote{1} & 3.383,99 & 590,10 & 14.334,19 & 1.695,96 & 360,42 & 57,05 & 470,86 & 71,46 & 18.549,46 & 2.378,51 \\ 2017 \tnote{1} & 3.519,13 & 608,86 & 14.869,95 & 1.750,87 & 373,07 & 61,49 & 476,38 & 84,74 & 19.238,53 & 2.443,61 \\ 2018 \tnote{1} & 3.682,07 & 623,26 & 15.259,88 & 1.838,28 & 398,09 & 70,47 & 489,75 & 70,71 & 19.829,79 & 2.519,53 \\ 2019 \tnote{1} & 3.506,86 & 596,63 & 15.145,31 & 1.829,48 & 365,82 & 63,40 & 476,84 & 85,11 & 19.494,83 & 2.495,07 \\ 2020 \tnote{1} & 3.473,77 & 596,83 & 14.830,70 & 1.790,95 & 353,09 & 60,54 & 469,74 & 72,27 & 19.127,30 & 2.408,28 \\ 2021 & 3.688,10 & 630,47 & 15.539,59 & 1.865,64 & 397,70 & 67,72 & 479,82 & 73,82 & 20.105,21 & 2.584,89 \\ 2022 & 3.785,98 & 647,81 & 16.099,28 & 1.875,76 & 416,40 & 69,68 & 490,14 & 75,41 & 20.791,80 & 2.615,29 \\ \hline \end{NiceTabular} \begin{tablenotes} \item[1] Rauntölur \end{tablenotes} \end{threeparttable}}} \end{table} \end{document} ``` I am sorry if I come off as dry, I am just tired after long day, and that same footnote over many lines took way too much time to figure out.
https://tex.stackexchange.com/users/289862
Table placement got messed up by using `threeparttable`
false
A try to fit your table on portrait oriented page. By use of `talltblr` of `tabularray` package, which is offer functionalčity of the to classic `threeparttable`, with libraries `booktabs` and `siunitx`. ``` \documentclass[a4paper,12pt,twoside,BCOR=10mm]{scrbook} \usepackage[icelandic]{babel} \usepackage[T1]{fontenc} \usepackage[dvipsnames]{xcolor} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \sisetup{group-minimum-digits =4, group-separator ={.}, output-decimal-marker={,}} \newcommand\TN[1]{\TblrNote{#1}} \usepackage[format=plain, labelformat=simple,labelsep=colon]{caption} %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \begin{document} \begin{table} \footnotesize \centering \SetTblrStyle{note}{font=\scriptsize} \begin{talltblr}[ caption = {Spá um raforkunotkun, forgangsorka og skerðanleg orka. Almenn notkun að meðtöldum dreifitöpum og núverandi og samþykktir nýir stórnotendur.}, label = {table:Orkuspá}, note{1} = {Rauntölur} ]{colsep = 2.9pt, colspec = {@{} l Q[c, si={table-format=4.2}] Q[c, si={table-format=3.2}] Q[c, si={table-format=5.2}] Q[c, si={table-format=4.2}] *{2}{Q[c, si={table-format=3.2}] Q[c, si={table-format=2.2}]} Q[c, si={table-format=5.2}] Q[c, si={table-format=4.2}] @{}}, row{1,2} = {guard, b}, hspan=even } \toprule \SetCell[r=2]{c} Ár & \SetCell[c=2]{c} {Úttekt frá dreifikerfinu\\ forgangsog skerðanleg\\ orka með dreifitöpum} & & \SetCell[c=2]{c} {Úttekt frá\\ flutningskerfinu} & & \SetCell[c=2]{c} Flutningstöp & &\SetCell[c=2]{c} {Úttekt frá \\ vinnslufyrir-\\tækjum} & & \SetCell[c=2]{c} Samtals & \\ \cmidrule[lr=-0.4]{2-3} \cmidrule[lr=-0.4]{4-5} \cmidrule[lr=-0.4]{6-7} \cmidrule[lr=-0.4]{8-9} \cmidrule[lr=-0.4]{10-11} & {Orka\\ GWh} & {Afl\\ MW} & {Orka\\ GWh} & {Afl\\ MW} & {Orka\\ GWh} & {Afl\\ MW} & {Orka\\ GWh} & {Afl\\ MW} & {Orka\\ GWh} & {Afl\\ MW} \\ \midrule 2015\TN{1} & 3 604,74 & 618,46 & 14 356,34 & 1 685,89 & 369,56 & 57,11 & 468,32 & 75,40 & 18 798,96 & 2 383,25 \\ 2016\TN{1} & 3 383,99 & 590,10 & 14 334,19 & 1 695,96 & 360,42 & 57,05 & 470,86 & 71,46 & 18 549,46 & 2 378,51 \\ 2017\TN{1} & 3 519,13 & 608,86 & 14 869,95 & 1 750,87 & 373,07 & 61,49 & 476,38 & 84,74 & 19 238,53 & 2 443,61 \\ 2018\TN{1} & 3 682,07 & 623,26 & 15 259,88 & 1 838,28 & 398,09 & 70,47 & 489,75 & 70,71 & 19 829,79 & 2 519,53 \\ 2019\TN{1} & 3 506,86 & 596,63 & 15 145,31 & 1 829,48 & 365,82 & 63,40 & 476,84 & 85,11 & 19 494,83 & 2 495,07 \\ 2020\TN{1} & 3 473,77 & 596,83 & 14 830,70 & 1 790,95 & 353,09 & 60,54 & 469,74 & 72,27 & 19 127,30 & 2 408,28 \\ 2021 & 3 688,10 & 630,47 & 15 539,59 & 1 865,64 & 397,70 & 67,72 & 479,82 & 73,82 & 20 105,21 & 2 584,89 \\ 2022 & 3 785,98 & 647,81 & 16 099,28 & 1 875,76 & 416,40 & 69,68 & 490,14 & 75,41 & 20 791,80 & 2 615,29 \\ \bottomrule \end{talltblr} \end{table} \end{document} ```
1
https://tex.stackexchange.com/users/18189
683857
317,265
https://tex.stackexchange.com/questions/683848
3
I can't make the bullet points appear in my beamer template, but they appear in the contents list. ``` \documentclass[11pt,usenames,xcolor=dvipsnames,aspectratio=169]{beamer} \mode<presentation> \usetheme{Madrid} \usecolortheme[named=PineGreen]{structure} \usecolortheme{dolphin} \setbeamercolor{mord}{bg=PineGreen!60!White} \setbeamerfont{footline}{series=\bfseries} \setbeamersize{text margin left=5mm,text margin right=5mm} \setbeamercolor{titlelike}{parent=structure} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} %\usepackage{epstopdf} \usepackage{subfig} \usepackage{pstricks} \usepackage{ragged2e} \usepackage{color} \usepackage{bbding} \usepackage{tikzsymbols} \usepackage{pstricks-add} \usepackage{booktabs} \usepackage{multirow} \usepackage{hyperref} \usepackage{smartdiagram} \usepackage{appendixnumberbeamer} \usepackage[justification=justified,format=plain]{caption} \usepackage{pstricks} \usepackage{pst-node} % para diagramas \usepackage{pst-plot} % para representacion de datos funciones, etc \usepackage{auto-pst-pdf} \usepackage{pst-pdf} \usepackage{pst-coil} \usepackage{graphicx} \usepackage{multirow} \usepackage{multicol} \usepackage{xcolor} \usepackage{parskip} \usepackage{pgfpages} \usepackage{mathrsfs} \usepackage{pslatex} \usepackage{mathptmx} \usepackage{enumerate} \usepackage{enumitem} \usepackage[full]{textcomp} \usepackage{fancyhdr} \newcommand{\grad}{$^{\circ} $} \newcommand{\dint}{\displaystyle\int} \newcommand{\registered}{\textsuperscript{\textregistered}} \newcommand{\dsum} {\displaystyle\sum} \newcommand{\dprod} {\displaystyle\prod} \DeclareMathOperator*{\argmax}{arg\,max} \usepackage{textpos} %posicionar texto donde quiera \usepackage[backend=biber,style=numeric-comp,sorting=none]{biblatex} \renewcommand{\raggedright}{\leftskip=0pt \rightskip=0pt plus 0cm} \addbibresource{biblio.bib} \addbibresource{publications.bib} \renewcommand*{\mkbibcompletename}[1]{% \ifitemannotation{highlight} {\textbf{#1}} {#1}% } % Pone mi nombre en negritas \renewcommand{\footnotesize}{\tiny} %Las footnotes son en tamaño pequeño \setbeamertemplate{caption}{\raggedright\insertcaption\par} %%%%%%%%%%% \title[Adaptive control using RL]{Adaptive} \subtitle{\vspace{0.2cm}Doctoral Defense} \author[K. R]{KR} \institute [University]{} % (optional) \date[April, 2023]{\small April 14, 2020} \AtBeginSection[] { \begin{frame}[noframenumbering,plain] \frametitle{Outline} \begin{columns}[t] \begin{column}{.5\textwidth} \tableofcontents[currentsection,hideothersubsections,sections={1-4}] \end{column} \begin{column}{.5\textwidth} \tableofcontents[currentsection,hideothersubsections,sections={5-7}] \end{column} \end{columns} \end{frame} } \setbeamertemplate{section in toc}{% {\color{red!70!black}\inserttocsectionnumber.}~\inserttocsection} \setbeamercolor{subsection in toc}{bg=white,fg=black} \setbeamertemplate{subsection in toc}{% \hspace{1.2em}{\color{red}\rule[0.3ex]{3pt}{3pt}}~\inserttocsubsection\par} % \setbeamertemplate{itemize item}{fg=red} \setbeamertemplate{navigation symbols}{} \begin{document} \begin{frame}[noframenumbering,plain] \maketitle \end{frame} \begin{frame}[noframenumbering,plain] \frametitle{Outline} \begin{columns}[t] \begin{column}{.5\textwidth} \tableofcontents[hideallsubsections,sections={1-4}] \end{column} \begin{column}{.5\textwidth} \tableofcontents[hideallsubsections,sections={5-7}] \end{column} \end{columns} \end{frame} \section{Overview} \subsection{Context} \begin{frame} \frametitle{Overview} \framesubtitle{} \justifying \begin{columns} \begin{column}{0.5\textwidth} \begin{itemize} \item Designed to perform many tasks: \begin{itemize} \item Rescue \item Healthcare \end{itemize} \item Complex variety of capabilities: \begin{itemize} \item Climbing stairs \item Avoiding obstacles \item Jumping \item Walking on slopes \end{itemize} \end{itemize} \end{column} \begin{column}{0.5\textwidth} \centering \begin{itemize} \item Many approaches have arisen with the aim of improving how robotic devices interact in human-oriented environments \end{itemize} \smartdiagramset{planet color=orange!60, distance planet-satellite=1cm} \scalebox{0.55}{ \smartdiagram[bubble diagram]{Human-oriented\\ environments, Uncertain \\environments,Presence\\ of external\\ perturbations,Modelling\\ imprecision } } \end{column} \end{columns} \subsection{General problem statement} \subsection{Objectives} \section{Mathematical model} \subsection{Linear Actuators} \subsection{Mathematical modeling strategy} \subsection{Actuator dynamics} \section{Controller} \subsection{Problem statement} \end{document} ```
https://tex.stackexchange.com/users/129126
Beamer bullet points are lost
true
There several problems: * Don't use `enumitem` with beamer, they are incompatible * If you use `\setbeamertemplate{itemize item}{fg=red}` you are replacing the itemize bullet points with the word `fg=red`. To change the colour, you want to use `\setbeamercolor{item projected}{bg=red}` instead of overwriting the whole template * You have to end every frame you start. * You should clean up your preamble. There are many unnecessary packages --- ``` \documentclass[11pt,usenames,xcolor=dvipsnames,aspectratio=169]{beamer} \mode<presentation> \usetheme{Madrid} \usecolortheme[named=PineGreen]{structure} \usecolortheme{dolphin} \setbeamercolor{mord}{bg=PineGreen!60!White} \setbeamerfont{footline}{series=\bfseries} \setbeamersize{text margin left=5mm,text margin right=5mm} \setbeamercolor{titlelike}{parent=structure} %\usepackage[utf8]{inputenc} \usepackage[english]{babel} %\usepackage{amsmath} %\usepackage{amsfonts} %\usepackage{amssymb} %\usepackage{graphicx} %\usepackage{epstopdf} \usepackage{subfig} \usepackage{pstricks} \usepackage{ragged2e} %\usepackage{color} \usepackage{bbding} \usepackage{tikzsymbols} \usepackage{pstricks-add} \usepackage{booktabs} \usepackage{multirow} %\usepackage{hyperref} \usepackage{smartdiagram} \usepackage{appendixnumberbeamer} \usepackage[justification=justified,format=plain]{caption} \usepackage{pstricks} \usepackage{pst-node} % para diagramas \usepackage{pst-plot} % para representacion de datos funciones, etc %\usepackage{auto-pst-pdf} \usepackage{pst-pdf} \usepackage{pst-coil} %\usepackage{graphicx} \usepackage{multirow} %\usepackage{multicol} %\usepackage{xcolor} %\usepackage{parskip} \usepackage{pgfpages} \usepackage{mathrsfs} \usepackage{pslatex} \usepackage{mathptmx} %\usepackage{enumerate} %\usepackage{enumitem} \usepackage[full]{textcomp} \usepackage{fancyhdr} \newcommand{\grad}{$^{\circ} $} \newcommand{\dint}{\displaystyle\int} \newcommand{\registered}{\textsuperscript{\textregistered}} \newcommand{\dsum} {\displaystyle\sum} \newcommand{\dprod} {\displaystyle\prod} \DeclareMathOperator*{\argmax}{arg\,max} \usepackage{textpos} %posicionar texto donde quiera \usepackage[backend=biber,style=numeric-comp,sorting=none]{biblatex} \renewcommand{\raggedright}{\leftskip=0pt \rightskip=0pt plus 0cm} \addbibresource{biblio.bib} \addbibresource{publications.bib} \renewcommand*{\mkbibcompletename}[1]{% \ifitemannotation{highlight} {\textbf{#1}} {#1}% } % Pone mi nombre en negritas \renewcommand{\footnotesize}{\tiny} %Las footnotes son en tamaño pequeño \setbeamertemplate{caption}{\raggedright\insertcaption\par} %%%%%%%%%%% \title[Adaptive control using RL]{Adaptive} \subtitle{\vspace{0.2cm}Doctoral Defense} \author[K. R]{KR} \institute [University]{} % (optional) \date[April, 2023]{\small April 14, 2020} \AtBeginSection[] { \begin{frame}[noframenumbering,plain] \frametitle{Outline} \begin{columns}[t] \begin{column}{.5\textwidth} \tableofcontents[currentsection,hideothersubsections,sections={1-4}] \end{column} \begin{column}{.5\textwidth} \tableofcontents[currentsection,hideothersubsections,sections={5-7}] \end{column} \end{columns} \end{frame} } \setbeamertemplate{section in toc}{% {\color{red!70!black}\inserttocsectionnumber.}~\inserttocsection} \setbeamercolor{subsection in toc}{bg=white,fg=black} \setbeamertemplate{subsection in toc}{% \hspace{1.2em}{\color{red}\rule[0.3ex]{3pt}{3pt}}~\inserttocsubsection\par} % %\setbeamertemplate{itemize item}{fg=red} \setbeamercolor{item projected}{bg=red} \setbeamertemplate{navigation symbols}{} \begin{document} \begin{frame}[noframenumbering,plain] \maketitle \end{frame} \begin{frame}[noframenumbering,plain] \frametitle{Outline} \begin{columns}[t] \begin{column}{.5\textwidth} \tableofcontents[hideallsubsections,sections={1-4}] \end{column} \begin{column}{.5\textwidth} \tableofcontents[hideallsubsections,sections={5-7}] \end{column} \end{columns} \end{frame} \section{Overview} \subsection{Context} \begin{frame} \frametitle{Overview} \framesubtitle{} \justifying \begin{columns} \begin{column}{0.5\textwidth} \begin{itemize} \item Designed to perform many tasks: \begin{itemize} \item Rescue \item Healthcare \end{itemize} \item Complex variety of capabilities: \begin{itemize} \item Climbing stairs \item Avoiding obstacles \item Jumping \item Walking on slopes \end{itemize} \end{itemize} \end{column} \begin{column}{0.5\textwidth} \centering \begin{itemize} \item Many approaches have arisen with the aim of improving how robotic devices interact in human-oriented environments \end{itemize} \smartdiagramset{planet color=orange!60, distance planet-satellite=1cm} \scalebox{0.55}{ \smartdiagram[bubble diagram]{Human-oriented\\ environments, Uncertain \\environments,Presence\\ of external\\ perturbations,Modelling\\ imprecision } } \end{column} \end{columns} \end{frame} \subsection{General problem statement} \subsection{Objectives} \section{Mathematical model} \subsection{Linear Actuators} \subsection{Mathematical modeling strategy} \subsection{Actuator dynamics} \section{Controller} \subsection{Problem statement} \end{document} ```
5
https://tex.stackexchange.com/users/36296
683859
317,267
https://tex.stackexchange.com/questions/683835
5
It's in the title. I'm trying to make a command-creating macro which would quickly create a length and setting it to some `\settowidth{}{}` output, then making it a command for horizontal spacing. I also tried with `\csname#1\endcsname` but it doesn't work either. ``` \documentclass{article} \newcommand{\newspace}[2]{% \newlength{#1aux}% \settowidth{#1aux}{#2}% \newcommand{#1}{\hspace*{#1aux}}} \begin{document} \newspace{\QQspace}{QQ} AQQA A\QQspace A \end{document} ```
https://tex.stackexchange.com/users/262813
Problem with macro for creating and defining length using \settowidth and then making it an hspace command
false
You don't need to allocate a length: just define `\QQspace` to `\hspace*{<width>}`, where the width can be computed using a scratch length. ``` \documentclass{article} \makeatletter \newcommand{\newspace}[2]{% \settowidth{\dimen@}{#2}% \ExpandArgs{ne}\newcommand{#1}{\noexpand\hspace*{\the\dimen@}}% } \makeatother \begin{document} \newspace{\QQspace}{QQ} AQQA A\QQspace A \texttt{\meaning\QQspace} \end{document} ``` This uses `\ExpandArgs{ne}` that 1. jumps over the next token, here `\newcommand`; 2. jumps over the next braced argument, because of `n`, here `{#1}`; 3. fully `e`xpands the contents of the next braced argument. This explains the `\noexpand` in front of `\hspace` and `\the` in front of `\dimen@`. With “classic” code, the `\ExpandArgs` line might be ``` \begingroup\edef\x{\endgroup \noexpand\newcommand{\noexpand#1}{\noexpand\hspace*{\the\dimen@}}% }\x ```
6
https://tex.stackexchange.com/users/4427
683862
317,268
https://tex.stackexchange.com/questions/683873
2
Let's have a look at the example: ``` Some text. \iffalse Nothing to print. \fi Further text. ``` I would expect that this is handled like ``` Some text. Further text. ``` because the system simply removes the part between `\iffalse`and `\fi`. But when you test it, in the resulting pdf you read `Some text. Further text.` in the same line. So this suggests that the text is handled like ``` Some text. Further text. ``` Can somebody explain why we lose one linebreak?
https://tex.stackexchange.com/users/88423
How is \iffalse ... \fi handled?
true
Whitespaces (but not empty lines, because they are `\par`) after macros, primitives etc. are always ignored (they delimit the macro name). A end of line is just a whitespace. So you not just have to remove everything from `\iffalse` until the end of `\fi`, but also the whitespaces (end-of-line) after `\fi` and you'll get: ``` Some text. Further text. ``` In in other words: Because end-of-line is just a whitespace, your original code is the same like ``` Some text. \iffalse Nothing to print. \fi Further text. ``` and this expands to: ``` Some text. Further text. ``` Note: The space after “`text.`” is not the space from behind `\fi`, it is the space from before `\iffalse`. Note: In previous versions of the answer I wrote “is the same like” instead of “expands to”, but this is not really correct, because TeX really scans and parses the `\iffalse`, so a line with `\iffalse` is never an empty line in sense of TeX. Additionally the special handling of `\if…` happens: TeX reads the following without expanding until either `\else` or `\fi` is found. And if while this reading another TeX `\if…` (e.g., `\iftrue`, `\iffalse`, `\ifcase`, `\ifx`, `\ifcsname`, `\if` etc.) is found, it is also read until the corresponding `\fi`.
6
https://tex.stackexchange.com/users/277964
683876
317,276
https://tex.stackexchange.com/questions/45919
131
Is it possible to identify the font used in a specific document/picture? Answers to this question should identify: * Possible methods to do this (perhaps one answer per method) and adequately describe how to use it (as opposed to merely stating it); * Ways of finding the identified fonts, if possible (free or not); and * Any prerequisites associated with the method used, if required (for example, "In order to use method X, your document has to be in format Y"). This question is meant as an FAQ, based on an [original inquiry launched on meta](https://tex.meta.stackexchange.com/q/2330/5764). Its aim is to facilitate the community with the general procedures involved in font identification. Similar cases are solved on a per-usage basis on [Graphic Design](http://graphicdesign.stackexchange.com)'s [{font-identification}](https://graphicdesign.stackexchange.com/questions/tagged/font-identification) tag.
https://tex.stackexchange.com/users/5764
How do I find out what fonts are used in a document/picture?
false
Another tool that can be used for this is masterpdfeditor. This way you can click precisely on the text on the page and it will tell you the font. Unlike Adobe's tools, this one is (mostly) free. > > The demo version allows you to try out all the features of Master PDF Editor. There are no limitations, except for the addition of a watermark on the output file. > > > ([source](https://code-industry.net/get-masterpdfeditor/)) As mentioned in the answer below, inkscape is also free and can do this. Although if you import the PDF into inkscape it will not display the font correctly if the font is not installed in your system. Of course, after getting the font name if you're using e.g. pdflatex to compile you'd need to decrypt what the "CMR10" mean. For that refer to [Berry naming scheme list of LaTeX font families](https://tex.stackexchange.com/q/23592/250119). (I'm not really aware of a better method) I'm also not sure what the random 6 characters before the `+` is for ("XESXVG") other than that it's not a part of the font name.
1
https://tex.stackexchange.com/users/250119
683879
317,277
https://tex.stackexchange.com/questions/683880
1
I'm trying to split a large table (I use `NiceTabular` environment from `nicematrix` package) into two parts and arrange them side by side. At the same time, I want the tables to be vertically aligned not in the center, but the first part up and the second down. For example, this is how I want the tables to look like: ``` If the first half If the right half is higher in height: is higher in height: a a a a a a a a a a a a a a a a a a a a ``` To achieve this goal, I tried adding the argument `[t]` to the first table, and `[b]` to the right one. However, the result surprised me: the first half turned out to be lower than the right one. Example: ``` a a a a a a a a a a ``` How can to fix this problem and achieve the desired alignment? I tried various solutions from [this](https://tex.stackexchange.com/q/378548/171124) question, but either there was no effect, or the file stopped compiling. MWE: ``` \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{table} \centering \begin{NiceTabular}[t]{cc} a & a \\ a & a \\ a & a \end{NiceTabular} \quad \begin{NiceTabular}[b]{cc} a & a \\ a & a \end{NiceTabular} \end{table} \end{document} ``` Perhaps in this question it is possible to replace nicetabular with tabular, but I used `NiceTabular` and I assume that solutions working with `tabular` may not work with `NiceTabular`.
https://tex.stackexchange.com/users/171124
`NiceTabular` vertical alignment
false
Thanks to Jasper Habicht's comment, I found a solution: it is necessary to make `[b]` or `[t]` for both tables: ``` \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{table} \centering \begin{NiceTabular}[b]{cc} % ^^^ a & a \\ a & a \\ a & a \end{NiceTabular} \quad \begin{NiceTabular}[b]{cc} % ^^^ a & a \\ a & a \end{NiceTabular} \end{table} \end{document} ``` for ``` a a a a a a a a a a ``` and ``` \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{table} \centering \begin{NiceTabular}[t]{cc} % ^^^ a & a \\ a & a \\ a & a \end{NiceTabular} \quad \begin{NiceTabular}[t]{cc} % ^^^ a & a \\ a & a \end{NiceTabular} \end{table} \end{document} ``` for ``` a a a a a a a a a a ```
1
https://tex.stackexchange.com/users/171124
683883
317,278
https://tex.stackexchange.com/questions/683799
3
In our team we are encountering an issue with the line break of Chinese text when using the packages babel and etoc and compiling with xelatex. The issue only occurs when the content is placed within a braces scope. Since we are using a loop to import files for a total of 16 languages into a document, we depend on that scope. It works fine for all other languages. So this actually occurred in a very complex setup in which we absolutely need the braces, but we were able to break it down to the following MWE: ``` \documentclass[a4paper]{article} \usepackage[english]{babel} \babelprovide[import]{chinese} \usepackage{fontspec} \setmainfont{FandolSong-Regular.otf} \usepackage{etoc} \begin{document} { % Usage of this brace triggers the problem \selectlanguage{chinese} \localtableofcontents \section{简体中文} 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。简体中文简体中文。简体中文,简体中文。 } % Usage of this brace triggers the problem \end{document} ``` Without the braces, the line break is fine. When introducing the braces, the lines run out of the page. (After the first compile run the line break is still fine. You have to compile twice.) Does Chinese need any additional option here? Is this a bug in babel or etoc? Note: We know that the problem does not occur when compiling with lualatex. Switching to lualatex however is currently not possible, because we are encountering massive performance issues with that engine - but that is a different topic ;)
https://tex.stackexchange.com/users/215495
Lines do not break for Chinese text in a braces scope
true
After some experiments, I’d say `\XeTeXlinebreaklocale` isn’t very well behaved wrt scoping. Sometimes seems global, sometimes seems local. Either I’m missing something or there is some bug in `xetex`. Here is the workaround I was thinking of in my comment above, following a suggestion by @UlrikeFischer, which admittedly isn’t very efficient. Just add after loading `etoc`: ``` \addto\localtableofcontents{% \expandafter\selectlanguage\expandafter{\languagename}} ``` This will re-select the current language and therefore reset `\XeTeXlinebreaklocale`.
0
https://tex.stackexchange.com/users/5735
683887
317,279
https://tex.stackexchange.com/questions/683882
2
I would like to create beamer slides where each slide contains an image. I have a file that contains a list of all the image locations. This is my code: ``` \documentclass{beamer} % Import necessary packages \usepackage{pdfpages} \usepackage{tikz} % Set beamer theme and color scheme \usetheme{Madrid} \usecolortheme{beaver} % Define title and author \title{PDF Slides} \author{Your Name} \begin{document} % Title slide \begin{frame} \titlepage \end{frame} % Read list of PDF file names from text file \newread\file \openin\file=fileloop.txt \loop \read\file to\fileline \unless\ifeof\file % Remove trailing newline character from file name \edef\fileline{\expandafter\stripnewline\fileline} % Create slide with PDF image for current file \begin{frame} \frametitle{\fileline} \centering \includegraphics[height=0.7\textheight, width=0.8\textwidth]{\fileline} \end{frame} \repeat \closein\file \end{document} ``` The error I am getting is: > > Extra }, or forgotten $. > Undefined control sequence. > Missing } inserted. > Missing $ inserted. > > > The error is for the `\repeat` I checked and there was nothing not closed. What is the correct way to use `\repeat`? Edit: fileloop.txt looks like this: ``` file_1.pdf file_2.pdf file_3.pdf ``` All files are in the same folder as the latex script. They are listed one file per line and not comma separated. There are underscores in the file names. I'm not sure if that is causing a problem.
https://tex.stackexchange.com/users/209798
Writing a for loop that iterates through filenames in a text file
true
Use `expl3`. ``` \begin{filecontents*}{\jobname.lst} example-image-a example-image-b example-image-c \end{filecontents*} \documentclass{beamer} % Set beamer theme and color scheme \usetheme{Madrid} \usecolortheme{beaver} %% boilerplate code for image inclusion from a file \ExplSyntaxOn \NewDocumentCommand{\dofromfile}{mm} {% #1 = file name, #2 = template \michal_read_do:nn { #1 } { #2 } } \ior_new:N \g_michal_read_ior \cs_new_protected:Nn \michal_read_do:nn { \ior_open:Nn \g_michal_read_ior { #1 } \ior_str_map_inline:Nn \g_michal_read_ior { #2 } \ior_close:N \g_michal_read_ior } \ExplSyntaxOff % Define title and author \title{PDF Slides} \author{Your Name} \begin{document} % Title slide \begin{frame} \titlepage \end{frame} \dofromfile{\jobname.lst}{ \begin{frame} \frametitle{\texttt{#1}} \centering \includegraphics[height=0.7\textheight, width=0.8\textwidth]{#1} \end{frame} } \end{document} ``` I used `filecontents` just to make the example self-contained. In the second argument to `\dofromfile` you specify what you want to do with the current line of input from the file, denoting it with `#1`.
1
https://tex.stackexchange.com/users/4427
683888
317,280
https://tex.stackexchange.com/questions/683890
-1
I have the following latex code which gives me a table in landscape mode, and also changes the page number from the side to the bottom: ``` \begin{landscape} \def\fillandplacepagenumber{% \par\pagestyle{empty}% \vbox to 0pt{\vss}\vfill \vbox to 0pt{\baselineskip0pt \hbox to\linewidth{\hss}% \baselineskip\footskip \hbox to\linewidth{% \hfil\thepage\hfil}\vss}} \begin{table}[]\centering \begin{tabular}{lllllll} \hline Monitoring & Thickness & \begin{tabular}[c]{@{}l@{}}Channel Dimensions \\ (W\texttimes{} L) \textmu m\end{tabular} & Fabrication Technique & Array size & Transconductance & Reference \\ \hline Heart ECG recordings & 2.6 \textmu m & 10\texttimes{}10 & \begin{tabular}[c]{@{}l@{}}Photolithography \\ RIE \\ lift-off\\ {} \end{tabular} & 4 \texttimes{}4 & 1 mS & \textbf{x} \\ ECoG & $\sim$ 1.3 \textmu m & 1600\texttimes{}8 & \begin{tabular}[c]{@{}l@{}}Photolithography \\ lift-off \\ RIE \\ {} \end{tabular} & 4\texttimes{}4 & 139 mS & x \\ EEG rat signals & 3 \textmu m & 70\texttimes{}20 & \begin{tabular}[c]{@{}l@{}}Photolithography \\ RIE\\ lift-off\\ {} \end{tabular} & 3\texttimes{}5 & 1.1 mS & x \\ ECG & $\sim$ 4 \textmu m & 8\texttimes{}2 & \begin{tabular}[c]{@{}l@{}}Photolithography \\ RIE\\ lift-off\\ {} \end{tabular} & 5\texttimes{}5 & 0.26 mS & x \\ EEG action potential & $\sim$ 1 \textmu m & 20\texttimes{}25 & \begin{tabular}[c]{@{}l@{}}Photolithography \\ RIE\\ lift-off\\ {}\end{tabular} & 4\texttimes{}4 & 2 mS & x \\ ECoG & $\sim$ 4 \textmu m & 15\texttimes{}6 & \begin{tabular}[c]{@{}l@{}}Photolithography \\ RIE\\ lift-off\\ {}\end{tabular} & N/A & & \\ EMG & 2 \textmu m & 5\texttimes{} 2 & \begin{tabular}[c]{@{}l@{}}Photolithography \\ RIE\\ lift-off\\ {}\end{tabular} & 5\texttimes{}5 & 1.6 mS & x \\ \hline \end{tabular} \end{table} \fillandplacepagenumber \end{landscape} ``` However, when the table becomes too large for one page it then does not continue onto the next page and rotates another 90 degrees. Does anyone know how to continue the table onto the next page while keeping it in landscape orientation? Thanks
https://tex.stackexchange.com/users/295713
How to get a table to continue onto the next page
false
An simple example: ``` \documentclass{article}%[margin=3mm,varwidth]{standalone} \usepackage{pdflscape} \usepackage{booktabs, longtable, makecell} \begin{document} \begin{landscape} \begin{longtable}{lllllll} \toprule Monitoring & Thickness & \makecell[c]{Channel\\ Dimensions\\ (W\texttimes{} L) \textmu m} & Fabrication Technique & Array size & Transconductance & Reference \\ \midrule Heart ECG recordings & 2.6 \textmu m & 10\texttimes{}10 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4 \texttimes{}4 & 1 mS & \textbf{x} \\ \addlinespace ECoG & $\sim$ 1.3 \textmu m & 1600\texttimes{}8 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4\texttimes{}4 & 139 mS & x \\ \addlinespace EEG rat signals & 3 \textmu m & 70\texttimes{}20 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 3\texttimes{}5 & 1.1 mS & x \\ \addlinespace ECG & $\sim$ 4 \textmu m & 8\texttimes{}2 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 5\texttimes{}5 & 0.26 mS & x \\ \addlinespace EEG action potential & $\sim$ 1 \textmu m & 20\texttimes{}25 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4\texttimes{}4 & 2 mS & x \\ \addlinespace ECoG & $\sim$ 4 \textmu m & 15\texttimes{}6 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & N/A & & \\ \addlinespace EMG & 2 \textmu m & 5\texttimes{} 2 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 5\texttimes{}5 & 1.6 mS & x \\ \bottomrule \end{longtable}% \end{landscape} \end{document} ``` **Addendum:** * A more sophisticated solution using `tabularray` package and its libraries `booktabs` and `siunitx`. Both libraries load packages of the same name. * In both suggestion I left out code for page layout (since this is not table writing problem, I stick with MWE (Minimal working Example) what your code example is not); desired page layout should be part of your real document * Your table now can fit in the portrait page, and also consider: + `booktabs` rules for table horizontal lines + `siunitx` packages for writing units and quantities + units are written only in column headers: + in case, that table is longer than one page, to table will be automatically added table foot note "continued on next page" and to caption "(continued)" * you may liked this solution ``` \documentclass{article} \usepackage{geometry} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \sisetup{table-align-text-before=false, explicit-sign={\sim} } \begin{document} \begin{longtblr}[ caption = {caption text}, label = {tab:long} ]{colspec = {X[l] Q[c, si={table-format={$\sim$}1.1}] Q[c, mode=math] X[1.2, l] X[0.6,c, mode=math] X[0.8, si={table-format=3.2}] l}, row{1} = {guard, mode=text, c, b} } \toprule Monitoring & {Thickness\\ (\unit{\micro\meter})} & {Channel\\ Dimensions\\ (W$\times$L) \unit{\micro\meter}} & {Fabrication\\ Technique} & Array size & Transcon\-duc\-tance (\unit{\milli\siemens}) & Reference \\ \midrule Heart ECG recordings & 2.6 & 10\times 10 & {Photolithography \\ RIE \\ lift-off} & 4 \times 4 & 1 & x \\ ECoG & \sim 1.3 & 1600\times 8 & {Photolithography \\ RIE \\ lift-off} & 4\times 4 & 139 & x \\ EEG rat signals & 3 & 70\times 20 & {Photolithography \\ RIE \\ lift-off} & 3\times 5 & 1.1 & x \\ ECG & \sim 4 & 8\times 2 & {Photolithography \\ RIE \\ lift-off} & 5\times 5 & 0.26 & x \\ EEG action potential & \sim 1 & 20\times 25 & {Photolithography \\ RIE \\ lift-off} & 4\times 4 & 2 & x \\ ECoG & \sim 4 & 15\times 6 & {Photolithography \\ RIE \\ lift-off} & N/A & & \\ EMG & 2 & 5\times 2 & {Photolithography \\ RIE \\ lift-off} & 5\times 5 & 1.6 & x \\ \bottomrule \end{longtblr}% \end{document} ```
2
https://tex.stackexchange.com/users/18189
683901
317,285
https://tex.stackexchange.com/questions/683895
1
I'm using the Roboto light condensed font, and always get the following font warning: > > Font shape `OT1/cmr/lc/n' undefined(Font) using` OT1/cmr/m/n' instead > > > An example document to generate the warning would be: ``` \documentclass{article} \usepackage[sfdefault, light, condensed]{roboto} \usepackage[utf8]{inputenc} \begin{document} Why does Roboto font give a warning? \end{document} ``` I am using pdflatex through TeXLive. Anyone any ideas on how to solve this?
https://tex.stackexchange.com/users/30958
Roboto light condensed undefined font shape warning
false
Compile with `lualatex`: ``` \documentclass{article} % Compile using lualatex. \usepackage[sfdefault, light, condensed]{roboto} \begin{document} Roboto font does not give a warning. Produces light condensed text. \end{document} ```
0
https://tex.stackexchange.com/users/287367
683913
317,291
https://tex.stackexchange.com/questions/683642
0
At the moment I'm working on a bigger paper in which there will be exercises and solutions of these exercises at the end. The exercises are counted within chapters and the solutions will be in a chapter of their own, divided into unnumbered sections. Logically the solutions have to be numbered within these sections. Like ``` \chapter{chapter 1} exercise 1 \chapter{chapter 2} exercise 1 \chapter{solutions} \section*{Solution to chapter 1} solution 1 \section*{solution to chapter 2} solution 1 ``` Is there any way to get this? I don't want to reset the counter every time after the section. Obviously, the `counterwithin`-option does not work with unnumbered sections. I found a solution in which you had to redefine the section-command or hard-reset the counter at the end of every section, but I prefer not to do this. I hope for a solution, where I either redefine my solution-environment (which is currently just defined by newtheorem) or to write a command, that I can use after `\chapter`. Is there any way to realize this?
https://tex.stackexchange.com/users/271455
reset counter of theorem after unnumbered section
true
I just found a good alternative. There exists a package `exsheets` which does exactly what I wanted. The only negative is, that this package will not be updated anymore (except for bugs). Here is an MWE: ``` \documentclass{amsbook} \usepackage{exsheets} \counterwithin*{question}{chapter} \SetupExSheets{headings=runin,question/type=exam } \begin{document} \chapter{chapter one} \begin{question} Show $1=2$. \end{question} \begin{solution} Let $a\in\mathbb{N}\setminus\{0\}$. Then $a^2-a^2=a^2-a^2$, thus $a(a-a)=(a+a)(a-a)$ and $a=a+a$. By dividing by $a$ we get $1=2$. \end{solution} \chapter{chapter two} \begin{question} Every chapter is trivial. \end{question} \begin{solution} Last chapter was trivial, this chapter is trivial. Thus, by induction, every chapter is trivial. \end{solution} \chapter*{Solution} \section*{Solution of chapter one} \printsolutions[chapter={1}] \section*{Solution of chapter two} \printsolutions[chapter={2}] \end{document} ```
0
https://tex.stackexchange.com/users/271455
683914
317,292
https://tex.stackexchange.com/questions/683895
1
I'm using the Roboto light condensed font, and always get the following font warning: > > Font shape `OT1/cmr/lc/n' undefined(Font) using` OT1/cmr/m/n' instead > > > An example document to generate the warning would be: ``` \documentclass{article} \usepackage[sfdefault, light, condensed]{roboto} \usepackage[utf8]{inputenc} \begin{document} Why does Roboto font give a warning? \end{document} ``` I am using pdflatex through TeXLive. Anyone any ideas on how to solve this?
https://tex.stackexchange.com/users/30958
Roboto light condensed undefined font shape warning
false
With PDFLaTeX package `roboto` loads `fontenc` after changing some defaults but before changing the default family. So, while loading `fontenc` still `cmr` is the valid family. The package is one of the exceptions that are actually reloaded on every `\usepackage` or `\RequirePackage`. So the line ``` \usefont\encodingdefault\familydefault\seriesdefault\shapedefault ``` in the file is executed, even if you'd load the package yourself before `roboto`. And at this time `\familydefault` is still `cmr`. This results in a (in your case not needed) selection of a light condensed version of `cmr`, that does not exist. You can simply ignore the warning. If you really, really have to avoid the warning, you can disable loading package `fontenc` inside `roboto` (and optionally load is yourself before the package): ``` \documentclass{article} \usepackage{fontenc} % NOTE: I DO NOT RECOMMEND TO DO THIS, BUT IT MAKES THE FONT WARNING GO AWAY. \makeatletter \disable@package@load{fontenc} \makeatother \usepackage[sfdefault, light, condensed]{roboto} \makeatletter \reenable@package@load{fontenc} \makeatother \begin{document} Roboto font does not give a warning. Produces light condensed text. \end{document} ``` But of course this is at your own risk!
1
https://tex.stackexchange.com/users/277964
683918
317,293
https://tex.stackexchange.com/questions/683925
3
I am trying to write a Dirac delta function. I almost have it but would like to bold my "x =x'" text. Here is my code: ``` \begin{equation} \delta(\mathbf{x-x^{'}})=\begin{cases} 1, & \text{$x = x'$}\\ 0, & \text{$x \neq x'$} \end{cases} \end{equation} ``` I also tried this: ``` \begin{equation} \delta(\mathbf{x-x^{'}})=\begin{cases} 1, & \textbf{$x = x'$}\\ 0, & \textbf{$x \neq x'$} \end{cases} \end{equation} ``` but that gives the same output Edit:from teddies comments this is the latex code I used to get the result I wanted: ``` \begin{equation} \delta(\mathbf{x-x'})=\begin{cases} 1, & \mathbf{ x = x'}\\ 0, & \mathbf{ x \neq x'} \end{cases} \end{equation} ```
https://tex.stackexchange.com/users/295727
how to bold text in cases
false
You haven't indicated whether the bold `x` symbols should be rendered in upright or in slanted/italic lettering. The following code shows how to pursue either variant. I wouldn't render the `-` (minus), `'` (prime), `=` (equals), or `\neq` (not equal to) symbols in bold. ``` \documentclass{article} % or some other suitable document class \usepackage{amsmath} % for 'cases' environment \usepackage{bm} % for '\bm' macdro \newcommand\bfx{\mathbf{x}} % "upright bold" x \newcommand\bmx{\bm{x}} % "italic bold" x \begin{document} \begin{equation} \delta(\bfx-\bfx') =\begin{cases} 1 & \text{if $\bfx=\bfx'$,}\\ 0 & \text{if $\bfx\neq\bfx'$.} \end{cases} \end{equation} \begin{equation} \delta(\bmx-\bmx') =\begin{cases} 1 & \text{if $\bmx=\bmx'$,}\\ 0 & \text{if $\bmx\neq\bmx'$.} \end{cases} \end{equation} \end{document} ```
3
https://tex.stackexchange.com/users/5001
683926
317,297
https://tex.stackexchange.com/questions/683834
-1
I tried ChatGPT and Bard for this first, but both responses were a little off. Here's my request: I need a LaTeX program like this: the label format is 2 wide, 10 rows down per page. Within the label I need the three columns as specified before ("not for infants under 1 yr", "Kate's Blackberry Honey", (graphic placeholder above) , "Not for infants under 1 yr" ) thanks ... Avery 5163 are the labels ... Thanks Here's Bard's latest: ``` \documentclass{article} \usepackage{graphicx} \newcommand{\mylabel}[4]{% \begin{tabular}{@{}c@{\hspace{20pt}}c@{\hspace{20pt}}c@{}} #1 & #2 & #3 \ #4 & & \end{tabular}% } \begin{document} \noindent\begin{minipage}{.5\textwidth} \centering \mylabel{Not for infants under 1 yr}{Kate's Blackberry Honey}{Graphic placeholder above}{Not for infants under 1 yr} \end{minipage}\hfill \begin{minipage}{.5\textwidth} \centering \mylabel{Not for infants under 1 yr}{Kate's Blackberry Honey}{Graphic placeholder above}{Not for infants under 1 yr} \end{minipage} \end{document} ``` This isn't quite right; I get Extra alignment tab has been changed to \cr. \unskip \hfil }\endtemplate l.18 ...eholder above}{Not for infants under 1 yr} Looks like it's close; can you help please?
https://tex.stackexchange.com/users/295674
I am working to get some Honey labels set up for my wife with 3 columns and trying LaTeX
false
You can use the labels package. <http://tug.ctan.org/tex-archive/macros/latex/contrib/labels/labels.pdf> It is built to do what you are asking for. Or not?
0
https://tex.stackexchange.com/users/282431
683927
317,298
https://tex.stackexchange.com/questions/683911
0
I have the following table code: ``` \begin{longtable}{lllllll} \toprule Monitoring & Thickness & \makecell[c]{Channel\\ Dimensions\\ (W\texttimes{} L) \textmu m} & Fabrication Technique & Array size & Transconductance & Reference \\ \midrule Heart ECG recordings & 2.6 \textmu m & 10\texttimes{}10 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4 \texttimes{}4 & 1 mS & \textbf{x} \\ \addlinespace ECoG & $\sim$ 1.3 \textmu m & 1600\texttimes{}8 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4\texttimes{}4 & 139 mS & x \\ \addlinespace EEG rat signals & 3 \textmu m & 70\texttimes{}20 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 3\texttimes{}5 & 1.1 mS & x \\ \addlinespace ECG & $\sim$ 4 \textmu m & 8\texttimes{}2 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 5\texttimes{}5 & 0.26 mS & x \\ \addlinespace EEG action potential & $\sim$ 1 \textmu m & 20\texttimes{}25 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4\texttimes{}4 & 2 mS & x \\ \addlinespace ECoG & $\sim$ 4 \textmu m & 15\texttimes{}6 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & N/A & 0.9 mS & x \\ \addlinespace EMG & 2 \textmu m & 5\texttimes{} 2 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 5\texttimes{}5 & 1.6 mS & x \\ Heart ECG recordings & 2.6 \textmu m & 10\texttimes{}10 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4 \texttimes{}4 & 1 mS & \textbf{x} \\ \addlinespace ECoG & $\sim$ 1.3 \textmu m & 1600\texttimes{}8 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 4\texttimes{}4 & 139 mS & x \\ \addlinespace EEG rat signals & 3 \textmu m & 70\texttimes{}20 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 3\texttimes{}5 & 1.1 mS & x \\ \addlinespace ECG & $\sim$ 4 \textmu m & 8\texttimes{}2 & \makecell[l]{Photolithography \\ RIE\\ lift-off} & 5\texttimes{}5 & 0.26 mS & x \\ \addlinespace \bottomrule \caption{OECTs for biophysical signal sensing} \label{Table: OECT biophysical sensing} \end{longtable}% ``` However, it does not stay within the page width. Could someone help me with this.
https://tex.stackexchange.com/users/295713
How can I fit my longtable within the page limit
false
I can't see a good reason for employing a `longtable` environment. I'd use a `tabularx` environment (with a target width of `\textwidth`) embedded inside a `table` environment. I'd also allow automatic line breaking in 5 of the 7 columns in order to make the table fit inside the width of the text block. I'd further place repeated elements, such as the units of measurement in columns 2 and 6, in the headers, mainly to help declutter the table's appearance. ``` \documentclass{article} % or some other suitable document class \usepackage{tabularx} % for 'tabularx' environment \usepackage{ragged2e} % for '\RaggedRight' and '\Centering' macro \newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X} \newcolumntype{C}{>{\Centering\hspace{0pt}}X} \usepackage{siunitx} % for '\unit' macro \usepackage{booktabs} % for well-spaced horizontal rules \hyphenation{trans-con-duct-ance photo-lith-og-raphy} \begin{document} \begin{table} \setlength\tabcolsep{2.5pt} % default: 6pt \begin{tabularx}{\textwidth}{@{} L CCCcCc @{}} \toprule Monitoring & Thickness (\unit{\micro\meter}) & Channel Dim.\ (W\texttimes L) \unit{\micro\meter} & Fabrication Technique & Array size & Transconductance (mS) & Ref. \\ \midrule Heart ECG recordings & 2.6 & $10\times10$ & Photolithography RIE lift-off & $4\times4$ & 1 & x \\ \addlinespace ECoG & ${\approx}1.3$ & $1600\times8$ & Photolithography RIE lift-off & $4\times4$ & 139 & x \\ \addlinespace EEG rat signals & 3 & $70\times20$ & Photolithography RIE lift-off & $3\times5$ & 1.1 & x \\ \addlinespace ECG & ${\approx}4$ & $8\times2$ & Photolithography RIE lift-off & $5\times5$ & 0.26 & x \\ \addlinespace EEG action potential & ${\approx}1$ & $20\times25$ & Photolithography RIE lift-off & $4\times4$ & 2 & x \\ \addlinespace ECoG & ${\approx}4$ & $15\times6$ & Photolithography RIE lift-off & N/A & 0.9 & x \\ \addlinespace EMG & 2 & $5\times2$ & Photolithography RIE lift-off & $5\times5$ & 1.6 & x \\ \addlinespace Heart ECG recordings & 2.6 & $10\times10$ & Photolithography RIE lift-off & $4\times4$ & 1 & x \\ \addlinespace ECoG & ${\approx}1.3$ & $1600\times8$ & Photolithography RIE lift-off & $4\times4$ & 139 & x \\ \addlinespace EEG rat signals & 3 & $70\times20$ & Photolithography RIE lift-off & $3\times5$ & 1.1 & x \\ \addlinespace ECG & ${\approx}4$ & $8\times2$ & Photolithography RIE lift-off & $5\times5$ & 0.26 & x \\ \bottomrule \end{tabularx} \caption{OECTs for biophysical signal sensing} \label{Table:OECTBiophysicalSensing} \end{table} \end{document} ```
1
https://tex.stackexchange.com/users/5001
683932
317,300
https://tex.stackexchange.com/questions/683925
3
I am trying to write a Dirac delta function. I almost have it but would like to bold my "x =x'" text. Here is my code: ``` \begin{equation} \delta(\mathbf{x-x^{'}})=\begin{cases} 1, & \text{$x = x'$}\\ 0, & \text{$x \neq x'$} \end{cases} \end{equation} ``` I also tried this: ``` \begin{equation} \delta(\mathbf{x-x^{'}})=\begin{cases} 1, & \textbf{$x = x'$}\\ 0, & \textbf{$x \neq x'$} \end{cases} \end{equation} ``` but that gives the same output Edit:from teddies comments this is the latex code I used to get the result I wanted: ``` \begin{equation} \delta(\mathbf{x-x'})=\begin{cases} 1, & \mathbf{ x = x'}\\ 0, & \mathbf{ x \neq x'} \end{cases} \end{equation} ```
https://tex.stackexchange.com/users/295727
how to bold text in cases
false
Define your own command for vectors. ``` \documentclass{article} \usepackage{amsmath} \usepackage{bm} \newcommand{\vect}[1]{\mathbf{#1}} % vector %\newcommand{\vect}[1]{\bm{#1}} % vector \begin{document} \begin{equation} \delta(\vect{x}-\vect{x}')= \begin{cases} 1, & \vect{x} = \vect{x}' \\ 0, & \vect{x} \neq \vect{x}' \end{cases} \end{equation} \end{document} ``` If you switch the comments, so use `\bm` instead of `\mathbf`, you get Defining an own command ensures uniformity and has the advantage that you can change the typographic representation of *all* vectors with a single shot.
2
https://tex.stackexchange.com/users/4427
683937
317,303
https://tex.stackexchange.com/questions/2044
88
TikZ is undergoing lots of development with new features being added, but the versions distributed with standard TeX releases are often a little old. How do I get the latest version? If I want to be sure that I get the latest stable version, how do I do that? --- Note: I'm not asking this question for myself, but because a question like this seems to be useful for pointing to it when a new feature of TikZ is mentioned in an answer to some other question. Feel free to post answers for any operating system/TeX distribution combination.
https://tex.stackexchange.com/users/83
How to install a current version of TikZ?
false
This answer gave the solution for me! <https://tex.stackexchange.com/a/343324/202358> In short: `apt install texlive-latex-extra`
0
https://tex.stackexchange.com/users/202358
683942
317,304
https://tex.stackexchange.com/questions/683941
2
I am trying to get the following table to span over multiple pages or columns. I have tried using longtable instead of table but that ends up causing other issues. Does anyone know how to fix this? Thanks. ``` \begin{table}[!ht] \centering\captionsetup{justification = centering} \begin{tabular}{|c c c c c c|} \hline \#Nodes & Partition Type & Time & Cut & Energy & Modularity \\ [0.5ex] \hline\hline \multirow{8}{*}{9} & \rowcolor{yellow} kernighan-lin & 473.26 $\mu$s & -11 & 17 & 0.170 \\ & girvan-newman \rowcolor{yellow} & 2.01 ms & -7 & 20 & 0.180 \\ & \rowcolor{cyan} ideal cut & 46.04 ms & -11 & 19 & 0.186 \\ & \rowcolor{cyan} ideal energy & 46.04 ms & -7 & 20 & 0.180 \\ & \rowcolor{cyan} ideal modularity & 46.04 ms & -11 & 19 & 0.186 \\ & \rowcolor{pink} SNN \#0 & 1.46 ns & -7 & 15 & 0.125 \\ & \rowcolor{pink} SNN \#1 & 1.46 ns & -11 & 16 & 0.186 \\ & \rowcolor{pink} SNN \#2 & 1.46 ns & -11 & 17 & 0.170 \\ \hline \multirow{8}{*}{18} & \rowcolor{yellow} kernighan-lin & 715.02 $\mu$s & -60 & 83 & 0.284 \\ & \rowcolor{yellow} girvan-newman & 29.86 ms & -64 & 89 & 0.306 \\ & \rowcolor{cyan} ideal cut & 72.48 s & -64 & 89 & 0.305 \\ & \rowcolor{cyan} ideal energy & 72.48 s & 32 & 101 & 0.149 \\ & \rowcolor{cyan} ideal modularity & 72.48 s & -64 & 89 & 0.305 \\ & \rowcolor{pink} SNN \#0 & 5.83 ns & -32 & 67 & 0.245 \\ & \rowcolor{pink} SNN \#1 & 5.83 ns & -32 & 73 & 0.183 \\ & \rowcolor{pink} SNN \#2 & 5.83 ns & -36 & 73 & 0.208 \\ & \rowcolor{pink} SNN \#3 & 5.83 ns & -44 & 74 & 0.247 \\ \hline \multirow{5}{*}{20} & \rowcolor{yellow} kernighan-lin & 979.42 $\mu$s & -74 & 85 & 0.203 \\ & \rowcolor{yellow} girvan-newman & 44.43 ms & -82 & 85 & 0.224 \\ & \rowcolor{pink} SNN \#0 & 7.20 ns & -42 & 67 & 0.170 \\ & \rowcolor{pink} SNN \#1 & 7.20 ns & -46 & 70 & 0.160 \\ & \rowcolor{pink} SNN \#2 & 7.20 ns & -58 & 74 & 0.184 \\ \hline \multirow{9}{*}{22} & \rowcolor{yellow} metis & 1.64 ms & -92 & 91 & 0.177 \\ & \rowcolor{yellow} kernighan-lin & 1.61 ms & -92 & 89 & 0.177 \\ & \rowcolor{yellow} girvan-newman & 84.34 ms & 180 & 101 & -0.00296 \\ & \rowcolor{cyan} ideal cut & 2.09 ks & -92 & 93 & 0.178 \\ & \rowcolor{cyan} ideal energy & 2.09 ks & -36 & 101 & 0.124 \\ & \rowcolor{cyan} ideal modularity & 2.09 ks & -92 & 93 & 0.178 \\ & \rowcolor{pink} SNN \#0 & 8.71 ns & -76 & 81 & 0.152, \\ & \rowcolor{pink} SNN \#1 & 8.71 ns & -76 & 81 & 0.152 \\ & \rowcolor{pink} SNN \#2 & 8.71 ns & -88 & 88 & 0.169 \\ \hline \multirow{8}{*}{24} & \rowcolor{yellow} kernighan-lin & 1.32 ms & -104 & 108 & 0.173 \\ & \rowcolor{yellow} girvan_newman & 156.77 ms & -104 & 104 & 0.178 \\ & \rowcolor{cyan} ideal cut & 8.58 ks & -108 & 108 & 0.18 \\ & \rowcolor{cyan} ideal energy & 8.58 ks & -44 & 126 & 0.133 \\ & \rowcolor{cyan} ideal modularity & 8.58 ks & -108 & 108 & 0.18 \\ & \rowcolor{pink} SNN \#0 & 10.37 ns & -96 & 100 & 0.166 \\ & \rowcolor{pink} SNN \#1 & 10.37 ns & -96 & 100 & 0.166 \\ & \rowcolor{pink} SNN \#2 & 10.37 ns & -100 & 103 & 0.172 \\ \hline \multirow{9}{*}{24} & \rowcolor{yellow} metis & 1.36 ms & -120 & 153 & 0.306 \\ & \rowcolor{yellow} kernighan-lin & 15.03 ms & -120 & 153 & 0.306 \\ & \rowcolor{yellow} girvan-newman & 113.37 ms & -104 & 142 & 0.272 \\ & \rowcolor{cyan} ideal cut & 11.05 ks & -120 & 150 & 0.306 \\ & \rowcolor{cyan} ideal energy & 11.05 ks & 76 & 178 & 0.125 \\ & \rowcolor{cyan} ideal modularity & 11.05 ks & -120 & 150 & 0.306 \\ & \rowcolor{pink} SNN \#0 & 1.44 ns & -84 & 160 & 0.234 \\ & \rowcolor{pink} SNN \#1 & 1.44 ns & -104 & 163 & 0.287 \\ & \rowcolor{pink} SNN \#2 & 1.44 ns & -116 & 157 & 0.3 \\ \hline \multirow{10}{*}{25} & \rowcolor{yellow} kernighan-lin & 56.65 ms & -131 & 121 & 0.202 \\ & \rowcolor{yellow} girvan-newman & 547.38 ms & -135 & 120 & 0.209 \\ & \rowcolor{cyan} ideal cut & 19.97 ks & -135 & 120 & 0.209 \\ & \rowcolor{cyan} ideal energy & 19.97 ks & -59 & 138 & 0.147 \\ & \rowcolor{cyan} ideal modularity & 19.97 ks & -135 & 120 & 0.209 \\ & \rowcolor{pink} SNN \#0 & 11.25 ns & -107 & 106 & 0.184 \\ & \rowcolor{pink} SNN \#1 & 11.25 ns & -103 & 106 & 0.177 \\ & \rowcolor{pink} SNN \#2 & 11.25 ns & -107 & 106 & 0.184 \\ & \rowcolor{pink} SNN \#3 & 11.25 ns & -87 & 103 & 0.155 \\ & \rowcolor{pink} SNN \#4 & 11.25 ns & -107 & 106 & 0.184 \\ \hline \multirow{6}{*}{35} & \rowcolor{yellow} kernighan-lin & 1.66 ms & -233 & 324 & 0.294 \\ & \rowcolor{yellow} girvan-newman & 584.88 ms & -185 & 364 & 0.274 \\ & \rowcolor{pink} SNN \#0 & 22.05 ns & -157 & 269 & 0.269 \\ & \rowcolor{pink} SNN \#1 & 22.05 ns & -93 & 251 & 0.218 \\ & \rowcolor{pink} SNN \#2 & 22.05 ns & -117 & 252 & 0.255 \\ & \rowcolor{pink} SNN \#3 & 22.05 ns & -105 & 250 & 0.241 \\ \hline \multirow{5}{*}{50} & \rowcolor{yellow} kernighan-lin & 2.02 ms & -356 & 770 & 0.348 \\ & \rowcolor{yellow} girvan-newman & 776.80 ms & -8 & 556 & 0.269 \\ & \rowcolor{pink} SNN \#0 & 45.00 ns & 92 & 522 & 0.240 \\ & \rowcolor{pink} SNN \#1 & 45.00 ns & 108 & 520 & 0.225 \\ & \rowcolor{pink} SNN \#2 & 45.00 ns & 68 & 545 & 0.200 \\ \hline \multirow{5}{*}{50} & \rowcolor{yellow} metis & 2.93 ms & -488 & 676 & 0.286 \\ & \rowcolor{yellow} kernighan-lin & 2.65 ms & -480 & 669 & 0.286 \\ & \rowcolor{yellow} girvan-newman & 3.15 s & -424 & 604 & 0.273 \\ & \rowcolor{pink} SNN \#0 & 45.00 ns & -400 & 592 & 0.266 \\ & \rowcolor{pink} SNN \#1 & 45.00 ns & -444 & 611 & 0.282 \\ \hline \end{tabular} \caption{Results from simulations.} \label{tab:results} \end{table} ```
https://tex.stackexchange.com/users/295745
Tabular and longtable won't span over multiple pages
true
Since a `tabular` environment cannot span more than a page, I suggest you do try using a `longtable`. I don't think it's a good idea ot use `\multirow` since the numbers regularly end up in the blue zone, where they're difficult to spot (and read). I'd also load the `booktabs` package and use `\addlinespace` instead of `\hline` to create offsets between the groups of rows. Last but not least, consider aligning the numbers in the three final columns on their (implicit or explicit) decimal markers to make them easier to read. A final remark: I can't say that I understand the gaudy color scheme. Are your readers supposed to know what the colors mean? ``` \documentclass{article} % or some other suitable document class \usepackage{longtable,siunitx,booktabs} \usepackage[table]{xcolor} \begin{document} \begin{longtable}{ ll c S[table-format=-2.0] S[table-format= 3.0] S[table-format=-1.5,group-digits=false]} % headers and footers \caption{Results from simulations.} \label{tab:results} \\ \toprule \# Nodes & Partition Type & Time & {Cut} & {Energy} & {Modularity} \\[0.25ex] \hline \endfirsthead \multicolumn{6}{l}{Table \thetable, continued} \\[1ex] \toprule \# Nodes & Partition Type & Time & {Cut} & {Energy} & {Modularity} \\[0.25ex] \hline \endhead \multicolumn{6}{r@{}}{\footnotesize(continued on following page)} \\ \endfoot \hline \endlastfoot % body of table \rowcolor{yellow} \textbf{9} & kernighan-lin & 473.26 \textmu s & -11 & 17 & 0.170 \\ \rowcolor{yellow} & girvan-newman & 2.01 ms & -7 & 20 & 0.180 \\ \rowcolor{cyan} & ideal cut & 46.04 ms & -11 & 19 & 0.186 \\ \rowcolor{cyan} & ideal energy & 46.04 ms & -7 & 20 & 0.180 \\ \rowcolor{cyan} & ideal modularity & 46.04 ms & -11 & 19 & 0.186 \\ \rowcolor{pink} & SNN \#0 & 1.46 ns & -7 & 15 & 0.125 \\ \rowcolor{pink} & SNN \#1 & 1.46 ns & -11 & 16 & 0.186 \\ \rowcolor{pink} & SNN \#2 & 1.46 ns & -11 & 17 & 0.170 \\ \addlinespace \rowcolor{yellow} \textbf{18} & kernighan-lin & 715.02 \textmu s & -60 & 83 & 0.284 \\ \rowcolor{yellow} & girvan-newman & 29.86 ms & -64 & 89 & 0.306 \\ \rowcolor{cyan} & ideal cut & 72.48 s & -64 & 89 & 0.305 \\ \rowcolor{cyan} & ideal energy & 72.48 s & 32 & 101 & 0.149 \\ \rowcolor{cyan} & ideal modularity & 72.48 s & -64 & 89 & 0.305 \\ \rowcolor{pink} & SNN \#0 & 5.83 ns & -32 & 67 & 0.245 \\ \rowcolor{pink} & SNN \#1 & 5.83 ns & -32 & 73 & 0.183 \\ \rowcolor{pink} & SNN \#2 & 5.83 ns & -36 & 73 & 0.208 \\ \rowcolor{pink} & SNN \#3 & 5.83 ns & -44 & 74 & 0.247 \\ \addlinespace \rowcolor{yellow} \textbf{20} & kernighan-lin & 979.42 \textmu s & -74 & 85 & 0.203 \\ \rowcolor{yellow} & girvan-newman & 44.43 ms & -82 & 85 & 0.224 \\ \rowcolor{pink} & SNN \#0 & 7.20 ns & -42 & 67 & 0.170 \\ \rowcolor{pink} & SNN \#1 & 7.20 ns & -46 & 70 & 0.160 \\ \rowcolor{pink} & SNN \#2 & 7.20 ns & -58 & 74 & 0.184 \\ \addlinespace \rowcolor{yellow} \textbf{22} & metis & 1.64 ms & -92 & 91 & 0.177 \\ \rowcolor{yellow} & kernighan-lin & 1.61 ms & -92 & 89 & 0.177 \\ \rowcolor{yellow} & girvan-newman & 84.34 ms & 180 & 101 & -0.00296 \\ \rowcolor{cyan} & ideal cut & 2.09 ks & -92 & 93 & 0.178 \\ \rowcolor{cyan} & ideal energy & 2.09 ks & -36 & 101 & 0.124 \\ \rowcolor{cyan} & ideal modularity & 2.09 ks & -92 & 93 & 0.178 \\ \rowcolor{pink} & SNN \#0 & 8.71 ns & -76 & 81 & 0.152 \\ \rowcolor{pink} & SNN \#1 & 8.71 ns & -76 & 81 & 0.152 \\ \rowcolor{pink} & SNN \#2 & 8.71 ns & -88 & 88 & 0.169 \\ \addlinespace \rowcolor{yellow} \textbf{24} & kernighan-lin & 1.32 ms & -104 & 108 & 0.173 \\ \rowcolor{yellow} & girvan-newman & 156.77 ms & -104 & 104 & 0.178 \\ \rowcolor{cyan} & ideal cut & 8.58 ks & -108 & 108 & 0.18 \\ \rowcolor{cyan} & ideal energy & 8.58 ks & -44 & 126 & 0.133 \\ \rowcolor{cyan} & ideal modularity & 8.58 ks & -108 & 108 & 0.18 \\ \rowcolor{pink} & SNN \#0 & 10.37 ns & -96 & 100 & 0.166 \\ \rowcolor{pink} & SNN \#1 & 10.37 ns & -96 & 100 & 0.166 \\ \rowcolor{pink} & SNN \#2 & 10.37 ns & -100 & 103 & 0.172 \\ %\addlinespace \rowcolor{yellow} \textbf{24} & metis & 1.36 ms & -120 & 153 & 0.306 \\* % no page break at this line \rowcolor{yellow} & kernighan-lin & 15.03 ms & -120 & 153 & 0.306 \\ \rowcolor{yellow} & girvan-newman & 113.37 ms & -104 & 142 & 0.272 \\ \rowcolor{cyan} & ideal cut & 11.05 ks & -120 & 150 & 0.306 \\ \rowcolor{cyan} & ideal energy & 11.05 ks & 76 & 178 & 0.125 \\ \rowcolor{cyan} & ideal modularity & 11.05 ks & -120 & 150 & 0.306 \\ \rowcolor{pink} & SNN \#0 & 1.44 ns & -84 & 160 & 0.234 \\ \rowcolor{pink} & SNN \#1 & 1.44 ns & -104 & 163 & 0.287 \\ \rowcolor{pink} & SNN \#2 & 1.44 ns & -116 & 157 & 0.3 \\ \addlinespace \rowcolor{yellow} \textbf{25} & kernighan-lin & 56.65 ms & -131 & 121 & 0.202 \\ \rowcolor{yellow} & girvan-newman & 547.38 ms & -135 & 120 & 0.209 \\ \rowcolor{cyan} & ideal cut & 19.97 ks & -135 & 120 & 0.209 \\ \rowcolor{cyan} & ideal energy & 19.97 ks & -59 & 138 & 0.147 \\ \rowcolor{cyan} & ideal modularity & 19.97 ks & -135 & 120 & 0.209 \\ \rowcolor{pink} & SNN \#0 & 11.25 ns & -107 & 106 & 0.184 \\ \rowcolor{pink} & SNN \#1 & 11.25 ns & -103 & 106 & 0.177 \\ \rowcolor{pink} & SNN \#2 & 11.25 ns & -107 & 106 & 0.184 \\ \rowcolor{pink} & SNN \#3 & 11.25 ns & -87 & 103 & 0.155 \\ \rowcolor{pink} & SNN \#4 & 11.25 ns & -107 & 106 & 0.184 \\ \addlinespace \rowcolor{yellow} \textbf{35} & kernighan-lin & 1.66 ms & -233 & 324 & 0.294 \\ \rowcolor{yellow} & girvan-newman & 584.88 ms & -185 & 364 & 0.274 \\ \rowcolor{pink} & SNN \#0 & 22.05 ns & -157 & 269 & 0.269 \\ \rowcolor{pink} & SNN \#1 & 22.05 ns & -93 & 251 & 0.218 \\ \rowcolor{pink} & SNN \#2 & 22.05 ns & -117 & 252 & 0.255 \\ \rowcolor{pink} & SNN \#3 & 22.05 ns & -105 & 250 & 0.241 \\ \addlinespace \rowcolor{yellow} \textbf{50} & kernighan-lin & 2.02 ms & -356 & 770 & 0.348 \\ \rowcolor{yellow} & girvan-newman & 776.80 ms & -8 & 556 & 0.269 \\ \rowcolor{pink} & SNN \#0 & 45.00 ns & 92 & 522 & 0.240 \\ \rowcolor{pink} & SNN \#1 & 45.00 ns & 108 & 520 & 0.225 \\ \rowcolor{pink} & SNN \#2 & 45.00 ns & 68 & 545 & 0.200 \\ \addlinespace \rowcolor{yellow} \textbf{50} & metis & 2.93 ms & -488 & 676 & 0.286 \\ \rowcolor{yellow} & kernighan-lin & 2.65 ms & -480 & 669 & 0.286 \\ \rowcolor{yellow} & girvan-newman & 3.15 s & -424 & 604 & 0.273 \\ \rowcolor{pink} & SNN \#0 & 45.00 ns & -400 & 592 & 0.266 \\ \rowcolor{pink} & SNN \#1 & 45.00 ns & -444 & 611 & 0.282 \\ \end{longtable} \end{document} ```
2
https://tex.stackexchange.com/users/5001
683946
317,305
https://tex.stackexchange.com/questions/683958
0
The commands \textbf and \texttt don't have an effect. XeLaTeX Font Warning: Font shape `TU/pcr/m/n' undefined .cls file: ``` \RequirePackage{fmtcount} \newcommand{\setthesistype}[1]{\def\@thesistype{#1}} \let\thesistype\setthesistype \newcommand{\show@thesistype}{\@thesistype} %\newcommand{\uselogo}{\def\@uselogo{yes}} \global\let\@examiner\@empty \newcommand{\setexaminer}[1]{\def\@examiner{#1}} \let\examiner\setexaminer \global\let\@supervisor\@empty \newcommand{\setsupervisor}[1]{\def\@supervisor{#1}} \let\supervisor\setsupervisor \newcommand{\birthinfo}[1]{\normalsize \GetTranslation{born} #1} \newcommand{\matricnumber}[1]{\normalsize \GetTranslation{matriculationnumber}: #1} \let\oldmaketitle\maketitle \renewcommand{\maketitle}{ \begin{titlepage} \ifx\@uselogo\@empty \null\vskip16mm \else \begin{flushright} \includegraphics[height=16mm]{gfx/ubn-logo} \includegraphics[height=35mm]{gfx/hrl-logo}\par \end{flushright} \fi \null\vfil\vskip60pt \centering \begin{minipage}{0.618034\paperwidth} \centering {\Large \textsc{\show@thesistype}\par}\vspace{1ex} \rule{\linewidth}{1pt}\\ {\Huge\bfseries\@title\par} \rule{\linewidth}{1pt}\vspace{2cm} \end{minipage}\par {\emph{\GetTranslation{written-submitted}}\\\vspace{1em} \Large \begin{tabular}[t]{c} \@author \end{tabular}\par}\vspace{2cm} {\def\and{\end{tabular}\\ \personprefix & \renewcommand{\arraystretch}{1.0}\begin{tabular}[t]{l} } \def\arraystretch{1.5} \newcounter{examinercnt} \setcounter{examinercnt}{0} \gdef\personprefix{\stepcounter{examinercnt}\ordinal{examinercnt} \GetTranslation{examiner}:} \Large \global\let\@needtable\@empty \ifx\@examiner\@empty\else \gdef\@needtable{yes} \fi \ifx\@supervisor\@empty\else \gdef\@needtable{yes} \fi \ifx\@needtable\@empty\else% \begin{tabular}[t]{rl} \ifx\@examiner\@empty\else\personprefix & \renewcommand{\arraystretch}{1.0}\begin{tabular}[t]{l}\@examiner\end{tabular}\fi\renewcommand{\arraystretch}{1.5}\\ \ifx\@supervisor\@empty\else \gdef\personprefix{} % \makeatletter % \global\def\personprefix\@empty % \makeatother \GetTranslation{supervisors}: & \renewcommand{\arraystretch}{1.0}\begin{tabular}[t]{l}\@supervisor\end{tabular}\renewcommand{\arraystretch}{1.5} \fi \end{tabular}% \fi} \vfill\null {\@date\par} \end{titlepage} } \RequirePackage{iftex} \RequirePackage[margin=3cm,bindingoffset=3mm,includehead,includefoot]{geometry} \RequirePackage{fancyhdr,emptypage,xcolor,graphicx,subcaption,booktabs} \RequirePackage[labelfont=bf,format=hang]{caption} \definecolor{ub-blue}{cmyk}{1,0.7,0,0} \definecolor{ub-yellow}{cmyk}{0,0.3,1,0} \definecolor{ub-gray}{cmyk}{0,0,0.15,0.55} \RequirePackage[hidelinks,breaklinks]{hyperref} \hypersetup{colorlinks=true, linkcolor=black, filecolor=black, urlcolor=ub-blue, citecolor=ub-blue, %black, %darkblue, bookmarksnumbered=true } \fancypagestyle{mlai-fancy}{ \fancyhf{} \fancyfoot[LE,RO]{\sffamily\small\thepage} \fancyhead[LE]{\sffamily\small\leftmark} \fancyhead[RO]{\sffamily\small\rightmark} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } \fancypagestyle{plain}{ \fancyhf{} \fancyfoot[LE,RO]{\sffamily\small\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } \setlength{\headheight}{13pt} \pagestyle{mlai-fancy} \AtBeginDocument{\thispagestyle{plain}} \RequirePackage[intlimits]{mathtools} \RequirePackage[amsmath,thmmarks]{ntheorem} \newenvironment{abstract}{ \small% \begin{center} \bfseries\GetTranslation{abstractname} \end{center}% \quotation% }{\endquotation} \ifPDFTeX \wlog{PDF LaTeX detected} \RequirePackage[utf8]{inputenc} \RequirePackage[T1]{fontenc} \RequirePackage{textcomp,tgpagella} \else \ifLuaTeX \wlog{LuaLaTeX detected} \RequirePackage{fontspec} \setmainfont[Ligatures=TeX]{TeX Gyre Pagella} \else \ifXeTeX \wlog{XeLaTeX detected} \RequirePackage{fontspec} \setmainfont[Ligatures=TeX]{TeX Gyre Pagella} \fi \fi \fi ```
https://tex.stackexchange.com/users/295754
XeLaTeX Font Warning: Font shape `TU/pcr/m/n' undefined (Font)
false
What you posted does not per itself allow to reproduce the problem. Probably the preamble or some other package is also doing `\usepackage{courier}` or `\usepackage{times}` which are packages for interacting with font encodings such as OT1, T1, ... suitable for pdfLaTeX, not the TU which becomes default font encoding with XeLaTeX and is used to fit "Unicode" font into the LaTeX font system. ``` \documentclass{article} \RequirePackage{iftex} \ifPDFTeX \wlog{PDF LaTeX detected} \RequirePackage[utf8]{inputenc} \RequirePackage[T1]{fontenc} \RequirePackage{textcomp,tgpagella} \else \ifLuaTeX \wlog{LuaLaTeX detected} \RequirePackage{fontspec} \setmainfont[Ligatures=TeX]{TeX Gyre Pagella} \else \ifXeTeX \wlog{XeLaTeX detected} \RequirePackage{fontspec} \setmainfont[Ligatures=TeX]{TeX Gyre Pagella} \fi \fi \fi % \usepackage{times} % or \usepackage{courier} \begin{document} \texttt{foo} \showoutput\thispagestyle{empty} \end{document} % Local variables: % TeX-engine: xetex % End: ``` and there is warning: ``` LaTeX Font Info: Trying to load font information for TU+pcr on input line 27 . LaTeX Font Info: No file TUpcr.fd. on input line 27. LaTeX Font Warning: Font shape `TU/pcr/m/n' undefined (Font) using `TU/lmr/m/n' instead on input line 27. ``` The `\showoutput` triggered extra information in the log ``` ...\hbox(7.05+0.10999)x345.0, glue set 314.16fil ....\hbox(0.0+0.0)x15.0 ....\TU/lmr/m/n/10 foo ....\kern 0.0 ``` confirming this. So you should identify what in your set-up leads to using such font packages which are specific to PDFLaTeX. What your posted (at time of writing this) does *not*. --- In investigating this I hit against a strange thing with LaTeX NFSS. In the above I used `\usepackage{times}` rather than `\usepackage{courier}` and expected the exact same. Although warning is indeed the same ``` LaTeX Font Info: Trying to load font information for TU+pcr on input line 27 . LaTeX Font Info: No file TUpcr.fd. on input line 27. LaTeX Font Warning: Font shape `TU/pcr/m/n' undefined (Font) using `TU/lmr/m/n' instead on input line 27. ``` the `\showoutput` box log diplays: ``` ...\hbox(7.05+0.10999)x345.0, glue set 313.33fil ....\hbox(0.0+0.0)x15.0 ....\TU/ptm/m/n/10 foo ....\kern 0.0 ....\glue 3.33 plus 1.665 minus 1.11 ``` notice the unexpected `\TU/ptm...` therein. The PDF does contain the announced Latin Modern font. But the showoutput log uses a fontname macro which somewhere else the system must know is not available. On has to find higher up int the log that `TU/lmr` was substituted to `TU/ptm`, but still `TU/ptm` is used here.
0
https://tex.stackexchange.com/users/293669
683963
317,308
https://tex.stackexchange.com/questions/683941
2
I am trying to get the following table to span over multiple pages or columns. I have tried using longtable instead of table but that ends up causing other issues. Does anyone know how to fix this? Thanks. ``` \begin{table}[!ht] \centering\captionsetup{justification = centering} \begin{tabular}{|c c c c c c|} \hline \#Nodes & Partition Type & Time & Cut & Energy & Modularity \\ [0.5ex] \hline\hline \multirow{8}{*}{9} & \rowcolor{yellow} kernighan-lin & 473.26 $\mu$s & -11 & 17 & 0.170 \\ & girvan-newman \rowcolor{yellow} & 2.01 ms & -7 & 20 & 0.180 \\ & \rowcolor{cyan} ideal cut & 46.04 ms & -11 & 19 & 0.186 \\ & \rowcolor{cyan} ideal energy & 46.04 ms & -7 & 20 & 0.180 \\ & \rowcolor{cyan} ideal modularity & 46.04 ms & -11 & 19 & 0.186 \\ & \rowcolor{pink} SNN \#0 & 1.46 ns & -7 & 15 & 0.125 \\ & \rowcolor{pink} SNN \#1 & 1.46 ns & -11 & 16 & 0.186 \\ & \rowcolor{pink} SNN \#2 & 1.46 ns & -11 & 17 & 0.170 \\ \hline \multirow{8}{*}{18} & \rowcolor{yellow} kernighan-lin & 715.02 $\mu$s & -60 & 83 & 0.284 \\ & \rowcolor{yellow} girvan-newman & 29.86 ms & -64 & 89 & 0.306 \\ & \rowcolor{cyan} ideal cut & 72.48 s & -64 & 89 & 0.305 \\ & \rowcolor{cyan} ideal energy & 72.48 s & 32 & 101 & 0.149 \\ & \rowcolor{cyan} ideal modularity & 72.48 s & -64 & 89 & 0.305 \\ & \rowcolor{pink} SNN \#0 & 5.83 ns & -32 & 67 & 0.245 \\ & \rowcolor{pink} SNN \#1 & 5.83 ns & -32 & 73 & 0.183 \\ & \rowcolor{pink} SNN \#2 & 5.83 ns & -36 & 73 & 0.208 \\ & \rowcolor{pink} SNN \#3 & 5.83 ns & -44 & 74 & 0.247 \\ \hline \multirow{5}{*}{20} & \rowcolor{yellow} kernighan-lin & 979.42 $\mu$s & -74 & 85 & 0.203 \\ & \rowcolor{yellow} girvan-newman & 44.43 ms & -82 & 85 & 0.224 \\ & \rowcolor{pink} SNN \#0 & 7.20 ns & -42 & 67 & 0.170 \\ & \rowcolor{pink} SNN \#1 & 7.20 ns & -46 & 70 & 0.160 \\ & \rowcolor{pink} SNN \#2 & 7.20 ns & -58 & 74 & 0.184 \\ \hline \multirow{9}{*}{22} & \rowcolor{yellow} metis & 1.64 ms & -92 & 91 & 0.177 \\ & \rowcolor{yellow} kernighan-lin & 1.61 ms & -92 & 89 & 0.177 \\ & \rowcolor{yellow} girvan-newman & 84.34 ms & 180 & 101 & -0.00296 \\ & \rowcolor{cyan} ideal cut & 2.09 ks & -92 & 93 & 0.178 \\ & \rowcolor{cyan} ideal energy & 2.09 ks & -36 & 101 & 0.124 \\ & \rowcolor{cyan} ideal modularity & 2.09 ks & -92 & 93 & 0.178 \\ & \rowcolor{pink} SNN \#0 & 8.71 ns & -76 & 81 & 0.152, \\ & \rowcolor{pink} SNN \#1 & 8.71 ns & -76 & 81 & 0.152 \\ & \rowcolor{pink} SNN \#2 & 8.71 ns & -88 & 88 & 0.169 \\ \hline \multirow{8}{*}{24} & \rowcolor{yellow} kernighan-lin & 1.32 ms & -104 & 108 & 0.173 \\ & \rowcolor{yellow} girvan_newman & 156.77 ms & -104 & 104 & 0.178 \\ & \rowcolor{cyan} ideal cut & 8.58 ks & -108 & 108 & 0.18 \\ & \rowcolor{cyan} ideal energy & 8.58 ks & -44 & 126 & 0.133 \\ & \rowcolor{cyan} ideal modularity & 8.58 ks & -108 & 108 & 0.18 \\ & \rowcolor{pink} SNN \#0 & 10.37 ns & -96 & 100 & 0.166 \\ & \rowcolor{pink} SNN \#1 & 10.37 ns & -96 & 100 & 0.166 \\ & \rowcolor{pink} SNN \#2 & 10.37 ns & -100 & 103 & 0.172 \\ \hline \multirow{9}{*}{24} & \rowcolor{yellow} metis & 1.36 ms & -120 & 153 & 0.306 \\ & \rowcolor{yellow} kernighan-lin & 15.03 ms & -120 & 153 & 0.306 \\ & \rowcolor{yellow} girvan-newman & 113.37 ms & -104 & 142 & 0.272 \\ & \rowcolor{cyan} ideal cut & 11.05 ks & -120 & 150 & 0.306 \\ & \rowcolor{cyan} ideal energy & 11.05 ks & 76 & 178 & 0.125 \\ & \rowcolor{cyan} ideal modularity & 11.05 ks & -120 & 150 & 0.306 \\ & \rowcolor{pink} SNN \#0 & 1.44 ns & -84 & 160 & 0.234 \\ & \rowcolor{pink} SNN \#1 & 1.44 ns & -104 & 163 & 0.287 \\ & \rowcolor{pink} SNN \#2 & 1.44 ns & -116 & 157 & 0.3 \\ \hline \multirow{10}{*}{25} & \rowcolor{yellow} kernighan-lin & 56.65 ms & -131 & 121 & 0.202 \\ & \rowcolor{yellow} girvan-newman & 547.38 ms & -135 & 120 & 0.209 \\ & \rowcolor{cyan} ideal cut & 19.97 ks & -135 & 120 & 0.209 \\ & \rowcolor{cyan} ideal energy & 19.97 ks & -59 & 138 & 0.147 \\ & \rowcolor{cyan} ideal modularity & 19.97 ks & -135 & 120 & 0.209 \\ & \rowcolor{pink} SNN \#0 & 11.25 ns & -107 & 106 & 0.184 \\ & \rowcolor{pink} SNN \#1 & 11.25 ns & -103 & 106 & 0.177 \\ & \rowcolor{pink} SNN \#2 & 11.25 ns & -107 & 106 & 0.184 \\ & \rowcolor{pink} SNN \#3 & 11.25 ns & -87 & 103 & 0.155 \\ & \rowcolor{pink} SNN \#4 & 11.25 ns & -107 & 106 & 0.184 \\ \hline \multirow{6}{*}{35} & \rowcolor{yellow} kernighan-lin & 1.66 ms & -233 & 324 & 0.294 \\ & \rowcolor{yellow} girvan-newman & 584.88 ms & -185 & 364 & 0.274 \\ & \rowcolor{pink} SNN \#0 & 22.05 ns & -157 & 269 & 0.269 \\ & \rowcolor{pink} SNN \#1 & 22.05 ns & -93 & 251 & 0.218 \\ & \rowcolor{pink} SNN \#2 & 22.05 ns & -117 & 252 & 0.255 \\ & \rowcolor{pink} SNN \#3 & 22.05 ns & -105 & 250 & 0.241 \\ \hline \multirow{5}{*}{50} & \rowcolor{yellow} kernighan-lin & 2.02 ms & -356 & 770 & 0.348 \\ & \rowcolor{yellow} girvan-newman & 776.80 ms & -8 & 556 & 0.269 \\ & \rowcolor{pink} SNN \#0 & 45.00 ns & 92 & 522 & 0.240 \\ & \rowcolor{pink} SNN \#1 & 45.00 ns & 108 & 520 & 0.225 \\ & \rowcolor{pink} SNN \#2 & 45.00 ns & 68 & 545 & 0.200 \\ \hline \multirow{5}{*}{50} & \rowcolor{yellow} metis & 2.93 ms & -488 & 676 & 0.286 \\ & \rowcolor{yellow} kernighan-lin & 2.65 ms & -480 & 669 & 0.286 \\ & \rowcolor{yellow} girvan-newman & 3.15 s & -424 & 604 & 0.273 \\ & \rowcolor{pink} SNN \#0 & 45.00 ns & -400 & 592 & 0.266 \\ & \rowcolor{pink} SNN \#1 & 45.00 ns & -444 & 611 & 0.282 \\ \hline \end{tabular} \caption{Results from simulations.} \label{tab:results} \end{table} ```
https://tex.stackexchange.com/users/295745
Tabular and longtable won't span over multiple pages
false
Long table should not be inserted in `table` float. It prevent table breaking over several pages. A wee bit changed table design (column "Time" is replaced by two columns: `S` and `s`, used is `tabularray` package with `booktabs` and `siunitx` libraries (which load packages of the same names), table rows are terminated by`\\*` with exception, where break table between pages is allowed: ``` \documentclass{article} % or some other suitable document class %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \SetTblrStyle{contfoot}{font=\footnotesize\sffamily\itshape} \NewColumnType{u}[1][]{Q[si={#1},l,cmd=\TblrUnit]} \begin{document} \begin{longtblr}[ caption = {Results from simulations.}, label = {tab:results} ]{colspec = {l l Q[si={table-format= 3.2{\,}, table-number-alignment=right}] @{} u % <--- for typing units, left aligned S[table-format=-2.0] S[table-format= 3.0] S[table-format=-1.5,group-digits=false] }, cell{2-Z}{1} = {font=\bfseries}, row{1} = {guard}, rowsep = 0.25pt, rowhead = 1, } % table body \toprule \# Nodes & Partition Type & \SetCell[c=2]{c} Time & & Cut & Energy & Modularity \\ \midrule % body of table \SetRow{bg=yellow} 9 & kernighan-lin & 473.26 & \micro\second & -11 & 17 & 0.170 \\* \SetRow{bg=yellow} & girvan-newman & 2.01 & \milli\second & -7 & 20 & 0.180 \\* \SetRow{bg=cyan} & ideal cut & 46.04 & \milli\second & -11 & 19 & 0.186 \\* \SetRow{bg=cyan} & ideal energy & 46.04 & \milli\second & -7 & 20 & 0.180 \\* \SetRow{bg=cyan} & ideal modularity & 46.04 & \milli\second & -11 & 19 & 0.186 \\* \SetRow{bg=pink} & SNN \#0 & 1.46 & \nano\second & -7 & 15 & 0.125 \\* \SetRow{bg=pink} & SNN \#1 & 1.46 & \nano\second & -11 & 16 & 0.186 \\* \SetRow{bg=pink} & SNN \#2 & 1.46 & \nano\second & -11 & 17 & 0.170 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 18 & kernighan-lin & 715.02 & \micro\second & -60 & 83 & 0.284 \\* \SetRow{bg=yellow} & girvan-newman & 29.86 & \milli\second & -64 & 89 & 0.306 \\* \SetRow{bg=cyan} & ideal cut & 72.48 & \second & -64 & 89 & 0.305 \\* \SetRow{bg=cyan} & ideal energy & 72.48 & \second & 32 & 101 & 0.149 \\* \SetRow{bg=cyan} & ideal modularity & 72.48 & \second & -64 & 89 & 0.305 \\* \SetRow{bg=pink} & SNN \#0 & 5.83 & \nano\second & -32 & 67 & 0.245 \\* \SetRow{bg=pink} & SNN \#1 & 5.83 & \nano\second & -32 & 73 & 0.183 \\* \SetRow{bg=pink} & SNN \#2 & 5.83 & \nano\second & -36 & 73 & 0.208 \\* \SetRow{bg=pink} & SNN \#3 & 5.83 & \nano\second & -44 & 74 & 0.247 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} \ 20 & kernighan-lin & 979.42 & \second & -74 & 85 & 0.203 \\* \SetRow{bg=yellow} & girvan-newman & 44.43 & \milli\second & -82 & 85 & 0.224 \\* \SetRow{bg=pink} & SNN \#0 & 7.20 & \nano\second & -42 & 67 & 0.170 \\* \SetRow{bg=pink} & SNN \#1 & 7.20 & \nano\second & -46 & 70 & 0.160 \\* \SetRow{bg=pink} & SNN \#2 & 7.20 & \nano\second & -58 & 74 & 0.184 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 22 & metis & 1.64 & \milli\second & -92 & 91 & 0.177 \\* \SetRow{bg=yellow} & kernighan-lin & 1.61 & \milli\second & -92 & 89 & 0.177 \\* \SetRow{bg=yellow} & girvan-newman & 84.34 & \milli\second & 180 & 101 & -0.00296 \\* \SetRow{bg=cyan} & ideal cut & 2.09 & \kilo\second & -92 & 93 & 0.178 \\* \SetRow{bg=cyan} & ideal energy & 2.09 & \kilo\second & -36 & 101 & 0.124 \\* \SetRow{bg=cyan} & ideal modularity & 2.09 & \kilo\second & -92 & 93 & 0.178 \\* \SetRow{bg=pink} & SNN \#0 & 8.71 & \nano\second & -76 & 81 & 0.152 \\* \SetRow{bg=pink} & SNN \#1 & 8.71 & \nano\second & -76 & 81 & 0.152 \\* \SetRow{bg=pink} & SNN \#2 & 8.71 & \nano\second & -88 & 88 & 0.169 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 24 & kernighan-lin & 1.32 & \milli\second & -104 & 108 & 0.173 \\* \SetRow{bg=yellow} & girvan-newman & 156.77 & \milli\second & -104 & 104 & 0.178 \\* \SetRow{bg=cyan} & ideal cut & 8.58 & \kilo\second & -108 & 108 & 0.18 \\* \SetRow{bg=cyan} & ideal energy & 8.58 & \kilo\second & -44 & 126 & 0.133 \\* \SetRow{bg=cyan} & ideal modularity & 8.58 & \kilo\second & -108 & 108 & 0.18 \\* \SetRow{bg=pink} & SNN \#0 & 10.37 & \nano\second & -96 & 100 & 0.166 \\* \SetRow{bg=pink} & SNN \#1 & 10.37 & \nano\second & -96 & 100 & 0.166 \\* \SetRow{bg=pink} & SNN \#2 & 10.37 & \nano\second & -100 & 103 & 0.172 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 24 & metis & 1.36 & \milli\second & -120 & 153 & 0.306 \\* \SetRow{bg=yellow} & kernighan-lin & 15.03 & \milli\second & -120 & 153 & 0.306 \\* \SetRow{bg=yellow} & girvan-newman & 113.37 & \milli\second & -104 & 142 & 0.272 \\* \SetRow{bg=cyan} & ideal cut & 11.05 & \kilo\second & -120 & 150 & 0.306 \\* \SetRow{bg=cyan} & ideal energy & 11.05 & \kilo\second & 76 & 178 & 0.125 \\* \SetRow{bg=cyan} & ideal modularity & 11.05 & \kilo\second & -120 & 150 & 0.306 \\* \SetRow{bg=pink} & SNN \#0 & 1.44 & \nano\second & -84 & 160 & 0.234 \\* \SetRow{bg=pink} & SNN \#1 & 1.44 & \nano\second & -104 & 163 & 0.287 \\* \SetRow{bg=pink} & SNN \#2 & 1.44 & \nano\second & -116 & 157 & 0.3 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 25 & kernighan-lin & 56.65 & \milli\second & -131 & 121 & 0.202 \\* \SetRow{bg=yellow} & girvan-newman & 547.38 & \milli\second & -135 & 120 & 0.209 \\* \SetRow{bg=cyan} & ideal cut & 19.97 & \kilo\second & -135 & 120 & 0.209 \\* \SetRow{bg=cyan} & ideal energy & 19.97 & \kilo\second & -59 & 138 & 0.147 \\* \SetRow{bg=cyan} & ideal modularity & 19.97 & \kilo\second & -135 & 120 & 0.209 \\* \SetRow{bg=pink} & SNN \#0 & 11.25 & \nano\second & -107 & 106 & 0.184 \\* \SetRow{bg=pink} & SNN \#1 & 11.25 & \nano\second & -103 & 106 & 0.177 \\* \SetRow{bg=pink} & SNN \#2 & 11.25 & \nano\second & -107 & 106 & 0.184 \\* \SetRow{bg=pink} & SNN \#3 & 11.25 & \nano\second & -87 & 103 & 0.155 \\* \SetRow{bg=pink} & SNN \#4 & 11.25 & \nano\second & -107 & 106 & 0.184 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 35 & kernighan-lin & 1.66 & \milli\second & -233 & 324 & 0.294 \\* \SetRow{bg=yellow} & girvan-newman & 584.88 & \milli\second & -185 & 364 & 0.274 \\* \SetRow{bg=pink} & SNN \#0 & 22.05 & \nano\second & -157 & 269 & 0.269 \\* \SetRow{bg=pink} & SNN \#1 & 22.05 & \nano\second & -93 & 251 & 0.218 \\* \SetRow{bg=pink} & SNN \#2 & 22.05 & \nano\second & -117 & 252 & 0.255 \\* \SetRow{bg=pink} & SNN \#3 & 22.05 & \nano\second & -105 & 250 & 0.241 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 50 & kernighan-lin & 2.02 & \milli\second & -356 & 770 & 0.348 \\* \SetRow{bg=yellow} & girvan-newman & 776.80 & \milli\second & -8 & 556 & 0.269 \\* \SetRow{bg=pink} & SNN \#0 & 45.00 & \nano\second & 92 & 522 & 0.240 \\* \SetRow{bg=pink} & SNN \#1 & 45.00 & \nano\second & 108 & 520 & 0.225 \\* \SetRow{bg=pink} & SNN \#2 & 45.00 & \nano\second & 68 & 545 & 0.200 \\ \midrule[3pt, fg=white] \SetRow{bg=yellow} 50 & metis & 2.93 & \milli\second & -488 & 676 & 0.286 \\ \SetRow{bg=yellow} & kernighan-lin & 2.65 & \milli\second & -480 & 669 & 0.286 \\ \SetRow{bg=yellow} & girvan-newman & 3.15 & \second & -424 & 604 & 0.273 \\ \SetRow{bg=pink} & SNN \#0 & 45.00 & \nano\second & -400 & 592 & 0.266 \\ \SetRow{bg=pink} & SNN \#1 & 45.00 & \nano\second & -444 & 611 & 0.282 \\ \end{longtblr} \end{document} ```
2
https://tex.stackexchange.com/users/18189
683964
317,309
https://tex.stackexchange.com/questions/683935
0
This is my first question, so I'm sorry if there are detiails missing or my question could be written more clearly. Any help is greatly appreciated. I want to use hyperref to reference the name of one of my Appendices such that I can write: ``` ...detailed information is found in \nameref{App:B} ``` And have the result be ``` ...detailed information is found in Appendix B - Matlab Code ``` The thing is, my appendices are unnumbered so I have used \refstepcounter to increment the chapter counter manually. Now, when I use \ref to reference the appendix the outputted number is correct but when using \nameref, the compiled name is the last numbered chapter. I have narrowed down the issue to have something to do with \refstepcounter redefining \ @currentlabel but even so I really struggle with understanding the exact details of what \refstepcounter has done to my \label and how to fix it. My current code says something in the lines of ``` \documentclass[a4paper,11pt]{scrreprt} \begin{document} \usepackage{hyperref} \chapter{Some numbered chapter} \chapter*{Appendix B - Matlab Code} \refstepcounter{chapter}\label{App:B} \addcontentsline{toc}{chapter}{Appendix B - Matlab Code} ```
https://tex.stackexchange.com/users/295734
ref references the correct number, but nameref uses the wrong name
true
Your main problem is, that you try to fake numbered chapters with commands for not numbered chapters. Instead you should use `\chapter{…}` and configure the output to what you want. For example: ``` \documentclass{scrreprt} \usepackage{hyperref} \newcommand*{\tocchapapp}{} \AddToHook{scrreprt/appendix}{% % Code from https://sf.net/p/koma-script/wiki-en/HowTo_TocAppendixPrefix/ \renewcommand*{\tocchapapp}{\chapapp\ }% \addtocontents{\csname ext@toc\endcsname}{% \string\DeclareTOCStyleEntry[numwidth+=5em]{chapter}{chapter}% }% % Additionally add the prefix to the format of the headings: \renewcommand*{\chapterformat}{\appendixname\ \thechapter\ --\ }% % and the format of the running heads: \renewcommand*{\chaptermarkformat}{\appendixname\ \thechapter\ --\ }% } % Again Code from https://sf.net/p/koma-script/wiki-en/HowTo_TocAppendixPrefix/ \renewcommand*{\addchaptertocentry}[2]{% \IfArgIsEmpty{#1}{% keine Nummer: \addtocentrydefault{chapter}{#1}{#2}% wie bisher }{% mit Nummer: \addtocentrydefault{chapter}{\tocchapapp#1}{#2}% }% } \begin{document} \tableofcontents \chapter{Some numbered chapter} See \autoref{App:B}: \nameref{App:B} \appendix \chapter{Matlab Code} \label{App:B} \end{document} ```
0
https://tex.stackexchange.com/users/277964
683970
317,312
https://tex.stackexchange.com/questions/4542
21
When adding citations in the body of a document I'm used to write ``` ... in some interesting paper~\cite{interesting}. ``` So that (if I'm using numbered references) the word “paper” and the citation number stick together and do not accidentally end up in two different lines. It seems, however, that the `\citet` command from `natbib` (which should produce something like “Authors [4]”), does not use a `~` between the names of the authors and the citation number so that, on a few rare occasions, I end up with something like ``` ... Authors [4]. ``` Which is annoying. Is there an easy way to make `natbib` use a non-breaking space there?
https://tex.stackexchange.com/users/169
Non-breaking space in \citet using natbib?
false
@JanJones answer worked for me too when using `biblatex`. I applied it as follows also fixing `multicitedelim` ``` \renewcommand*{\namelabeldelim}{\nobreakspace} \renewcommand*{\multicitedelim}{\addcomma\nobreakspace} ```
1
https://tex.stackexchange.com/users/277157
683973
317,313