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/691566
|
1
|
I'm using Mactex and locally editing a presentation file in Beamer. When I go to use the `Berlin` color theme, I get the follolwing
>
> File `beamercolorthemeBerlin.sty' not found.
>
>
>
Any ideas?
|
https://tex.stackexchange.com/users/298871
|
Beamer on VSCode mac: File `beamercolorthemeBerlin.sty' not found
| false |
In my installation, I have
```
~/tmp> locate beamercolorthemeB
/home/romano/texlive2023/texmf-dist/tex/latex/beamer-fuberlin/beamercolorthemeBerlinFU.sty
/home/romano/texlive2023/texmf-dist/tex/latex/bfh-ci/beamercolorthemeBFH.sty
```
So it seems that the colortheme is called `BerlinFU`. Given that you didn't post any code, I can't be sure this is the problem.
|
1
|
https://tex.stackexchange.com/users/38080
|
691567
| 320,808 |
https://tex.stackexchange.com/questions/691557
|
0
|
I have an issue in a system I am working on where long equations go beyond the page width. The LaTeX is automatically generated by an algorithm and I would like to have a way to make it fit in the page even if that makes it a little smaller. This solution would be fine for cases where the equation is a little larger than the page width. Obviously for extreme cases the developer will have to split the equation into more equations.
In my estimate it is way harder to make the system automatically recognise positions in an equation where it could split it in more lines.
After going through various posts in this forum (for example this one [can i use resize box in align](https://tex.stackexchange.com/questions/685394/can-i-use-resize-box-in-align/)) I have not found a working sample of code using \resizebox in an align environment. How could I resize the following equation for example to fit the page?
```
\begin{align*}
N_{Ed0} &= N_x · \cos^2(\phi_0) + N_y · \sin^2(\phi_0) + 2 · N_{xy} · \sin(\phi_0) · \cos(\phi_0) - N_0 · \cot(\phi_0) \\
&= (-1.81234E3) · \cos^2(47.0113) + (-9.06168E3) · \sin^2(47.0113) + 2 · 28.19E3 · \sin(47.0113) · \cos(47.0113) - 18.4356 · \cot(47.0113) = \mathbf{ 22.4121E3 \: N }
\end{align*}
```
PS: The decimal points are a user option so the solution could not be "reduce the decimals".
|
https://tex.stackexchange.com/users/289840
|
Automatically fit equation in align environment in page width
| true |
You need a horizontal mode construct in `\resizebox` I really can not recommend doing this at all as it quickly makes the math unreadable with no warning but:
```
\documentclass{article}
\usepackage{amsmath,graphicx}
\DeclareUnicodeCharacter{00B7}{\cdot}
\begin{document}
\noindent X\dotfill X
\begin{center}
\resizebox{\textwidth}{!}{$\begin{aligned}
N_{Ed0} &= N_x · \cos^2(\phi_0) + N_y · \sin^2(\phi_0) + 2 · N_{xy} · \sin(\phi_0) · \cos(\phi_0) - N_0 · \cot(\phi_0) \\
&= (-1.81234E3) · \cos^2(47.0113) + (-9.06168E3) · \sin^2(47.0113) + 2 · 28.19E3 · \sin(47.0113) · \cos(47.0113) - 18.4356 · \cot(47.0113) = \mathbf{ 22.4121E3 \: N }
\end{aligned}$}
\end{center}
\end{document}
```
I would drop the alignment and let latex break the inline math with no font scaling
```
\usepackage{amsmath,graphicx}
\DeclareUnicodeCharacter{00B7}{\cdot}
\begin{document}
\noindent X\dotfill X
\begin{center}
$
N_{Ed0} = N_x · \cos^2(\phi_0) + N_y · \sin^2(\phi_0) + 2 · N_{xy} · \sin(\phi_0) · \cos(\phi_0) - N_0 · \cot(\phi_0) $\\$
= (-1.81234E3) · \cos^2(47.0113) + (-9.06168E3) · \sin^2(47.0113) + 2 · 28.19E3 · \sin(47.0113) · \cos(47.0113) - 18.4356 · \cot(47.0113) = \mathbf{ 22.4121E3 \: N }
$
\end{center}
\end{document}
```
|
3
|
https://tex.stackexchange.com/users/1090
|
691570
| 320,809 |
https://tex.stackexchange.com/questions/691571
|
0
|
I am new to LaTeX, and trying to create a table in a document with scrbook document class. This document doesn't have any other content, but a table in first page itself. And when I compile, I am getting this error: "Underfull \hbox (badness 10000) in paragraph".
My code is as follows:
```
\documentclass[12pt,%font size 12
paper =a4,%a4 size paper
final,%final, not draft
twoside = semi,%print two side of the paper
openright,%open new chapter on right page
titlepage = firstiscover,
leqno,%equation number on left
fleqn,
chapterprefix, %Write "Chapter" before chapter name
appendixprefix, %write "Appendix" before appendix name
headsepline, %horizontal line below header
footsepline, %horizontal line above footer
listof = nottotoc,%don't include list of table and list of figures in TOC
parskip = full,
captions = tableheading]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[british]{babel}%use British English
\usepackage{csquotes}
\setcaptionalignment{c}
\begin{document}
\chapter{Introduction}
\begin{table}[htbp]
\centering
\caption{\begin{center}
My Introductory Table
\end{center}}
\label{tbl:sample}
\begin{tabular}{cc}
\hline
Heading 1 & Heading 2\\
\hline
Item 1 & Item 2 \\
Item 3 & Item 4 \\
Item 5 & Item 6 \\
Item 7 & Item 8\\
\hline
\end{tabular}
\end{table}
\end{document}
```
In the desired output, I want to keep both, all the tables and their respective captions in the center alignment. How can I do this?
|
https://tex.stackexchange.com/users/267842
|
How to solve "Underfull \hbox (badness 10000) in paragraph" error in scrbook document class?
| true |
The posted code does not give an underful box warning, however it stops with an error due to the misplaced `center` inside the caption. If you delete that you still get a centred caption, and no error or warning.
```
\documentclass[12pt,%font size 12
paper =a4,%a4 size paper
final,%final, not draft
twoside = semi,%print two side of the paper
openright,%open new chapter on right page
titlepage = firstiscover,
leqno,%equation number on left
fleqn,
chapterprefix, %Write "Chapter" before chapter name
appendixprefix, %write "Appendix" before appendix name
headsepline, %horizontal line below header
footsepline, %horizontal line above footer
listof = nottotoc,%don't include list of table and list of figures in TOC
parskip = full,
captions = tableheading]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[british]{babel}%use British English
\usepackage{csquotes}
\setcaptionalignment{c}
\begin{document}
\chapter{Introduction}
\begin{table}[htbp]
\centering
\caption{My Introductory Table}
\label{tbl:sample}
\begin{tabular}{cc}
\hline
Heading 1 & Heading 2\\
\hline
Item 1 & Item 2 \\
Item 3 & Item 4 \\
Item 5 & Item 6 \\
Item 7 & Item 8\\
\hline
\end{tabular}
\end{table}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/1090
|
691573
| 320,811 |
https://tex.stackexchange.com/questions/117402
|
15
|
I am writing my thesis and I am using document class `thesis`. I want the page numbering appearing at bottom of the pages and centered.
```
\documentclass[12pt,a4paper, oneside, bold]{thesis}
\usepackage[left=3cm,right=2cm,top=3cm,bottom=2cm]{geometry}
\begin{document}
My text....
\end{document}
```
I tried writing something like that:
```
\documentclass[12pt,a4paper, oneside, bold]{thesis}
\usepackage[left=3cm,right=2cm,top=3cm,bottom=2cm]{geometry}
\usepackage{fancyhdr}
\fancyhf{}
\cfoot{\thepage}
\begin{document}
My text
\end{document}
```
But nothing is working. Any suggestions please.
|
https://tex.stackexchange.com/users/31656
|
Page numbering at bottom of page
| false |
Write in the header or body
```
\pagestyle{plain}
```
The \pagestyle command changes the style from the current page on throughout the remainder of your document.
The [valid options](http://www.emerson.emory.edu/services/latex/latex_129.html) are:
* plain - Just a plain page number.
* empty - Produces empty heads and feet - no page numbers.
* headings - Puts running headings on each page. The document style specifies what goes in the headings.
* myheadings - You specify what is to go in the heading with the \markboth or the \markright commands.
Pro: doesn't require additional packages.
Con: the author of the question actually used *fancyhdr* (I don't know the reason). Several people pointed that my answer in comments would be also useful, that is why I'm posting it here.
See more about page styles and *fancyhdr* in the Wikibook on [LaTeX](https://en.wikibooks.org/wiki/LaTeX/Customizing_Page_Headers_and_Footers).
|
1
|
https://tex.stackexchange.com/users/71097
|
691577
| 320,813 |
https://tex.stackexchange.com/questions/691557
|
0
|
I have an issue in a system I am working on where long equations go beyond the page width. The LaTeX is automatically generated by an algorithm and I would like to have a way to make it fit in the page even if that makes it a little smaller. This solution would be fine for cases where the equation is a little larger than the page width. Obviously for extreme cases the developer will have to split the equation into more equations.
In my estimate it is way harder to make the system automatically recognise positions in an equation where it could split it in more lines.
After going through various posts in this forum (for example this one [can i use resize box in align](https://tex.stackexchange.com/questions/685394/can-i-use-resize-box-in-align/)) I have not found a working sample of code using \resizebox in an align environment. How could I resize the following equation for example to fit the page?
```
\begin{align*}
N_{Ed0} &= N_x · \cos^2(\phi_0) + N_y · \sin^2(\phi_0) + 2 · N_{xy} · \sin(\phi_0) · \cos(\phi_0) - N_0 · \cot(\phi_0) \\
&= (-1.81234E3) · \cos^2(47.0113) + (-9.06168E3) · \sin^2(47.0113) + 2 · 28.19E3 · \sin(47.0113) · \cos(47.0113) - 18.4356 · \cot(47.0113) = \mathbf{ 22.4121E3 \: N }
\end{align*}
```
PS: The decimal points are a user option so the solution could not be "reduce the decimals".
|
https://tex.stackexchange.com/users/289840
|
Automatically fit equation in align environment in page width
| false |
Here's a possible solution, but this will lead to very poor typesetting.
The argument to `scaleddisplay` is the type of environment you want to scale and can be `equation`, `gather`, `align` or `alignat`.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{newunicodechar}
\usepackage{lipsum}% for mock text
\newunicodechar{·}{\TextOrMath{\textperiodcentered}{\cdot}}
\ExplSyntaxOn
\NewDocumentEnvironment{scaleddisplay}{mb}
{% #1 = type of alignment (equation,gather,align,alignat)
% #2 = body
\tsaras_scaleddisplay:nn { #1 } { #2 }
}{}
\cs_new_protected:Nn \tsaras_scaleddisplay:nn
{
\begin{displaymath}
\resizebox{\textwidth}{!}
{
\__tsaras_scaleddisplaytype:nn { #1 } { #2 }
}
\end{displaymath}
}
\cs_new:Nn \__tsaras_scaleddisplaytype:nn
{
\str_case:nn { #1 }
{
{equation}{$#2$}
{gather}{$\begin{gathered}#2\end{gathered}$}
{align}{$\begin{aligned}#2\end{aligned}$}
{alignat}{$\begin{alignedat}{-1}#2\end{alignedat}$}
}
}
\ExplSyntaxOff
\begin{document}
\lipsum[1][1-4]
\begin{scaleddisplay}{align}
N_{Ed0} &= N_x · \cos^2(\phi_0) + N_y · \sin^2(\phi_0) + 2 · N_{xy} · \sin(\phi_0) · \cos(\phi_0) - N_0 · \cot(\phi_0) \\
&= (-1.81234E3) · \cos^2(47.0113) + (-9.06168E3) · \sin^2(47.0113) + 2 · 28.19E3 · \sin(47.0113) · \cos(47.0113) - 18.4356 · \cot(47.0113) = \mathbf{ 22.4121E3 \: N }
\end{scaleddisplay}
\lipsum[2][1-4]
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/4427
|
691578
| 320,814 |
https://tex.stackexchange.com/questions/691580
|
0
|
I want to use subfigure to put one image next to the other in my document. I literally copy-pasted the code from [Overleaf](https://www.overleaf.com/learn/latex/How_to_Write_a_Thesis_in_LaTeX_(Part_3)%3A_Figures%2C_Subfigures_and_Tables#Subfigures) and modified it to have 2 instead of 3 images. I am working on Overleaf directly and it did not work, with the following errors:
>
> Missing number, treated as zero.
>
>
>
> ```
> } l.20 \begin{subfigure}[b]{0.4\textwidth}
>
> ```
>
> A number should have been here; I inserted 0. (If you can't figure out
> why I needed to see a number, look up `weird error' in the index to
> The TeXbook.)
>
>
>
and
>
> Illegal unit of measure (pt inserted)
>
> }
> l.27 \begin{subfigure}[b]{0.4\textwidth}
>
>
>
>
> Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one! I'll assume that you meant to say pt, for printer's points. To recover gracefully from this error, it's best to delete the erroneous units; e.g., type 2 to delete two letters. (See Chapter 27 of The TeXbook.)
>
>
>
I tried to just copy-paste literally and use 2 times the same image, but the same errors show up.
```
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{images/body/hierarchical-clustering-sklearn.png}
\caption{$y=x$}
\label{fig:y equals x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{images/body/partition-sklearn.png}
\caption{$y=3\sin x$}
\label{fig:three sin x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{images/body/partition-sklearn.png}
\caption{$y=5/x$}
\label{fig:five over x}
\end{subfigure}
\caption{Three simple graphs}
\label{fig:three graphs}
\end{figure}
```
Edit 1: I do have graphicx loaded in the preamble.
|
https://tex.stackexchange.com/users/233957
|
Subfigure and \textwidth not working correctly
| false |
I can reproduce the errors if I run LaTeX on
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfigure}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{$y=x$}
\label{fig:y equals x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{$y=3\sin x$}
\label{fig:three sin x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{$y=5/x$}
\label{fig:five over x}
\end{subfigure}
\caption{Three simple graphs}
\label{fig:three graphs}
\end{figure}
\end{document}
```
The package `subfigure` has been obsolete for about two decades and was replaced by `subfig`. Anyway, you're using the syntax of `subcaption`.
```
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{$y=x$}
\label{fig:y equals x}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{$y=3\sin x$}
\label{fig:three sin x}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{$y=5/x$}
\label{fig:five over x}
\end{subfigure}
\caption{Three simple graphs}
\label{fig:three graphs}
\end{figure}
\end{document}
```
Note that I removed the useless `\centering` commands inside `subfigure`. I also replaced the file names for the image with something I have.
Note also the correct syntax for `\hfill` (you had a space in excess caused by the endline).
|
2
|
https://tex.stackexchange.com/users/4427
|
691583
| 320,816 |
https://tex.stackexchange.com/questions/691591
|
4
|
I often see things like `\lambda_{\min}` or `\lambda_{\max}` in papers. To me, it seems that the "min" and "max" are not used as operators, but rather as text, so it would be better to do something like `\lambda_{\textup{min}}` or `\lambda_{\textup{max}}`.
However, while there's a [clear difference](https://tex.stackexchange.com/questions/48459/whats-the-difference-between-mathrm-and-operatorname) between `\min` and `\textup{min}` in regular math mode, I haven't really been able to see a difference between how the different options are typset in the subscripts. Are there situations in which there is a difference?
|
https://tex.stackexchange.com/users/153736
|
operatorname vs text in subscripts
| true |
When you type `\lambda_{\min}` you get essentially the same as with `\lambda_{\mathrm{min}}`. They're different semantically: in the former case you're using an operator, in the latter case a textual subscripts.
You *may* get the same as `\mathrm` if you use `\textup`, but not necessarily: compare
```
$\lambda_{\textup{min}}$ and \textsf{$\lambda_{\textup{min}}$}
```
where the second “min” is typeset in the prevailing font valid outside the math formula. There wouldn't usually be differences with either `\mathrm{min}` or `\min`. Well, there *can* be!
Suppose you want to use a style that's unfortunately found in some publications, where sans serif type is used in some contexts, for instance tables. If you have math, you should define a suitable math version for sans serif type (look at `sansmath.sty` for an example). If the math version is correctly set up, then `\mathrm` would use the standard (upright) sans serif font.
Note also that, even without taking math versions into account, the font chosen by `\mathrm` may not be the same as the main text font, but I'd consider such cases as disputable, if not outright wrong, setting.
Barring such situations, using `\min` instead of `\mathrm{min}` for a textual subscript might be considered a venial sin against consistency in semantics, unless you consider this as a different way to write the result of applying the operator “min”.
You're the judge.
|
6
|
https://tex.stackexchange.com/users/4427
|
691597
| 320,817 |
https://tex.stackexchange.com/questions/691606
|
3
|
I'm trying to label the angle between the horizontal side and the oblique side but I do not know how to do this since I'm just a beginner in tikz. Could someone help me with this. The following is my code:
```
\begin{tikzpicture}
\coordinate (P) at (0,0);
\coordinate (Q) at (6,0);
\coordinate (R) at (6,3);
\draw[thick] (P)--(Q)--(R)--cycle;
\end{tikzpicture}
```
|
https://tex.stackexchange.com/users/300484
|
label angle in tikz
| true |
Here is one way to do it:
* `angles`-library marks angles as given
* `quotes` is needed to insert text `" .. "` which includes math mode `$ .. $` which can render e.g. greek letters
* note: `{angle=P--Q--R}` marks the outer angle
```
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles}% see ch. 41 in the pgfmanual
\usetikzlibrary{quotes}% see ch. 41 in the pgfmanual
\begin{document}
\begin{tikzpicture}
\coordinate (P) at (0,0);
\coordinate (Q) at (6,0);
\coordinate (R) at (6,3);
\draw[thick] (P)--(Q)--(R)--cycle;
\pic[draw,->] {angle=R--Q--P};
\pic[draw,angle radius=1.5cm,<->,"$\psi$"]
{angle=Q--P--R};
\end{tikzpicture}
\end{document}
```
|
5
|
https://tex.stackexchange.com/users/245790
|
691608
| 320,824 |
https://tex.stackexchange.com/questions/691603
|
-1
|
I want to insert figure below into my document to a specified scale of 0.7 between text and I also want it captioned. If I use the figure environment it creates a whole page for itself(even after using `\begin{figure}[H]`. The figure is In a single page PDF.
```
\documentclass{article}
\usepackage{amsmath}
```
|
https://tex.stackexchange.com/users/295796
|
Insert pdf between text
| false |
Your most likely issue here is that the image itself is too big to fit within the text block boundary, even though you scale it down to 70%. Options to remedy the situation:
1. Choose a smaller scale until the image fits within the page, or adjust the margins to allow some form of textual flow around it (rather than being set on a page by itself);
2. Trim enough excess whitespace around the image to reduce its ultimate size
As an example that highlights your issue, let's assume your image is `example-image-letter` (from [`mwe`](//ctan.org/pkg/mwe)):
In the above image, the page boundary forms part of the image.
Placement of the image is mostly impacted by the final image height. Including this at 70% scale into a document leaves you with an image that has a height of 11.5in x 0.7 ~ 8in. With the default `\textheight` of a document being less than that (550pt ~ 7.6in for a letter-sized document), there's no way you can fit a full page in between text on the same page. As such, any inclusion method (even with `[H]` from [`float`](//ctan.org/pkg/float)) will cause the image to spill over to the next page, or be set on a page-of-floats (on its own).
Follow remedy option (1) (a smaller scale value) to make it fit or adjust the text block margins using [`geometry`](//ctan.org/pkg/geometry). Here's an example using the former option:
```
\documentclass{article}
\usepackage{graphicx,float}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{figure}[H]
\centering
\includegraphics[scale=0.4]{example-image-letter}
\caption{A figure caption.}
\end{figure}
\lipsum[2]
\end{document}
```
For option (2), you can use the `bb` and `clip` option to trim off some excess whitespace from your image (assuming that it is actually smaller than a full page). Here's an example using that approach:
```
\documentclass{article}
\usepackage{graphicx,float}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{figure}[H]
\centering
\includegraphics[scale=0.7,bb=1in 5in 7.5in 10in,clip]{example-image-letter}
\caption{A figure caption.}
\end{figure}
\lipsum[2]
\end{document}
```
Using `bb=1in 5in 7.5in 10in` and `clip` I've trimmed `1in` from the left/right of the document, `5in` from the bottom and `1in` from the top (the default paper size is letter, which has dimensions 8.5in x 11in). The values for `bb=<llx> <lly> <urx> <ury>` represent the `l`ower `l`eft and `u`pper `r`ight `x`/`y` coordinates on the page.
|
1
|
https://tex.stackexchange.com/users/5764
|
691615
| 320,826 |
https://tex.stackexchange.com/questions/691606
|
3
|
I'm trying to label the angle between the horizontal side and the oblique side but I do not know how to do this since I'm just a beginner in tikz. Could someone help me with this. The following is my code:
```
\begin{tikzpicture}
\coordinate (P) at (0,0);
\coordinate (Q) at (6,0);
\coordinate (R) at (6,3);
\draw[thick] (P)--(Q)--(R)--cycle;
\end{tikzpicture}
```
|
https://tex.stackexchange.com/users/300484
|
label angle in tikz
| false |
Here is a way without using the angles library. The basic idea is simple:
* move the pen (so to say) to the starting position `\draw (1,0)`
* draw an arc from there `arc(0:30:1);` (startAngle:stopAngle:radius)
Downsides:
* now you have to know or calculate the required angle yourself
* here I did it manually: 26.6 deg
* you need to put the text-label yourself
* using polar coordinates is useful here `(13.3:1.5)` , i.e. at 13.3 deg and radius 1.5
```
\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (P) at (0,0);
\coordinate (Q) at (6,0);
\coordinate (R) at (6,3);
\draw[thick] (P)--(Q)--(R)--cycle;
\draw (1,0) arc(0:26.6:1);
\node at (13.3:1.5) {$\beta$};
\end{tikzpicture}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/245790
|
691618
| 320,828 |
https://tex.stackexchange.com/questions/691582
|
0
|
>
> *This was the underlying motivation for [a previous question of mine](https://tex.stackexchange.com/q/691541/194994). However, after several hours of failure, I decide to ask this problem directly.*
>
>
>
The goal
========
In order to support the four declensions of German in the package [crefthe](https://ctan.org/pkg/crefthe), I intended to define a new command `\crefthevariantname`, whose usage would be like:
```
\crefthevariantname{theorem}
{
{Satz}{Sätze}
, Nominativ = [der]{Satz}[die]{Sätze}
, Genitiv = [des]{Satzes}[der]{Sätze}
, Dativ = [dem]{Satz}[den]{Sätzen}
, Akkusativ = [den]{Satz}[die]{Sätze}
}
```
Ideally, it should internally convert this input into:
```
\crefthename{theorem}
[
\str_case:NnF \l__crefthe_variant_tl
{
{ Nominativ } { der }
{ Genitiv } { des }
{ Dativ } { dem }
{ Akkusativ } { den }
} { }
]
{
\str_case:NnF \l__crefthe_variant_tl
{
{ Nominativ } { Satz }
{ Genitiv } { Satzes }
{ Dativ } { Satz }
{ Akkusativ } { Satz }
} { Satz }
}
[
\str_case:Nn \l__crefthe_variant_tl
{
{ Nominativ } { die }
{ Genitiv } { der }
{ Dativ } { den }
{ Akkusativ } { die }
} { }
]
{
\str_case:Nn \l__crefthe_variant_tl
{
{ Nominativ } { Sätze }
{ Genitiv } { Sätze }
{ Dativ } { Sätzen }
{ Akkusativ } { Sätze }
} { Sätze }
}
```
I've tested the code above directly and it works, so the only thing remains to do is to achieve this transition.
What I have done
================
For now, I have successfully managed to parse the input, with the code below:
```
\keys_define:nn { crefthe-variant-parse }
{
, unknown .code:n = {
\seq_put_right:No \l__crefthe_variant_variant_seq { \l_keys_key_tl }
\__crefthe_variant_append_to_seq:w #1
}
}
\bool_new:N \l__crefthe_variant_dafault_given_bool
\cs_new:Nn \crefthe_parse_variant_string:n
% #1 = clist of configuration
{
\bool_set_false:N \l__crefthe_variant_dafault_given_bool
\clist_map_inline:nn { #1 }
{
\str_if_in:nnTF { ##1 } { = }
{
\keys_set:nn { crefthe-variant-parse } { ##1 }
}
{
\bool_set_true:N \l__crefthe_variant_dafault_given_bool
\__crefthe_variant_set_default:w ##1
}
}
\__crefthe_variant_create_prop_from_seq:n { article_singular }
\__crefthe_variant_create_prop_from_seq:n { article_plural }
\__crefthe_variant_create_prop_from_seq:n { singular }
\__crefthe_variant_create_prop_from_seq:n { plural }
}
\tl_new:N \l__crefthe_variant_default_article_singular_tl
\tl_new:N \l__crefthe_variant_default_article_plural_tl
\tl_new:N \l__crefthe_variant_default_singular_tl
\tl_new:N \l__crefthe_variant_default_plural_tl
\NewDocumentCommand \__crefthe_variant_set_default:w { O{} m O{} m }
{
\tl_set:Nn \l__crefthe_variant_default_article_singular_tl { #1 }
\tl_set:Nn \l__crefthe_variant_default_article_plural_tl { #3 }
\tl_set:Nn \l__crefthe_variant_default_singular_tl { #2 }
\tl_set:Nn \l__crefthe_variant_default_plural_tl { #4 }
}
\seq_new:N \l__crefthe_variant_variant_seq
\seq_new:N \l__crefthe_variant_article_singular_seq
\seq_new:N \l__crefthe_variant_article_plural_seq
\seq_new:N \l__crefthe_variant_singular_seq
\seq_new:N \l__crefthe_variant_plural_seq
\NewDocumentCommand \__crefthe_variant_append_to_seq:w { O{} m O{} m }
{
\seq_put_right:Nn \l__crefthe_variant_article_singular_seq { #1 }
\seq_put_right:Nn \l__crefthe_variant_article_plural_seq { #3 }
\seq_put_right:Nn \l__crefthe_variant_singular_seq { #2 }
\seq_put_right:Nn \l__crefthe_variant_plural_seq { #4 }
}
\cs_new:Nn \__crefthe_variant_create_prop_from_seq:n
{
\prop_clear_new:c { l__crefthe_variant_ #1 _prop }
\int_step_inline:nn { \seq_count:c { l__crefthe_variant_ #1 _seq } }
{
\prop_put:cxx { l__crefthe_variant_ #1 _prop }
{ \seq_item:cn { l__crefthe_variant_variant_seq } { ##1 } }
{ \seq_item:cn { l__crefthe_variant_ #1 _seq } { ##1 } }
}
}
```
The main command is `\crefthe_parse_variant_string:n`. It shall parse the default line (the one without `=`, in the previous example it is `{Satz}{Sätze}`) and the other lines (like `Nominativ = [der]{Satz}[die]{Sätze}`) separately:
1. `\__crefthe_variant_set_default:w` parses the default line, saves the strings into the corresponding `\l__crefthe_variant_default_<type>_tl`;
2. `\__crefthe_variant_append_to_seq:w` processes the other lines, at each time appends the string into the corresponding `\l__crefthe_variant_<type>_seq`.
Moreover, though I'm not sure if it would be helpful in the final solution, with the help of this [@egreg's answer](https://tex.stackexchange.com/a/691554/194994), there is a `\__crefthe_variant_create_prop_from_seq:n` to convert a pair of `seq`uences into a `prop`erty list.
What I don't know how to do
===========================
I would like then to achieve the `[...] {...} [...] {...}` part in `\crefthe_pass_variant_string_to:n` and then pass it to `\crefthename{<name>}` to get the desired result.
However, since all these variables, whether `tl` or `seq`, are reusable, when converting into the final result, they have to be properly expanded, i.e. to store their values instead of the macros themselves. However, since I am not experienced at controlling expansion, even with the powerful `expl3` I feel hard to correctly achieve this.
My sole purpose is to achieve the main goal, i.e. the translation from the input into something that can be accepted by `\crefthename`, a command which receives `m O{} m O{} m` type arguments. Thus if you find my idea tedious or have alternative and maybe better approach, please kindly share your opinion with me.
MWE
===
Below is a MWE. Since the problem is really about macro calling and expanding, I did not include specific code about `crefthe`. In some commented part you may see my failed attempts trying to make use of [Max Chernoff](https://tex.stackexchange.com/a/691550/194994)'s and [@egreg](https://tex.stackexchange.com/a/691554/194994)'s code.
```
\documentclass{article}
\begin{document}
\ExplSyntaxOn
\NewDocumentCommand \crefthevariantname { m m }
{
\crefthe_parse_variant_string:n { #2 }
\crefthe_pass_variant_string_to:n { \crefthename {#1} }
}
\keys_define:nn { crefthe-variant-parse }
{
, unknown .code:n = {
\seq_put_right:No \l__crefthe_variant_variant_seq { \l_keys_key_tl }
\__crefthe_variant_append_to_seq:w #1
}
}
\bool_new:N \l__crefthe_variant_dafault_given_bool
\cs_new:Nn \crefthe_parse_variant_string:n
% #1 = clist of configuration
{
\bool_set_false:N \l__crefthe_variant_dafault_given_bool
\clist_map_inline:nn { #1 }
{
\str_if_in:nnTF { ##1 } { = }
{
\keys_set:nn { crefthe-variant-parse } { ##1 }
}
{
\bool_set_true:N \l__crefthe_variant_dafault_given_bool
\__crefthe_variant_set_default:w ##1
}
}
\__crefthe_variant_create_prop_from_seq:n { article_singular }
\__crefthe_variant_create_prop_from_seq:n { article_plural }
\__crefthe_variant_create_prop_from_seq:n { singular }
\__crefthe_variant_create_prop_from_seq:n { plural }
}
\tl_new:N \l__crefthe_variant_default_article_singular_tl
\tl_new:N \l__crefthe_variant_default_article_plural_tl
\tl_new:N \l__crefthe_variant_default_singular_tl
\tl_new:N \l__crefthe_variant_default_plural_tl
\NewDocumentCommand \__crefthe_variant_set_default:w { O{} m O{} m }
{
\tl_set:Nn \l__crefthe_variant_default_article_singular_tl { #1 }
\tl_set:Nn \l__crefthe_variant_default_article_plural_tl { #3 }
\tl_set:Nn \l__crefthe_variant_default_singular_tl { #2 }
\tl_set:Nn \l__crefthe_variant_default_plural_tl { #4 }
}
\seq_new:N \l__crefthe_variant_variant_seq
\seq_new:N \l__crefthe_variant_article_singular_seq
\seq_new:N \l__crefthe_variant_article_plural_seq
\seq_new:N \l__crefthe_variant_singular_seq
\seq_new:N \l__crefthe_variant_plural_seq
\NewDocumentCommand \__crefthe_variant_append_to_seq:w { O{} m O{} m }
{
\seq_put_right:Nn \l__crefthe_variant_article_singular_seq { #1 }
\seq_put_right:Nn \l__crefthe_variant_article_plural_seq { #3 }
\seq_put_right:Nn \l__crefthe_variant_singular_seq { #2 }
\seq_put_right:Nn \l__crefthe_variant_plural_seq { #4 }
}
\cs_new:Nn \__crefthe_variant_create_prop_from_seq:n
{
\prop_clear_new:c { l__crefthe_variant_ #1 _prop }
\int_step_inline:nn { \seq_count:c { l__crefthe_variant_ #1 _seq } }
{
\prop_put:cxx { l__crefthe_variant_ #1 _prop }
{ \seq_item:cn { l__crefthe_variant_variant_seq } { ##1 } }
{ \seq_item:cn { l__crefthe_variant_ #1 _seq } { ##1 } }
}
}
% \cs_new_protected:Nn \__crefthe_variant_map_dafault:nn
% {
% \str_if_eq:onT { \l__crefthe_variant_tl } { #1 }
% {
% \prg_break:n { #2 \use_none:n }
% }
% }
% \cs_new_protected:Nn \__crefthe_variant_map:nn
% {
% \str_if_eq:onT { \l__crefthe_variant_tl } { #1 }
% {
% \prg_break:n { #2 }
% }
% }
\cs_new:Nn \crefthe_pass_variant_string_to:n
{
\bool_if:NTF \l__crefthe_variant_dafault_given_bool
{
#1
% [
% \prop_if_in:coTF { l__crefthe_variant_article_singular_prop } { \l__crefthe_variant_tl }
% {
% \prop_get:coN { l__crefthe_variant_article_singular_prop } { \l__crefthe_variant_tl } \l_tmpa_tl
% \tl_use:N \l_tmpa_tl
% }
% { \l__crefthe_variant_default_article_singular_tl }
% ]
% {
% \prop_if_in:coTF { l__crefthe_variant_singular_prop } { \l__crefthe_variant_tl }
% {
% \prop_get:coN { l__crefthe_variant_singular_prop } { \l__crefthe_variant_tl } \l_tmpa_tl
% \tl_use:N \l_tmpa_tl
% }
% { \l__crefthe_variant_default_singular_tl }
% }
% [
% \prop_if_in:coTF { l__crefthe_variant_article_plural_prop } { \l__crefthe_variant_tl }
% {
% \prop_get:coN { l__crefthe_variant_article_plural_prop } { \l__crefthe_variant_tl } \l_tmpa_tl
% \tl_use:N \l_tmpa_tl
% }
% { \l__crefthe_variant_default_article_plural_tl }
% ]
% {
% \prop_if_in:coTF { l__crefthe_variant_plural_prop } { \l__crefthe_variant_tl }
% {
% \prop_get:coN { l__crefthe_variant_plural_prop } { \l__crefthe_variant_tl } \l_tmpa_tl
% \tl_use:N \l_tmpa_tl
% }
% { \l__crefthe_variant_default_plural_tl }
% }
}
{
#1
% [
% \seq_map_pairwise_function:NNN
% \l__crefthe_variant_variant_seq
% \l__crefthe_variant_article_singular_seq
% \__crefthe_variant_map:nn
% ]
% {
% \seq_map_pairwise_function:NNN
% \l__crefthe_variant_variant_seq
% \l__crefthe_variant_singular_seq
% \__crefthe_variant_map:nn
% }
% [
% \seq_map_pairwise_function:NNN
% \l__crefthe_variant_variant_seq
% \l__crefthe_variant_article_plural_seq
% \__crefthe_variant_map:nn
% ]
% {
% \seq_map_pairwise_function:NNN
% \l__crefthe_variant_variant_seq
% \l__crefthe_variant_plural_seq
% \__crefthe_variant_map:nn
% }
}
}
\ExplSyntaxOff
Text in case of empty.
\end{document}
```
Below is a MWE with specific example of `crefthe` (due to the character count limitation I can only omit some of the code as `% ...`; you may find the corresponding code in the MWE above, if needed).
```
\documentclass{article}
\usepackage{amsthm}
\usepackage{crefthe}
\newtheorem{testenv}{Testenv}
\begin{document}
\ExplSyntaxOn
\NewDocumentCommand \crefthevariantname { m m }
{
\crefthe_parse_variant_string:n { #2 }
\crefthe_pass_variant_string_to:n { \crefthename {#1} }
}
%...
\cs_new:Nn \crefthe_pass_variant_string_to:n
{
\bool_if:NTF \l__crefthe_variant_dafault_given_bool
{
#1
% ...
}
{
#1
% ...
}
}
\ExplSyntaxOff
\crefthevariantname{testenv}
{
[0]{Zero}[00]{Zero}
, Nominativ = [1]{One}[11]{Ones}
, Genitiv = [2]{Two}[22]{Twos}
, Dativ = [3]{Three}[33]{Threes}
, Akkusativ = [4]{Four}[44]{Fours}
}
\begin{testenv}\label{testenv:test}
Environment for testing...
\end{testenv}
\crefthe{testenv:test}
\crefthe[variant=Nominativ]{testenv:test}
\crefthe[variant=Genitiv]{testenv:test}
\crefthe[variant=Dativ]{testenv:test}
\crefthe[variant=Akkusativ]{testenv:test}
\end{document}
```
The expected result would be `0 Zero <number>`, `1 One <number>`, `2 Two <number>` etc. I didn't include actual preposition or definite article for testing article contraction, but let's hope that the expansion works as expected.
---
Just in case needed, below is the current (as of 2023/07/20) version of `crefthe`. It contains the definition of the command option `variant` and the corresponding macro `\l__crefthe_variant_tl`.
```
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage
{crefthe}
{2023/07/20} {}
{Cross referencing with proper definite articles}
\keys_define:nn { crefthe }
{
, overwrite .bool_set:N = \l__crefthe_overwrite_bool
, overwrite .initial:n = { false }
, nameinlink .bool_set:N = \l__crefthe_nameinlink_bool
, nameinlink .initial:n = { false }
, unknown .code:n =
{ \PassOptionsToPackage { \CurrentOption } { cleveref } }
}
\ProcessKeyOptions [ crefthe ]
\bool_if:NT \l__crefthe_nameinlink_bool
{
\PassOptionsToPackage { nameinlink } { cleveref }
}
\RequirePackage { cleveref }
\RequirePackage { regexpatch }
\NewCommandCopy \crefthe_cref_original:w \cref
\NewCommandCopy \crefthe_Cref_original:w \Cref
\NewCommandCopy \crefthe_crefname_original:w \crefname
\NewCommandCopy \crefthe_Crefname_original:w \Crefname
\NewCommandCopy \crefthe_namecref_original:w \namecref
\NewCommandCopy \crefthe_nameCref_original:w \nameCref
\NewCommandCopy \crefthe_namecrefs_original:w \namecrefs
\NewCommandCopy \crefthe_nameCrefs_original:w \nameCrefs
\str_new:N \l__crefthe_tmpa_str
% \l__crefthe_prep_once_tl is for the "-" mode,
% that only passes the preposition to the first definite article;
% \l__crefthe_prep_each_tl is for the "+" mode,
% that passes the preposition to every definite article.
\tl_new:N \l__crefthe_prep_once_tl
\tl_new:N \l__crefthe_prep_each_tl
\bool_new:N \g__crefthe_uppercase_bool
\bool_new:N \g__crefthe_has_prep_bool
\NewDocumentCommand \crefthe { s t- t+ O{} m }
{
\bool_gset_false:N \g__crefthe_uppercase_bool
\__crefthe_cref_general:NNNnnN #1 #2 #3 { #4 } { #5 } \crefthe_cref_original:w
}
\NewDocumentCommand \Crefthe { s t- t+ O{} m }
{
\bool_gset_true:N \g__crefthe_uppercase_bool
\__crefthe_cref_general:NNNnnN #1 #2 #3 { #4 } { #5 } \crefthe_Cref_original:w
}
\NewDocumentCommand \namecrefthe { t- t+ O{} m }
{
\bool_gset_false:N \g__crefthe_uppercase_bool
\__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_namecref_original:w
}
\NewDocumentCommand \nameCrefthe { t- t+ O{} m }
{
\bool_gset_true:N \g__crefthe_uppercase_bool
\__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_nameCref_original:w
}
\NewDocumentCommand \namecrefsthe { t- t+ O{} m }
{
\bool_gset_false:N \g__crefthe_uppercase_bool
\__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_namecrefs_original:w
}
\NewDocumentCommand \nameCrefsthe { t- t+ O{} m }
{
\bool_gset_true:N \g__crefthe_uppercase_bool
\__crefthe_cref_general:NNNnnN \c_false_bool #1 #2 { #3 } { #4 } \crefthe_nameCrefs_original:w
}
\keys_define:nn { crefthe-setting }
{
, variant .tl_set:N = \l__crefthe_variant_tl
, unknown .code:n = {
\bool_gset_true:N \g__crefthe_has_prep_bool
\tl_set:No \l__crefthe_prep_tl { \l_keys_key_tl }
}
}
\cs_new_protected:Nn \__crefthe_cref_general:NNNnnN
% #1 = star or not
% #2 = -
% #3 = +
% #4 = key-value
% #5 = label
% #6 = original command, such as \crefthe_cref_original:w or \crefthe_Cref_original:w
{
\tl_set:Nn \l__crefthe_variant_tl {}
\bool_gset_false:N \g__crefthe_has_prep_bool
\tl_set:Nn \l__crefthe_prep_tl {}
\keys_set:nn { crefthe-setting } { #4 }
\bool_if:NTF #2
{ \tl_set:No \l__crefthe_prep_once_tl { \l__crefthe_prep_tl } }
{
\bool_if:NTF #3
{ \tl_set:No \l__crefthe_prep_each_tl { \l__crefthe_prep_tl } }
{
% \str_set:Nx fully expands \__crefthe_prep_mode: into a string,
% then \str_case:Vn compares the value of the resulting string:
\str_set:Nx \l__crefthe_tmpa_str { \__crefthe_prep_mode: }
\str_case:Vn \l__crefthe_tmpa_str
{
{ - } { \tl_set:No \l__crefthe_prep_once_tl { \l__crefthe_prep_tl } }
{ + } { \tl_set:No \l__crefthe_prep_each_tl { \l__crefthe_prep_tl } }
}
}
}
\group_begin:
\bool_if:NTF #1
{ #6 * { #5 } }
{ #6 { #5 } }
\group_end:
\tl_gclear:N \l__crefthe_prep_each_tl
}
% \__crefthe_prep_mode: defines the default mode for supported languages
\cs_new:Nn \__crefthe_prep_mode:
{
\str_case:Vn \languagename
{
{french} { + }
{italian} { + }
{spanish} { - }
{portuguese} { + }
{brazilian} { + }
}
}
\NewDocumentCommand \crefthename { m O{} m O{} m }
{
\__crefthe_name_general:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { c }
}
\NewDocumentCommand \Crefthename { m O{} m O{} m }
{
\__crefthe_name_general:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { C }
}
\cs_new:Npn \crefthe_retrieve_space: { \skip_horizontal:n { -\tex_fontdimen:D 2 \tex_font:D~plus -\tex_fontdimen:D 3 \tex_font:D~minus -\tex_fontdimen:D 4 \tex_font:D } }
\cs_new:Nn \crefthe_empty_adjust:n
{
\tl_if_blank:nTF { #1 }
{
\crefthe_retrieve_space:
}
{
#1
}
}
\cs_new_protected:Nn \__crefthe_name_general:nnnnnn
% #1 = environment name
% #2 = singular definite article
% #3 = singular name
% #4 = plural definite article
% #5 = plural name
% #6 = c or C
{
\__crefthe_name_general_do:nnnnnn
{ #1 }
{ \crefthemark { \crefthe_empty_adjust:n { #2 } } }
{ \crefthe_empty_adjust:n { #3 } }
{ \crefthemark { \crefthe_empty_adjust:n { #4 } } }
{ \crefthe_empty_adjust:n { #5 } }
{ #6 }
}
\cs_new_protected:Nn \__crefthe_name_general_do:nnnnnn
{
\use:c { crefthe_#6refname_original:w } { #1 } { #2 #3 } { #4 #5 }
\bool_if:NT \l__crefthe_nameinlink_bool
{
\hook_gput_code:nnn { begindocument } { crefthe }
{
\crefthe_patch_format:nnnn { #6ref@#1@format } { #6ref@#1@name } { #2 } { #3 }
\crefthe_patch_format:nnnn { #6ref@#1@format@first } { #6ref@#1@name@plural } { #4 } { #5 }
\crefthe_patch_format:nnnn { #6refrange@#1@format } { #6ref@#1@name@plural } { #4 } { #5 }
\crefthe_patch_format:nnnn { #6refrange@#1@format@first } { #6ref@#1@name@plural } { #4 } { #5 }
}
}
}
\seq_new:N \g__crefthe_already_patched_seq
\cs_new_protected:Nn \crefthe_patch_format:nnnn
% #1 = name of the format command
% #2 = name of the command after the hyperlink beginning mark
% #3 = new content before the mark
% #4 = new content after the mark
{
\seq_if_in:NnF \g__crefthe_already_patched_seq { #1 - #2 }
{
\makeatletter
\tl_set:No \l_tmpa_tl { #3 }
\tl_set:No \l_tmpb_tl { #4 }
\exp_args:Nc \regexpatchcmd { #1 }
{ (\cP\# .) \c{ #2 } }
{ \u{l_tmpa_tl} \1 \u{l_tmpb_tl} }
{ } { \msg_warning:nnn { crefthe } { format-patch-failed } { #1 } }
\makeatother
\seq_gput_right:Nn \g__crefthe_already_patched_seq { #1 - #2 }
}
}
\msg_new:nnn { crefthe }
{ format-patch-failed }
{ Failed~to~patch~the~format~"\iow_char:N \\#1"! }
\cs_generate_variant:Nn \text_lowercase:n { V }
\NewDocumentCommand \crefthemark { m }
{
\crefthe_contraction:Ve \l__crefthe_prep_each_tl
{ \crefthe_contraction:Vn \l__crefthe_prep_once_tl { #1 } }
\tl_gclear:N \l__crefthe_prep_once_tl
\tl_gset:Nx \l__crefthe_prep_each_tl
{ \text_lowercase:V \l__crefthe_prep_each_tl }
\str_if_eq:eeF { \str_tail:n { #1 } } { ' } { ~ }
\bool_gset_false:N \g__crefthe_uppercase_bool
}
\prg_generate_conditional_variant:Nnn \str_case_e:nn { ev } { T, F, TF }
\cs_new:Nn \crefthe_contraction:nn
{
\exp_args:Ne \__crefthe_contraction:nnn
{ \text_lowercase:n { #2 } } { #1 } { #2 }
}
\cs_generate_variant:Nn \crefthe_contraction:nn { V, Ve }
\cs_new:Nn \__crefthe_contraction:nnn
{
% #1 is \text_lowercase:n { #3 }
% #2 is the preposition
\tl_if_blank:nTF { #2 }
{ #3 }
{
\tl_if_exist:cTF { c_crefthe_contraction_rule_ \languagename _tl }
{
\exp_args:Ne \__crefthe_conditional_uppercase:n
{
\str_case_e:evF { #2~#1 }
{ c_crefthe_contraction_rule_ \languagename _tl }
{ #2~#1 }
}
}
{ #2~#3 }
}
}
\cs_new:Nn \__crefthe_conditional_uppercase:n
{
\bool_if:NTF \g__crefthe_uppercase_bool
{ \text_titlecase_first:n }
{ \use:n }
{ #1 }
}
\NewDocumentCommand \crefthepatchname { m }
{
\clist_map_inline:nn { #1 }
{
\crefthe_patch_name:n { ##1 }
}
}
\cs_new:Nn \crefthe_patch_name:n
{
\tl_gput_left:cn { cref@#1@name } { \crefthemark { \crefthe_empty_adjust:n {} } }
\tl_gput_left:cn { cref@#1@name@plural } { \crefthemark { \crefthe_empty_adjust:n {} } }
\tl_gput_left:cn { Cref@#1@name } { \crefthemark { \crefthe_empty_adjust:n {} } }
\tl_gput_left:cn { Cref@#1@name@plural } { \crefthemark { \crefthe_empty_adjust:n {} } }
}
\hook_gput_code:nnn { begindocument/end } { crefthe }
{
\bool_if:NT \l__crefthe_overwrite_bool
{
\RenewCommandCopy \cref \crefthe
\RenewCommandCopy \Cref \Crefthe
\RenewCommandCopy \crefname \crefthename
\RenewCommandCopy \Crefname \Crefthename
}
}
\tl_const:Nn \c_crefthe_contraction_rule_french_tl
{
{ à~le } { au }
{ à~les } { aux }
{ de~le } { du }
{ de~les } { des }
{ À~le } { Au }
{ À~les } { Aux }
{ De~le } { Du }
{ De~les } { Des }
}
\tl_const:Nn \c_crefthe_contraction_rule_ngerman_tl
{
{ an~dem } { am }
{ an~das } { ans }
{ bei~dem } { beim }
{ in~dem } { im }
{ in~das } { ins }
{ von~dem } { vom }
{ zu~dem } { zum }
{ zu~der } { zur }
{ An~dem } { Am }
{ An~das } { Ans }
{ Bei~dem } { Beim }
{ In~dem } { Im }
{ In~das } { Ins }
{ Von~dem } { Vom }
{ Zu~dem } { Zum }
{ Zu~der } { Zur }
}
\tl_const:Nn \c_crefthe_contraction_rule_italian_tl
{
{ a~il } { al }
{ a~lo } { allo }
{ a~l' } { all' }
{ a~la } { alla }
{ di~il } { del }
{ di~lo } { dello }
{ di~l' } { dell' }
{ di~la } { della }
{ da~il } { dal }
{ da~lo } { dallo }
{ da~l' } { dall' }
{ da~la } { dalla }
{ in~il } { nel }
{ in~lo } { nello }
{ in~l' } { nell' }
{ in~la } { nella }
{ su~il } { sul }
{ su~lo } { sullo }
{ su~l' } { sull' }
{ su~la } { sulla }
{ a~i } { ai }
{ a~gli } { agli }
{ a~le } { alle }
{ di~i } { dei }
{ di~gli } { degli }
{ di~le } { delle }
{ da~i } { dai }
{ da~gli } { dagli }
{ da~le } { dalle }
{ in~i } { nei }
{ in~gli } { negli }
{ in~le } { nelle }
{ su~i } { sui }
{ su~gli } { sugli }
{ su~le } { sulle }
{ A~il } { Al }
{ A~lo } { Allo }
{ A~l' } { All' }
{ A~la } { Alla }
{ Di~il } { Del }
{ Di~lo } { Dello }
{ Di~l' } { Dell' }
{ Di~la } { Della }
{ Da~il } { Dal }
{ Da~lo } { Dallo }
{ Da~l' } { Dall' }
{ Da~la } { Dalla }
{ In~il } { Nel }
{ In~lo } { Nello }
{ In~l' } { Nell' }
{ In~la } { Nella }
{ Su~il } { Sul }
{ Su~lo } { Sullo }
{ Su~l' } { Sull' }
{ Su~la } { Sulla }
{ A~i } { Ai }
{ A~gli } { Agli }
{ A~le } { Alle }
{ Di~i } { Dei }
{ Di~gli } { Degli }
{ Di~le } { Delle }
{ Da~i } { Dai }
{ Da~gli } { Dagli }
{ Da~le } { Dalle }
{ In~i } { Nei }
{ In~gli } { Negli }
{ In~le } { Nelle }
{ Su~i } { Sui }
{ Su~gli } { Sugli }
{ Su~le } { Sulle }
}
\tl_const:Nn \c_crefthe_contraction_rule_spanish_tl
{
{ a~el } { al }
{ de~el } { del }
{ A~el } { Al }
{ De~el } { Del }
}
\tl_const:Nn \c_crefthe_contraction_rule_portuguese_tl
{
{ a~o } { ao }
{ a~a } { à }
{ a~os } { aos }
{ a~as } { às }
{ de~o } { do }
{ de~a } { da }
{ de~os } { dos }
{ de~as } { das }
{ em~o } { no }
{ em~a } { na }
{ em~os } { nos }
{ em~as } { nas }
{ A~o } { Ao }
{ A~a } { À }
{ A~os } { Aos }
{ A~as } { Às }
{ De~o } { Do }
{ De~a } { Da }
{ De~os } { Dos }
{ De~as } { Das }
{ Em~o } { No }
{ Em~a } { Na }
{ Em~os } { Nos }
{ Em~as } { Nas }
}
\tl_const:Nx \c_crefthe_contraction_rule_brazilian_tl
{ \exp_not:V \c_crefthe_contraction_rule_portuguese_tl }
\endinput
%%
%% End of file `crefthe.sty'.
```
|
https://tex.stackexchange.com/users/194994
|
Convert key-value argument into \str_case comparison
| true |
I want to note that I don't like this code particularly much. I think the interface is unclean, and you should rather change `\crefthename` to support an optional argument specifying the variant.
However the following does what you want in a rather straight forward way. We need a few too many variables for my taste, but 10 is still fine, I hope. One could optimize a bit for speed dropping `\tl_item:Nn` and using `\exp_args:No \exp_not:o { \exp_after:wN \use_i:nnnn \l__crefthe_<variable>_tl }` instead, but I doubt it's worth it, the code has too many more severe performance issues for that optimisation to make a change.
Anyway, here goes nothing:
```
\documentclass{article}
\usepackage{amsthm}
\usepackage{crefthe}
\newtheorem{testenv}{Testenv}
\begin{document}
\ExplSyntaxOn
\NewDocumentCommand \crefthevariantname { m m }
{
\crefthe_parse_variant:n { #2 }
\crefthe_pass_variant_to:n { \crefthename {#1} }
}
% sn: singular noun, pn: plural noun, sa: singular article, pa: plural article
\tl_new:N \l__crefthe_variant_sn_tl
\tl_new:N \l__crefthe_variant_pn_tl
\tl_new:N \l__crefthe_variant_sa_tl
\tl_new:N \l__crefthe_variant_pa_tl
\tl_new:N \l__crefthe_variant_default_sn_tl
\tl_new:N \l__crefthe_variant_default_pn_tl
\tl_new:N \l__crefthe_variant_default_sa_tl
\tl_new:N \l__crefthe_variant_default_pa_tl
\bool_new:N \l__crefthe_variant_default_bool
\cs_new_protected:Npn \crefthe_parse_variant:n #1
{
\tl_clear:N \l__crefthe_variant_singular_noun_tl
\tl_clear:N \l__crefthe_variant_plural_noun_tl
\tl_clear:N \l__crefthe_variant_singular_article_tl
\tl_clear:N \l__crefthe_variant_plural_article_tl
\tl_clear:N \l__crefthe_variant_default_sn_tl
\tl_clear:N \l__crefthe_variant_default_pn_tl
\tl_clear:N \l__crefthe_variant_default_sa_tl
\tl_clear:N \l__crefthe_variant_default_pa_tl
\bool_set_false:N \l__crefthe_variant_default_bool
\keyval_parse:NNn
\__crefthe_parse_variant_default:n
\__crefthe_parse_variant_value:nn
{#1}
}
\tl_new:N \l__crefthe_parsed_tl
% this is wrong! That's not a document command, interface should be cleaner.
\NewDocumentCommand \__crefthe_variant_parser:w { O{} m O{} m }
{
\tl_set:Nn \l__crefthe_parsed_tl { {#1} {#2} {#3} {#4} }
\use_none_delimit_by_q_stop:w
}
\cs_new_protected:Npn \__crefthe_parse_variant_default:n #1
{
\bool_set_true:N \l__crefthe_variant_default_bool
\__crefthe_variant_parser:w #1 {} {} \q_stop
\tl_set:Nx \l__crefthe_variant_default_sa_tl
{ \tl_item:Nn \l__crefthe_parsed_tl {1} }
\tl_set:Nx \l__crefthe_variant_default_sn_tl
{ \tl_item:Nn \l__crefthe_parsed_tl {2} }
\tl_set:Nx \l__crefthe_variant_default_pa_tl
{ \tl_item:Nn \l__crefthe_parsed_tl {3} }
\tl_set:Nx \l__crefthe_variant_default_pn_tl
{ \tl_item:Nn \l__crefthe_parsed_tl {4} }
}
\cs_new_protected:Npn \__crefthe_parse_variant_value:nn #1#2
{
\__crefthe_variant_parser:w #2 {} {} \q_stop
\tl_put_right:Nx \l__crefthe_variant_sa_tl
{ { \tl_to_str:n {#1} } { \tl_item:Nn \l__crefthe_parsed_tl {1} } }
\tl_put_right:Nx \l__crefthe_variant_sn_tl
{ { \tl_to_str:n {#1} } { \tl_item:Nn \l__crefthe_parsed_tl {2} } }
\tl_put_right:Nx \l__crefthe_variant_pa_tl
{ { \tl_to_str:n {#1} } { \tl_item:Nn \l__crefthe_parsed_tl {3} } }
\tl_put_right:Nx \l__crefthe_variant_pn_tl
{ { \tl_to_str:n {#1} } { \tl_item:Nn \l__crefthe_parsed_tl {4} } }
}
\cs_new_protected:Npn \crefthe_pass_variant_to:n #1
{
\use:e
{
\exp_not:n {#1}
\bool_if:NTF \l__crefthe_variant_default_bool
{
[
\exp_not:n { \str_case:NnF \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_sa_tl }
{ \exp_not:o \l__crefthe_variant_default_sa_tl }
]
{
\exp_not:n { \str_case:NnF \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_sn_tl }
{ \exp_not:o \l__crefthe_variant_default_sn_tl }
}
[
\exp_not:n { \str_case:NnF \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_pa_tl }
{ \exp_not:o \l__crefthe_variant_default_pa_tl }
]
{
\exp_not:n { \str_case:NnF \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_pa_tl }
{ \exp_not:o \l__crefthe_variant_default_pa_tl }
}
}
{
[
\exp_not:n { \str_case:Nn \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_sa_tl }
]
{
\exp_not:n { \str_case:Nn \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_sn_tl }
}
[
\exp_not:n { \str_case:Nn \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_pa_tl }
]
{
\exp_not:n { \str_case:Nn \l__crefthe_variant_tl }
{ \exp_not:o \l__crefthe_variant_pa_tl }
}
}
}
}
\ExplSyntaxOff
\crefthevariantname{testenv}
{
[0]{Zero}[00]{Zero}
, Nominativ = [1]{One}[11]{Ones}
, Genitiv = [2]{Two}[22]{Twos}
, Dativ = [3]{Three}[33]{Threes}
, Akkusativ = [4]{Four}[44]{Fours}
}
\begin{testenv}\label{testenv:test}
Environment for testing...
\end{testenv}
\crefthe{testenv:test}
\crefthe[variant=Nominativ]{testenv:test}
\crefthe[variant=Genitiv]{testenv:test}
\crefthe[variant=Dativ]{testenv:test}
\crefthe[variant=Akkusativ]{testenv:test}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/117050
|
691619
| 320,829 |
https://tex.stackexchange.com/questions/691596
|
0
|
I want to convert a `bibtex` citation into a human readable citation to paste into my editor. That is all.
A [solution](https://tex.stackexchange.com/questions/23878/how-to-quickly-convert-a-single-bibtex-reference-into-a-formatted-reference) that I found makes use of `bibtex2html`, which is fine.
However, this needs `bibtex` to be installed. (Not BibDesk, not `biber`, nor MacTeX, nor `biblatex`) and I don't seem to be able to able to find this in `homebrew`, and it is not discussed on this page (<https://www.bibtex.org/Links/>).
How do I install `bibtex` on a Mac?
|
https://tex.stackexchange.com/users/301043
|
How do I install bibtex on a Mac?
| false |
Answering my own question.
You can install `mactex` with `brew install mactex`. But bibtex will only be on your path after you start a new terminal. I needed to create a completely new terminal tab / window (not just a new shell within a terminal).
`bibtex` was located here: `/Library/TeX/texbin/bibtex`.
|
0
|
https://tex.stackexchange.com/users/301043
|
691621
| 320,830 |
https://tex.stackexchange.com/questions/691613
|
1
|
In spring I got the same error and here we found that changing to another font would solve the problem. (See ["Illegal storage address" with tex4ebook, tex4ht error](https://tex.stackexchange.com/questions/680793/illegal-storage-address-with-tex4ebook-tex4ht-error)) But now with three other fonts (ebgaramond, lmodern, stix2) the same error appears with the `tex4ht error code 1`.
I also used today the tlmgr update tex4ht to get the newest version of it.
Is in the meanwhile some knowledge arosen for another solution that could help and not just change the font?
Thank you.
|
https://tex.stackexchange.com/users/292824
|
Again: Error: "Illegal storage address" with tex4ebook
| false |
I got an valid epub just by changing to another font for compiling with tex4ebook. I tried `bookman` and the `default (European Computer Modern)` without loading a special font. Just like it is said in the latex font catalogue. With this no error in epubcheck occurs and gives an valid epub.
|
0
|
https://tex.stackexchange.com/users/292824
|
691624
| 320,833 |
https://tex.stackexchange.com/questions/691610
|
4
|
As suggested by Barbara Beeton [here](https://tex.stackexchange.com/questions/130641/how-to-put-the-qed-symbol-of-a-proof-at-the-right-place-inside-align/130654?noredirect=1#comment1716082_130654), I am posting this as a new question.
When a proof ends in a displayed formula, to have the QED symbol in the correct place you have to use `\qedhere` inside the formula.
The problem is that if the formula is given by means of the `alignat*` environment, then LaTeX issues a (harmless) warning when compiling.
Here is a MWE:
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\begin{document}
\begin{proof}
\begin{alignat*}{2}
&x && =1 \\
&y && =2
\qedhere
\end{alignat*}
\end{proof}
\begin{proof}
\begin{align*}
x & =1 \\
y & =2
\qedhere
\end{align*}
\end{document}
```
Please note that `amsmath` is called before `amsthm`, as specified in `amsthdoc`
When compiling, I get the (double) warning
```
Package amsthm Warning: The \qedhere command may not work correctly here on input line 10.
Package amsthm Warning: The \qedhere command may not work correctly here on input line 10.
```
The QED symbol is still there (albeit not flushed to the right).
If you use the environment `align*` instead of `alignat*`, on the other hand, everything works flawlessly.
As Barbara said, they should work the same, but it looks like they don't.
P.S.: A way to avoid the warning is to use `\tag*{\qedhere}` instead of `\qedhere`, which has also the side effect to flush the QED symbol to the right, restoring it to its intended position, but this looks more like a sort of workaround than the intended use of `\qedhere`.
|
https://tex.stackexchange.com/users/63363
|
Problem using \qedhere inside alignat
| false |
The following solution should work with both documents with or without `leqno`.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\makeatletter
\def\qed@tag@alignat{%
\global\tag@true \nonumber
&\omit\setboxz@h {\strut@ \qedsymbol}%
\iftagsleft@%
\global\advance\tagshift@-\displaywidth%
\fi%
\tagsleft@false
\place@tag
\kern-\tabskip
\ifst@rred \else \global\@eqnswtrue \fi \global\advance\row@\@ne \cr
}
\def\alignat@qed{%
\ifmeasuring@ \tag*{\qedsymbol}%
\else \let\math@cr@@@\qed@tag@alignat
\fi
}
\@xp\let\csname alignat*@qed\endcsname\alignat@qed
\makeatother
\begin{document}
\begin{proof}
\begin{alignat*}{2}
&x && =1 \\
&y && =2
\qedhere
\end{alignat*}
\end{proof}
\begin{proof}
\begin{align*}
x & =1 \\
y & =2
\qedhere
\end{align*}
\end{proof}
\end{document}
```
**Explanation**
Most of the code is copied directly from what is in use for the `align` environment in `amsthm.sty`, the key difference is that we define a new `\qed@tag@alignat` macro.
In `amsthm.sty` a `\qed@tag` macro is defined, which works well for both `gather` and `align` environments; but the fact that it works with `align` is mostly a hack. A short and slightly inaccurate description of why the hack is needed is:
>
> Ideally we want something like `\tag*{\qedsymbol}` to work. If the world doesn't have `leqno` documents, then exactly the form above is okay. But if you have a left-numbered equation, then `\tag*{\qedsymbol}` would print it on the wrong side. So we have to do something more clever to shove the `\qedsymbol` all the way right even when `leqno` is involved.
>
>
>
Normally, the placement of the tag is computed differently between `gather` and `align` environments (they have their own `\place@tag@gather` and `\place@tag` macros). In `\qed@tag` a hack is (ab)used to allow `\place@tag@gather` to also work in the context of `align` environments; I haven't worked out fully the mechanism yet, but it has something to do with how `\llap` works in right-aligned columns and the spacing inserted between groups of columns in `align`. Whatever it is it **doesn't** work with `alignat`.
In the code above we try to solve the issue of `leqno` differently. Fundamentally the reason that `leqno` causes an issue for using `\place@tag` is because during typesetting, the position of the tag, determined by `\tagshift@`, is computed during the "measuring phase" of the typesetting of the equations (`amsmath` famously uses a two pass approach to set the equations). During this phase the code doesn't know that there will be a `\qedsymbol` that ought to be placed flush right. The difference (between whether `leqno` is in force or not) boils down to a length of `\displaywidth`. So in the code above, we call `\place@tag` (which is designed to work with `alignat`), but we correct for the missing `\displaywidth` if necessary. This allows for the correct placement both in the left- and right-numbered `alignat`s.
(This should, in principle, also work with `align`; but this will not work for `gather`. So potentially one may envision patching `amsthm.sty` so that the `\qedhere` invocation works using the above code for both `align` and `alignat`, but leaving the original code for `gather`.
|
6
|
https://tex.stackexchange.com/users/119
|
691626
| 320,835 |
https://tex.stackexchange.com/questions/691629
|
0
|
I'm trying to use the [mnotes](https://ctan.org/pkg/mnotes?lang=en) package (`\usepackage{mnotes}`), which is a package for adding comments to the margins that point to text in the document.
but I'm getting this error:
```
(C:\ProgramsPortable\miktex-portable\texmfs\install\tex/latex/mnotes\mnotes.sty
)
! Incomplete \iffalse; all text was ignored after line 70.
<inserted text>
\fi
```
I tried looking at the code in `mnotes.sty`, but I couldn't see any mismatched `\if`s or `\fi`s (as far I can see, though I'm no latex expert).
Turning on "basic" mode allows it to run, but functionality is greatly reduced:
```
\usepackage[basic]{mnotes}
```
Any ideas why this error is happening? Is the problem within mnotes or perhaps a dependency?
|
https://tex.stackexchange.com/users/49045
|
mnotes package error: Incomplete \iffalse
| false |
I made a MWE to test this issue, and the problem went away! I started adding in lines one-by-one from my original tex file until the issue re-appeared.
MWE with no issues:
```
\documentclass[dvipsnames]{article}
\usepackage{mnotes}
\begin{document}
Hello world \MNOTE{This is an mnote} Goodbye
\end{document}
```
Once I added the line which imports algorithm2e (for pseudocode formatting), then it broke again. But **moving the mnotes import to be before algorithm2e fixes the problem** (Note: I didn't test whether the pseudocode still works), like so:
```
\usepackage{mnotes}
\usepackage[linesnumbered,vlined,figure,tworuled]{algorithm2e}
```
However, back in my original document, I moved the mnotes import to be the first line after `\documentclass` and my problem still occurrs.
Next I removed ALL the `\usepackage` lines in my original document and started adding them back in. It broke once I got to `\usepackage{ulem}`. Even though that package comes *after* `\usepackage{mnotes}`, it still conflicts.
**Conclusion: `mnotes` conflicts with other packages, if getting an error, remove other `\usepackage` lines until it works.**
|
0
|
https://tex.stackexchange.com/users/49045
|
691630
| 320,836 |
https://tex.stackexchange.com/questions/335780
|
0
|
I am trying to draw Feynman diagram with feynarts.sty in MikTek2.9.
However, I get diagram with nothing only label.
This is the same problem as [Feynman diagrams with feynarts](https://tex.stackexchange.com/questions/278165/feynman-diagrams-with-feynarts/278175#278175?newreg=118b5cecf4ab447fa2ca02678256cbfb) but his solution doesn't work for me.
Any other solutions?
Thanks
|
https://tex.stackexchange.com/users/117143
|
Drawing Feynman Diagram in Latex with feynarts.sty
| false |
You should change your compiler to `latex` instead of `pdflatex`, `xelatex`, or `lualatex`. then you can generate the diagrams normally.
|
1
|
https://tex.stackexchange.com/users/292713
|
691637
| 320,837 |
https://tex.stackexchange.com/questions/691634
|
0
|
I have many rows of text that need to be aligned with one another, similarly to Blast text output:
```
Query 1 MASETPRVDPTEISNVNAPVFRIIAQIKSQPTESQLILQSPTISSKNGSEVEMITLNNIR 60
MASETPR+DPTEISN+NAPVFRI+AQIKSQPTESQL+LQSPTISSKN E+EMITLNNIR
Sbjct 1 MASETPRIDPTEISNINAPVFRIVAQIKSQPTESQLVLQSPTISSKNSGEIEMITLNNIR 60
```
and I'm trying to output text like that in LaTeX.
I have gotten close, but the problem is that the spacing on the left hand side is difficult to reproduce within LaTeX.
I have tried a table, but the spaces are unacceptably large.
This is the closest that I've come to solving the problem, but the vertical alignment looks really bad:
```
\begin{mymonoframe} \tiny
Query RFDRLVAGQIPT----GWNAKTYGISDDIISQVDPITLFVLVSVVEAFIASGITDPYEMYKYVHVSEVGNCSGSGMGG-------VSALRGMFKDRFKDE 100\\
midline ++ +AG+I + GW ++ + ++D L+++ + +A GIT+ E+ + S G GS MGG + ALR +K \\
hit KYPTRIAGEIKSFSTDGW------VAPKLAKRMDKFMLYLITAGKKALENGGITE--EVMNELDKSRCGVLVGSAMGGMKIFSDAIEALRVSYKK-----\\
Query PVQNDILQESFINTMSAWVNMLLISSSGPIKTPVGACATSVESVDIGVETILSGKARICIVGGYD-DFQEEGSFEFGNMKATSNTLEEFEHGRTPAEMSR 200\\
midline N M + + + + GP + ACATS + I G+ + + GG D G F +A S + PA+ SR\\
hit --MNPFCVPFATTNMGSAILAMDLGWMGPNYSISTACATSNFCILNAANHIRRGETDVMLCGGSDAPIIPIGLGGFVACRALS------QRNNDPAKASR\\
Query PATTTRNGFMEAQGAGIQIIMQADLALKMGVPIYGIVAMAATATDKIGRSVPAP-GKGILTTAREHHSSVKYASPNLN 278\\
midline P R+GF+ +GAG+ ++ + + A + G IY + D + P P G+G++ + A ++N\\
hit PWDVDRDGFVMGEGAGVLLLEELEHAKQRGAQIYAEFLGGSFTCDAYHMTEPHPEGRGVILCIENALADAGVAKEDIN\\
\end{mymonoframe}
```
I've tried monospace fonts and all that, but the spacing just isn't working.
[Align Text vertically](https://tex.stackexchange.com/questions/271011/align-text-vertically) looks similar, but he/she is doing something different.
How can I reproduce text like the Blast in LaTeX?
|
https://tex.stackexchange.com/users/34160
|
How to align rows of text vertically outside of table environment?
| true |
I think you just want a simple `verbatim`:
```
\documentclass{article}
\usepackage{lmodern}
\begin{document}
\noindent X\dotfill X
{\fontsize{5.5pt}{7pt}\selectfont %bigger than \tiny, smaller than \scriptsize
\begin{verbatim}
Query RFDRLVAGQIPT----GWNAKTYGISDDIISQVDPITLFVLVSVVEAFIASGITDPYEMYKYVHVSEVGNCSGSGMGG-------VSALRGMFKDRFKDE 100
midline ++ +AG+I + GW ++ + ++D L+++ + +A GIT+ E+ + S G GS MGG + ALR +K
hit KYPTRIAGEIKSFSTDGW------VAPKLAKRMDKFMLYLITAGKKALENGGITE--EVMNELDKSRCGVLVGSAMGGMKIFSDAIEALRVSYKK-----
Query PVQNDILQESFINTMSAWVNMLLISSSGPIKTPVGACATSVESVDIGVETILSGKARICIVGGYD-DFQEEGSFEFGNMKATSNTLEEFEHGRTPAEMSR 200
midline N M + + + + GP + ACATS + I G+ + + GG D G F +A S + PA+ SR
hit --MNPFCVPFATTNMGSAILAMDLGWMGPNYSISTACATSNFCILNAANHIRRGETDVMLCGGSDAPIIPIGLGGFVACRALS------QRNNDPAKASR
Query PATTTRNGFMEAQGAGIQIIMQADLALKMGVPIYGIVAMAATATDKIGRSVPAP-GKGILTTAREHHSSVKYASPNLN 278
midline P R+GF+ +GAG+ ++ + + A + G IY + D + P P G+G++ + A ++N
hit PWDVDRDGFVMGEGAGVLLLEELEHAKQRGAQIYAEFLGGSFTCDAYHMTEPHPEGRGVILCIENALADAGVAKEDIN
\end{verbatim}
}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/1090
|
691647
| 320,843 |
https://tex.stackexchange.com/questions/691656
|
0
|
I am using the Marburg theme in latex to have a vertical bar showing my sections.
In the first page dedicated to the title I would like to remove the bar keeping the top and bottom bar.
I know the option `plain` will remove the side bar, but this will remove all bars.
Do you know how can I realize my goal?
My code:
```
\documentclass[hyperref={pdftex}]{beamer}
\useoutertheme{shadow}
\usetheme[left]{Marburg}
\definecolor{ceruleanblue}{rgb}{0.16, 0.32, 0.75}
\definecolor{caribbeangreen}{rgb}{0.0, 0.8, 0.6}
\definecolor{darkpastelgreen}{rgb}{0.01, 0.75, 0.24}
\setbeamertemplate{sidebar canvas left}[vertical shading][top=ceruleanblue,middle=darkpastelgreen,bottom=ceruleanblue]
\colorlet{titleleft}{ceruleanblue}
\colorlet{titlemiddle}{darkpastelgreen}
\colorlet{titleright}{ceruleanblue}
\pgfdeclarehorizontalshading[titleleft,titlemiddle,titleright]
{beamer@frametitleshade}{\paperheight}{
color(0pt)=(titleleft);
color(0.6\paperwidth)=(titlemiddle);
color(\paperwidth)=(titleright)
}
\title[aa]{aa}
\date{\today}
\setbeamerfont{title}{size=\Large, series=\bf}
\setbeamerfont{subtitle}{size=\large}
\setbeamerfont{institute}{size=\small}
\setbeamerfont{date}{size=\footnotesize}
\author[bla]
{
\textbf{bla}\inst{1}, bla\inst{2}, bla\inst{3}}
\institute[]
{
\inst{1 }bla \\
\inst{2 }bla\\
\inst{ 3}bla
}
\setbeamercolor{author in head/foot}{parent=palette primary,bg=}
\setbeamercolor{title in head/foot}{parent=palette secondary,bg=}
\setbeamercolor{date in head/foot}{parent=palette tertiary,bg=}
\setbeamercolor{section in head/foot}{parent=palette primary,bg=}
\setbeamercolor{subsection in head/foot}{parent=palette secondary,bg=}
\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\setbox\beamer@tempbox=\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}%
}%
\beamer@tempdim=\ht\beamer@tempbox%
\advance\beamer@tempdim by 4pt%
\begin{pgfpicture}{0pt}{0pt}{\paperwidth}{20pt}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
\pgfusepath{clip}
\pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
\end{pgfpicture}
\vskip-\beamer@tempdim%
\box\beamer@tempbox%
}%
\setbeamertemplate{headline}
{
\leavevmode%
\setbox\beamer@tempbox=\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,right]{section in head/foot}%
\usebeamerfont{section in head/foot}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,left]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}
\end{beamercolorbox}%
}%
\beamer@tempdim=\ht\beamer@tempbox%
\advance\beamer@tempdim by 4pt%
\vskip-\beamer@tempdim%
\begin{pgfpicture}{0pt}{0pt}{\paperwidth}{20pt}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
\pgfusepath{clip}
\pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
\end{pgfpicture}
\vskip-\beamer@tempdim%
\box\beamer@tempbox%
\vskip0pt%
}
\begin{document}
\begin{frame}
\begin{titlepage}
\end{titlepage}
\end{frame}
\section{ble}
\subsection{bla}
\begin{frame}{Slide 1}
Content
\end{frame}
\end{document}
```
|
https://tex.stackexchange.com/users/nan
|
Remove vertical bar only on first page (Marburg theme)
| false |
You could temporarily redefine the `sidebar canvas left` and `sidebar left` templates:
```
\documentclass[hyperref={pdftex}]{beamer}
\useoutertheme{shadow}
\usetheme[left]{Marburg}
\definecolor{ceruleanblue}{rgb}{0.16, 0.32, 0.75}
\definecolor{caribbeangreen}{rgb}{0.0, 0.8, 0.6}
\definecolor{darkpastelgreen}{rgb}{0.01, 0.75, 0.24}
\setbeamertemplate{sidebar canvas left}[vertical shading][top=ceruleanblue,middle=darkpastelgreen,bottom=ceruleanblue]
\colorlet{titleleft}{ceruleanblue}
\colorlet{titlemiddle}{darkpastelgreen}
\colorlet{titleright}{ceruleanblue}
\pgfdeclarehorizontalshading[titleleft,titlemiddle,titleright]
{beamer@frametitleshade}{\paperheight}{
color(0pt)=(titleleft);
color(0.6\paperwidth)=(titlemiddle);
color(\paperwidth)=(titleright)
}
\title[aa]{aa}
\date{\today}
\setbeamerfont{title}{size=\Large, series=\bf}
\setbeamerfont{subtitle}{size=\large}
\setbeamerfont{institute}{size=\small}
\setbeamerfont{date}{size=\footnotesize}
\author[bla]
{
\textbf{bla}\inst{1}, bla\inst{2}, bla\inst{3}}
\institute[]
{
\inst{1 }bla \\
\inst{2 }bla\\
\inst{ 3}bla
}
\setbeamercolor{author in head/foot}{parent=palette primary,bg=}
\setbeamercolor{title in head/foot}{parent=palette secondary,bg=}
\setbeamercolor{date in head/foot}{parent=palette tertiary,bg=}
\setbeamercolor{section in head/foot}{parent=palette primary,bg=}
\setbeamercolor{subsection in head/foot}{parent=palette secondary,bg=}
\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\setbox\beamer@tempbox=\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}%
}%
\beamer@tempdim=\ht\beamer@tempbox%
\advance\beamer@tempdim by 4pt%
\begin{pgfpicture}{0pt}{0pt}{\paperwidth}{20pt}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
\pgfusepath{clip}
\pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
\end{pgfpicture}
\vskip-\beamer@tempdim%
\box\beamer@tempbox%
}%
\setbeamertemplate{headline}
{
\leavevmode%
\setbox\beamer@tempbox=\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,right]{section in head/foot}%
\usebeamerfont{section in head/foot}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,left]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}
\end{beamercolorbox}%
}%
\beamer@tempdim=\ht\beamer@tempbox%
\advance\beamer@tempdim by 4pt%
\vskip-\beamer@tempdim%
\begin{pgfpicture}{0pt}{0pt}{\paperwidth}{20pt}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
\pgfusepath{clip}
\pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
\end{pgfpicture}
\vskip-\beamer@tempdim%
\box\beamer@tempbox%
\vskip0pt%
}
\begin{document}
{
\setbeamertemplate{sidebar left}{}
\setbeamertemplate{sidebar canvas left}{}
\begin{frame}
\hspace{-.5\beamersidebarwidth}
\begin{minipage}{\linewidth}
\maketitle
\end{minipage}
\end{frame}
}
\section{ble}
\subsection{bla}
\begin{frame}{Slide 1}
Content
\end{frame}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/36296
|
691657
| 320,847 |
https://tex.stackexchange.com/questions/691658
|
1
|
I am trying to compile a big beamer template (CCM beamer template 3) on overleaf. But because of the time out (lots of tikz figures) I am forced to switch to something else so I am trying TEXMaker.
The problem I have is the following: I have 4 .sty files and one .tex files in a folder, when I compile my .tex file on overleaf, I have the desired output (a simple blank frame with the text "Is someone here?") . But, when running the exact same file with the exact same directory organization on TEXMaker, the compiling does not output any pdf and I have a new error.
In short, it works on overleaf but not on TEXMaker.
Is it that I have to configure something in particular to make it work on TEXMaker?
Did I mess up something (I have been using latex since a week so I am a complete beginner)?
The new error mentioned above are the following :
*! Paragraph ended before \setbeamertemplate was complete.*
There is one error both present on overleaf and TEXMaker (I don't know how to solve it):
*! Too many }'s.*
Both errors are at : *beamerinnerthemeccm3.sty ; line 40*
Versions used :
*MiKTeX-pdfTeX 4.15 (MiKTeX 23.5)*
*overleaf - Tex Live 2022*
Here are my files :
**test.tex :**
```
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
\renewcommand*\oldstylenums[1]{\textosf{#1}}
\usepackage[sfdefault,scaled=.85]{FiraSans}
\usetheme{ccm3}
\begin{document}
\section{ Hello?}
\begin{frame}
Is someone here?
\end{frame}
\end{document}
```
**beamercolorthemeccm3.sty:**
```
\mode<presentation>
\setbeamercolor*{title page header}{fg=mostazaccm}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{institute}{fg=white}
\setbeamercolor*{sectiontitle}{fg=white}
\setbeamercolor*{frametitle}{fg=mostazaccm}
\setbeamercolor*{framesubtitle}{fg=amarilloccm}
\setbeamercolor*{section in head/foot}{fg=white}
\setbeamercolor*{author in head/foot}{fg=white}
\setbeamercolor*{date in head/foot}{fg=white}
\setbeamercolor*{item}{fg=azulccm}
\setbeamercolor{block title}{use=structure,fg=white,bg=gristexto}
\setbeamercolor{block body}{fg=black,bg=gristexto!35}
\mode<all>
```
**beamerinnerthemeccm3.sty:**
```
\mode<presentation>
\defbeamertemplate*{title page}{CCM3}[1][]
{
\begin{textblock}{4}(7,1)
\end{textblock}
\vspace*{3.2cm}
\begin{beamercolorbox}[center,wd=\paperwidth,sep=1pt]{title page header}
\usebeamerfont{title}{\setstretch{1.1} \scalefont{1.5} \inserttitle}\par%
\end{beamercolorbox}
\vspace*{0.01cm}
\begin{beamercolorbox}[center,wd=\paperwidth]{date}
\usebeamerfont{date}\insertdate%
\end{beamercolorbox}
\vspace*{\fill}
\vspace*{1cm}
\begin{beamercolorbox}[center,wd=\the\paperwidth]{author}
{\usebeamerfont{author} \insertauthor}%
\end{beamercolorbox}
\begin{beamercolorbox}[center,wd=\the\paperwidth]{institute}
{\usebeamerfont{institute}\insertinstitute}
\end{beamercolorbox}
}
\setbeamertemplate{title page
%A definir la apareciencia de listas y tabla de contenidos
\setbeamertemplate{items}[circle]
\setbeamercolor{section in toc}{fg=black}
\setbeamertemplate{section in toc}{{\Huge \color{mostazaccm} \oldstylenums{\inserttocsectionnumber}.}~\inserttocsection}
\setbeamercolor{subsection in toc}{fg=gray}
\setbeamertemplate{subsection in toc}{\hspace{1.45em}{\color{gray}\rule[0.3ex]{3pt}{3pt}}~\inserttocsubsection\par}
\mode<all>
```
**beamerouterthemeccm3.sty**
```
\mode<presentation>
\setbeamerfont{sectiontitle}{size=\huge, shape=\scshape}
\defbeamertemplate*{frametitle}{ccm3}[1][]
{
\begin{beamercolorbox}[wd=\the\paperwidth,ht=1.9cm]{frametitle}
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,1.4);
\ifx\insertframesubtitle\@empty%
{\node[anchor=west, mostazaccm , font=\huge] at (0.85,0.82){\textbf{\insertframetitle}};}
\else%
{\node[anchor=west, mostazaccm, font=\huge] at (0.85, 1.02){ \textbf{\insertframetitle}};%
\node[anchor=west, mostazaccm , font=\large] at (0.85, 0.53){\insertframesubtitle};}%
\fi
\end{tikzpicture}
\end{beamercolorbox}
\vskip-0.5cm
}
\defbeamertemplate*{sidebar left}{sidebar theme}
{
\ifnum\thepage>2
\vspace*{\fill}
\hspace{-0.25\paperwidth}\colorbox{azulccm}{\makebox[1.5\paperwidth][c]{\scriptsize \textcolor{white}{\begin{tabular}{
p{\dimexpr.5\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 1
|p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 2
|p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}|% column 3
}
\insertauthor & \centering \insertsection & \raggedleft \insertframenumber\,/\,\inserttotalframenumber
\end{tabular}}}}
\fi
}
\mode<all>
```
**beamerthemeccm3.sty**
```
\mode<presentation>
%Paquete requerido
\RequirePackage{tikz}
\RequirePackage{graphicx}
\RequirePackage{amssymb}
\RequirePackage{xcolor}
\RequirePackage{lastpage}
\RequirePackage{setspace}
\RequirePackage{scalefnt}
\RequirePackage[absolute, overlay]{textpos}
\definecolor{rojotexto}{HTML}{A21916}
\definecolor{gristexto}{HTML}{B2B2B2}
\definecolor{amarilloccm}{HTML}{FDC600}
\definecolor{mostazaccm}{HTML}{C99C00}
\definecolor{azulccm}{HTML}{003062}
\usecolortheme{CCM3}
\useinnertheme{CCM3}
\useoutertheme{CCM3}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]
\mode<all>
```
|
https://tex.stackexchange.com/users/301095
|
Beamer template not working on TexMaker
| false |
The line `\setbeamertemplate{title page` in your inner theme just ends in the middle of nowhere. I assume it should be something like `\setbeamertemplate{title page}[CCM3]` instead?
```
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
\renewcommand*\oldstylenums[1]{\textosf{#1}}
\usepackage[sfdefault,scaled=.85]{FiraSans}
\mode<presentation>
%Paquete requerido
\RequirePackage{tikz}
\RequirePackage{graphicx}
\RequirePackage{amssymb}
\RequirePackage{xcolor}
\RequirePackage{lastpage}
\RequirePackage{setspace}
\RequirePackage{scalefnt}
\RequirePackage[absolute, overlay]{textpos}
\definecolor{rojotexto}{HTML}{A21916}
\definecolor{gristexto}{HTML}{B2B2B2}
\definecolor{amarilloccm}{HTML}{FDC600}
\definecolor{mostazaccm}{HTML}{C99C00}
\definecolor{azulccm}{HTML}{003062}
\mode<presentation>
\setbeamercolor*{title page header}{fg=mostazaccm}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{institute}{fg=white}
\setbeamercolor*{sectiontitle}{fg=white}
\setbeamercolor*{frametitle}{fg=mostazaccm}
\setbeamercolor*{framesubtitle}{fg=amarilloccm}
\setbeamercolor*{section in head/foot}{fg=white}
\setbeamercolor*{author in head/foot}{fg=white}
\setbeamercolor*{date in head/foot}{fg=white}
\setbeamercolor*{item}{fg=azulccm}
\setbeamercolor{block title}{use=structure,fg=white,bg=gristexto}
\setbeamercolor{block body}{fg=black,bg=gristexto!35}
\mode<all>
\mode<presentation>
\defbeamertemplate*{title page}{CCM3}[1][]
{
\begin{textblock}{4}(7,1)
\end{textblock}
\vspace*{3.2cm}
\begin{beamercolorbox}[center,wd=\paperwidth,sep=1pt]{title page header}
\usebeamerfont{title}{\setstretch{1.1} \scalefont{1.5} \inserttitle}\par%
\end{beamercolorbox}
\vspace*{0.01cm}
\begin{beamercolorbox}[center,wd=\paperwidth]{date}
\usebeamerfont{date}\insertdate%
\end{beamercolorbox}
\vspace*{\fill}
\vspace*{1cm}
\begin{beamercolorbox}[center,wd=\the\paperwidth]{author}
{\usebeamerfont{author} \insertauthor}%
\end{beamercolorbox}
\begin{beamercolorbox}[center,wd=\the\paperwidth]{institute}
{\usebeamerfont{institute}\insertinstitute}
\end{beamercolorbox}
}
\setbeamertemplate{title page}[CCM3]
%A definir la apareciencia de listas y tabla de contenidos
\setbeamertemplate{items}[circle]
\setbeamercolor{section in toc}{fg=black}
\setbeamertemplate{section in toc}{{\Huge \color{mostazaccm} \oldstylenums{\inserttocsectionnumber}.}~\inserttocsection}
\setbeamercolor{subsection in toc}{fg=gray}
\setbeamertemplate{subsection in toc}{\hspace{1.45em}{\color{gray}\rule[0.3ex]{3pt}{3pt}}~\inserttocsubsection\par}
\mode<all>
\mode<presentation>
\setbeamerfont{sectiontitle}{size=\huge, shape=\scshape}
\defbeamertemplate*{frametitle}{ccm3}[1][]
{
\begin{beamercolorbox}[wd=\the\paperwidth,ht=1.9cm]{frametitle}
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,1.4);
\ifx\insertframesubtitle\@empty%
{\node[anchor=west, mostazaccm , font=\huge] at (0.85,0.82){\textbf{\insertframetitle}};}
\else%
{\node[anchor=west, mostazaccm, font=\huge] at (0.85, 1.02){ \textbf{\insertframetitle}};%
\node[anchor=west, mostazaccm , font=\large] at (0.85, 0.53){\insertframesubtitle};}%
\fi
\end{tikzpicture}
\end{beamercolorbox}
\vskip-0.5cm
}
\defbeamertemplate*{sidebar left}{sidebar theme}
{
\ifnum\thepage>2
\vspace*{\fill}
\hspace{-0.25\paperwidth}\colorbox{azulccm}{\makebox[1.5\paperwidth][c]{\scriptsize \textcolor{white}{\begin{tabular}{
p{\dimexpr.5\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 1
|p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 2
|p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}|% column 3
}
\insertauthor & \centering \insertsection & \raggedleft \insertframenumber\,/\,\inserttotalframenumber
\end{tabular}}}}
\fi
}
\mode<all>
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]
\mode<all>
\begin{document}
\section{ Hello?}
\begin{frame}
Is someone here?
\end{frame}
\end{document}
```
(I added a gray background to the image, otherwise the white font wouldn't be visible)
|
0
|
https://tex.stackexchange.com/users/36296
|
691660
| 320,849 |
https://tex.stackexchange.com/questions/691667
|
3
|
I would like to define a function with a function as image; something similar to what follows but I suspect that `array` isn't the best structure to do that
```
\begin{array}{}
f:&A&\to& L(B)\\
&h&\mapsto& f_h:&B&\to& B\\
&&&&x&\mapsto& 2x
\end{array}
```
(I don't know how to render latex code in this forum so I just posted the code).
I really appreciate any kind of help :)
|
https://tex.stackexchange.com/users/300462
|
Define function with a function as image
| true |
I'd use nested `aligned`
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
f\colon
\begin{aligned}[t]
A&\to L(B)\\
h &\mapsto f_h \colon
\begin{aligned}[t]
B &\to B\\
x &\mapsto 2x
\end{aligned}
\end{aligned}
\]
\end{document}
```
|
6
|
https://tex.stackexchange.com/users/82917
|
691669
| 320,854 |
https://tex.stackexchange.com/questions/691672
|
4
|
it seems `expl3` language is not yet very popular, i have not found even a single example of this test. I tried it but it fails. What i understood is that `\reverse_if:N <primitive conditional>` will check whether its argument is `True` or `False` and run what was defined next to `\if_false:` or what next to `\else:` appropriately.
```
\documentclass{beamer}
\mode<presentation>
{ \usetheme{metropolis} }
\geometry{verbose,papersize={160mm,90mm}}
\setlength{\parindent}{0pt}
\ExplSyntaxOn
\NewDocumentCommand\ifelsetest{ m o }{
Ltroiscommand~test \\
optional~parameter~:~#2
\if_false:
false
\else:
else
\fi:
\reverse_if:N { #2 }
}
\ExplSyntaxOff
\begin{document}
\begin{frame}
\ifelsetest{test} % #2 should be -NoValue-, therefore I suppose 'False'
\ifelsetest{test}[optarg~shouldtesttrue] % Anything elsethan -NoValue- should
% be 'True' I suppose
\end{frame}
\end{document}
```
|
https://tex.stackexchange.com/users/145290
|
example of \if_true: \fi: \else \reverse_if:N
| false |
`\reverse_if:N` reverses a primitive conditional. That is, `\reverse_if:N \if_true:` behaves like `\if_false:` and `\reverse_if:N \if_false:` like `\if_true:`.
```
\documentclass{article}
\begin{document}
\ExplSyntaxOn
\if_true: true~branch \else: false~branch \fi:
\par
\reverse_if:N \if_true: true~branch \else: false~branch \fi:
\end{document}
```
You can search for eTeX's `\unless` for examples in the non-LaTeX3 syntax.
|
5
|
https://tex.stackexchange.com/users/48973
|
691674
| 320,855 |
https://tex.stackexchange.com/questions/691495
|
1
|
I'm using the `footnote-dw` citation style from the package `biblatex-dw`. In my thesis I am working with a lot of newspaper articles where no author information is given. Currently I am using 'o. A.' (German abbreviation for 'without author') as author information in my bibtex file. In my bibliography the author field gets replaced by the German idem 'Ders.' which means 'the same', which is wrong because the authors are not the same.
Is it possible to deactivate the idem feature of `biblatex-dw` for entries that have 'o. A.' as author field?
The issue happens with the following example document and bibtex file:
```
\documentclass{scrreprt}
\title{Test Dokument}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
backend=biber,
style=footnote-dw]{biblatex}
\addbibresource{example.bib}
\begin{document}
\maketitle
Das ist ein Testdokument.\cite{test1} Das ist ein zweiter Test.\cite{test2}
\printbibliography
\end{document}
```
```
@article{test1,
author = {o.~A.},
journal = {Test Zeitung},
title = {Test Artikel 1},
year = {2023}
}
@article{test2,
author = {o.~A.},
journal = {Test Zeitung 2},
title = {Test Artikel 2},
year = {2023}
}
```
In the second article (test2) the author field is replaced with "Ders." in the output document.
|
https://tex.stackexchange.com/users/300993
|
biblatex-dw disable idem for no author
| true |
`biblatex-dw` has several options and settings to stop "idem" from appearing, but I couldn't find a one-stop solution, so here is an attempt at writing a per-entry option to suppress "idem" for this specific entry.
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
backend=biber,
style=footnote-dw,
]{biblatex}
\DeclareEntryOption{noidem}[true]{%
\ifstrequal{#1}{true}
{\boolfalse{bbx:idembib}%
\booltrue{cbx:noidem}}
{}}
\begin{filecontents}{\jobname.bib}
@article{test1,
author = {o.~A.},
journal = {Test Zeitung},
title = {Test Artikel 1},
year = {2023},
options = {noidem},
}
@article{test2,
author = {o.~A.},
journal = {Test Zeitung 2},
title = {Test Artikel 2},
year = {2023},
options = {noidem},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Das ist ein Testdokument.\cite{test1}
Das ist ein zweiter Test.\cite{test2}
\printbibliography
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/35864
|
691677
| 320,856 |
https://tex.stackexchange.com/questions/691675
|
0
|
I just created this heatmap, following this template: <https://tikz.net/heatmap/>
Now I would like to customize a few things:
1. If I replace the Column Label with $j=1$ bsp. then the labels overlap. How can I make the boxes in the square larger so that the text fits well on it?
2. Unfortunately, because of the smaller colors, the heat gradations are different. How do I adjust this to my values, so that three is the maximum?
Here is my code:
```
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[scale=0.6]
\foreach \y [count=\n] in {
{0,1,2,0,0,1,2,1,3,2,1,2,1,1},
{0,1,0,0,1,1,1,1,0,0,0,0,1,0},
{3,1,1,3,2,1,0,1,0,1,2,1,1,2},
} {
% heatmap tiles
\foreach \x [count=\m] in \y {
\node[fill=purple!\x!yellow, minimum size=6mm, text=white] at (\m,-\n) {\x};
}
}
% row labels
\foreach \a [count=\i] in {$k=1~~~~~$,$k=2~~~~~$,$k=3~~~~~$} {
\node[minimum size=6mm] at (0,-\i) {\a};
}
\foreach \b [count=\j] in {1,2,3,4,5,6,7,8,9,10,11,12,13,14} {
\node[minimum size=6mm] at (\j,0) {\b};
}
\end{tikzpicture}
\end{document}
```
|
https://tex.stackexchange.com/users/301110
|
Adjust heatmap tile size
| false |
Short of using a [matrix](https://tikz.dev/tikz-matrices) or other matrix-creating packages/tools I'd approach this with `chains` to not have to think about any coordinates at all.
With setting a common `text width` for almost all nodes we can achieve a uniform output.
Though, now the diagram is 18cm wide.
The values for `text height` and `text depth` are set globally for all nodes for the same effect in the vertical dimension. (The *j* in the headings needs to be taken care of, otherwise they are almost the same size anyway.)
I've added two rectangular paths, one encompasses the whole diagram (though, the [`backgrounds` library](https://tikz.dev/library-backgrounds#tikz/show:background:rectangle) might be better suited since it also has its own interface to adjust the padding and style) and one just the heatmap boxes.
I've chosen different line styles to show their overlap better.
Code
----
```
\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[
node distance=+0pt,
text height=.8em, text depth=+.2em, outer sep=+0pt, align=center,
box/.style ={text width={width("$j = 00$")}},
box1/.style={text width={width("$k = 0$")}, align=right},
start chain=rows going below,
]
\node[on chain, box1]{};
\scoped[start branch=k0 going base right]
\foreach \b in {1, ..., 14} \node[on chain, box] {$j = \b$};
\foreach \y [count=\n] in {
{0,1,2,0,0,1,2,1,3,2,1,2,1,1},
{0,1,0,0,1,1,1,1,0,0,0,0,1,0},
{3,1,1,3,2,1,0,1,0,1,2,1,1,2}}{
\node[on chain] {$k = \n$};
\tikzset{start branch/.expanded=k\n\space going base right}
\foreach \x [evaluate={
\xc = \x*100/3;
\tc = \xc < 33 ? "black" : "white";}] in \y
\node[fill=purple!\xc!yellow, box, text=\tc, on chain] {\x};
}
\draw[green, ultra thick]
(current bounding box.south west) rectangle (current bounding box.north east);
\draw[blue] (rows/k3-2.south west) rectangle (rows/k1-end.north east);
\end{tikzpicture}
\end{document}
```
Output
------
|
1
|
https://tex.stackexchange.com/users/16595
|
691679
| 320,857 |
https://tex.stackexchange.com/questions/422029
|
2
|
Something I have always wanted to do is use `\autoref` with an optional argument, similarly to the use that is often made of `\cite`: I would like to be able to write `\autoref[comment]{label}`, to obtain [link to label, comment] in the final pdf. Is there any way of doing this (specifically with autoref, and not the other referencing packages/commands)? Thank you for any help.
|
https://tex.stackexchange.com/users/11123
|
Autoref with optional argument
| false |
Updated solution for new LaTeX from TeXlive 2023/etc. onward:
```
\AtBeginDocument{%
\NewCommandCopy\autoreforig\autoref
\RenewDocumentCommand{\autoref}{som}{%
\IfBooleanF{#1}{%
\hyperref[#3]%
}{%
\autoreforig*{#3}\IfValueT{#2}{\nobreak}\xspace\IfValueT{#2}{#2}%
}%
}
}
```
Kudos to Ulrike Fischer and David Carlisle for their quick response!
|
1
|
https://tex.stackexchange.com/users/83262
|
691680
| 320,858 |
https://tex.stackexchange.com/questions/691673
|
2
|
I do not want to install the full TeX Live in macOS 13.2 with an M1 chip, I just want to use this command:
`tlmgr install scheme-small`
to install only required packages with minimal disk usage. Is it possible to use `tlmgr` to install a small LaTeX collection? If so, how? I did not find anyone talking about this. I only found this command to install a full distribution: `brew install texlive`
|
https://tex.stackexchange.com/users/69600
|
Is it possible to use tlmgr to install required LaTeX packages in macOS 13.2
| true |
You can install the [BasicTeX](https://www.tug.org/mactex/morepackages.html) distribution which is very small and then use `tlmgr` to install any other packages you need. Since Homebrew simply runs these installers there’s no advantage to using it to install TeX Live on a Mac.
|
5
|
https://tex.stackexchange.com/users/2693
|
691681
| 320,859 |
https://tex.stackexchange.com/questions/691672
|
4
|
it seems `expl3` language is not yet very popular, i have not found even a single example of this test. I tried it but it fails. What i understood is that `\reverse_if:N <primitive conditional>` will check whether its argument is `True` or `False` and run what was defined next to `\if_false:` or what next to `\else:` appropriately.
```
\documentclass{beamer}
\mode<presentation>
{ \usetheme{metropolis} }
\geometry{verbose,papersize={160mm,90mm}}
\setlength{\parindent}{0pt}
\ExplSyntaxOn
\NewDocumentCommand\ifelsetest{ m o }{
Ltroiscommand~test \\
optional~parameter~:~#2
\if_false:
false
\else:
else
\fi:
\reverse_if:N { #2 }
}
\ExplSyntaxOff
\begin{document}
\begin{frame}
\ifelsetest{test} % #2 should be -NoValue-, therefore I suppose 'False'
\ifelsetest{test}[optarg~shouldtesttrue] % Anything elsethan -NoValue- should
% be 'True' I suppose
\end{frame}
\end{document}
```
|
https://tex.stackexchange.com/users/145290
|
example of \if_true: \fi: \else \reverse_if:N
| true |
A function with argument spec `:N` expects to receive a single token as argument, so `\reverse_if:N { #1 }` isn't legal.
Actually, `\reverse_if:N` is an alias to the primitive `\unless`. If you look about it in `interface3`, you see
This means that the argument of `\reverse_if:N` *must* be one of the primitive conditionals described in section 4.6.2, namely
```
\if_true: \if_false: \if_meaning:w \if:w \if_catcode:w \if_charcode:w
\if_cs_exist:N \if_cs_exist:w \if_mode_(...)
```
(the last comprises the four conditionals for testing the typesetting mode) and also
```
\if_int_compare:w \if_dim:w
```
Anything else following `\reverse_if:N` would produce an error.
On the other hand, direct usage of these conditionals and of `\reverse_if:N` is not encouraged for writing functions and higher level programming is recommended. These primitive conditionals are admittedly faster, but they should only be used when the code has to be streamlined for efficiency, which is not so frequent a circumstance.
Thus seeing code with `\else:` or `\fi:` should be very rare. Look at the sections about boolean variables and functions.
If you want that your `\ifelsetest` prints “true” when the optional argument is present, you should use the `xparse` features:
```
\NewDocumentCommand{\ifelsetest}{mo}{%
\IfNoValueTF{#2}{False}{True}%
}
\ifelsetest{text} % prints False
\ifelsetest{text}[whatever] % prints True
```
|
7
|
https://tex.stackexchange.com/users/4427
|
691684
| 320,860 |
https://tex.stackexchange.com/questions/276479
|
8
|
The Issue
=========
I am attempting to have a figure placed at the top of the following page, but LaTeX is insisting on placing it on it's own page, after the bibliography.
### What I've Tried
* Using `\clearpage` and `\newpage` in various places
* Placing the figure on it's own page, inserted after the page I want it to follow, but before the bibliography
* Using the `[!ht]`, and `\usepackage{float}` with `[H]`
* Using the `placeins` package, along with the `[section]` option *and* an explicit `\FloatBarrier` after the figure, prior to the bibliography
None of it has worked.
***What am I missing?***
### MCVE:
**This is a modular document**
dave.tex
```
\documentclass[man,12pt]{apa6}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\usepackage{subfigure}
\bibliography{mybib}
% This is here to take advantage of the apa6 class' running header
% and page numbering, but I've defined my own title page to suit
% title page requirements at Colorado Technical University. This
% customized title page is not compatible with the jou option for
% the apa6 document class, as of October 31st, 2015. You have to
% use \maketitle, otherwise the two column formatting will be broken.
\title{a}
\shorttitle{b}
\author{c}
\affiliation{d}
\date{e}
\begin{document}
% \abstract{}
% \keywords{}
\include{bob}
\nocite{*}
\printbibliography
\end{document}
```
bob.tex
```
\section{Bob's page}
This is bob's page. Hello.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tempor ut augue id placerat. Suspendisse in sapien quis nulla scelerisque blandit vitae vitae risus. Nunc id ligula vehicula, imperdiet urna eu, tincidunt ante. Phasellus laoreet lorem eu nisl venenatis, ut hendrerit odio molestie. Nam a suscipit erat, vitae mollis eros. Vivamus congue diam enim. Nullam vestibulum purus eu elit volutpat, ut aliquet ligula laoreet. Suspendisse sagittis hendrerit justo accumsan consectetur. Integer non nisi elit. Quisque ac elit mauris. Curabitur malesuada fermentum lacus vel elementum. Donec ultricies suscipit turpis congue viverra. Cras eleifend diam lobortis, aliquet diam vel, euismod odio.
Sed tincidunt vulputate tellus nec luctus. Mauris scelerisque lacinia iaculis. Pellentesque a dui eu dui porta hendrerit sit amet ac tellus. Sed condimentum, mi ac consequat scelerisque, dui dolor mattis nulla, pretium aliquam libero ipsum id urna. Aenean at lacinia ligula, quis varius mi. Nunc at efficitur quam, vel ullamcorper sapien. Vivamus erat nunc, rutrum eget scelerisque nec, vestibulum nec mauris. Suspendisse volutpat, diam at elementum dapibus, ipsum mi varius ante, vel consectetur magna tellus vitae mi.
Suspendisse nisi dui, efficitur nec mollis et, tempor sit amet risus. Fusce consequat purus at neque tincidunt, sed vehicula mauris vehicula. Phasellus vulputate tincidunt dolor id facilisis. In nisi est, pretium vel euismod ac, convallis vitae lorem. Vivamus tempor neque nunc. Phasellus pulvinar varius orci in vulputate. Sed lobortis ante eros, a placerat urna molestie et.
Cras cursus pharetra venenatis. Morbi sit amet neque tincidunt, consequat metus nec, euismod erat. Integer odio turpis, lobortis ut urna non, sagittis consectetur tellus. Praesent ut purus at enim accumsan dapibus. Suspendisse nulla tortor, commodo feugiat blandit sit amet, tempor sed eros. Curabitur pretium magna fringilla pharetra varius. Vivamus leo libero, laoreet vel aliquam tristique, aliquet eget nunc.
\begin{figure}[!ht]
\begin{subfigure}
\centering
{\includegraphics[width=2.5in]{htmlExample}}
\end{subfigure}
\end{figure}
```
mybib.bib
```
@ONLINE{tug14,
author = {{{\TeX} Users Group}},
title = {{Just What is {\TeX}}?},
year = {2014},
url = {http://www.tug.org/whatis.html}
}
```
|
https://tex.stackexchange.com/users/90612
|
APA6 document class figure being placed after bibliography
| false |
Piling onto an old thread, but there is also an option based on the [apa6 manual](http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/apa6/apa6.pdf):
>
> `floatsintext`: In man mode, integrates floats (tables and figures)
> within the
> body of the text instead of postponing them until after the reference list.
>
>
>
so you can provide that at the beginning when calling the apa6 document class and then use without the post bibliography placement.
```
\documentclass[a4paper,man,apacite,12pt,noextraspace,floatsintext]{apa6}
```
|
1
|
https://tex.stackexchange.com/users/301125
|
691692
| 320,863 |
https://tex.stackexchange.com/questions/691707
|
1
|
How can I put a link back to the table of contents on every page (I guess the page number would be best place to add the link)? I've tried searching, but didn't find anything and I'm not good enough with LaTeX to do it myself.
Thanks!
|
https://tex.stackexchange.com/users/185129
|
How to link to the table of contents on every page?
| true |
Probably you know that with the `hyperref` package is easy make linked `\ref`erences to sections or pages (with `\pageref`). The tricky part is label the ToC, as you cannot place it just after sectioning command like `\section{foo}\label{foo}`. The solution is:
```
\tableofcontents\label{retoc} % well, really not very tricky ...
```
And then, use \hyperref[label]{text} elsewhere if you want other that link the section number ot the page numeber of the TOC. So can add some like this in your headers or footers:
```
\hyperref[retoc]{Page \thepage}
```
Alternatively to `\label`, you can use also `\hypertarget`. The problem here is that here are are a second argument (the text to show) and only can be before the ToC, after the ToC, or be the ToC. But mark as target the whole ToC, that could have several pages is tricky (now really). To avoid the indigestion of `\hypertarget`, seem that one can protect it, at least in this example, and then make the link with `\hyperlink` in the header or footer. MWE:
```
\documentclass{book}
\title{Foo}
\author{Foo}
\date{}
\usepackage[colorlinks,linkcolor=blue]{hyperref}
\usepackage{lipsum}
\usepackage{fancyhdr}
\fancypagestyle{plain}{ \fancyhf{} \fancyfoot[C]{ --- \hyperlink{toc}{\thepage} --- }}
\pagestyle{fancy}
\fancyhf{}\rhead{ \hyperlink{toc}{Page \thepage}}
\usepackage{emptypage}
\begin{document}
\frontmatter
\maketitle
\renewcommand\contentsname{\protect\hypertarget{toc}{Foo}}
\tableofcontents
\mainmatter
\chapter{Foo} \lipsum[1-3]
\section{Foo} \lipsum[1-3]
\subsection{Foo} \lipsum[1-3]
\chapter{Foo} \lipsum[1-3]
\section{Foo} \lipsum[1-3]
\subsection{Foo} \lipsum[1-3]
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/11604
|
691714
| 320,870 |
https://tex.stackexchange.com/questions/691725
|
0
|
I have two semi-circumferences with an intersection point defined as `E`. I want to use different line style/color along them.
For this purpose, first I used `path` to define the semi-circumferences. Now I would like to draw:
* a line **along the semi-circumference** `orig1--A`, between `orig1` and the intersection point `E`;
* a line **along the semi-circumference** `orig2--B`, between `orig2` and the intersection point `E`.
I tried with
```
\draw[-] (orig1) to node {} (E);
```
but of course this plots a straight line between `orig1` and `E`. I want the line to follow the semi-circumference, instead.
Is it possible to do this? If yes, how?
```
\documentclass[tikz,border=1.5cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles,quotes,arrows,arrows.meta,calc,decorations.pathreplacing,through,intersections}
\begin{document}
\begin{tikzpicture}
\coordinate (orig1) at (0,0);
\path [name path=orig1--A, line width=0.5mm, red] (orig1) arc[start angle=0, end angle=180, radius=5cm] coordinate (A);
\coordinate (orig2) at ($(orig1)!0.5!(A)$);
\path [name path=orig2--B, line width=0.5mm, red] (orig2) arc[start angle=0, end angle=180, radius=5cm] coordinate (B);
\path [name intersections={of=orig1--A and orig2--B,by=E}];
\node at (E)[circle,fill,red] {};
%\coordinate (C) at (intersection of orig1--A and orig2--B);
\draw[-] (orig1) to node {} (E);
\end{tikzpicture}
\end{document}
```
|
https://tex.stackexchange.com/users/74786
|
TikZ, draw along a path
| true |
In your example is easy to obtain the necessary angles, but that wont always be true. So probably the best approach is using the `spath3` library, cut the paths in their components and then drawing only the needed one.
Something like this:
```
\documentclass[tikz,border=1.618mm]{standalone}
\usetikzlibrary{calc,intersections,spath3}
\begin{document}
\begin{tikzpicture}
\coordinate (orig1) at (0,0);
\path [draw,spath/save=orig1--A, line width=0.5mm, red] (orig1) arc[start angle=0, end angle=180, radius=5cm] coordinate (A);
\coordinate (orig2) at ($(orig1)!0.5!(A)$);
\path [draw,spath/save=orig2--B, line width=0.5mm, red] (orig2) arc[start angle=0, end angle=180, radius=5cm] coordinate (B);
\path [draw,name intersections={of=orig1--A and orig2--B,by=E}];
\node at (E)[circle,fill,red] {};
% computing the angles
\draw[line width=1.5mm,teal] (orig1) arc[start angle=0, end angle=120, radius=5cm] arc[start angle=60, end angle=180, radius=5cm];
% with spath3
\tikzset
{% spath3 operatios:
spath/split at intersections={orig1--A}{orig2--B},
spath/get components of={orig1--A}\Acpts,
spath/get components of={orig2--B}\Bcpts
}
\draw[line width=0.5mm,yellow,
spath/use=\getComponentOf\Acpts{1},
spath/use={\getComponentOf\Bcpts{2},weld}];
\end{tikzpicture}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/231368
|
691727
| 320,876 |
https://tex.stackexchange.com/questions/691742
|
4
|
Running `latex` from the current Debian stable on
```
\documentclass[british]{article}
\usepackage[british]{babel}
\begin{document}
\showhyphens{memorandum}
\end{document}
```
yields
```
mem-o-ran-dum
```
At the same time, <https://www.ushuaia.pl/hyphen/?ln=en>, which is, using its own words, “based on TeX system”, says
```
memor•andum
```
when choosing English (GB). This was also the hyphenation point in a text of mine as of May 2023 using one of my TeX installations (which is now gone, alas); the hyphenation has apparently changed in some direction.
These two hyphenation patterns have no common hyphenation point; at least one of them is probably very wrong. The 5th, 6th, 7th, and 9th printed editions of *Oxford Advanced Learner's Dictionary of Current English* by A S Hornby say
```
memo•ran•dum
```
The *New Oxford Spelling Dictionary, The Writers' and Editors' Guide to Spelling and Word Division* by Maurice Waite, 2005, ISBN 0-19-860881-0, ISBN 978-0-19-860881-3 (cf. an [online library](http://archive.org/details/newoxfordspellin0000unse_n6f1/page/313/mode/1up)), says on page 313,
```
memo|ran¦dum
memo|randa
memo|ran¦dums
```
The bar | is a primary division point (“at which a word can be divided under almost any circumstances”) and the broken bar is a secondary division point (“at which a word is best divided only if absolutely necessary […]”); cf. [page x](http://archive.org/details/newoxfordspellin0000unse_n6f1/page/n13/mode/1up). Other words in the dictionary may have more than one primary or secondary division point, so it's a matter of taste or convention of what to do with this distinction in (La)TeX, and the word list should be interpreted according to the guide at the start of the book anyway.
Being a non-native speaker, I can only suggest that the version from the spelling-and-word-division dictionary is probably authoritative; cf. <http://comp.text.tex.narkive.com/9kbsxiTL/british-english-hyphenation#post3>.
I have access neither to the most recent edition of the aforementioned dictionary nor to *The Oxford minidictionary of spelling and word division*. I also don't have access to the data in <https://www.oed.com/dictionary/memorandum_int>, as they are behind a paywall. If anyone has access and would like to confirm/refute using these sources, please yell.
I kindly ask the British native speakers among you to double-check and, if necessary, adjust or suggest adjusting the UK-hyphenation patterns.
An e-mail concerning the issue has been sent to the maintainers of ushuaia.pl. Hyph-utf8 has received an [issue report](https://github.com/hyphenation/tex-hyphen/issues/59), too.
|
https://tex.stackexchange.com/users/292998
|
On TeX hyphenating “memorandum” in British English
| true |
The UK and US patterns have not changed in TeX.
US gives `mem-o-ran-dum` UK gives `memor-andum`
If you get `mem-o-ran-dum` from the document shown you do not have the UK patterns installed.
On Debian-packaged texlive, ensure that the package texlive-lang-english is installed.
|
10
|
https://tex.stackexchange.com/users/1090
|
691743
| 320,884 |
https://tex.stackexchange.com/questions/691745
|
1
|
I have hundreds of lines of code of the form
`\Umathcode`a = 0 \symwmb "1D4B6`
and
`\Umathcode"03B1 = 0 \symrmtl "0000B`
where, in the latter case, there is a counterpart `\def\alpha{^^^^03b1}`,
within commands of the type in David Carlisle's answer in [Greek letters within \mathsf, \mathsfit, \mathbfsf, and \mathbfsfit without using unicode-math](https://tex.stackexchange.com/questions/690558/greek-letters-within-mathsf-mathsfit-mathbfsf-and-mathbfsfit-without-usinthat) that map character codes to characters in various fonts. Since I am reusing the Latin and Greek alphabets in several such commands, it occurs to me that it should be possible to create several globally-defined comma-separated `\clist`s from LaTeX 3 code that is available in `xparse` (actually, from what I have read, `\seq`s may be more versatile in this case) and reuse them. So I need to write a command of the form
`\MapCodes{LatinLower}{\symYYYY}{1D486, 1D487, 1D488,` ... `1D4CF}`
that can be called from within each of the `\symXXXX` commands in like those in David's answer to my previous question that would then execute this sequence of commands within the scope of the calling command. Here, `LatinLower` is a list or sequence containing the Latin lowercase letters and could be globally defined, `\symYYYY` is the font declared with `DeclareSymbolFont{YYYY}{TU}{<NFSS family>}{m}{n}`, and the last argument is the list of slot numbers for the particular font which correspond to the lowercase characters desired.
I am pretty certain this is doable, but I am a newbie to LaTeX 3 and learn most easily by example anyway, so I can either spend all day trying to figure this out from `interface3.pdf` or just ask and learn from the answers. I hope I have adequately explained what I am trying to accomplish.
|
https://tex.stackexchange.com/users/224317
|
Execute list of commands generated by pairing elements from two \clist s or \seq s
| true |
You can define sequences for the blocks and use `\seq_map_pairwise_function:NNN`.
Here I use just a short example. Use numeric codes (with the appropriate prefix).
```
\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\StixTwoMath}{STIXTwoMath-Regular.otf}[
NFSSFamily=stix,
Script=Math,
Scale=MatchLowercase
]
\DeclareSymbolFont{stix}{TU}{stix}{m}{n}
\ExplSyntaxOn
\NewDocumentCommand{\defineblock}{mm}
{% #1 = block name, #2 = clist
\seq_gclear_new:c { g_pugh_math_block_#1_seq }
\seq_gset_from_clist:cn { g_pugh_math_block_#1_seq } { #2 }
}
\NewDocumentCommand{\definecodes}{mmm}
{% #1 = block name, #2 = math family, #3 = clist
\__pugh_math_definecodes:nnn { #1 } { #2 } { #3 }
}
\seq_new:N \l__pugh_math_temp_seq
\tl_new:N \l__pugh_math_family_tl
\cs_new_protected:Nn \__pugh_math_definecodes:nnn
{
\seq_set_from_clist:Nn \l__pugh_math_temp_seq { #3 }
\tl_set:Nn \l__pugh_math_family_tl { #2 }
\seq_map_pairwise_function:cNN
{ g_pugh_math_block_#1_seq } % the block
\l__pugh_math_temp_seq % the codes
\__pugh_math_assigncode:nn
}
\cs_new_protected:Nn \__pugh_math_assigncode:nn
{
\Umathcode #1 = 0 ~ \use:c { sym \l__pugh_math_family_tl } #2 \scan_stop:
}
\ExplSyntaxOff
\defineblock{LowerLatin}{`a,`b,`c}
\definecodes{LowerLatin}{stix}{"1D482,"1D483,"1D484}
\begin{document}
$abc+d$
\end{document}
```
Since I just specified a to c, only those characters receive a special `\Umathcode`.
|
1
|
https://tex.stackexchange.com/users/4427
|
691747
| 320,885 |
https://tex.stackexchange.com/questions/691655
|
4
|
Is there a simple way to substitute a tick in the axis environment? I want to replace the tick defined by `data` (that is, `xtick = data`).
Below is an example where I *add* an extra tick. Since I'm adding, I am not substituting, and I want to know how to substitute.
```
\documentclass[11pt, a4paper]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{filecontents}{data.csv}
date,pct
44755,0.01925374
44756,0.01925374
44757,0.01925374
44768,0.018989264
44769,0.018989264
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin = -0.07, ymax =0.11,
%
xtick = data,
xticklabel style={ rotate=45},
extra x ticks={44757, 44765},
extra x tick labels={special1, special2},
extra x tick style={tick label style={red}},
scaled ticks=false,
]
\addplot[
blue, const plot,
] table [x=date, y=pct, col sep = comma]{data.csv};
\end{axis}
\end{tikzpicture}
\end{document}
```
Thanks
|
https://tex.stackexchange.com/users/190368
|
Is there a simple way to substitute a tick in the axis environment?
| true |
Here's some code that lets you specify which ticks to replace based on their *x*-value in `\replaceTheseTicks`. In this example, the ticks with an *x*-value of 44757 and 44768 have been replaced with "Alice" and "Bob," respectively. A warning, though: This code only works with integers.
```
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{filecontents}{data.csv}
date, pct
44755,0.01925374
44756,0.01925374
44757,0.01925374
44768,0.018989264
44769,0.018989264
\end{filecontents}
% Comma-separated list of ticks you want to replace
\def\replaceTheseTicks{44757,44768}
\def\replaceTick{
\pgfmathtruncatemacro{\result}{\tick}
\def\replaceHere{}
\foreach\xValue in \replaceTheseTicks{
\ifnum\xValue=\result
\gdef\replaceHere{T}
\fi
}
\if T\replaceHere
{}
\else
\axisdefaultticklabel
\fi
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin = -0.07,
ymax = 0.11,
xtick = data,
xticklabel = {\replaceTick},
xticklabel style={rotate = 90},
extra x ticks=\replaceTheseTicks,
extra x tick labels={Alice, Bob},
extra x tick style={tick label style={red}},
scaled ticks=false,
]
\addplot[blue, const plot] table [x=date, y=pct, col sep = comma]{data.csv};
\end{axis}
\end{tikzpicture}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/91603
|
691748
| 320,886 |
https://tex.stackexchange.com/questions/691676
|
0
|
Since the `acronym` package is built with the description environment, and the description environment works with Enumitem `\setlist{nosep}`, why is the Acronym package not affected by this command? I needed to reset the `AC@deflist` environment to have a similar effect, which is a much more complex solution than a simple command. Is it possible to configure Acronym to react to the `\setlist{nosep}` command?
```
\renewenvironment{AC@deflist}[1]{
\ifAC@nolist%
\else%
\raggedright\begin{list}{}{
\settowidth{\labelwidth}{\AC@makelabel{\aclabelfont{#1}}}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\setlength{\parskip}{0pt}
\renewcommand{\makelabel}{\AC@makelabel}
}
\fi
}{
\ifAC@nolist%
\else%
\end{list}%
\fi
}
```
|
https://tex.stackexchange.com/users/223790
|
Why doe \setlist{nosep} not work in the acronym package?
| true |
It is possible to redefine the `AC@deflist` environment to use description instead of list with the code below. This way the `\setlist{nosep}` command will also be applied to the acronym list.
```
\documentclass{article}
\usepackage{acronym}
\usepackage{enumitem}
\setlist{nosep}
\makeatletter
\renewenvironment{AC@deflist}[1]%
{\begin{description}[leftmargin=!, labelwidth=3cm, labelsep=0pt, itemindent=0pt]}%
{\end{description}}
\makeatother
\begin{document}
\begin{acronym}
\acro{AI}{Artificial Intelligence}
\acro{ML}{Machine Learning}
\end{acronym}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/223790
|
691749
| 320,887 |
https://tex.stackexchange.com/questions/691751
|
5
|
My
question
is
related
to
TikZ
Decoration [markings](https://tikz.dev/library-decorations#autosec-5525)
While compiling the code, there are no errors
[TeXLive.net](https://texlive.net/run?%5Cdocumentclass%5Btikz%5D%7Bstandalone%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cusetikzlibrary%7Bdecorations.markings%7D%0A%5Cbegin%7Btikzpicture%7D%0A%5Cdraw%5Bpreaction=%7Bdecorate%7D,decoration=%7Bmarkings,%0Amark=at%20position%200.15%20with%20%5Carrow%7Blatex%7D,%0Amark=at%20position%200.25%20with%20%5Carrow%7Blatex%7D,%0Amark=at%20position%200.35%20with%20%5Carrow%7Blatex%7D,%0Amark=at%20position%200.45%20with%20%5Carrow%7Blatex%7D,%0Amark=at%20position%200.55%20with%20%5Carrow%7Blatex%7D,%0Amark=at%20position%200.65%20with%20%5Carrow%7Blatex%7D,%0Amark=at%20position%200.2%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%20%25%20should%20be%20on%20the%20curve%E2%9D%93%0Amark=at%20position%200.3%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%20%25%20should%20be%20on%20the%20curve%E2%9D%93%0Amark=at%20position%200.4%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%20%25%20on%20the%20curve%E2%9C%94%EF%B8%8F%0Amark=at%20position%200.5%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%20%25%20on%20the%20curve%E2%9C%94%EF%B8%8F%0Amark=at%20position%200.6%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%20%25%20on%20the%20curve%E2%9C%94%EF%B8%8F%0Amark=at%20position%200.7%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%20%25%20on%20the%20curve%E2%9C%94%EF%B8%8F%0A%7D%5D(-4.5,-0.5)%20..%20controls%20(-3,2)%20and%20(-1,2)%20..%20(-0.5,-0.5)..%20controls%20(0,-3)%20and%20(3,-5)%20..%20(4,2.5);%0A%5Cend%7Btikzpicture%7D%0A%5Cend%7Bdocument%7D)
```
\documentclass[tikz]{standalone}
\begin{document}
\usetikzlibrary{decorations.markings}
\begin{tikzpicture}
\draw[preaction={decorate},decoration={markings,
mark=at position 0.15 with \arrow{latex},
mark=at position 0.25 with \arrow{latex},
mark=at position 0.35 with \arrow{latex},
mark=at position 0.45 with \arrow{latex},
mark=at position 0.55 with \arrow{latex},
mark=at position 0.65 with \arrow{latex},
mark=at position 0.2 with {\fill(0,0)circle(0.1);}, % should be on the curve❓
mark=at position 0.3 with {\fill(0,0)circle(0.1);}, % should be on the curve❓
mark=at position 0.4 with {\fill(0,0)circle(0.1);}, % on the curve✔️
mark=at position 0.5 with {\fill(0,0)circle(0.1);}, % on the curve✔️
mark=at position 0.6 with {\fill(0,0)circle(0.1);}, % on the curve✔️
mark=at position 0.7 with {\fill(0,0)circle(0.1);}, % on the curve✔️
}](-4.5,-0.5) .. controls (-3,2) and (-1,2) .. (-0.5,-0.5).. controls (0,-3) and (3,-5) .. (4,2.5);
\end{tikzpicture}
\end{document}
```
The path is concatenation of 2 Bezier curves.
First I put some arrows on the path, then I put some black dots on the path, however the first few black dots aren‘t on the path.
I tried another way:
While compiling the code, there are no errors
[TeXLive.net](https://texlive.net/run?%5Cdocumentclass%5Btikz%5D%7Bstandalone%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cusetikzlibrary%7Bdecorations.markings%7D%0A%5Cbegin%7Btikzpicture%7D%0A%5Cdraw%5Bpreaction=%7Bdecorate%7D,decoration=%7Bmarkings,%0Amark=at%20position%200.2%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%0Amark=at%20position%200.3%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%0Amark=at%20position%200.4%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%0Amark=at%20position%200.5%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%0Amark=at%20position%200.6%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%0Amark=at%20position%200.7%20with%20%7B%5Cfill(0,0)circle(0.1);%7D,%0Amark=at%20position%200.15%20with%20%5Carrow%7Blatex%7D,%20%25%20should%20be%20on%20the%20curve%E2%9D%93%0Amark=at%20position%200.25%20with%20%5Carrow%7Blatex%7D,%20%25%20should%20be%20on%20the%20curve%E2%9D%93%0Amark=at%20position%200.35%20with%20%5Carrow%7Blatex%7D,%20%25%20should%20be%20on%20the%20curve%E2%9D%93%0Amark=at%20position%200.45%20with%20%5Carrow%7Blatex%7D,%20%25%20on%20the%20curve%E2%9C%94%EF%B8%8F%0Amark=at%20position%200.55%20with%20%5Carrow%7Blatex%7D,%20%25%20on%20the%20curve%E2%9C%94%EF%B8%8F%0Amark=at%20position%200.65%20with%20%5Carrow%7Blatex%7D,%20%25%20on%20the%20curve%E2%9C%94%EF%B8%8F%0A%7D%5D(-4.5,-0.5)%20..%20controls%20(-3,2)%20and%20(-1,2)%20..%20(-0.5,-0.5)..%20controls%20(0,-3)%20and%20(3,-5)%20..%20(4,2.5);%0A%5Cend%7Btikzpicture%7D%0A%5Cend%7Bdocument%7D)
```
\documentclass[tikz]{standalone}
\begin{document}
\usetikzlibrary{decorations.markings}
\begin{tikzpicture}
\draw[preaction={decorate},decoration={markings,
mark=at position 0.2 with {\fill(0,0)circle(0.1);},
mark=at position 0.3 with {\fill(0,0)circle(0.1);},
mark=at position 0.4 with {\fill(0,0)circle(0.1);},
mark=at position 0.5 with {\fill(0,0)circle(0.1);},
mark=at position 0.6 with {\fill(0,0)circle(0.1);},
mark=at position 0.7 with {\fill(0,0)circle(0.1);},
mark=at position 0.15 with \arrow{latex}, % should be on the curve❓
mark=at position 0.25 with \arrow{latex}, % should be on the curve❓
mark=at position 0.35 with \arrow{latex}, % should be on the curve❓
mark=at position 0.45 with \arrow{latex}, % on the curve✔️
mark=at position 0.55 with \arrow{latex}, % on the curve✔️
mark=at position 0.65 with \arrow{latex}, % on the curve✔️
}](-4.5,-0.5) .. controls (-3,2) and (-1,2) .. (-0.5,-0.5).. controls (0,-3) and (3,-5) .. (4,2.5);
\end{tikzpicture}
\end{document}
```
First I put some black dots on the path, then I put some arrows on the path, however the first few arrows aren‘t on the path.
|
https://tex.stackexchange.com/users/260481
|
TikZ decoration markings not on the path
| true |
For some reason, if you put the first marks in the correct order, they all belong to their correct places. This I can't explain yet, but at least, it works.
EDIT
----
Adding @muzimuzhi comment about that:
>
> Multiple `mark=at position <pos> with <code>` must have their `<pos>` in increasing order, see doc for this option: [tikz.dev/library-decorations#pgf/decoration/mark](https://tikz.dev/library-decorations#pgf/decoration/mark).
>
>
>
> >
> > It is possible to give the `mark` option several times, which causes several markings to be applied. In this case, however, it is necessary that the positions on the path are in increasing order.
> >
> >
> >
>
>
>
The strange behaviour here lies in the fact that the last ones are *not* in increasing order, and yet seem to be correctly placed.
```
\documentclass[tikz]{standalone}
\begin{document}
\usetikzlibrary{decorations.markings}
\begin{tikzpicture}
\draw[preaction={decorate},decoration={markings,
mark=at position 0.15 with \arrow{latex},
mark=at position 0.2 with {\fill(0,0)circle(0.1);},
mark=at position 0.25 with \arrow{latex},
mark=at position 0.3 with {\fill(0,0)circle(0.1);},
mark=at position 0.35 with \arrow{latex},
mark=at position 0.4 with {\fill(0,0)circle(0.1);},
mark=at position 0.5 with {\fill(0,0)circle(0.1);},
mark=at position 0.6 with {\fill(0,0)circle(0.1);},
mark=at position 0.7 with {\fill(0,0)circle(0.1);},
mark=at position 0.45 with \arrow{latex},
mark=at position 0.55 with \arrow{latex},
mark=at position 0.65 with \arrow{latex},
}](-4.5,-0.5) .. controls (-3,2) and (-1,2) .. (-0.5,-0.5).. controls (0,-3) and (3,-5) .. (4,2.5);
\end{tikzpicture}
\end{document}
```
|
5
|
https://tex.stackexchange.com/users/204164
|
691753
| 320,888 |
https://tex.stackexchange.com/questions/604731
|
1
|
I've been trying to read a .tex version of a free linear algebra textbook:
<http://joshua.smcvt.edu/linearalgebra/>
**ISSUE 1 is with the repositories:**
My goal is I want to read the .pdf version of the text alongside the .tex version of the text. In this case, there are 3 texts:
1. book.pdf
2. jhanswer.pdf
3. lab.pdf
*In the repositories, they [the .tex files] are undersized dramatically.* Therefore, there is not a way for a person wishing to browse .tex version of these .pdf books in parallel, so I made an issue report. However, that is not the only problem.
None of the repositories have ".tex versions" of the ".pdf" documents. Instead, the .tex files are spread out across a large number of folders and subfolders.
This is the case in both repositories: <https://gitlab.com/jim.hefferon/linear-algebra> and <https://github.com/indraniel/linear-algebra>
**Boiling up to issue 2, with installation . . .**
I installed texlive from tug: <https://www.tug.org/texlive/acquire-netinstall.html>
I installed texmaker:
<https://www.xm1math.net/texmaker/download.html>
**ISSUE 2: Even though I installed it through tug, which includes getnonfreefonts, I was missing many .sty files needed to QuickView .tex files.**
>
> If you installed TeX Live yourself from h\*\*p://tug.org/texlive, then getnonfreefonts will be installed as it were part of TeX Live itself. If the installer is invoked on Windows, it installs getnonfreefonts for Windows only, otherwise for all platforms.
>
>
>
It says I shouldn't have this issue here explicitly: <https://tug.org/fonts/getnonfreefonts/>
**Boiling up to issue 3, with getnonfreefonts . . .**
>
> The TEX Live installer contains only fonts whose license allow distribution on DVD. So some are missing where this is not allowed, but which may be used free of cost. Now we install these.
>
>
>
That's what it says here: <https://www.latexbuch.de/install-latex-windows/>
I followed the installation instructions for Windows, downloaded this link: <https://tug.org/fonts/getnonfreefonts/install-getnonfreefonts> and ran the following commands:
```
texlua install-getnonfreefonts
etnonfreefonts --sys --all
```
However, after doing this, I still get many errors for missing files, such as luximono.sty or bookans.sty (to name a few).
**Conclusion and rationale:**
I'm somewhat learning disabled due to a vision impairment. Typically, I am simply tired of having to Google a math symbol expressed in Hebrew or Greek etc. To work around this, I thought it would be excellent if I could read an introductory text (in linear algebra) composed in .tex so I could search for Latex expressions I don't already know. It's vitally important I know not only how symbols look on the page, but how they sound to the human ear. To clear up this confusion, I wanted a .tex document so I could follow along more easily, but I'm having a lot of trouble.
|
https://tex.stackexchange.com/users/246201
|
Unable to build Jim Hefferon's Linear Algebra book in Windows 10
| false |
Forgive me, I was not aware of this post and it is now years later, so perhaps my answer is useless to you. Anyway, you seem to have gotten wrapped around trying to compile the book to get a pdf. But the pdf is freely available; for instance look on my web site [hefferon.net](https://hefferon.net/linearalgebra).
As to the TeX source files, they are in the repo that you found. The first chapter is on Gaussian reduction so the first section's file is gr1.tex, the second section's file is gr2.tex, etc. The second chapter is on vector spaces so the files are vs1.tex, vs2.tex, etc. Then comes the chapter on linear maps with map1.tex, etc. Then determinants with det1.tex, etc. Finally the last chapter's files are jc1.tex, etc. (it covers Jordan canonical form).
|
1
|
https://tex.stackexchange.com/users/339
|
691756
| 320,890 |
https://tex.stackexchange.com/questions/691757
|
0
|
The format in **chapter 1** has no problem at all, but when I **include** in the main text, the format changed.
This is the chapter 1,preambles:
```
% Preamble
\documentclass[12pt]{report}
\usepackage{graphicx} % Required for inserting images
\usepackage{setspace}
\usepackage{geometry}
\usepackage{indentfirst}
\usepackage{titlesec}
\setcounter{secnumdepth}{4}
\usepackage{ragged2e}
\begin{document}
```
This is in the main text preambles, I used
`\include{Chapters/Chapter1}`:
```
% Preamble
\documentclass[12pt]{report}%letter and artcile type
\usepackage{graphicx} % Required for inserting images
\usepackage{setspace}
\usepackage{geometry}
\usepackage{indentfirst}
\usepackage{titlesec}
\setcounter{secnumdepth}{4}
\usepackage{ragged2e}
\setcounter{tocdepth}{0}
```
In the main text, I used preambles and in the chapter 1 I used preambles too, is this the problem?
|
https://tex.stackexchange.com/users/301169
|
Using \include format of the main text changes
| true |
`\include` acts as if the contents of the file were pasted into that spot (surrounded by pagebreaks). This means that your main file is acting like:
```
\documentclass[12pt]{report}
\begin{document}
% chapter 1:
\documentclass[12pt]{report}
\begin{document}
Chapter 1
\end{document}
% end chapter 1
\end{document}
```
Since you can't have a second `\documentclass`, you can't have that in an included file.
If you really want to be able to compile chapters on their own, look into the subfiles package. But it's usually easier to have `chapter1.tex` just have the content for chapter 1, and then if you only want to compile chapter 1, you can have `\includeonly{chapter1}` in your (main file's) preamble. Your main file would end up looking like:
```
\documentclass[12pt]{report}
% other preamble material
% \includeonly{Chapters/Chapter1} % optional
\begin{document}
\include{Chapters/Chapter1}
\end{document}
```
and a chapter file would look like
```
\chapter{Chapter 1 Title}
Chapter 1 content
```
The idea of `\includeonly` is if you have several different chapters that you've included, then you can use `\includeonly` to make only a few of them actually included. TeX will use the counters from the non-included files so that the included material still has the right numbering, but now you can have a much faster compilation because you don't need to compile the non-included files.
|
0
|
https://tex.stackexchange.com/users/107497
|
691760
| 320,891 |
https://tex.stackexchange.com/questions/691602
|
3
|
I use R and ggplot to create figures, which I then import as tikz code into my LaTeX file. The publisher wants me to submit in their template, which is based on `[12pt]{article}`. However, whenever I use the following code to export my ggplot2-figure, there is a small problem.
```
if (!require("pacman")) install.packages("pacman")
pacman::p_load( 'ggplot2', 'tikzDevice', 'tinytex')
trialfigure <- ggplot(mpg, aes(y = class)) +
geom_bar(aes(fill = drv)) +
scale_fill_discrete(labels = c("4" = "really long label")) +
theme(legend.position = "bottom")
trialfigure
tikz('trialfigure.tex', width = 6.5, height = 4.875, sanitize = TRUE, documentDeclaration = "\\documentclass[12pt]{article}")
print(trialfigure)
dev.off()
```
In the LaTex Output from Overleaf, I feel like the fonts are too big, which can be seen as the "longish color legend" texts always interfere with the legend colors.
If I set my document to 10 points, everything works as expected.
I include the tikz-code as follows:
```
\documentclass[12pt,authoryear]{article}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage[utf8]{inputenc} % for easy quotation marks ""
%%%%% for the TIKZPictures
\makeatletter
\tikzset{dangerous style/.code={
\tikzoption{clip}[]{\pgf@relevantforpicturesizefalse}
\tikzoption{use as bounding box}[]{\pgf@relevantforpicturesizefalse}
}
}
\makeatother
%%%%% for the TIKZPictures
\usepackage{graphicx}
\begin{document}
\begin{figure}[htbp!]
\centering
\resizebox{\textwidth}{!}{
% Created by tikzDevice version 0.12.3.1 on 2023-07-24 15:04:05
% !TEX encoding = UTF-8 Unicode
\begin{tikzpicture}[x=1pt,y=1pt]
\definecolor{fillColor}{RGB}{255,255,255}
\path[use as bounding box,fill=fillColor,fill opacity=0.00] (0,0) rectangle (469.75,352.32);
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{RGB}{255,255,255}
\definecolor{fillColor}{RGB}{255,255,255}
\path[draw=drawColor,line width= 0.6pt,line join=round,line cap=round,fill=fillColor] ( 0.00, 0.00) rectangle (469.75,352.32);
\end{scope}
\begin{scope}
\path[clip] ( 59.42, 67.12) rectangle (464.26,346.82);
\definecolor{fillColor}{gray}{0.92}
\path[fill=fillColor] ( 59.42, 67.12) rectangle (464.26,346.82);
\definecolor{drawColor}{RGB}{255,255,255}
\path[draw=drawColor,line width= 0.3pt,line join=round] (137.18, 67.12) --
(137.18,346.82);
\path[draw=drawColor,line width= 0.3pt,line join=round] (255.90, 67.12) --
(255.90,346.82);
\path[draw=drawColor,line width= 0.3pt,line join=round] (374.62, 67.12) --
(374.62,346.82);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 59.42, 90.42) --
(464.26, 90.42);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 59.42,129.27) --
(464.26,129.27);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 59.42,168.12) --
(464.26,168.12);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 59.42,206.97) --
(464.26,206.97);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 59.42,245.81) --
(464.26,245.81);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 59.42,284.66) --
(464.26,284.66);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 59.42,323.51) --
(464.26,323.51);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 77.82, 67.12) --
( 77.82,346.82);
\path[draw=drawColor,line width= 0.6pt,line join=round] (196.54, 67.12) --
(196.54,346.82);
\path[draw=drawColor,line width= 0.6pt,line join=round] (315.26, 67.12) --
(315.26,346.82);
\path[draw=drawColor,line width= 0.6pt,line join=round] (433.98, 67.12) --
(433.98,346.82);
\definecolor{fillColor}{RGB}{248,118,109}
\path[fill=fillColor] (285.58,111.79) rectangle (356.81,146.75);
\path[fill=fillColor] (303.39,150.64) rectangle (321.20,185.60);
\path[fill=fillColor] ( 77.82,228.33) rectangle (273.71,263.29);
\path[fill=fillColor] (261.84,267.18) rectangle (285.58,302.14);
\path[fill=fillColor] (143.12,306.03) rectangle (445.85,340.99);
\definecolor{fillColor}{RGB}{0,186,56}
\path[fill=fillColor] ( 77.82,111.79) rectangle (285.58,146.75);
\path[fill=fillColor] ( 77.82,150.64) rectangle (303.39,185.60);
\path[fill=fillColor] ( 77.82,189.49) rectangle (143.12,224.45);
\path[fill=fillColor] (131.24,267.18) rectangle (261.84,302.14);
\definecolor{fillColor}{RGB}{97,156,255}
\path[fill=fillColor] ( 77.82, 72.94) rectangle (107.50,107.91);
\path[fill=fillColor] ( 77.82,267.18) rectangle (131.24,302.14);
\path[fill=fillColor] ( 77.82,306.03) rectangle (143.12,340.99);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{gray}{0.30}
\node[text=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 54.47, 87.90) {2seater};
\node[text=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 54.47,126.75) {compact};
\node[text=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 54.47,165.59) {midsize};
\node[text=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 54.47,204.44) {minivan};
\node[text=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 54.47,243.29) {pickup};
\node[text=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 54.47,282.14) {subcompact};
\node[text=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 54.47,320.98) {suv};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{gray}{0.20}
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 56.67, 90.42) --
( 59.42, 90.42);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 56.67,129.27) --
( 59.42,129.27);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 56.67,168.12) --
( 59.42,168.12);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 56.67,206.97) --
( 59.42,206.97);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 56.67,245.81) --
( 59.42,245.81);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 56.67,284.66) --
( 59.42,284.66);
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 56.67,323.51) --
( 59.42,323.51);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{gray}{0.20}
\path[draw=drawColor,line width= 0.6pt,line join=round] ( 77.82, 64.37) --
( 77.82, 67.12);
\path[draw=drawColor,line width= 0.6pt,line join=round] (196.54, 64.37) --
(196.54, 67.12);
\path[draw=drawColor,line width= 0.6pt,line join=round] (315.26, 64.37) --
(315.26, 67.12);
\path[draw=drawColor,line width= 0.6pt,line join=round] (433.98, 64.37) --
(433.98, 67.12);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{gray}{0.30}
\node[text=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 0.73] at ( 77.82, 57.12) {0};
\node[text=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 0.73] at (196.54, 57.12) {20};
\node[text=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 0.73] at (315.26, 57.12) {40};
\node[text=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 0.73] at (433.98, 57.12) {60};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{RGB}{0,0,0}
\node[text=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 0.92] at (261.84, 46.63) {count};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{RGB}{0,0,0}
\node[text=drawColor,rotate= 90.00,anchor=base,inner sep=0pt, outer sep=0pt, scale= 0.92] at ( 11.81,206.97) {class};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{fillColor}{RGB}{255,255,255}
\path[fill=fillColor] (178.83, 5.50) rectangle (344.84, 33.84);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{RGB}{0,0,0}
\node[text=drawColor,anchor=base west,inner sep=0pt, outer sep=0pt, scale= 0.92] at (184.33, 16.52) {drv};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{fillColor}{gray}{0.95}
\path[fill=fillColor] (203.35, 11.00) rectangle (220.70, 28.34);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{fillColor}{RGB}{248,118,109}
\path[fill=fillColor] (204.06, 11.71) rectangle (219.99, 27.63);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{fillColor}{gray}{0.95}
\path[fill=fillColor] (283.04, 11.00) rectangle (300.38, 28.34);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{fillColor}{RGB}{0,186,56}
\path[fill=fillColor] (283.75, 11.71) rectangle (299.67, 27.63);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{fillColor}{gray}{0.95}
\path[fill=fillColor] (313.62, 11.00) rectangle (330.97, 28.34);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{fillColor}{RGB}{97,156,255}
\path[fill=fillColor] (314.33, 11.71) rectangle (330.26, 27.63);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{RGB}{0,0,0}
\node[text=drawColor,anchor=base west,inner sep=0pt, outer sep=0pt, scale= 0.73] at (226.20, 17.15) {really long label};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{RGB}{0,0,0}
\node[text=drawColor,anchor=base west,inner sep=0pt, outer sep=0pt, scale= 0.73] at (305.88, 17.15) {f};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (469.75,352.32);
\definecolor{drawColor}{RGB}{0,0,0}
\node[text=drawColor,anchor=base west,inner sep=0pt, outer sep=0pt, scale= 0.73] at (336.47, 17.15) {r};
\end{scope}
\end{tikzpicture}
}
\caption{Some caption. The problem is in the "really long label".}
\label{fig:someplotlabel}
\end{figure}
\end{document}
```
The problem with the figure is in the large label. And I do not want to alter the tikz code, please.
I am not sure, what I could do for a reproducible example, any tips are welcome.
Is there any way to solve my problem with the 12 pt font? - e.g., by defining all figures should be 10 pt?
|
https://tex.stackexchange.com/users/114622
|
Using LaTeX with TikZDevice in R: is it possible to set the font for Tikzfigures to 10 while 12 for the text?
| true |
**Edit**
(Complete rewrite of the original answer since the question show code that allow a better understanding of the issues.)
A) First, you have a problem with R code. It seems that you created a "document agnostic" tikz picture without the option `standAlone=TRUE`, so I guess that `tikzDocumentDeclaration` has no effect and the figure is calculated for the default (10pt). A tikz picture intended for 10pt in 12pt latex text can produce this label overflow.
But even making a standalone TeX document adding this option, the tuning of font metrics of tkiz seems to fail in this way (The R script below, make the wrong picture in 12pt document, the output of `trialfigure.tex` is included as figure 1 in the next `MWE.Rnw`):
The `MWE.R` script:
```
require(ggplot2)
require(tikzDevice)
options(tikzDocumentDeclaration = "\\documentclass[12pt]{article}")
trialfigure <- ggplot(mpg, aes(y = class)) +
geom_bar(aes(fill = drv)) +
scale_fill_discrete(labels = c("4" = "really long label")) +
theme(legend.position = "bottom")
trialfigure
tikz('trialfigure.tex',
width = 6.5, height = 4.875,
standAlone=TRUE,
sanitize = TRUE)
print(trialfigure)
dev.off()
```
Now you have a few alternatives to solve the issue:
1. Do not ask me why, but change in the source the label "really long label" by "really lang label" (just replacing "o" by "a") solves the issue for me. It seems a bug, failing to measure the right dimensions for 12pt with this exact label, but not with 10pt or 11pt. I see no problems using even clearly longer labels with 12 pt as "really long long label". But thinking in other cases of miscalculation:
2. Presumably, add the `pointsize=12` option to the `tikz()` function. That is used as base font size if `tikzDocumentDeclaration` fails to produce a math with a valid latex font size. But it does not work with the damn "really long label".
3. Make the image for the default 10 pt, save the pdf, and scale up the image a 20% (scale=1.2) in the final document.
4. Edit `trialfigure.tex` and in `\begin{tikzpicture}` line change `[x=1pt,y=1pt]` to `[x=1.2pt,y=1.2pt]`, and take care of reduce picture dimensions proportionally in the `tikz()` function if needed, to avoid any resizing in LaTeX side.
5. Alternatively, make "almost" the same standalone documents via `knitr` in a .Rnw file. Now R will make the figure correctly for 12 pt, so it is ready to use without modifications nor scaling (figure 2). No idea why "really long label" is not problematic here, but although the plot look the same, all tikz coordinates are different, so maybe this avoided the bug?
B) Second, as said in the original anwers, you have also a problem in LaTeX using `\resizebox`. Using the correct tikz code for 10pt in a 12pt document can produce label overflows (of any label, no only of this weird label), but besides this, the font sizes will be inconsistent between plots and with the main text, depending on whether each one is enlarged or narrowed, just ugly. If instead of the tikz code, you include a pdf image, you will face the same problem using any kind of redimension, via `\includegraphics` options, or when document set automatically the image dimensions (e.g.: \setkeys{Gin}{width=3cm,height=3cm}). In special you should be aware that Rstudio reports that in PDF (via LaTeX) use templates to automatically shrink large files exceeding `\maxdimen` (figure 3). So again take care of the dimensions in the R side to avoid redimensions in the LaTeX side, if the final font size matter.
Nonetheless, note that no matter if you make this plot large o small, for 10pt or 12pt, with R script or knitr, invariably the tikz nodes are scaled to 92% or 73% for labels a axis ticks. In a 12pt document, this mean final that the non-scaled image will have font sizes of roughly 11pt and 8pt, respectively. If this matter, you should control also the `cex` in the R side.
The `MWE.Rnw` file:
```
\documentclass[12pt]{article}
\usepackage[bmargin=1cm,tmargin=1cm]{geometry}
\usepackage{tikz}
\parskip1em\parindent0pt
\begin{document}
\begin{figure}[h!]
\centering
\includegraphics[scale=1]{trialfigure.pdf}
\caption{Plot generated by the standalone R script}
\end{figure}
<<theplot,echo=F,include=F>>=
require(ggplot2)
trialfigure <- ggplot(mpg, aes(y = class)) +
geom_bar(aes(fill = drv)) +
scale_fill_discrete(labels = c("4" = "really long label")) +
theme(legend.position = "bottom")
@
<<herewego,echo=F,dev='tikz',fig.cap="Plot generated with knitr.", fig.align='center', fig.width=4, fig.height=2, message=FALSE, fig.pos="h!">>=
trialfigure
@
<<herewego2,echo=F,dev='tikz',fig.cap="The same but too big = smaller fonts.", fig.align='center', fig.width=6.5, fig.height=2, message=FALSE, fig.pos="h!">>=
trialfigure
@
\end{document}
```
`The MWE.pdf`:
Note:
Yes, the `knitr` workflow is very different , but IMHO plenty of advantages, besides manage well this issue.
|
5
|
https://tex.stackexchange.com/users/11604
|
691761
| 320,892 |
https://tex.stackexchange.com/questions/691697
|
0
|
I would like to number the corollary of the theorem “theorem 1.2.3.” such as “corollary 1.2.3.” Instead of “corollary 1.2.3.1.”. How can I do? I’m using amsthm package.
|
https://tex.stackexchange.com/users/301130
|
Unnumbering corollaries
| false |
In my opinion your readers won't understand. But you're the judge.
```
\documentclass{book}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem*{corollary}{Corollary \thetheorem}
\begin{document}
\chapter{Test}
\section{One}
\begin{theorem}
This is a theorem.
\end{theorem}
\begin{corollary}
This is the first corollary.
\end{corollary}
\begin{corollary}
This is the second corollary.
\end{corollary}
\end{document}
```
Of course corollaries must follow the theorem they refer to without any other theorem in between. Text is allowed, though.
|
0
|
https://tex.stackexchange.com/users/4427
|
691763
| 320,893 |
https://tex.stackexchange.com/questions/691441
|
1
|
Since the last update to the newest TexLive version, a corporate designed `scrlttr2`-document does not compile anymore.
I always receive errors about a missing font:
>
> Font \TU/lmr/m/n/10=[lmroman10-regular]:+tlig; at 10pt not loadable: metric data not found or bad. ...lt\familydefault\seriesdefault\shapedefault
>
>
>
>
> Package fontspec Error: The font "LinotypeSyntaxCom-Regular" cannot be(fontspec) found.
>
>
>
>
> Font \TU/LinotypeSyntaxCom(0)/m/n/10=[/usr/local/share/fonts/linotype-syntax-cdable: metric data not found or bad.
>
>
>
There are definitely all mentioned `Linotype.ttf-fonts` stored in `/usr/local/share/fonts/linotype-syntax-com/` directory.
---
Therefore I have tried to recall the fonts in the document by:
```
\documentclass{article}
\usepackage{fontspec}
\setmainfont[
Path = /usr/local/share/fonts/linotype-syntax-com/,
Extension = .ttf ,
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-Italic,
BoldItalicFont = *-BoldIt,
]{LinotypeSyntaxCom}
\begin{document}
Something is wrong! I am momentarily blinded and confused by moving, overlapping, translucent images that overwhelm my vision of the book I am reading.
\end{document}
```
But this didn't work.
---
**Any ideas how to solve this?**
In LibreOffice all fonts are still available.
|
https://tex.stackexchange.com/users/78784
|
Arch Linux: Fontspec does not find *.ttf-Font (LuaLaTex)
| false |
Install [texlive-fontsrecommended](https://archlinux.org/packages/extra/any/texlive-fontsrecommended/files), it has `/usr/share/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf`.
It will vanish the first error.
I do not have own copy for these Linotype Syntax font. Please confirm @Dave.
>
> PS: [Looks like a bad practice install over `/usr/local`](https://wiki.archlinux.org/title/Creating_packages#build()) (off-topic comment).
>
>
>
|
0
|
https://tex.stackexchange.com/users/117967
|
691766
| 320,896 |
https://tex.stackexchange.com/questions/691778
|
2
|
I'm trying to have numbered paragraphs:
```
\documentclass{article}
\newcounter{para}
\setcounter{secnumdepth}{4}
\begin{document}
\section{Lorum ipsum}
\subsection{Lorum ipsum}
\paragraph{} Lorum ipsum
\end{document}
```
However, I do get an unnecessary "0" in numbering - so the paragraph in the example is 1.1.0.1. How can I avoid this?
|
https://tex.stackexchange.com/users/592
|
How to remove "0" from numbers of paragraphs when they are not in subsubsection
| false |
The code given below does what the OP wants.
I can't help but remark that it's decidedly poor and sloppy typographic practice to skip subsubsection-level headers when also using paragraph-level headers. There has got to be a way to create a dummy-type subsubsection-level header, no?
```
\documentclass{article}
\setcounter{secnumdepth}{4} % default: 3
% Suppress value of subsubsection counter if equal to 0:
\renewcommand{\theparagraph}{%
\ifnum\value{subsubsection}=0 \thesubsection.\arabic{paragraph}
\else \thesubsubsection.\arabic{paragraph}
\fi}
\usepackage{lipsum} % filler text
\begin{document}
\section{Lorem ipsum}
\subsection{Lorem ipsum}
%\subsubsection{Lorem ipsum} % commented out
\paragraph{Lorem ipsum}
\lipsum[1][1-3] % filler text
\section{Nam dui}
\subsection{Nam dui}
\subsubsection{Nam dui} % *not* commented out
\paragraph{Nam dui}
\lipsum[2][1-3] % more filler text
\end{document}
```
|
6
|
https://tex.stackexchange.com/users/5001
|
691779
| 320,901 |
https://tex.stackexchange.com/questions/691713
|
0
|
I am writing my PhD thesis in WinEdt 10.2 with MikTeX support. My thesis needs to include cover page having chinese fonts. University thesis class has all the definitions. When I compile the main text file, it gives error:
>
> *geometry* driver: auto-detecting
>
>
> *geometry* detected driver: pdftex
>
>
> (Main.out) (Main.out)
>
>
> ! Package CJK Error: Invalid character code.
>
>
> See the CJK package documentation for explanation.
>
> Type H for immediate help.
>
> ...
>
> l.114 \makeCoverPage
>
> ?
>
>
> Process has been terminated ...
>
>
>
I have included necessary CJK package in the tex file.
Previously, it was running fine. Last week, I tried to install TeX Live which took too much time to install. After that this problem occured. I have removed TeX Live 2023 but the problem still persists. May be, Tex Live has removed some necessary files from my computer.
If i don't include CJK package in main tex file then following error occurs:
>
> Missing character: There is no · in font ptmr7t!
>
>
> ! Package CJK Error: Invalid character code.
>
>
>
Main.tex file is:
```
\expandafter\def\csname CTEX@spaceChar\endcsname{\hspace{1em}}
\expandafter\def\csname ver@subfig.sty\endcsname{}
\documentclass[oneside]{ZJUthesis}
\usepackage{psfrag}
\usepackage{subcaption}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{bbm}
\usepackage[english]{babel}
\usepackage[toc,page]{appendix}
\usepackage{fullpage}
\usepackage{amsfonts,amsthm,amsmath,mathrsfs,amssymb}
\usepackage{subeqnarray}
%\usepackage{booktabs}
\usepackage{ctex}
\usepackage{longtable}
\usepackage{epstopdf,epsfig}
\usepackage{cite}
\usepackage{url}
%\usepackage[utf8]{inputenc}
%\usepackage{CJKutf8}
%\usepackage{CJK,CJKnumb}
%\usepackage[T1]{fontenc}
\usepackage{nomencl}
\let\abbrev\nomenclature
\renewcommand{\nomname}{List of Abbreviations}
\setlength{\nomlabelwidth}{.25\hsize}
\renewcommand{\nomlabel}[1]{#1 \dotfill}
\setlength{\nomitemsep}{-\parsep}
\makenomenclature
\newcommand{\Abkuerzung}{
\printnomenclature
\newpage
}
\newcommand{\zht}[1]{\begin{CJK}{UTF8}{bsmi}#1\end{CJK}}
\newcommand{\zhs}[1]{\begin{CJK}{UTF8}{gbsn}#1\end{CJK}}
\newcommand{\zh}[4]{\zht{#1}/\zhs{#2} (\emph{#3}) ``#4''}
\numberwithin{equation}{chapter}
\numberwithin{algorithm}{chapter}
\hypersetup{colorlinks=false}
\begin{document}
\fangsong
%\zihao{-4}
\classification{}
\serialnumber{}
\PersonalID{}
\Etitle{}
\Etitletl}
\author{}
\degree{}
\submitdate{2023.7}
\defenddate{2023.9}
\makeCoverPage
\reviewersA{}
\reviewersB{}
\reviewersC{}
\reviewersD{}
\reviewersE{}
\chairman{}
\commissionerA{}
\commissionerB{}
\commissionerC{}
\commissionerD{}
\maketitle
\englishtitle{}
\englishtitletl{}
\EreviewersA{Anonymous}
\EreviewersB{Anonymous}
\EreviewersC{Anonymous}
\EreviewersD{Anonymous}
\EreviewersE{Anonymous}
\Echairman{}
\EcommissionerA{}
\EcommissionerB{}
\EcommissionerC{}
\EcommissionerD{}
\makeenglishtitle
\SignautreDateA{}{}{}
\SignautreDateB{}{}{}
\SignautreDateC{}{}{}
\makeOSandCPRTpage
\ZJUfrontmatter
\input{./Chapters/Thanks}
\input{./Chapters/AbstractC}
\input{./Chapters/AbstractE}
\ZJUListofFigures
\ZJUListofTables
\input{./Chapters/Abbreviations}
\ZJUcontents
\ZJUmainmatter
\input{./Chapters/Chapter1}
\ZJUbackmatter
\appendix
\input{./Chapters/Appendix}
\ZJUindex
\input{./Chapters/PublicationList}
\end{document}
%*******************************
```
ZJUthesis.cls is also attached for your reference.
```
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{ZJUthesis}[2013/01/25 v2.0 ZJUthesis document class]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}}
\ProcessOptions
\LoadClass[cs4size,a4paper,fancyhdr,hyperref]{ctexbook}[2009/09/13]
\RequirePackage{amsmath,amsthm,amsfonts,amssymb,bm}
\RequirePackage{graphicx}
\RequirePackage{times}
%\RequirePackage{fontspec}
\RequirePackage{array}
\RequirePackage[titles, subfigure]{tocloft}
\RequirePackage[chapter]{tocbibind}
\RequirePackage{makeidx}
\RequirePackage[sort&compress,longnamesfirst,square,numbers]{natbib}
\RequirePackage[margin=10pt,font={small,bf},labelsep=quad]{caption}
\RequirePackage{booktabs}
\RequirePackage{calc}
\RequirePackage{multirow}
\RequirePackage{xcolor}
\hypersetup{CJKbookmarks=true,%
bookmarksnumbered,%
linkcolor=blue,%
plainpages=false,%
pdfstartview=FitH,
hidelinks
}
\AtBeginDocument{\makeatletter\input{ZJUthesis.cfg}\makeatother}
\RequirePackage[a4paper,%
top=51pt,bottom=51pt,left=68pt,right=57pt,%
headsep=14pt,footskip=26pt,%
footnotesep=10.8pt plus 1fil minus 2.0pt,%
includehead, includefoot]{geometry}
\RequirePackage{subfigure}
\RequirePackage{upgreek}
\RequirePackage{enumerate}
%\oddsidemargin -0.14 true cm
% ż��ҳ�����߾���������˫��ģʽ�뵥��ģʽ��������
%\if@twoside
% \evensidemargin -0.34 true cm
%\else
% \evensidemargin -0.14 true cm
%\fi
% ����ҳͷ�հ׳ߴ�
%\topmargin -0.74 true cm
%\headheight 0.8 true cm
%\headsep 0.5 true cm
\topsep 0.7 true cm
%\textheight 23.9 true cm
%\textwidth 16.6 true cm
%\footskip 0.9 true cm
\parskip 0.5ex plus 0.25ex minus 0.25ex
% cleardoublepage������������
\def\cleardoublepage{%
\clearpage
\if@twoside
\ifodd
\c@page
\else
\thispagestyle{empty}%
\hbox{}\newpage
\if@twocolumn
\hbox{}\newpage
\fi
\fi
\fi}
\renewcommand{\textfraction}{0.15}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.65}
\renewcommand{\floatpagefraction}{0.60}
%\setmainfont{Times New Roman}
\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}
\renewcommand{\theequation}{\arabic{chapter}-\arabic{equation}}
\renewcommand{\thefigure}{\arabic{chapter}-\arabic{figure}}
\newcommand\ZJUspace{\protect\CTEX@spaceChar\protect\CTEX@spaceChar}
\def\reserved@a#1 #2 #3\@nil{%
\def\ZJUfiledate{#1}%
\def\ZJUfileversion{#2}%
\def\ZJUfileinfo{#3}}%
\edef\reserved@b{\csname ver@ZJUthesis.cls\endcsname}
\expandafter\reserved@a\reserved@b\@nil\relax
% ������Nchapter����
% ������mainmatter��Ӧ��tex�ĵ��еĶ���
\newcommand\Nchapter[1]{%
\if@mainmatter%
\@mainmatterfalse%
\chapter{#1}%
\@mainmattertrue%
\else
\chapter{#1}%
\fi}
\def\ZJU@underline[#1]#2{%
\underline{\hbox to #1{\hfil#2\hfil}}}
\def\ZJUunderline{\@ifnextchar[\ZJU@underline\underline}
\newcommand\classification[1]{\def\ZJU@value@classification{#1}}
\newcommand\confidential[1]{\def\ZJU@value@confidential{#1}}
\newcommand\UDC[1]{\def\ZJU@value@UDC{#1}}
\newcommand\serialnumber[1]{\def\ZJU@value@serialnumber{#1}}
\newcommand\school[1]{\def\ZJU@value@school{#1}}
\newcommand\SecretLevel[1]{%
\def\ZJU@value@SecretLevel{#1}
\def\ZJU@value@IsSecret{1}}
\newcommand\PersonalID[1]{\def\ZJU@value@PersonalID{#1}}
\newcommand\degree[1]{\def\ZJU@value@degree{#1}}
\renewcommand\title[2][\ZJU@value@title]{%
\def\ZJU@value@title{#2}
\def\ZJU@value@titlemark{\MakeUppercase{#1}}}
\newcommand\titletl[1]{\def\ZJU@value@titletl{#1}}
\newcommand\Etitle[1]{\def\ZJU@value@Etitle{#1}}
\newcommand\Etitletl[1]{\def\ZJU@value@Etitletl{#1}}
\newcommand\EtitletB[1]{\def\ZJU@value@EtitletB{#1}}
\renewcommand\author[1]{\def\ZJU@value@author{#1}}
\newcommand\supervisor[1]{\def\ZJU@value@supervisor{#1}}
\newcommand\cpsupervisor[1]{\def\ZJU@value@cpsupervisor{#1}}
\newcommand\supervisorinstitute[1]{\def\ZJU@value@supervisorinstitute{#1}}
\newcommand\major[1]{\def\ZJU@value@major{#1}}
\newcommand\researchdm[1]{\def\ZJU@value@researchdm{#1}}
\newcommand\submitdate[1]{\def\ZJU@value@submitdate{#1}}
\newcommand\defenddate[1]{\def\ZJU@value@defenddate{#1}}
\newcommand\defenddateE[1]{\def\ZJU@value@defenddateE{#1}}
\newcommand\institute[1]{\def\ZJU@value@institute{#1}}
\newcommand\chairman[1]{\def\ZJU@value@chairman{#1}}
\newcommand\commissionerA[1]{\def\ZJU@value@commissionerA{#1}}
\newcommand\commissionerB[1]{\def\ZJU@value@commissionerB{#1}}
\newcommand\commissionerC[1]{\def\ZJU@value@commissionerC{#1}}
\newcommand\commissionerD[1]{\def\ZJU@value@commissionerD{#1}}
%\newcommand\commissionerE[1]{\def\ZJU@value@commissionerE{#1}}
\newcommand\reviewersA[1]{\def\ZJU@value@reviewersA{#1}}
\newcommand\reviewersB[1]{\def\ZJU@value@reviewersB{#1}}
\newcommand\reviewersC[1]{\def\ZJU@value@reviewersC{#1}}
\newcommand\reviewersD[1]{\def\ZJU@value@reviewersD{#1}}
\newcommand\reviewersE[1]{\def\ZJU@value@reviewersE{#1}}
\newcommand\SignautreDateA[3]{%
\def\ZJU@value@signaturedateAy{#1}
\def\ZJU@value@signaturedateAm{#2}
\def\ZJU@value@signaturedateAd{#3}}
\newcommand\SignautreDateB[3]{%
\def\ZJU@value@signaturedateBy{#1}
\def\ZJU@value@signaturedateBm{#2}
\def\ZJU@value@signaturedateBd{#3}}
\newcommand\SignautreDateC[3]{%
\def\ZJU@value@signaturedateCy{#1}
\def\ZJU@value@signaturedateCm{#2}
\def\ZJU@value@signaturedateCd{#3}}
\newcommand\PutsigndateA{%
ǩ�����ڣ�{\includegraphics[width=40pt,height=20pt]{./Signature/2022.pdf}}��
{\includegraphics[width=20pt,height=20pt]{./Signature/6.pdf}}��
{\includegraphics[width=20pt,height=20pt]{./Signature/7.pdf}}��
}
\newcommand\PutsigndateB{%
ǩ�����ڣ�{\includegraphics[width=40pt,height=20pt]{./Signature/2022.pdf}}��
{\includegraphics[width=20pt,height=20pt]{./Signature/6.pdf}}��
{\includegraphics[width=20pt,height=20pt]{./Signature/7.pdf}}��
}
\newcommand\PutsigndateC{%
ǩ�����ڣ�{\includegraphics[width=40pt,height=20pt]{./Signature/2022.pdf}}��
{\includegraphics[width=20pt,height=20pt]{./Signature/6.pdf}}��
{\includegraphics[width=20pt,height=20pt]{./Signature/7.pdf}}��
}
% ��������������
\newcommand\makeCoverPage{%
% �����ط�д���Ƿ����ϵķ�������ѧ�ţ������ֺſ��Ը���
\pagenumbering{alph}
\cleardoublepage
\thispagestyle{empty}
{
\songti\zihao{-4}
\linespread{1.3}
\begin{center}
{\hspace{2em}
\ZJU@label@classification~
\ZJUunderline[90pt]{\ZJU@value@classification}
\hfill
\ZJU@label@serialnumber~
\ZJUunderline[60pt]{\ZJU@value@serialnumber} \\
\vspace{3pt}
\ifx\ZJU@value@IsSecret\undefined
\else
\hspace{2em}
\ZJU@label@SecretLevel~
\ZJUunderline[90pt]{\ZJU@value@SecretLevel}
\fi
\hfill
\ZJU@label@PersonalID~
\ZJUunderline[60pt]{\ZJU@value@PersonalID}\\
}
% �����ߴ����Ը���
\vspace{10mm}
% �㽭��ѧ�ĸ���
\ifpdf
\includegraphics[width=60.3mm]{./CoverPagepic/ZJDX.pdf} \\
\else
\includegraphics[width=60.3mm]{./CoverPagepic/ZJDX.eps} \\
\fi
% �����ߴ����Ը���
\vspace{4mm}
%% \ZJU@value@school \\ \zihao{-1}
% ������ʿѧλ������def�ļ������У���Ȼ��tex�ļ��л����Ը���
\centerline{\songti \zihao{-1}{\ZJU@value@degree\ZJU@label@thesis} }
% �����ߴ����Ը���
\vspace{4mm}
% �����ط����������ձ�
\ifpdf
\includegraphics[width=22.8mm]{./CoverPagepic/QSY.pdf} \\
\else
\includegraphics[width=22.8mm]{./CoverPagepic/QSY.eps} \\
\fi
\end{center}
\vspace{2mm}
\begin{center}
% ������Ŀ�������ݣ�������
\begin{tabular}{rl}
{\bfseries\fangsong\zihao{3}\ZJU@label@title:}
&
\bfseries\fangsong\zihao{-2} \ZJUunderline[260pt]{\ZJU@value@title} \\[3mm]
&
% �����ط������ڶ��б������жϣ���������һ��д���£��еڶ�������ʾ����������ʾ
\ifx\ZJU@value@titletl\undefined
\hfil
\else
{\bfseries\fangsong\zihao{-2}\ZJUunderline[260pt]{\ZJU@value@titletl}}
\fi \\[4mm]
{\bfseries\fangsong\zihao{3}\ZJU@label@Etitle:}
&
{\bf\zihao{-3}\ZJUunderline[300pt]{\ZJU@value@Etitle}}\\[3mm]
&
%ͬ����Ӣ�ı����Ķ����жϣ�����һ��д���£��еڶ�����ʾ����������ʾ�ڶ���
\ifx\ZJU@value@Etitletl\undefined
\hfil
\else
{\bf\zihao{-3}\ZJUunderline[300pt]{\ZJU@value@Etitletl}}
\fi\\[2mm]
&
\ifx\ZJU@value@EtitletB\undefined
\hfil
\else
{\bf\zihao{-3}\ZJUunderline[300pt]{\ZJU@value@EtitletB}}
\fi\\
\end{tabular}
% ��������������
\vspace{6mm}
% �����������岻ͬ������������AB�����룬���������õ���array����
\newcolumntype{A}{>{\songti}r<{}}
\newcolumntype{B}{>{\fangsong}l<{}}
\zihao{4}
\begin{tabular}{A@{��}B}
\ZJU@label@author & \ZJUunderline[200pt]{\ZJU@value@author} \\[3mm]
\ZJU@label@supervisor & \ZJUunderline[200pt]{\ZJU@value@supervisor} \\[3mm]
% �ж���û�к�����ʦ
\ifx\ZJU@value@cpsupervisor\undefined
\else
\ZJU@label@cpsupervisor
\fi
&
\ifx\ZJU@value@cpsupervisor\undefined
\hfil\\[-7.7mm]
\else
\ZJUunderline[200pt]{\ZJU@value@cpsupervisor} \\[3mm]
\fi
\ZJU@label@major & \ZJUunderline[200pt]{\ZJU@value@major} \\[3mm]
\ZJU@label@researchdm & \ZJUunderline[200pt]{\ZJU@value@researchdm} \\[3mm]
\ZJU@label@institute & \ZJUunderline[200pt]{\ZJU@value@institute} \\
\end{tabular}
\end{center}
% �����ʵ��Ŀհ�
\vfill
% ����һ�� �����ύ����
\hfil{\bfseries\songti\zihao{-3}\hspace{4em}\ZJU@label@submitdate%
\ZJUunderline[150pt]{\ZJU@value@submitdate}}\hfil
}
}
%������������ҳ
\renewcommand\maketitle{%
\cleardoublepage
\thispagestyle{empty}
{
\linespread{1.3}
\begin{center}
% �Ȳ�������������Ŀ
{\bfseries\fangsong\zihao{-2}\ZJUunderline[340pt]{\ZJU@value@title}\\
\ifx\ZJU@value@titletl\undefined
\hfil\\
\else
\ZJUunderline[300pt]{\ZJU@value@titletl}\\
\fi}
% ����һ�ξ���
\vspace{12mm}
% ���������ձ�
\ifpdf
\includegraphics[width=22.8mm]{./CoverPagepic/QSY.pdf} \\
\else
\includegraphics[width=22.8mm]{./CoverPagepic/QSY.eps} \\
\fi
% �����հ�
\vspace{8mm}
{\bfseries\songti\zihao{3}
��������ǩ����
\ifpdf
\ZJUunderline[120pt]{\includegraphics[width=120pt,height=45pt]{./Signature/sign_ch2.pdf}}
\else
\ZJUunderline[120pt]{}
\fi
{\bfseries\songti\zihao{3}\textcolor{white}{��}}\\
% �����հ�
\vspace{3mm}
%\hfil\\
ָ����ʦǩ����}
\ifpdf
\ZJUunderline[120pt]{\includegraphics[width=120pt,height=45pt]{./Signature/sign_ch1.pdf}}
\else
\ZJUunderline[120pt]{}
\fi
{\bfseries\songti\zihao{3}\textcolor{white}{��}}\\
% �����հ�
\vspace{15mm}
% ��������Ϣ
\newcolumntype{A}{>{\songti\zihao{4}}r}
\newcolumntype{B}{>{\songti\zihao{4}}c}
\begin{tabular}{A@{��}B}
����������1 & \ZJUunderline[260pt]{\ZJU@value@reviewersA}\\[2.2mm]
������2 & \ZJUunderline[260pt]{\ZJU@value@reviewersB}\\[2.2mm]
������3 & \ZJUunderline[260pt]{\ZJU@value@reviewersC}\\[2.2mm]
������4 & \ZJUunderline[260pt]{\ZJU@value@reviewersD}\\[2.2mm]
������5 & \ZJUunderline[260pt]{\ZJU@value@reviewersE}\\
\end{tabular}
% ��һ�οհ�
\vspace{10mm}
% ����ίԱ������
\begin{tabular}{A@{��}B}
����ίԱ����ϯ & \ZJUunderline[320pt]{\ZJU@value@chairman}\\[2.2mm]
ίԱ1 & \ZJUunderline[320pt]{\ZJU@value@commissionerA}\\[2.2mm]
ίԱ2 & \ZJUunderline[320pt]{\ZJU@value@commissionerB}\\[2.2mm]
ίԱ3 & \ZJUunderline[320pt]{\ZJU@value@commissionerC}\\[2.2mm]
ίԱ4 & \ZJUunderline[320pt]{\ZJU@value@commissionerD}\\[2.2mm]
% ίԱ5 & \ZJUunderline[260pt]{\ZJU@value@commissionerE}\\
\end{tabular}
\end{center}
% ��һ�οɱ��հ�
\vfil
% ����ʱ��
{\songti\zihao{4}\hfill\ZJU@label@defenddate%
\ZJUunderline[150pt]{\ZJU@value@defenddate}\hspace{3em}}
}
}
% �����ط�������Ӣ�ı���ҳ
\newcommand\englishtitle[1]{\def\ZJU@value@englishtitle{#1}}
\newcommand\englishtitletl[1]{\def\ZJU@value@englishtitletl{#1}}
\newcommand\EreviewersA[1]{\def\ZJU@value@EreviewersA{#1}}
\newcommand\EreviewersB[1]{\def\ZJU@value@EreviewersB{#1}}
\newcommand\EreviewersC[1]{\def\ZJU@value@EreviewersC{#1}}
\newcommand\EreviewersD[1]{\def\ZJU@value@EreviewersD{#1}}
\newcommand\EreviewersE[1]{\def\ZJU@value@EreviewersE{#1}}
\newcommand\Echairman[1]{\def\ZJU@value@Echairman{#1}}
\newcommand\EcommissionerA[1]{\def\ZJU@value@EcommissionerA{#1}}
\newcommand\EcommissionerB[1]{\def\ZJU@value@EcommissionerB{#1}}
\newcommand\EcommissionerC[1]{\def\ZJU@value@EcommissionerC{#1}}
\newcommand\EcommissionerD[1]{\def\ZJU@value@EcommissionerD{#1}}
%\newcommand\EcommissionerE[1]{\def\ZJU@value@EcommissionerE{#1}}
\newcommand\makeenglishtitle{%
% ע������cleardoublepage���÷�
\cleardoublepage
\thispagestyle{empty}
{
\linespread{1.3}
\begin{center}
% Ӣ��������Ŀ
{\bf\zihao{-3}\ZJUunderline[400pt]{\ZJU@value@englishtitle}\\
\vspace{1ex}
% �ж�Ӣ�ı������ڶ���
\ifx\ZJU@value@englishtitletl\undefined
\hfil
\else
\ZJUunderline[360pt]{\ZJU@value@englishtitletl}
\fi}
% ����һ�οհ���
\vspace{7mm}
% ������
\ifpdf
\includegraphics[width=22.8mm]{./CoverPagepic/QSY.pdf} \\
\else
\includegraphics[width=22.8mm]{./CoverPagepic/QSY.eps} \\
\fi
% ����һ�οհ���
\vspace{1mm}
% ����Ӣ��ǩ��
{\bf\zihao{3}\hspace{1.7em}Author's signature:
\ifpdf
\ZJUunderline[120pt]{\includegraphics[width=120pt,height=45pt]{./Signature/sign_en2.pdf}}\\
\else
\ZJUunderline[120pt]{}
\fi
%\hfil\\
% ��ʦӢ��ǩ��
Supervisor's signature:
\ifpdf
\ZJUunderline[120pt]{\includegraphics[width=120pt,height=45pt]{./Signature/sign_en1.pdf}}\\
\else
\ZJUunderline[120pt]{}
\fi}
\end{center}
% ����һ�οհ�
\vspace{7mm}
\zihao{4}
% �����������б���Ӣ�ģ�
%\newcolumntype{A}{>{\zihao{4}}r}
%\newcolumntype{B}{>{\zihao{4}}c}
\begin{tabular}{rc}
External Reviewers: & \ZJUunderline[260pt]{\ZJU@value@EreviewersA}\\[1.2mm]
& \ZJUunderline[260pt]{\ZJU@value@EreviewersB}\\[1.2mm]
& \ZJUunderline[260pt]{\ZJU@value@EreviewersC}\\[1.2mm]
& \ZJUunderline[260pt]{\ZJU@value@EreviewersD}\\[1.2mm]
& \ZJUunderline[260pt]{\ZJU@value@EreviewersE}\\
\end{tabular}
% ����һ�οհ�
\vspace{6mm}
% ����ίԱ��������Ӣ�ģ�
~\\[1.2mm]
\hbox to 2.4em{}Examining Committee Chairperson:\\[1.2mm]
\hbox to 11.4em{}\ZJUunderline[260pt]{\ZJU@value@Echairman}\\[1.2mm]
\hbox to 2.4em{}Examining Committee Members:\\[1.2mm]
\hbox to 11.4em{}\ZJUunderline[260pt]{\ZJU@value@EcommissionerA}\\[1.2mm]
\hbox to 11.4em{}\ZJUunderline[260pt]{\ZJU@value@EcommissionerB}\\[1.2mm]
\hbox to 11.4em{}\ZJUunderline[260pt]{\ZJU@value@EcommissionerC}\\[1.2mm]
\hbox to 11.4em{}\ZJUunderline[260pt]{\ZJU@value@EcommissionerD}\\[1.2mm]
% \hbox to 11.4em{}\ZJUunderline[260pt]{\ZJU@value@EcommissionerE}\\
% ��һ�οհ�
\vfill
% ��������
{\hfill Date of oral defence: \ZJUunderline[150pt]{\ZJU@value@defenddateE}\hspace{3em}}
%{\hfill Date of oral defence:\ZJUunderline[150pt]{\ZJU@value@defenddateE}\hspace{3em}}
}
}
% ������������ȨЭ��ת��ҳ
\newcommand\makeOSandCPRTpage{%
\cleardoublepage
\thispagestyle{empty}
\input{./Chapters/Copyright.tex}
}
\newcommand\ZJUfrontmatter{%
\frontmatter
% ��������ǰ�IJ���ҳ����ʽΪ��д��������
\pagenumbering{Roman}
}
\newcommand\ZJUmainmatter{%
\mainmatter
}
\newcommand\ZJUbackmatter{%
\backmatter
}
% ��ҳüҳ�ĸ�ʽ����
% ÿһ��chapter��ʼ�ĵ�һҳ��ҳüҳ����ʽΪplain��ʽ
\fancypagestyle{plain}{%
\fancyhf{}% ��������ǰҳ����ҳüҳ�Ŷ��壬��fancyhdr���еĶ���
\renewcommand{\headrulewidth}{0pt}%
\renewcommand{\footrulewidth}{0pt}%
\if@twoside
\fancyfoot[RO]{\zihao{-5} ~\thepage~}
\fancyfoot[LE]{\zihao{-5} ~\thepage~}
\else
\fancyfoot[C]{\zihao{-5} ~\thepage~}
\fi
}
% L���� R���� O����ҳ Eż��ҳ
% һ��ҳ��ҳüҳ����ʽ
\pagestyle{fancy}
\fancyhf{} %fancyhfʵ����fancyhead��fancyfoot�ĺ��壬���IJ�����H��Fָ��
% �ֵ�˫���ж�ҳü������
\if@twoside
\fancyhead[CE]{\songti\zihao{-5}\ZJU@value@school\ZJU@value@degree\ZJU@label@thesis}
\fancyhead[CO]{\songti\zihao{-5}\leftmark}
\fancyfoot[RO]{\zihao{-5} ~\thepage~}
\fancyfoot[LE]{\zihao{-5} ~\thepage~}
\else
\fancyhead[L]{\songti\zihao{-5}\ZJU@value@school\ZJU@value@degree\ZJU@label@thesis}
\fancyhead[R]{\songti\zihao{-5}\leftmark}
\fancyfoot[C]{\zihao{-5} ~\thepage~}
\fi
% �����½ڱ�����ʽ
\CTEXsetup[name={,}]{chapter}
\CTEXsetup[number={\arabic{chapter}}]{chapter}
\CTEXsetup[format={\noindent}]{chapter}
\CTEXsetup[nameformat={\bfseries\zihao{-3}}]{chapter}
\CTEXsetup[titleformat={\bfseries\fangsong\zihao{-3}}]{chapter}
\CTEXsetup[format={\noindent}]{section}
\CTEXsetup[nameformat={\bfseries\zihao{4}}]{section}
\CTEXsetup[titleformat={\bfseries\fangsong\zihao{4}}]{section}
\CTEXsetup[format={\noindent}]{subsection}
\CTEXsetup[nameformat={\bfseries\zihao{-4}}]{subsection}
\CTEXsetup[titleformat={\bfseries\fangsong\zihao{-4}}]{subsection}
\CTEXsetup[format={\noindent}]{subsubsection}
\CTEXsetup[nameformat={\bfseries\zihao{-4}}]{subsubsection}
\CTEXsetup[titleformat={\bfseries\fangsong\zihao{-4}}]{subsubsection}
% �˴��½ڱ���ǰ���հ���������Ĭ�����ã����������ο�ctex�ο��ĵ�ctex.pdf
% ���IJ������ֵ��о�����
\linespread{1.5}
% ȥ��Ŀ¼�еĿո��ַ�
\addtocontents{toc}{\let\string\CTEX@spaceChar\relax}
% ���ø��������IJ���
\setcounter{topnumber}{4}
\setcounter{totalnumber}{5}
\setlength{\floatsep}{8pt plus 3pt minus 2pt}
\setlength{\textfloatsep}{8pt plus 2pt minus 4pt}
\setlength{\intextsep}{8pt plus 3pt minus 2pt}
% ������
\newenvironment{corrigenda}
{\Nchapter{\ZJU@label@corrigenda}}
{}
% ��л
\renewenvironment{thanks}
{\Nchapter{\ZJU@label@thanks}}
{}
% ����
\newenvironment{preface}
{\Nchapter{\ZJU@label@preface}}
{}
% ժҪ
\newenvironment{abstract}
{\Nchapter{\ZJU@label@abstract}}
{}
%�ؼ���
\newcommand\keywords[1]{%
\vspace{2ex}\noindent{\heiti \ZJU@label@keywords} #1}
%Ӣ��ժҪ
\newenvironment{englishabstract}
{\Nchapter{\ZJU@label@englishabstract}}
{}
%Ӣ�Ĺؼ���
\newcommand\englishkeywords[1]{%
\vspace{2ex}\noindent{\bf \ZJU@label@englishkeywords} #1}
% ����Ŀ¼�������г�Ŀ�Σ�
\newcommand\ZJUcontents{%
% ��Ŀ¼�ĸ�ʽ
\renewcommand{\cftchapfont}{\fangsong\zihao{-4}}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdot}}
\renewcommand{\cftchapdotsep}{\cftdotsep}
\renewcommand{\cftchappagefont}{\rm\zihao{-4}}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdot}}
\renewcommand{\cftsecdotsep}{\cftdotsep}
\renewcommand{\cftsecfont}{\fangsong\zihao{-4}}
\renewcommand{\cftsecpagefont}{\rm\zihao{-4}}
\renewcommand{\cftsubsecleader}{\cftdotfill{\cftdot}}
\renewcommand{\cftsubsecdotsep}{\cftdotsep}
\renewcommand{\cftsubsecfont}{\fangsong\zihao{-4}}
\renewcommand{\cftsubsecpagefont}{\rm\zihao{-4}}
\setlength{\cftbeforechapskip}{-2pt}
\setlength{\cftbeforesecskip}{-2pt}
\setlength{\cftbeforesubsecskip}{-2pt}
\setlength{\cftsecindent}{2em}
\setlength{\cftsubsecindent}{4em}
\setcounter{tocdepth}{2}
\addtocontents{toc}{\cftpagenumbersoff{chapter}}
\tableofcontents
\addtocontents{toc}{\cftpagenumberson{chapter}}
}
% ��ͼĿ¼
\newcommand\ZJUListofFigures{%
\renewcommand{\cftfigfont}{\fangsong\zihao{-4}}
\renewcommand{\cftfigleader}{\cftdotfill{\cftdot}}
\renewcommand{\cftfigdotsep}{\cftdotsep}
\renewcommand{\cftfigpagefont}{\rm\zihao{-4}}
\setlength{\cftbeforefigskip}{-2pt}
\listoffigures
}
% ����Ŀ¼
\newcommand\ZJUListofTables{%
\renewcommand{\cfttabfont}{\fangsong\zihao{-4}}
\renewcommand{\cfttableader}{\cftdotfill{\cftdot}}
\renewcommand{\cfttabdotsep}{\cftdotsep}
\renewcommand{\cfttabpagefont}{\rm\zihao{-4}}
\setlength{\cftbeforetabskip}{-2pt}
\listoftables
}
% ��д�������嵥��������
\newenvironment{ListofSymbol}
{\Nchapter{\ZJU@label@symbol}}
{}
% �ο����ײ���
\DeclareRobustCommand\citenum
{\begingroup
\NAT@swatrue\let\NAT@ctype\z@\NAT@parfalse\let\textsuperscript\relax
\NAT@citexnum[][]}
\newcommand\ZJUthesisbib[1]{%
\setcitestyle{numbers, round, comma, aysep={}, yysep={,}, notesep={,}}
\setlength{\bibsep}{0.5ex}
\setlength{\bibhang}{2em}
\renewcommand{\bibfont}{\fangsong\zihao{5}}
\bibliographystyle{ZJUthesis}
\bibliography{#1}
}
\makeindex
% ����
\newcommand\ZJUindex{%
\cleardoublepage
% ������һ����������������ǩλ�ô���
\phantomsection
\printindex
}
% ������
\newenvironment{resume}
{\Nchapter{\ZJU@label@resume}}
{}
% ��������Ŀ¼
\newenvironment{publications}
{\Nchapter{\ZJU@label@publications}}
{}
% 2006����ģ����δʹ�õ�������
\newenvironment{resumesection}[1]
{{\noindent\normalfont\bfseries #1}
\list{}{\labelwidth\z@
\leftmargin 2\ccwd}
\item\relax}
{\endlist}
\newenvironment{resumelist}[1]
{{\noindent\normalfont\bfseries #1}
\list{}{\labelwidth\z@
\leftmargin 4\ccwd
\itemindent -2\ccwd
\listparindent\itemindent}
\item\relax}
{\endlist}
\def\reflect#1{{\setbox0=\hbox{#1}\rlap{\kern0.5\wd0
\special{x:gsave}\special{x:scale -1 1}}\box0 \special{x:grestore}}}
\def\XeTeX{\leavevmode
\setbox0=\hbox{X\lower.5ex\hbox{\kern-.15em\reflect{E}}\kern-.1667em \TeX}%
\dp0=0pt\ht0=0pt\box0 }
% ������ʾ��4������ chapter section subsection subsubsection�����ʵ���С
\setcounter{secnumdepth}{4}
\newtheoremstyle{break}% name
{}% Space above, empty = `usual value'
{}% Space below
{\itshape}% Body font
{}% Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}% Punctuation after thm head
{\newline}% Space after thm head: \newline = linebreak
{}% Thm head spec
\endinput
%%
%% End of file `ZJUthesis.cls'.
```
Please give me suggestion to run the code successfully.
|
https://tex.stackexchange.com/users/301139
|
LaTeX Compile Error due to CJK error
| false |
Since you haven't provided an MWE, I'm gonna give my solution for Chinese documents for your reference.
I use `\documentclass{ctexbook}` that is basically Chinese `\documentclass{book}`. You could switch to `ctexart` for article, etc. There is no need for explicitly including CJK.
ctex classes force you to compile in XeLaTeX. The tex files should be encoded in UTF-8.
I use TeXLive. For whatever reason, if you can't install it, then you have a few alternatives.
* Use online services such as Overleaf, or its Chinese counterpart, TeXPage. Note that they have a runtime limit which, if you have a lot of figures in your thesis, could be exceeded, in which case you need to pay for a premium. GitHub workflow has a much longer time cap for a single compilation. It does have a 2000 minute cap for a month but that should be long enough.
* Uninstall and re-install MikTeX.
|
0
|
https://tex.stackexchange.com/users/199226
|
691783
| 320,902 |
https://tex.stackexchange.com/questions/691742
|
4
|
Running `latex` from the current Debian stable on
```
\documentclass[british]{article}
\usepackage[british]{babel}
\begin{document}
\showhyphens{memorandum}
\end{document}
```
yields
```
mem-o-ran-dum
```
At the same time, <https://www.ushuaia.pl/hyphen/?ln=en>, which is, using its own words, “based on TeX system”, says
```
memor•andum
```
when choosing English (GB). This was also the hyphenation point in a text of mine as of May 2023 using one of my TeX installations (which is now gone, alas); the hyphenation has apparently changed in some direction.
These two hyphenation patterns have no common hyphenation point; at least one of them is probably very wrong. The 5th, 6th, 7th, and 9th printed editions of *Oxford Advanced Learner's Dictionary of Current English* by A S Hornby say
```
memo•ran•dum
```
The *New Oxford Spelling Dictionary, The Writers' and Editors' Guide to Spelling and Word Division* by Maurice Waite, 2005, ISBN 0-19-860881-0, ISBN 978-0-19-860881-3 (cf. an [online library](http://archive.org/details/newoxfordspellin0000unse_n6f1/page/313/mode/1up)), says on page 313,
```
memo|ran¦dum
memo|randa
memo|ran¦dums
```
The bar | is a primary division point (“at which a word can be divided under almost any circumstances”) and the broken bar is a secondary division point (“at which a word is best divided only if absolutely necessary […]”); cf. [page x](http://archive.org/details/newoxfordspellin0000unse_n6f1/page/n13/mode/1up). Other words in the dictionary may have more than one primary or secondary division point, so it's a matter of taste or convention of what to do with this distinction in (La)TeX, and the word list should be interpreted according to the guide at the start of the book anyway.
Being a non-native speaker, I can only suggest that the version from the spelling-and-word-division dictionary is probably authoritative; cf. <http://comp.text.tex.narkive.com/9kbsxiTL/british-english-hyphenation#post3>.
I have access neither to the most recent edition of the aforementioned dictionary nor to *The Oxford minidictionary of spelling and word division*. I also don't have access to the data in <https://www.oed.com/dictionary/memorandum_int>, as they are behind a paywall. If anyone has access and would like to confirm/refute using these sources, please yell.
I kindly ask the British native speakers among you to double-check and, if necessary, adjust or suggest adjusting the UK-hyphenation patterns.
An e-mail concerning the issue has been sent to the maintainers of ushuaia.pl. Hyph-utf8 has received an [issue report](https://github.com/hyphenation/tex-hyphen/issues/59), too.
|
https://tex.stackexchange.com/users/292998
|
On TeX hyphenating “memorandum” in British English
| false |
It might surprise a non-native speaker of English, but hyphenation is not a skill that is normally taught at school! In handwriting one should only break lines at the end of words, and when word processing, you would allow the software to handle line breaks. Hyphenation is part of the typesetter's skill.
Dictionaries sometimes show the division of words into syllables, but these can only be a guide to where a good hyphenation point might be.
In this particular word, you can split at syllables mem-o-ran-dum, or (noting that "memo" is common abbreviation, so it would be nice not to split it) "memo-ran-dum". Or you can look up the Latin word and note that is formed from the root *"memor"*, via the verb *"memorare"* with *"-andum"* being a gerundive verb ending. And split the word following the Latin: "memor-andum".
It's impossible to say which is right, it is matter of judgement. All three hyphenation patters are acceptable to me as a (fairly picky) native speaker. And fortunately, native speakers are rather flexible at dealing with a few words that have been hyphenated poorly. More problematic is *too many* hyphens.
Generally then, let the typesetter do its job. It might, on rare occasions, make a mistake when hyphenating, but most native speakers simply won't notice.
|
4
|
https://tex.stackexchange.com/users/38202
|
691784
| 320,903 |
https://tex.stackexchange.com/questions/691788
|
2
|
I am using the following example from tex stack to crate a PDF-page with a picture centered over a page: [Image on full slide in beamer package](https://tex.stackexchange.com/questions/3915/image-on-full-slide-in-beamer-package)
The code I use from the example is this one:
```
\documentclass{beamer}
\title{test of full size graphic}
\usepackage{tikz}
\usetheme{AnnArbor}
\begin{document}
\begin{frame}
\maketitle
Notice the fancy presentation theme.
\end{frame}
{ % all template changes are local to this group.
\setbeamertemplate{navigation symbols}{}
\begin{frame}<article:0>[plain]
\begin{tikzpicture}[remember picture,overlay]
\node[at=(current page.center)] {
\includegraphics[keepaspectratio,
width=\paperwidth,
height=\paperheight]{yourimage}
};
\end{tikzpicture}
\end{frame}
}
\begin{frame}
symbols should be back now
\end{frame}
\end{document}
```
However, I want to add a frametitle to the page like this:
```
\begin{frame}{Some random data that I use and want to describe (yearly)}
```
When I do that the picture that I insert centres vertically over the page, not considering that there now is a frametitle to consider. The image thus overlays part of the frametitle. Can I use some code to make the image vertically center over the page considering the space required for the frametitle? That is, centring it over the white space on the page.
|
https://tex.stackexchange.com/users/297946
|
Image on full slide considering a frametitle
| true |
Instead of manually positioning the image, you could let beamer do its job:
```
\documentclass{beamer}
\title{test of full size graphic}
\usepackage{tikz}
\usetheme{AnnArbor}
\begin{document}
\begin{frame}
\maketitle
Notice the fancy presentation theme.
\end{frame}
{ % all template changes are local to this group.
\setbeamertemplate{navigation symbols}{}
\begin{frame}<article:0>[plain]
\frametitle{Some random data that I use and want to describe (yearly)}
\begin{columns}
\begin{column}{\paperwidth}
\includegraphics[
keepaspectratio,
width=\paperwidth,
height=\paperheight]{example-image-duck}
\end{column}
\end{columns}
\end{frame}
}
\begin{frame}
symbols should be back now
\end{frame}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/36296
|
691790
| 320,905 |
https://tex.stackexchange.com/questions/3915
|
131
|
I would like to make a slide of only one image without any borders or any other beamer specific element.
I tried :
```
\begin{frame}[plain]
\includegraphics[keepaspectratio=true,width=1\paperwidth]{kernel-panic.png}
\end{frame}
```
But I still get a border on the left, top and bottom.
Later edit: `width=1.2\paperwidth` seems to remove top and bottom borders. I still have a left border and some navigation elements on bottom right.
|
https://tex.stackexchange.com/users/1412
|
Image on full slide in beamer package
| false |
One could use the fact that beamer columns remove the normal text margins:
```
\documentclass{beamer}
\begin{document}
\begin{frame}[plain]
\begin{columns}
\begin{column}{\paperwidth}
\includegraphics[height=\paperheight,width=\paperwidth]{example-image-duck}
\end{column}
\end{columns}
\end{frame}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/36296
|
691791
| 320,906 |
https://tex.stackexchange.com/questions/691793
|
1
|
I'm trying to make a table with the following characteristics:
* Able to break across pages
* With right alignment of second column
* Able to adjust line spacing
I've tried longtable and multicol but I can't make these work together. I've put an example of what I mean, but this does not enable me to tighten that line spacing or right align the second column. It's not practical to break the data into separate columns, given its volume.
```
\documentclass[a4paper]{article}
\usepackage{scrextend}
\usepackage{multicol}
\begin{document}
\begin{multicols}{3}
\begin{labeling}{0000}
\item [5058] KS0-08
\item [5067] K50-50
\item [5085] K7T-T5
\item [509S] KT7-50
\item [XS04] KSS-S6
\item [XS04] K7-57
\item [XSU5] K4S-64
\item [XSU7] KT4-S8
\item [XSU8] KT4-50
\item [XS68] KSS-84
\item [XS8S] K8-79
\item [XS9S] KT5-50
\item [XS9U] KS6-45
\item [XT0S] KS0-50
\item [XT08] KST4-76
\item [XTSU] K45-45
\item [XTS5] K47-50
\item [XTS6] K90-50
\item [XTS7] K60-50
\item [XTT0] K40-50
\item [XTTU] K40-50
\item [XTT4] KSTT-50
\item [XTT5] K67-TS
\item [XTT6] KT5-50
\item [XTT7] K9-06
\item [XTT8] K56-50
\item [XTT9] K94-50
\item [XTU0] KS69-T8
\item [XTUS] KU8U-S0
\item [XTUT] K7U-80
\item [XTUU] KST0-66
\item [XTU4] K457-U5
\item [XTU5] K79-4U
\item [XTU6] KT4-50
\item [XTU7] K45-50
\item [XTU8] KS04-T6
\item [XTU9] KT50-90
\item [XT40] KUT-99
\item [XT4S] KS9S-T0
\item [XT4T] KS79-T5
\item [XT4U] KU06-TT
\item [XT44] KUS-0T
\item [XT45] KU5-50
\item [XT46] KTT-4S
\item [XT47] KT5-86
\item [XT48] KT04-50
\item [XT49] K50-50
\item [XT50] K60-5T
\item [XT5S] KT50-50
\item [XT5T] K9T-45
\item [XT5U] K50-50
\item [XT54] KTT-50
\item [XT50] KS6-50
\item [XT56] KSU9-S9
\item [XT57] K50-50
\item [XT58] K70-50
\item [XT59] K80-50
\item [XT6S] K45-04
\item [XT6T] K7U-UT
\item [XT6U] K9S-66
\item [XT64] KS46-64
\item [XT65] KU4-9T
\item [XT66] KU9-97
\item [XT67] K7S-U0
\item [XT68] K96-50
\item [XT69] KT5-50
\item [XT70] KU0-50
\item [XT7S] K90-50
\item [XT7T] K70-50
\item [XT7U] K70-50
\item [XT74] KST0-50
\item [XT75] KT90-50
\item [XT76] KT5-50
\item [XT77] KSU-49
\item [XT78] K4T-75
\item [XT79] K95-50
\item [XT80] KS95-50
\item [XT8S] K50-50
\item [XT8T] KS85-50
\item [XT8U] KU0-50
\item [XT84] KUT-UU
\item [XT85] KS50-50
\item [XT86] KU5-50
\item [XT87] K77-50
\item [XT88] K56-50
\item [XT89] K90-50
\item [XT90] K50-50
\item [XT9S] K50-50
\item [XT9T] KS99-89
\item [XT9U] KT70-50
\item [XT94] KTS-75
\item [XT95] KTS-75
\item [XT96] KU5-50
\item [XT97] K45-50
\item [XT98] K50-50
\item [XU50] K50-50
\item [XU0S] KU0-50
\item [XU0T] K85-50
\item [XU0U] K65-50
\item [XU04] KUS-0S
\item [XU05] K99-T0
\item [XU06] K50-80
\item [XU07] K49-60
\item [XU08] K4U-40
\item [XU09] KUS-50
\item [XUS0] KUS-50
\item [XUSS] K68-T0
\item [XUST] KT4-80
\item [XUSU] K45-50
\item [XUS4] K50-50
\item [XUS5] KST0-50
\item [XUS6] KT0-50
\item [XUS7] K40-50
\item [XUS8] KS7U-60
\item [XU44] KS0-UU
\item [XU45] KS0-UU
\item [XU47] KS0-UU
\item [XU49] K68-T0
\item [XU50] KS48-80
\item [XU5S] K74-40
\item [XU5T] KU7-T0
\item [XU5U] KU7-T0
\end{labeling}
\end{multicols}
\end{document}
```
|
https://tex.stackexchange.com/users/36728
|
Long table over several pages with right alignment and multiple columns
| true |
This would be easier if `\labelsep` were outside the label box and `\leftmargin` did not also position the label box.
```
\documentclass[a4paper]{article}
\usepackage{scrextend}
\usepackage{multicol}
\usepackage{showframe}
\makeatletter
\renewenvironment{labeling}[2][]{%
\def\sc@septext{#1}%
\list{}{\settowidth{\labelwidth}{{%
\usekomafont{labelinglabel}{#2%
\usekomafont{labelingseparator}{\sc@septext}}%
}}%
\leftmargin\labelwidth \advance\leftmargin by \labelsep
\let\makelabel\labelinglabel
\let\normal@item=\@item% added
\renewcommand{\@item}[1][]{\normal@item[##1]\hfill}% added
}%
}{%
\endlist
}
\makeatother
\begin{document}
\begin{multicols}{3}
\begin{labeling}{0000}
\item [5058] KS0-08
\item [5067] K50-50
\item [5085] K7T-T5
\item [509S] KT7-50
\item [XS04] KSS-S6
\item [XS04] K7-57
\item [XSU5] K4S-64
\item [XSU7] KT4-S8
\item [XSU8] KT4-50
\item [XS68] KSS-84
\item [XS8S] K8-79
\item [XS9S] KT5-50
\item [XS9U] KS6-45
\item [XT0S] KS0-50
\item [XT08] KST4-76
\item [XTSU] K45-45
\item [XTS5] K47-50
\item [XTS6] K90-50
\item [XTS7] K60-50
\item [XTT0] K40-50
\item [XTTU] K40-50
\item [XTT4] KSTT-50
\item [XTT5] K67-TS
\item [XTT6] KT5-50
\item [XTT7] K9-06
\item [XTT8] K56-50
\item [XTT9] K94-50
\item [XTU0] KS69-T8
\item [XTUS] KU8U-S0
\item [XTUT] K7U-80
\item [XTUU] KST0-66
\item [XTU4] K457-U5
\item [XTU5] K79-4U
\item [XTU6] KT4-50
\item [XTU7] K45-50
\item [XTU8] KS04-T6
\item [XTU9] KT50-90
\item [XT40] KUT-99
\item [XT4S] KS9S-T0
\item [XT4T] KS79-T5
\item [XT4U] KU06-TT
\item [XT44] KUS-0T
\item [XT45] KU5-50
\item [XT46] KTT-4S
\item [XT47] KT5-86
\item [XT48] KT04-50
\item [XT49] K50-50
\item [XT50] K60-5T
\item [XT5S] KT50-50
\item [XT5T] K9T-45
\item [XT5U] K50-50
\item [XT54] KTT-50
\item [XT50] KS6-50
\item [XT56] KSU9-S9
\item [XT57] K50-50
\item [XT58] K70-50
\item [XT59] K80-50
\item [XT6S] K45-04
\item [XT6T] K7U-UT
\item [XT6U] K9S-66
\item [XT64] KS46-64
\item [XT65] KU4-9T
\item [XT66] KU9-97
\item [XT67] K7S-U0
\item [XT68] K96-50
\item [XT69] KT5-50
\item [XT70] KU0-50
\item [XT7S] K90-50
\item [XT7T] K70-50
\item [XT7U] K70-50
\item [XT74] KST0-50
\item [XT75] KT90-50
\item [XT76] KT5-50
\item [XT77] KSU-49
\item [XT78] K4T-75
\item [XT79] K95-50
\item [XT80] KS95-50
\item [XT8S] K50-50
\item [XT8T] KS85-50
\item [XT8U] KU0-50
\item [XT84] KUT-UU
\item [XT85] KS50-50
\item [XT86] KU5-50
\item [XT87] K77-50
\item [XT88] K56-50
\item [XT89] K90-50
\item [XT90] K50-50
\item [XT9S] K50-50
\item [XT9T] KS99-89
\item [XT9U] KT70-50
\item [XT94] KTS-75
\item [XT95] KTS-75
\item [XT96] KU5-50
\item [XT97] K45-50
\item [XT98] K50-50
\item [XU50] K50-50
\item [XU0S] KU0-50
\item [XU0T] K85-50
\item [XU0U] K65-50
\item [XU04] KUS-0S
\item [XU05] K99-T0
\item [XU06] K50-80
\item [XU07] K49-60
\item [XU08] K4U-40
\item [XU09] KUS-50
\item [XUS0] KUS-50
\item [XUSS] K68-T0
\item [XUST] KT4-80
\item [XUSU] K45-50
\item [XUS4] K50-50
\item [XUS5] KST0-50
\item [XUS6] KT0-50
\item [XUS7] K40-50
\item [XUS8] KS7U-60
\item [XU44] KS0-UU
\item [XU45] KS0-UU
\item [XU47] KS0-UU
\item [XU49] K68-T0
\item [XU50] KS48-80
\item [XU5S] K74-40
\item [XU5T] KU7-T0
\item [XU5U] KU7-T0
\end{labeling}
\end{multicols}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/34505
|
691797
| 320,909 |
https://tex.stackexchange.com/questions/662316
|
2
|
I've defined a `tcbtheorem` (using `\newtcbtheorem`}, and use `\tcblistof` to create a "List of Theorems", similar to List of Figures and List of Tables. All pretty standard.
The list that comes out is fine, except that the horizontal space between the theorem identifier and its short title is too small. How can this be increased/edited?
For comparison, this space can be changed for the standard List of Figures using this command, using the `tocloft` package:
```
\setlength{\cftfignumwidth}{3em}
```
So I'm looking to do the same, but now for the list generated by `\tcblistof`
This issue:
[Horizontal spacing in tcblistof (from tcolorbox)](https://tex.stackexchange.com/questions/618572/horizontal-spacing-in-tcblistof-from-tcolorbox)
is related, but only considers `tcblistings`, which seems to be different.
|
https://tex.stackexchange.com/users/283208
|
\tcblistof: How to change horizontal spacing in generated list of theorem
| false |
I was facing the same issue and after a bit of searching, and based on [this existing answer](https://tex.stackexchange.com/questions/217489/numbering-tcolorbox-toc), this is what I put together with:
```
\documentclass{article}
\usepackage[skins]{tcolorbox}
\makeatletter
% no indent for entries
\renewcommand{\l@tcolorbox}{\@dottedtocline{1}{0pt}{2.3em}}
\makeatother
\newtcolorbox[list inside=remarkblocks]{remarkblock}[1]
{ enhanced
, colframe=red!15!lightgray
, colback=red!50!gray!5
, fonttitle=\bfseries
, title=#1
, list entry=#1
}
\usepackage{lipsum}
\begin{document}
\begin{remarkblock}{A first remark}
\lipsum[1]
\end{remarkblock}
\begin{remarkblock}{A second remark}
\lipsum[1]
\end{remarkblock}
\tcblistof[\section*]{remarkblocks}{List of remarks}
\end{document}
```
and this is the result:
|
0
|
https://tex.stackexchange.com/users/26482
|
691802
| 320,911 |
https://tex.stackexchange.com/questions/691796
|
0
|
This question is related to [Execute list of commands generated by pairing elements from two \clist s or \seq s](https://tex.stackexchange.com/questions/691745/execute-list-of-commands-generated-by-pairing-elements-from-two-clist-s-or-seq/691747?noredirect=1#comment1716526_691747).
I am trying to perform a sequence of commands of the form
`\def\alpha {^^^^03b1}`
with `\seq_\map_pairwise_function:ccN`. I would prefer to pass in arguments in the form `"03B1` rather than `^^^^03b1` and I think I have figured out how to do that. This code appears to function correctly.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{nopageno}
\newfontfamily\mathematica{Mathematica}[%
NFSSFamily=mathematica,Scale=MatchUppercase,%
Extension=.ttf,%
UprightFont=*,%
BoldFont=*-Bold]
\DeclareSymbolFont{wm}{TU}{mathematica}{m}{n}
\DeclareSymbolFont{wmb}{TU}{mathematica}{b}{n}
\ExplSyntaxOn
\Umathcode"03B1 = 0 \symwm "003B1
\Umathcode"03B2 = 0 \symwm "003B2
\NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:cpn {#1} {\codepoint_generate:nn{#2}{11}}}
\mapcommandfunction{alphatwo}{"03B1}
\mapcommandfunction{beta}{"03B2}
\ExplSyntaxOff
\begin{document}
$$\alphatwo\beta$$
\end{document}
```
(substitute your font of choice). But if I replace the code between `\ExplSyntaxOn` and `\ExplSyntaxOff` with
```
\Umathcode"03B1 = 0 \symwm "003B1
\Umathcode"03B2 = 0 \symwm "003B2
\NewDocumentCommand{\mapcommands}{mm}
{
\seq_set_from_clist:cc {cmds}{#1}
\seq_set_from_clist:cc {chars}{#2}
\seq_map_pairwise_function:ccN{cmds}{chars}{\mapcommandfunction}
}
\NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:cpn {#1} {\codepoint_generate:nn{#2}{11}}}
\mapcommands{alphatwo,beta}{"03B1,"03B2}
```
I get the error shown in the title. I have no idea what I am doing wrong or how to discover it. More specifically, I get
```
! Missing \endcsname inserted.
<to be read again>
\alphatwo,beta
l.27 \mapcommands{alphatwo,beta}{"03B1,"03B2}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
```
How do I fix this?
|
https://tex.stackexchange.com/users/224317
|
! Missing \endcsname inserted error when using \seq_map_pairwise_function:ccN
| true |
You need to watch the argument specifications to control expansion.
The first version works but defines
```
> \alphatwo=\long macro:
->\codepoint_generate:nn {"03B1}{11}.
l.22 \show\alphatwo
```
so the codepoint lookup happens every time it is used.
If you use `\cs_set:cpx` the lookup happens just once:
```
> \alphatwo=\long macro:
->α.
l.22 \show\alphatwo
```
Personally I would have used `\cs_set:Npx` and used a syntax
```
\mapcommandfunction\alphatwo{"03B1}
```
as I don't see any advantage in using a name here rather than the token directly.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{nopageno}
\newfontfamily\mathematica[NFSSFamily=mathematica]{STIX Two Math}%
\DeclareSymbolFont{wm}{TU}{mathematica}{m}{n}
\DeclareSymbolFont{wmb}{TU}{mathematica}{b}{n}
\ExplSyntaxOn
\Umathcode"03B1 = 0 \symwm "003B1
\Umathcode"03B2 = 0 \symwm "003B2
\NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:Npx #1 {\codepoint_generate:nn{#2}{11}}}
\mapcommandfunction\alphatwo{"03B1}
\mapcommandfunction\beta{"03B2}
\ExplSyntaxOff
\show\alphatwo
\begin{document}
$$\alphatwo\beta$$
\end{document}
```
Similarly in the second version
`\seq_map_pairwise_function:ccN`
an `N` should be a single token so `\mapcommandfunction` not `{\mapcommandfunction}` although an expl3 name would be more idiomatic.
`\seq_set_from_clist:cc` the second `c` makes a csname from the whole of `#1` so it is never used as a list.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{nopageno}
\newfontfamily\mathematica[NFSSFamily=mathematica]{STIX Two Math}%
\DeclareSymbolFont{wm}{TU}{mathematica}{m}{n}
\DeclareSymbolFont{wmb}{TU}{mathematica}{b}{n}
\ExplSyntaxOn
\Umathcode"03B1 = 0 \symwm "003B1
\Umathcode"03B2 = 0 \symwm "003B2
\NewDocumentCommand{\mapcommands}{mm}
{
\seq_set_from_clist:Nn\l_cmds{#1}
\seq_set_from_clist:Nn\l_chars{#2}
\seq_map_pairwise_function:NNN\l_cmds\l_chars\mapcommandfunction
}
\NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:Npx #1 {\codepoint_generate:nn{#2}{11}}}
\mapcommands{\alphatwo,\beta}{"03B1,"03B2}
\ExplSyntaxOff
\show\alphatwo
\begin{document}
$$\alphatwo\beta$$
\end{document}
```
|
3
|
https://tex.stackexchange.com/users/1090
|
691806
| 320,914 |
https://tex.stackexchange.com/questions/691488
|
1
|
In the XML file `cross-links` are not expended like **2–5** and final latex should be **\citep{B2,B3,B4,B5}**.
Any Number should expend in all the `cross-links` like, if XML coded as **11–18** it should be convert to **\citep{B11,B12,B13,B14,B15,B16,B17,B18}** (beginning to end). How to get the expected result using `LuaLaTeX`?
My XML is:
```
\documentclass{article}
\usepackage{luacode}
\begin{document}
\begin{luacode*}
local domobject = require "luaxml-domobject"
local transform = require "luaxml-transform"
sample = [[
<?xml version="1.0" encoding="utf-8"?>
<art>
<title>Scattering of flexural waves an electric current</title>
<para>Smart testing structures are $a+b$ components Reduce acoustic noise used in engineering applications that are capable of sensing or reacting to their environment change <?LuaLaTeX Sample XXX1?> their mechanical properties. in a predictable and desired manner. In addition to carrying mechanical loads, <?LuaLaTeX \hspace*{12pt}Abc?> alleviate vibration, reduce acoustic noise, change their mechanical properties as required or monitor their own condition.</para>
<para>The first <xref ref-type="section" rid="Sec1">Section 1</xref> description and correlation between gait impairment and hydrocephalus were made in 1965 by Hakim and Adam (<xref ref-type="bibr" rid="B1">1</xref>). The etiology of idiopathic normal pressure hydrocephalus (iNPH) has not yet been entirely understood (<xref ref-type="bibr" rid="B2">2</xref>–<xref ref-type="bibr" rid="B5">5</xref>). In elderly patients, other conditions such as spinal canal stenosis, Parkinson's disease, and polyneuropathy may influence the gait negatively.</para>
</art>]]
local dom = domobject.parse(sample)
local function process_instructions(el)
for _, child in ipairs(el:get_children()) do
local ntype = child:get_node_type()
if ntype == "PI" and child._name=="LuaLaTeX" then
local text = child._attr[ "_text" ]
local newel = el:create_element("lualatex-instruction", {text = text})
child:replace_node(newel)
end
if child:is_element() then
process_instructions(child)
end
end
end
process_instructions(dom:root_node())
local transformer = transform.new()
transformer:add_action("title", "\\section{@<.>}")
transformer:add_action("para", "@<.>\\par")
-- handle the processing instruction
transformer:add_custom_action("lualatex-instruction",
function(el)
return el:get_attribute("text")
end)
transform.print_tex(transformer:process_dom(dom))
\end{luacode*}
\end{document}
```
I have expected output LaTeX file is:
```
Smart testing structures are $a+b$ components Reduce acoustic noise used in
engineering applications that are capable of sensing or reacting to their environment change Sample XXX1 their mechanical properties. in a predictable
and desired manner. In addition to carrying mechanical loads,
Abc alleviate
vibration, reduce acoustic noise, change their mechanical properties as required
or monitor their own condition.
The first Section 1 description and correlation between gait impairment and
hydrocephalus were made in 1965 by Hakim and Adam (**\citep{B1}**). The etiology of idio-
pathic normal pressure hydrocephalus (iNPH) has not yet been entirely under-
stood (**\citep{B2,B3,B4,B5}**). In elderly patients, other conditions such as spinal canal stenosis,
Parkinson’s disease, and polyneuropathy may influence the gait negatively.
```
|
https://tex.stackexchange.com/users/17075
|
BIBR expend as per Input XML using LuaLaTeX
| true |
So if I understand it correctly, you don't have the numbers that you want to expand explicitly stated as attributes of the `xref` element, but rather encoded as two separate `xref` elements:
```
<xref ref-type="bibr" rid="B2">2</xref>–<xref ref-type="bibr" rid="B5">5</xref>
```
I don't think it is a good idea, but we can try anyway. In this case, you will need some pre-processing of the DOM to detect these cases and convert them to something that can be used in the tranformer library. This code should do that:
```
-- try to find <xref> followed by dash and another <xref>
-- we then expand rid attributes
for _, xref in ipairs(dom:query_selector("xref[ref-type='bibr']")) do
local first = xref:get_sibling_node(1)
local second = xref:get_sibling_node(2)
if first and second and
first:is_text() and first:get_text() == "–" and -- next node must be "–" text
second:is_element() and second:get_element_name() == "xref" -- second element must be <xref>
then
local rid1 = xref:get_attribute("rid") or ""
local rid2 = second:get_attribute("rid") or ""
local prefix1, number1 = rid1:match("(%a+)(%d+)")
local prefix2, number2 = rid2:match("(%a+)(%d+)")
-- expand only if prefixes match each other
if prefix1 and prefix2 and prefix1 == prefix2 then
-- expand numbers
local t = {}
for i = number1, number2 do
t[#t+1] = prefix1 .. math.floor(i)
end
-- save expanded numbers
xref:set_attribute("rid", table.concat(t, ","))
-- remove unnecessary elements
first:remove_node()
second:remove_node()
end
end
end
```
It detects `<xref>` elements followed by dash and another `<xref>`, sets the expanded ids as the `rid` attribute, and removes the unnecessary dash and second `<xref>`. You can then declare this transform rule to convert `<xref>` with `ref-type` of `bibr` to `\citep`:
```
transformer:add_action("xref[ref-type='bibr']", "\\citep{@{rid}}")
```
The `@{rid}` action will print value of the `rid` attribute.
This is the translated TeX result:
```
\section{Scattering of flexural waves an electric current}
Smart testing structures are \$a+b\$ components Reduce acoustic noise used in engineering applications that are capable of sensing or reacting to their environment change Sample XXX1 their mechanical properties.
in a predictable and desired manner. In addition to carrying mechanical loads, \hspace*{12pt}Abc alleviate vibration, reduce acoustic noise, change their mechanical properties as required or monitor their own condition.\par
The first Section 1 description and correlation between gait impairment and hydrocephalus were made in 1965 by Hakim and Adam (\citep{B1}).
The etiology of idiopathic normal pressure hydrocephalus (iNPH) has not yet been entirely understood (\citep{B2,B3,B4,B5}).
In elderly patients, other conditions such as spinal canal stenosis, Parkinson's disease, and polyneuropathy may influence the gait negatively.\par
```
This is the full code:
```
\documentclass{article}
\usepackage{luacode}
\usepackage{natbib}
\begin{document}
\begin{luacode*}
local domobject = require "luaxml-domobject"
local transform = require "luaxml-transform"
sample = [[
<?xml version="1.0" encoding="utf-8"?>
<art>
<title>Scattering of flexural waves an electric current</title>
<para>Smart testing structures are $a+b$ components Reduce acoustic noise used in engineering applications that are capable of sensing or reacting to their environment change <?LuaLaTeX Sample XXX1?> their mechanical properties. in a predictable and desired manner. In addition to carrying mechanical loads, <?LuaLaTeX \hspace*{12pt}Abc?> alleviate vibration, reduce acoustic noise, change their mechanical properties as required or monitor their own condition.</para>
<para>The first <xref ref-type="section" rid="Sec1">Section 1</xref> description and correlation between gait impairment and hydrocephalus were made in 1965 by Hakim and Adam (<xref ref-type="bibr" rid="B1">1</xref>). The etiology of idiopathic normal pressure hydrocephalus (iNPH) has not yet been entirely understood (<xref ref-type="bibr" rid="B2">2</xref>–<xref ref-type="bibr" rid="B5">5</xref>). In elderly patients, other conditions such as spinal canal stenosis, Parkinson's disease, and polyneuropathy may influence the gait negatively.</para>
</art>]]
local dom = domobject.parse(sample)
local function process_instructions(el)
for _, child in ipairs(el:get_children()) do
local ntype = child:get_node_type()
if ntype == "PI" and child._name=="LuaLaTeX" then
local text = child._attr[ "_text" ]
local newel = el:create_element("lualatex-instruction", {text = text})
child:replace_node(newel)
end
if child:is_element() then
process_instructions(child)
end
end
end
-- try to find <xref> followed by dash and another <xref>
-- we then expand rid attributes
for _, xref in ipairs(dom:query_selector("xref[ref-type='bibr']")) do
local first = xref:get_sibling_node(1)
local second = xref:get_sibling_node(2)
if first and second and
first:is_text() and first:get_text() == "–" and -- next node must be "–" text
second:is_element() and second:get_element_name() == "xref" -- second element must be <xref>
then
local rid1 = xref:get_attribute("rid") or ""
local rid2 = second:get_attribute("rid") or ""
local prefix1, number1 = rid1:match("(%a+)(%d+)")
local prefix2, number2 = rid2:match("(%a+)(%d+)")
-- expand only if prefixes match each other
if prefix1 and prefix2 and prefix1 == prefix2 then
-- expand numbers
local t = {}
for i = number1, number2 do
t[#t+1] = prefix1 .. math.floor(i)
end
-- save expanded numbers
xref:set_attribute("rid", table.concat(t, ","))
-- remove unnecessary elements
first:remove_node()
second:remove_node()
end
end
end
process_instructions(dom:root_node())
local transformer = transform.new()
transformer:add_action("title", "\\section{@<.>}")
transformer:add_action("para", "@<.>\\par")
transformer:add_action("xref[ref-type='bibr']", "\\citep{@{rid}}")
-- handle the processing instruction
transformer:add_custom_action("lualatex-instruction",
function(el)
return el:get_attribute("text")
end)
local result = transformer:process_dom(dom)
print(result)
transform.print_tex(result)
\end{luacode*}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/2891
|
691808
| 320,916 |
https://tex.stackexchange.com/questions/691755
|
1
|
I have found the following clever code [Brownion Motion](https://tex.stackexchange.com/questions/59926/how-to-draw-brownian-motions-in-tikz-pgf) here to plot a brownian motion:
```
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots, pgfplotstable}
% Create a function for generating inverse normally distributed numbers using the Box–Muller transform
\pgfmathdeclarefunction{invgauss}{2}{%
\pgfmathparse{sqrt(-2*ln(#1))*cos(deg(2*pi*#2))}%
}
% Code for brownian motion
\makeatletter
\pgfplotsset{
table/.cd,
brownian motion/.style={
create on use/brown/.style={
create col/expr accum={
(\coordindex>0)*(
max(
min(
invgauss(rnd,rnd)*0.1+\pgfmathaccuma,
\pgfplots@brownian@max
),
\pgfplots@brownian@min
)
) + (\coordindex<1)*\pgfplots@brownian@start
}{\pgfplots@brownian@start}
},
y=brown, x expr={\coordindex},
brownian motion/.cd,
#1,
/.cd
},
brownian motion/.cd,
min/.store in=\pgfplots@brownian@min,
min=-inf,
max/.store in=\pgfplots@brownian@max,
max=inf,
start/.store in=\pgfplots@brownian@start,
start=0
}
\makeatother
%
% Initialise an empty table with a certain number of rows
\pgfplotstablenew{201}\loadedtable % How many steps?
\begin{document}
\pgfplotsset{
no markers,
xmin=0,
enlarge x limits=false,
scaled y ticks=false,
ymin=-1, ymax=1
}
\tikzset{line join=bevel}
\pgfmathsetseed{3}
\begin{tikzpicture}
\begin{axis}
\addplot table [brownian motion] {\loadedtable};
\addplot table [brownian motion] {\loadedtable};
\end{axis}
\end{tikzpicture}
\end{document}
```
But i'm not good enough in LaTeX/pgfplot/Tikz to understand how and where i have to change it to get a Brownian bridge instead that brownian motion.
Thanks for your help
|
https://tex.stackexchange.com/users/111652
|
Brownian Bridge with pgfplot
| true |
While you are waiting for Tikz help, here is an effort in [Metapost](http://www.tug.org/metapost.html), that might be simpler to follow / adapt. This is wrapped up in `luamplib` so you have to compile it with `lualatex`.
I've followed some of the discussion in [this stats answer](https://stats.stackexchange.com/a/305058/38310).
The blue line is a regular brownian random walk, where the y-value is incremented by a normal deviate each time. The red line is the brownian bridge, which is derived from the regular walk by subtracting an appropriately weighted proportion of the final y-value.
To make the example concrete, I used 200 samples and a fixed random seed, so that the final value of the walk `w[n]` was 17.8543 -- each point of the red line `bb[i]` is then `w[i] - (i/n) * (b - w[n])`. This means that `bb[n]` is `w[n] - (n/n) * (b - w[n]) = b` as desired.
Here is the code. Compile this with `lualatex` to get a PDF that looks like the image above.
```
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\mplibshowlog{enable}
\begin{mplibcode}
% randomseed := uniformdeviate infinity;
randomseed := 778.58453;
beginfig(1);
% parameters: n number of samples, a = start, b = target
numeric n, a, b; n = 200; a = b = 0;
% x and y scales
numeric u, v; u = 2; v = 8;
% base line
draw ((0, a) -- (n, b)) xscaled u yscaled v;
% w[] is the regular brownian random walk
% bb[] is the brownian bridge
numeric w[], bb[];
w0 = a;
for i=1 upto n:
w[i] = w[i-1] + normaldeviate;
endfor
for i=0 upto n:
bb[i] = w[i] + (i/n) * (b - w[n]);
endfor
draw ((0, a) for i=1 upto n: -- (i, w[i]) endfor)
xscaled u yscaled v withcolor blue;
draw ((0, a) for i=1 upto n: -- (i, bb[i]) endfor)
xscaled u yscaled v withcolor red;
label.rt("$(" & decimal n & "," & decimal w[n] & ")$", (n*u, w[n]*v));
endfig;
\end{mplibcode}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/15036
|
691811
| 320,918 |
https://tex.stackexchange.com/questions/691810
|
4
|
I have seen that this subject was discussed a couple of times, but often the reason was like "oh, I used align\* with \label". In my case it is a bit different, here is a minimal example
```
\documentclass{article}
\usepackage{amsmath}
\usepackage[thmmarks, amsthm]{ntheorem}
\begin{document}
\begin{equation}\label{eq:a}
a=b
\end{equation}
\begin{align}
a &=b \label{eq:something_different}
\end{align}
\ref{eq:a} and \ref{eq:something_different}
\end{document}
```
When I compile this, I get the error message "Package amsmath Error: Multiple \label's: label 'eq:a' will be lost. \end{align}". In fact label "eq:a" is not defined and is referenced as "??" in the text. It works when I change "align" to "equation" (and remove the ampersand) and it also works when I remove the " \label{eq:something\_different).
Can anybody explain why this is the case and what I should do to avoid this error message?
Thank you very much.
Best regards,
Markus
|
https://tex.stackexchange.com/users/301208
|
Package amsmath Error: Multiple \labels
| false |
From page 4 of the user guide of the `ntheorem` package:
Hence, replace
```
\usepackage{amsmath}
\usepackage[thmmarks, amsthm]{ntheorem}
```
with
```
\usepackage{amsmath}
\usepackage[thmmarks, amsmath, amsthm]{ntheorem}
```
If, for some inscrutable reason, you do *not* wish to set the `amsmath` option while loading `ntheorem`, you must load `ntheorem` before, not after, `amsmath`. Not the recommended route, though.
|
4
|
https://tex.stackexchange.com/users/5001
|
691812
| 320,919 |
https://tex.stackexchange.com/questions/691635
|
1
|
In my package, there are options like:
```
\keys_define:nn { crefthe-setting }
{
, variant .tl_set:N = \l__crefthe_variant_tl
, nom .meta:n = { variant = Nominativ }
, gen .meta:n = { variant = Genitiv }
, dat .meta:n = { variant = Dativ }
, akk .meta:n = { variant = Akkusativ }
...
}
```
The short cuts, such as `nom`, however, should only be enabled when `\languagename` is equal to `ngerman`. How should one achieve such conditional keys?
Below is a MWE.
```
\documentclass{article}
\usepackage[english,ngerman]{babel}
\ExplSyntaxOn
\tl_new:N \l__crefthe_variant_tl
\keys_define:nn { crefthe-setting }
{
, variant .tl_set:N = \l__crefthe_variant_tl
, nom .meta:n = { variant = Nominativ }
, gen .meta:n = { variant = Genitiv }
, dat .meta:n = { variant = Dativ }
, akk .meta:n = { variant = Akkusativ }
, unknown .code:n = {}
}
\NewDocumentCommand \TestFunction { m }
{
\tl_set:Nn \l__crefthe_variant_tl {}
\keys_set:nn { crefthe-setting } { #1 }
\tl_use:N \l__crefthe_variant_tl
}
\ExplSyntaxOff
\begin{document}
\selectlanguage{english}
\TestFunction{nom} (\languagename) % should be empty
\selectlanguage{ngerman}
\TestFunction{nom} (\languagename)
\end{document}
```
|
https://tex.stackexchange.com/users/194994
|
expl3: keys enabled under certain condition
| true |
The following evaluates `\languagename` (there is a warning in the manual that due to catcode weirdness recommends using the `iflang` package, but I guess catcodes shouldn't be an issue if we use string based comparison) when you try to set those keys and will throw a warning (you could change this to an error) when the keys are used in the wrong language.
```
\documentclass{article}
\usepackage[english,ngerman]{babel}
\ExplSyntaxOn
\msg_new:nnn { crefthe } { unavailable-key }
{ Key~ `#1'~ unavailable~ outside~ of~ language~ `#2'. }
\cs_new_protected:Npn \__crefthe_lang_key:nn #1#2
{
\str_if_eq:VnTF \languagename {#1}
{ \keys_set:nn { crefthe-setting } {#2} }
{
\msg_warning:nnxx { crefthe } { unavailable-key }
{ \l_keys_key_tl } {#1}
}
}
\tl_new:N \l__crefthe_variant_tl
\keys_define:nn { crefthe-setting }
{
, variant .tl_set:N = \l__crefthe_variant_tl
, nom .code:n = \__crefthe_lang_key:nn {ngerman} { variant = Nominativ }
, gen .code:n = \__crefthe_lang_key:nn {ngerman} { variant = Genitiv }
, dat .code:n = \__crefthe_lang_key:nn {ngerman} { variant = Dativ }
, akk .code:n = \__crefthe_lang_key:nn {ngerman} { variant = Akkusativ }
, unknown .code:n = {}
}
\NewDocumentCommand \TestFunction { m }
{
\tl_set:Nn \l__crefthe_variant_tl {}
\keys_set:nn { crefthe-setting } { #1 }
\tl_use:N \l__crefthe_variant_tl
}
\ExplSyntaxOff
\begin{document}
\selectlanguage{english}
\TestFunction{nom} (\languagename) % should be empty
\selectlanguage{ngerman}
\TestFunction{nom} (\languagename)
\end{document}
```
There is likely a smarter way to do this, but this should do.
|
1
|
https://tex.stackexchange.com/users/117050
|
691813
| 320,920 |
https://tex.stackexchange.com/questions/691822
|
2
|
I am not sure about the forum protocol regarding when to ask a new question and when to lump it in with an existing one, so I apologize if this is unorthodox. The question stems from [! Missing \endcsname inserted error when using \seq\_map\_pairwise\_function:ccN](https://tex.stackexchange.com/questions/691796/missing-endcsname-inserted-error-when-using-seq-map-pairwise-functionccn?noredirect=1&lq=1). I have really just begun to explore `expl3`-style coding and I am far from a TeX guru, although I have been doing coding in other languages--obviously not typesetting languages--for many years. But the whole token/input stream methodology is a completely new paradigm for me and I am trying to wrap my head around it. The documentation is disseminated widely on the web, TeX books are few and getting harder to find (I actually bought Knuth's 5-volume set and Bechtolsheim's 4-volume set about a decade ago long before I got serious about this and they are currently in storage about a 1000 miles away), and I am consequently doing most of my learning by example, trial and error, and asking questions here. So please bear with me.
The code in the above reference has issues without the `no-math` option being passed to `fontspec`. Specifically, it has a problem with the common capital Greek letters having already been defined by `fontspec`. Now, including the `no-math` option indeed solves the problem, but I am more interested in why this is happening and why there is apparently no way to undefine or redefine commands in `expl3`. Or perhaps it is possible and I just haven't yet discovered how. So, this particular set of questions is independent of the above reference other than its having provided the example.
What does `\cs_undefine` do if not undefine a control sequence? What is its syntax? I cannot seem to make it work with `\Gamma`, for instance, regardless of whether I use `:N` or `:c` or `\Gamma`, `{\Gamma}`, or `{Gamma}`. The same is true for `\cs_meaning`, which I thought might help out with troubleshooting. I must be missing something fundamental. I am sure this could be done with plain TeX, but I get the impression from what I am reading that mixing the two is akin to dropping a self-modifying assembly routine into a C# UX application. Hypothetically, and regarding this specific case, if I could *not* use the `no-math` option, and the capital Greeks were already defined, how would I remedy the problem? More generally, how do you redefine a command that has already been defined with `expl3`? I'm probably not even asking the right questions, but I hope that someone will be able to see where I'm failing to grasp something and steer me in the right direction.
|
https://tex.stackexchange.com/users/224317
|
Undefining/redefining already defined commands within expl3
| true |
The message is completely unrelated to `expl3` you have
```
\documentclass{article}
\usepackage
%[no-math]
{fontspec}
\def\Gamma{wibble}
\begin{document}
\end{document}
```
which produces
```
! LaTeX Error: Command `\Gamma' already defined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.7 \begin{document}
?
```
as at `\begin{document}` `fontspec` tries to adjust some settings, using latex2e declarations that check commands are new.
`no-math` tells the package not to do that.
|
4
|
https://tex.stackexchange.com/users/1090
|
691825
| 320,924 |
https://tex.stackexchange.com/questions/691815
|
1
|
I have a not so old Asymptote code and my settings of `currentlight` do not longer work with a more recent version. This is the code:
```
currentlight = light(gray(0.85), ambient=black, specularfactor=3,
(0.5,0.5,1), specular=gray(0.6), viewport=false);
currentlight.background = rgb("363940ff");
```
The compilation complains about the usage of the `light` function. Something has changed?
|
https://tex.stackexchange.com/users/18595
|
Setting the current light in recent version of Asymptote
| true |
Four years ago Asymptote upgraded from the Phong-Blinn lighting model to physically based rendering, which has no `ambient` attribute. The `viewport` argument was removed a few months before that. Just use
```
currentlight = light(gray(0.85), specularfactor=3,(0.5,0.5,1), specular=gray(0.6));
```
`currentlight` also accepts an optional `background` argument.
|
2
|
https://tex.stackexchange.com/users/97772
|
691826
| 320,925 |
https://tex.stackexchange.com/questions/691818
|
0
|
I run the Asymptote code below with Asymptote on Windows. This code should generate 180 pictures. It worked fine before, but maybe I was on Linux, I don't remember. Now it generates two pictures only and it stops because of an out-of-memory. I use the `-compact` option of `asy`.
```
settings.outformat = "eps";
import geometry;
import solids;
size(10cm,0);
// camera and light ------------------------------------------------------------
currentprojection = orthographic(0,0,6);
currentlight.background = rgb("363940ff");
// files to be saved -----------------------------------------------------------
string[] files = new string[180];
for(int i = 0; i < 180; ++i){
string zeros = i < 10 ? "00" : (i < 100 ? "0": "");
files[i] = "zpic" + zeros + string(i);
}
// Steiner circles -------------------------------------------------------------
circle[] SteinerChain_phi0(circle c0, int n, real shift){
real R = c0.r; point O = c0.C;
real sine = sin(pi/n);
real Cradius = R / (1+sine);
real Cside = Cradius*sine;
circle[] circles0 = new circle[n+1];
for(int i = 0; i < n; ++i){
real beta = (i+shift)*2*pi/n;
point pti = Cradius * (cos(beta), sin(beta)) + O;
circles0[i] = circle(pti, Cside);
}
circles0[n] = circle(O, R-2*Cside);
return circles0;
}
circle[] SteinerChain(circle c0, int n, real phi, real shift){ // c0 : exterior circle
real invphi = 1/phi;
point I = (c0.r*invphi, 0) + c0.C;
real r = c0.r * sqrt(invphi*invphi-1);
circle[] circles0 = SteinerChain_phi0(c0, n, shift);
circle[] circles = new circle[n+1];
inversion iota = inversion(r*r, I);
for(int i = 0; i <= n; ++i){
circles[i] = iota*circles0[i];
}
return circles;
}
// -----------------------------------------------------------------------------
struct Cyclide {
real mu;
real a;
real c;
triple shift;
}
struct MySteinerChain {
revolution[] spheres;
Cyclide cyclide;
}
MySteinerChain SteinerChain3D(circle c0, real z, int n, real phi, real shift){
revolution[] spheres = new revolution[n+1];
circle[] scircles = SteinerChain(c0, n, phi, shift);
for(int i = 0; i <= n; ++i){
triple center = (scircles[i].C.x, scircles[i].C.y, z);
spheres[i] = sphere(center, scircles[i].r*0.999);
}
Cyclide cyclide;
cyclide.a = (c0.r + scircles[n].r)/2;
pair O2 = scircles[n].C;
cyclide.c = (O2.x - c0.C.x)/2;
cyclide.mu = (c0.r - scircles[n].r)/2;
cyclide.shift = (c0.C.x + O2.x, c0.C.y + O2.y, 0)/2;
MySteinerChain out;
out.spheres = spheres;
out.cyclide = cyclide;
return out;
}
// -----------------------------------------------------------------------------
transform3 transfo(real sx, real sy, real sz, real lambda, triple v){
transform3 T = identity4;
T[0][0] = sx; T[1][0] = sx*lambda;
T[1][1] = sy;
T[2][2] = sz;
T[0][3] = v.x; T[1][3] = v.x; T[2][3] = v.z;
return T;
}
transform3 T = transfo(2, 2, 2, 1/3, (0,0,0));
// -----------------------------------------------------------------------------
int n = 4; // n+1 circles
real phi = 0.3;
// "bounding box"
triple A = (2.5,2.5,0);
triple C = (-2.5,-2.5,0);
for(int f = 0; f < 180; ++f){
picture pic;
draw(pic, A, rgb("363940ff")+opacity(0));
draw(pic, C, rgb("363940ff")+opacity(0));
circle c0 = circle((point)(0,0),1);
MySteinerChain sc = SteinerChain3D(c0, 0.0, n, phi, n*f/180);
revolution[] spheres = sc.spheres;
Cyclide c = sc.cyclide;
for(int i = 0; i <= n; ++i){
draw(pic, T*surface(spheres[i]), rgb("7E03A8FF"));
}
real b = sqrt(c.a*c.a - c.c*c.c);
triple F(pair uv){
real h = c.a-c.c*cos(uv.x)*cos(uv.y);
real x = (c.mu*(c.c-c.a*cos(uv.x)*cos(uv.y))+b*b*cos(uv.x))/h;
real y = (b*sin(uv.x)*(c.a-c.mu*cos(uv.y)))/h;
real z = b*sin(uv.y)*(c.c*cos(uv.x)-c.mu)/h;
return (x,y,z);
}
surface s = surface(F, (0,0), (2pi,2pi), 150, 150);
draw(pic, T*shift(c.shift)*s, yellow+opacity(0.1));
//
add(pic);
shipout(files[f], bbox(rgb("363940ff"), FillDraw(rgb("363940ff"))));
erase();
}
```
|
https://tex.stackexchange.com/users/18595
|
Asymptote out of memory error when generating several files
| false |
Your example works fine under Linux with Asymptote version 2.86. If you are using Microsoft Windows, make sure you install the 64-bit executable since garbage collection won't work well on a 32-bit machine.
|
0
|
https://tex.stackexchange.com/users/97772
|
691827
| 320,926 |
https://tex.stackexchange.com/questions/689418
|
2
|
I am trying to add text above and below an arrow, but I can't seem to figure out a way to do this without creating two arrows on top of each other, which looks awkward.
What I currently have looks a bit like this:
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata, arrows.meta, positioning}
\begin{document}
\begin{tikzpicture} [node distance = 4cm, auto]
\node (0) [state, initial] {$q_0$};
\node (1) [state, right = of 0] {$q_1$};
\node (2) [state, right = of 1] {$q_2$};
\path [-stealth]
(0) edge node {A} (1)
(1) edge [loop above] node {B} (1)
(1) edge node {sample text above arrow} (2);
\end{tikzpicture}
\end{document}
\end{tikzpicture}
```
I would like to be also able to add some `sample text below arrow` in that same edge betweeen `(1)` and `(2)`.
|
https://tex.stackexchange.com/users/299589
|
How do I add text above and below an arrow using TikZ?
| false |
You can simple add another edge nodes with option `below` (see @
Qrrbrbirlbel comment) or use `quotes` library and write your MWE (Minimal Working Example) as follows:
```
\documentclass[margin=3mm]{standalone}
%\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, automata,
positioning,
quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 4cm,
every edge quotes/.style = {auto, align=center}
]
\node (0) [state, initial] {$q_0$};
\node (1) [state, right = of 0] {$q_1$};
\node (2) [state, right = of 1] {$q_2$};
\path[-Stealth]
(0) edge["A"] (1)
(1) edge[loop above, "B"] (1)
(1) edge["sample text\\ above arrow",
"sample text\\ below arrow" swap] (2);
\end{tikzpicture}
\end{document}
```
Instead option `swap` you can shortly write `'`.
|
0
|
https://tex.stackexchange.com/users/18189
|
691829
| 320,927 |
https://tex.stackexchange.com/questions/691796
|
0
|
This question is related to [Execute list of commands generated by pairing elements from two \clist s or \seq s](https://tex.stackexchange.com/questions/691745/execute-list-of-commands-generated-by-pairing-elements-from-two-clist-s-or-seq/691747?noredirect=1#comment1716526_691747).
I am trying to perform a sequence of commands of the form
`\def\alpha {^^^^03b1}`
with `\seq_\map_pairwise_function:ccN`. I would prefer to pass in arguments in the form `"03B1` rather than `^^^^03b1` and I think I have figured out how to do that. This code appears to function correctly.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{nopageno}
\newfontfamily\mathematica{Mathematica}[%
NFSSFamily=mathematica,Scale=MatchUppercase,%
Extension=.ttf,%
UprightFont=*,%
BoldFont=*-Bold]
\DeclareSymbolFont{wm}{TU}{mathematica}{m}{n}
\DeclareSymbolFont{wmb}{TU}{mathematica}{b}{n}
\ExplSyntaxOn
\Umathcode"03B1 = 0 \symwm "003B1
\Umathcode"03B2 = 0 \symwm "003B2
\NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:cpn {#1} {\codepoint_generate:nn{#2}{11}}}
\mapcommandfunction{alphatwo}{"03B1}
\mapcommandfunction{beta}{"03B2}
\ExplSyntaxOff
\begin{document}
$$\alphatwo\beta$$
\end{document}
```
(substitute your font of choice). But if I replace the code between `\ExplSyntaxOn` and `\ExplSyntaxOff` with
```
\Umathcode"03B1 = 0 \symwm "003B1
\Umathcode"03B2 = 0 \symwm "003B2
\NewDocumentCommand{\mapcommands}{mm}
{
\seq_set_from_clist:cc {cmds}{#1}
\seq_set_from_clist:cc {chars}{#2}
\seq_map_pairwise_function:ccN{cmds}{chars}{\mapcommandfunction}
}
\NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:cpn {#1} {\codepoint_generate:nn{#2}{11}}}
\mapcommands{alphatwo,beta}{"03B1,"03B2}
```
I get the error shown in the title. I have no idea what I am doing wrong or how to discover it. More specifically, I get
```
! Missing \endcsname inserted.
<to be read again>
\alphatwo,beta
l.27 \mapcommands{alphatwo,beta}{"03B1,"03B2}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
```
How do I fix this?
|
https://tex.stackexchange.com/users/224317
|
! Missing \endcsname inserted error when using \seq_map_pairwise_function:ccN
| false |
I think that the specification with two separate `clist` that need to stay in sync will be hard to maintain and keep track of. Instead, I'd either suggest to drop the mapping variant and only use your `\mapcommandfunction`, or use `key=value` based input.
Also, just like @DavidCarlisle I don't see the advantage of inputting `alphatwo` instead of `\alphatwo`.
As a last note: Don't use `$$` for displayed maths in LaTeX, instead use `\[` and `\]`, or the `equation` environment, or the `amsmath` environments. `$$` can lead to inconsistent spacing and is not supported in LaTeX.
```
\documentclass{article}
\usepackage{fontspec}
\usepackage{nopageno}
\newfontfamily\mathematica{Mathematica}[%
NFSSFamily=mathematica,Scale=MatchUppercase,%
Extension=.ttf,%
UprightFont=*,%
BoldFont=*-Bold]
\DeclareSymbolFont{wm}{TU}{mathematica}{m}{n}
\DeclareSymbolFont{wmb}{TU}{mathematica}{b}{n}
\ExplSyntaxOn
\Umathcode"03B1 = 0 \symwm "003B1
\Umathcode"03B2 = 0 \symwm "003B2
\NewDocumentCommand{\mapcommandfunction}{mm}{\cs_set:Npn #1 {\codepoint_generate:nn{#2}{11}}}
\msg_new:nnn { mike-pugh } { missing-value } { Missing~ value~ for~ `#1'. }
\NewDocumentCommand \mapcommands { m }
{
\keyval_parse:nnn
{ \msg_error:nnn { mike-pugh } { missing-value } }
{ \mapcommandfunction }
{#1}
}
\mapcommands{\alphatwo="03B1, \beta="03B2}
\ExplSyntaxOff
\begin{document}
\[\alphatwo\beta\]
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/117050
|
691832
| 320,928 |
https://tex.stackexchange.com/questions/505746
|
2
|
I'm making a command called `\seal` that uses the `\includegraphics` function. The command `\seal` has some `key=value` options of its own (`color`, `beamer`, `trimz`) and it must accept all options of `\includegraphics` so that it directly passes them to it. We may use `\seal` for a picture called `theimage` as follows:
```
\seal[width=2cm, color=red]{theimage}
```
which calls:
```
\includegraphics[width=2cm]{theimage}
```
Although I want to use all options in `\includegraphics`, the following code does it well for the `height` and `width` options.
```
% Declaring options for "seal"
\pgfkeys{
/seal/.is family, /seal,
% "seal" options
color/.estore in = \sealColor,
beamer/.estore in = \sealBeamer,
trimz/.estore in = \sealTrimz,
% "\includegraphics" options
height/.estore in = \sealHeight,
width/.estore in = \sealWidth,
}
% Declaring variables for the left side of "key=value"
\newcommand{\sealHeightL}{height}
\newcommand{\sealWidthL}{width}
% Declaring a command for storing the image
\newcommand{\theimage}{}
% Defining the \seal command
\newcommand{\seal}[2][]{%
\pgfkeys{/seal, #1}%
%
% Makes the left side of "key=value" empty
% if there's no value
\ifthenelse{\equal{\sealHeight}{}}
{\renewcommand{\sealHeightL}{}}
{\renewcommand{\sealHeightL}{height}}%
\ifthenelse{\equal{\sealWidth}{}}
{\renewcommand{\sealWidthL}{}}
{\renewcommand{\sealWidthL}{width}}%
%
% The \includegraphics command
\renewcommand{\theimage}{\includegraphics[%
\sealHeightL=\sealHeight,%
\sealWidthL=\sealWidth,%
]{#2}%
%
% The other command (pay no attention to this)
\othercommand{\sealColor}{\sealBeamer}{\sealTrimz}{\theimage}
}
```
The basic idea of this code is to make `\seal[width=2cm, color=red]{theimage}` call `\includegraphics[width=2cm, =]{theimage}`, and `\seal[color=red]{theimage}` call `\includegraphics[=, =]{theimage}`. This works because neither `\includegraphics[width=2cm, =]{theimage}` nor `\includegraphics[=, =]{theimage}` produce error messages. The last one is equivalent to calling `\includegraphics[]{theimage}`.
Now, although this code does the work very well, it returns two error messages when calling `\seal[height=2cm]{theimage}`:
```
Undefined control sequence. \seal[height=2cm]{theimage}
Package keyval Error: undefined. \seal[height=2cm]{theimage}
```
When calling `\seal{theimage}`, it returns the following messages repeated twice.
```
Undefined control sequence. \seal{theimage}
Package keyval Error: undefined. \seal{theimage}
```
I suppose this happens for the same reason that `\includegraphics[\empty = \empty,]{theimage}`, where `\newcommand{\empty}{}`, returns the following error message:
```
Package keyval Error: undefined. \includegraphics[\empty = \empty]{theimage}
```
Using an `\ifthenelse` command inside the (square) brackets of `\includegraphics` doesn't seem to work. It also seems to be mandatory that `=` be directly written inside the brackets, and not inside a command that is inside the brackets. I can think of the following strategies for addressing this problem:
1. Devising a completely different approach for passing options from `\seal` to `\includegraphics`. Currently, I don't have a clue as to what that approach might be.
2. Letting LaTeX know that this is not an error. Since I am new in LaTeX, I don't know how to do this. I also feel this cannot be a proper solution: if there is an error message something must be not in place. It could have actual consequences for the other options. However, I am open to be persuaded otherwise on this.
3. Defining `\seal` so that it uses two brackets for `key=value` options: one for its own options and the other for the `\includegraphics` options. In this way, it will pass the whole string of one of those brackets to `\includegraphics`. In this case, we would call `\seal[width=2cm][color=red]{theimage}` instead of `\seal[width=2cm, color=red]{theimage}`. I think this might be the most straightforward solution. The first version of `\seal` was a command of the form `\seal[includegraphicsOptions]{colorValue}{beamerValue}{trimzValue}{theimage}`, which passed the whole `includegraphicsOptions` string to `\includegraphics` returning no error whatsoever. Nevertheless, I don't know how to define `\seal` so that it has two brackets and, although I more than welcome a solution along these lines, I consider it a bit sub-optimal to my taste. (I'm more likely to be persuaded otherwise on this one.)
But ultimately, I am here because I do not know how to properly address this. I hope someone can suggest a solution.
**Note:** The only packages I am using/requiring for this command are `graphicx`, `pgfkeys` and `ifthenelse`. (Also `tikz`, which is not important for this question, and optionally the class `beamer`.)
**PS:** I'm sorry I couldn't make this question shorter.
|
https://tex.stackexchange.com/users/154737
|
Passing options from a newcommand to a another command (\includegraphics)
| false |
This is (almost) trivial to do with `expkv-cs`. The following doesn't define your temporary macros and only works by argument forwarding (if you need macros like `\sealColor` to be defined you can do so in `\sealDO` before you pass them on to `\othercommand`).
The following uses the same `\othercommand` as @egreg and the same values (except it doesn't expand the first token of the image command, as that is already `\includegraphics`):
```
\documentclass{article}
\usepackage{expkv-cs}
\newcommand\seal[2][]{\sealKV{#1}{#2}}
\ekvcSplitAndForward\sealKV\sealDO
{
color = {} % #1
,beamer = {} % #2
,trimz = {} % #3
,... % #4 -- all unknown keys
}
\newcommand\sealDO[5]
{\othercommand{#1}{#2}{#3}{\includegraphics[#4]{#5}}}
\newcommand{\othercommand}[4]{%
\typeout{%
sealColor=#1^^J%
sealBeamer=#2^^J%
sealTrimz=#3^^J%
imagecommand=\unexpanded{#4}%
}%
}
\begin{document}
\seal[width=2cm, color=red]{theimage}
\seal[trimz=b,width=2cm,height=1cm,beamer=x,color=red]{theimage}
\end{document}
```
which will print to the terminal:
```
sealColor=red
sealBeamer=
sealTrimz=
imagecommand=\includegraphics [, {width} = {2cm} ]{theimage}
sealColor=red
sealBeamer=x
sealTrimz=b
imagecommand=\includegraphics [, {width} = {2cm} , {height} = {1cm} ]{theimage}
```
|
0
|
https://tex.stackexchange.com/users/117050
|
691833
| 320,929 |
https://tex.stackexchange.com/questions/691835
|
0
|
I'm getting the error: **LaTeX Error: Missing \begin{document}.**
Everything in my document seemed to working earlier today, but now I have an empty first page with nothing but a page number at the top right, and an error saying:
LaTeX Error: Missing \begin{document}.
I don't really know what's important to post here if I could get any guidance I would appreciate it so much. I've been working on a paper for the better part of a year and don't know what to do. I know I'm including way too many packages. I inherited this paper and don't know what I need and what I don't. This all started earlier today when I was trying to align some equations.
```
\documentclass[10pt]{iopart}
\usepackage[table]{xcolor}
\usepackage{tabularray}
\usepackage{colortbl}
\definecolor{myOrange}{HTML}{DB5800}
\arrayrulecolor{myOrange}
\usepackage{hyperref}
\usepackage{enumitem,amssymb}
\newlist{todolist}{itemize}{2}
\setlist[todolist]{label=$\square$}
\usepackage[all]{hypcap}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=blue,
filecolor=magenta,
urlcolor=black,
pdftitle={Title},
pdfauthor={Author},
pdfpagemode=FullScreen,
}
\makeatletter
\newcommand*{\citelinktext}[2]{%
\hyper@@link[cite]{}{cite.#1}{#2}}
\makeatother
% Install packages
\makeatletter
\@namedef{ver@amsmath.sty}{}
\makeatother
\usepackage{amstext}
\usepackage{chemformula}
\usepackage[tracking=true]{microtype}
\DeclareMicrotypeSet*[tracking]{my}{font=*/*/*/sc/*}
\SetTracking{encoding=*,shape=sc}{500}
\usepackage{cite}
\usepackage{epsfig} % for postscript graphics files
\usepackage{epstopdf}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{multirow, makecell}
\usepackage{supertabular,booktabs}
\usepackage{hhline}
\usepackage{textgreek}
\usepackage{bm}
\usepackage[switch]{lineno}
\usepackage{helvet}
\newenvironment{fontHel}{\fontfamily{phv}\selectfont}{\par}
\newcommand*{\fontTimes}{\fontfamily{ptm}\selectfont}
\newcommand*{\fontHelv}{\fontfamily{phv}\selectfont}
\usepackage{times} % assumes new font selection scheme installed
\usepackage{amsmath} % assumes amsmath package installed
\usepackage{amssymb} % assumes amsmath package installed
\usepackage{multirow}
\usepackage[multiple]{footmisc}
\usepackage{float}
\usepackage{placeins}
\usepackage{outlines}
\renewcommand{\arraystretch}{1.2} % to increase default height of table rows
\usepackage{tabularx} % for text wrapping in tables
\usepackage{adjustbox} % resizes table if it gets too wide
\usepackage{enumitem} % to access properties of itemize env.
\usepackage{pdflscape}
\usepackage{longtable} % for multi-page table
\usepackage{lscape} % for landscape table
\usepackage{afterpage} % for table
\usepackage{rotating}
\usepackage{geometry} % for modifying page size/margins
\usepackage[normalem]{ulem} % for text strikethrough (command: \sout{text})
\usepackage{latexsym}
\usepackage{MnSymbol}
\newcommand*\sq{\mathbin{\vcenter{\hbox{\rule{1ex}{1ex}}}}}
\usepackage{etoolbox}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage{tablefootnote}
\usepackage{color} % For highlighting
\newcommand{\revision}[1]{\textcolor{black}{#1}}
\newcommand{\revrev}[1]{\textcolor{black}{#1}}
\newcommand\fnsep{\textsuperscript{,}}
\let\oldFootnote\footnote
\newcommand\nextToken\relax
\renewcommand\footnote[1]{%
\oldFootnote{#1}\futurelet\nextToken\isFootnote}
\newcommand\isFootnote{%
\ifx\footnote\nextToken\textsuperscript{,}\fi}
\newcommand{\thickhline}{%
\noalign {\ifnum 0=`}\fi \hrule height 1pt
\futurelet \reserved@a \@xhline
}
\begin{document}
```
the error log I'm getting is:
```
l.1 n
%%
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
Missing character: There is no n in font nullfont!
```
I'm panicking. Please let me know what I need to post to get help?
|
https://tex.stackexchange.com/users/262546
|
Empty first page and missing begin document
| false |
I feel like a dummy. I accidentally added a random character in my iopart.cls file. I still can't seem to get my equations aligned, but at least the document begins again.
|
1
|
https://tex.stackexchange.com/users/262546
|
691836
| 320,930 |
https://tex.stackexchange.com/questions/691835
|
0
|
I'm getting the error: **LaTeX Error: Missing \begin{document}.**
Everything in my document seemed to working earlier today, but now I have an empty first page with nothing but a page number at the top right, and an error saying:
LaTeX Error: Missing \begin{document}.
I don't really know what's important to post here if I could get any guidance I would appreciate it so much. I've been working on a paper for the better part of a year and don't know what to do. I know I'm including way too many packages. I inherited this paper and don't know what I need and what I don't. This all started earlier today when I was trying to align some equations.
```
\documentclass[10pt]{iopart}
\usepackage[table]{xcolor}
\usepackage{tabularray}
\usepackage{colortbl}
\definecolor{myOrange}{HTML}{DB5800}
\arrayrulecolor{myOrange}
\usepackage{hyperref}
\usepackage{enumitem,amssymb}
\newlist{todolist}{itemize}{2}
\setlist[todolist]{label=$\square$}
\usepackage[all]{hypcap}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=blue,
filecolor=magenta,
urlcolor=black,
pdftitle={Title},
pdfauthor={Author},
pdfpagemode=FullScreen,
}
\makeatletter
\newcommand*{\citelinktext}[2]{%
\hyper@@link[cite]{}{cite.#1}{#2}}
\makeatother
% Install packages
\makeatletter
\@namedef{ver@amsmath.sty}{}
\makeatother
\usepackage{amstext}
\usepackage{chemformula}
\usepackage[tracking=true]{microtype}
\DeclareMicrotypeSet*[tracking]{my}{font=*/*/*/sc/*}
\SetTracking{encoding=*,shape=sc}{500}
\usepackage{cite}
\usepackage{epsfig} % for postscript graphics files
\usepackage{epstopdf}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{multirow, makecell}
\usepackage{supertabular,booktabs}
\usepackage{hhline}
\usepackage{textgreek}
\usepackage{bm}
\usepackage[switch]{lineno}
\usepackage{helvet}
\newenvironment{fontHel}{\fontfamily{phv}\selectfont}{\par}
\newcommand*{\fontTimes}{\fontfamily{ptm}\selectfont}
\newcommand*{\fontHelv}{\fontfamily{phv}\selectfont}
\usepackage{times} % assumes new font selection scheme installed
\usepackage{amsmath} % assumes amsmath package installed
\usepackage{amssymb} % assumes amsmath package installed
\usepackage{multirow}
\usepackage[multiple]{footmisc}
\usepackage{float}
\usepackage{placeins}
\usepackage{outlines}
\renewcommand{\arraystretch}{1.2} % to increase default height of table rows
\usepackage{tabularx} % for text wrapping in tables
\usepackage{adjustbox} % resizes table if it gets too wide
\usepackage{enumitem} % to access properties of itemize env.
\usepackage{pdflscape}
\usepackage{longtable} % for multi-page table
\usepackage{lscape} % for landscape table
\usepackage{afterpage} % for table
\usepackage{rotating}
\usepackage{geometry} % for modifying page size/margins
\usepackage[normalem]{ulem} % for text strikethrough (command: \sout{text})
\usepackage{latexsym}
\usepackage{MnSymbol}
\newcommand*\sq{\mathbin{\vcenter{\hbox{\rule{1ex}{1ex}}}}}
\usepackage{etoolbox}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage{tablefootnote}
\usepackage{color} % For highlighting
\newcommand{\revision}[1]{\textcolor{black}{#1}}
\newcommand{\revrev}[1]{\textcolor{black}{#1}}
\newcommand\fnsep{\textsuperscript{,}}
\let\oldFootnote\footnote
\newcommand\nextToken\relax
\renewcommand\footnote[1]{%
\oldFootnote{#1}\futurelet\nextToken\isFootnote}
\newcommand\isFootnote{%
\ifx\footnote\nextToken\textsuperscript{,}\fi}
\newcommand{\thickhline}{%
\noalign {\ifnum 0=`}\fi \hrule height 1pt
\futurelet \reserved@a \@xhline
}
\begin{document}
```
the error log I'm getting is:
```
l.1 n
%%
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
Missing character: There is no n in font nullfont!
```
I'm panicking. Please let me know what I need to post to get help?
|
https://tex.stackexchange.com/users/262546
|
Empty first page and missing begin document
| true |
You are reading the log file incorrectly, because you refer the tail of the error `l.1 n` `%%` and the message after the error is ignored: `Missing character: There is no n in font nullfont!`. The log file shows you the context of the error an you don't show it in your listing.
The full log file looks like this:
```
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./your-document.tex
LaTeX2e <2023-06-01> patch level 1
L3 programming layer <2023-06-30>
(./iopart.cls
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 n
%%
?
```
and if you continue running TeX despite the error:
```
Missing character: There is no n in font nullfont!
```
At the opening parentesis `(`, TeX opens the file `./iopart.cls`. Then the LaTeX error is reported at line 1 of this file at the position 1 just before the `%%`. Then you can simply look to this file and you can found the `n` letter here. It was saved here probably as a mistake.
|
4
|
https://tex.stackexchange.com/users/51799
|
691839
| 320,931 |
https://tex.stackexchange.com/questions/689363
|
0
|
I'm writing a discussion document where contributors get their own pages and I want to mention these pages in the general text
So I have this which seems to do the trick
```
% usage: create printed page space for artist and the short form reference
% \artist{Jo Blow}{JoBl}
\newcommand{\artist}[2]{
\newpage
\subsection{#1}
Lorem ipsum
\newpage
Et tu quoque! #2\label{artist:#2}
% page reserved for artwork by #1
}
% obtain page numbering for artist image page given shortform reference
% \mention{JoBl}
\newcommand{ \mention}[1] { \emph{[p.\pageref{artist:#1}]}}
```
but I wanted to extend mention{} to take a variable length list of arguments
I found this [iterating-through-comma-separated-arguments](https://tex.stackexchange.com/questions/87407/iterating-through-comma-separated-arguments)
A case of running before I can walk, but bear with me I'm only a stupid artist, I tried this
```
%!TEX TS-program = lualatex
%!TEX encoding = UTF-8 Unicode
\documentclass{article}
\newcommand{\artist}[2]{
\newpage
\subsection{#1}
Lorem ipsum
\newpage
Et tu quoque! #2\label{artist:#2}
% page reserved for artwork by #1
}
% obtain page numbering for artist image page given short form reference
% \mention{HoBu}
\newcommand{ \mention}[1] { \emph{[p.\pageref{artist:#1}]}}
\makeatletter
\newcommand{\lmention}[2][$,$]{%
\def\nextitem{\def\nextitem{#1}}%
\@for \el:=#2\do{\nextitem\el}%
}
\makeatother
\begin{document}
\artist{Arty Blow}{Arty}
\artist{Jo Blow}{Jo}
What I want is the stylised \mention{Arty}
What would be nice would be an arg count to say p.18 or pp.18,23,24
A list of mentions is \lmention{Arty,Jo,Fred} tho we havent talked about Fred
Did I forget \lmention{Bart} who is yet to be referenced
\artist{Bart Beast}{Bart}
\artist{Fred Geest}{Fred}
\end{document}
```
Long story, short question?
How can I get it to do the \pageref lookup on an arg by arg basis
I try
```
\newcommand{\lmention}[2][$:$]{%
\def\nextitem{\def\nextitem{#1}}%
\@for \el:=#2\do{\pageref{artist:#2}\nextitem\el}%
}
```
but get
```
A list of mentions is ??Arty??:Jo??:Fred tho we havent talked about Fred
```
Well out of my depth here
|
https://tex.stackexchange.com/users/240033
|
handling a variable number of pagerefs
| false |
You can define your `\lmention` using TeX primitives and classical TeX recursive loop.
```
\def\lmention#1{\lmentionA#1,\end,}
\def\lmentionA#1,#2,{\ifx\end#2 [p.\pageref{artist:#1}]\else
[pp.\pageref{artist:#1}\afterfi{\lmentionB#2,}\fi
}
\def\lmentionB#1,#2,{,\pageref{artist:#1}%
\ifx\end#2]\else \afterfi{\lmentionB#2,}\fi
}
\def\afterfi #1#2\fi{\fi#1}
```
Note that this macro works with single parameter like your `\mention`, i.e. expands to the [p.page]. In other cases it expands to [pp.list-of-pages].
|
2
|
https://tex.stackexchange.com/users/51799
|
691841
| 320,932 |
https://tex.stackexchange.com/questions/689363
|
0
|
I'm writing a discussion document where contributors get their own pages and I want to mention these pages in the general text
So I have this which seems to do the trick
```
% usage: create printed page space for artist and the short form reference
% \artist{Jo Blow}{JoBl}
\newcommand{\artist}[2]{
\newpage
\subsection{#1}
Lorem ipsum
\newpage
Et tu quoque! #2\label{artist:#2}
% page reserved for artwork by #1
}
% obtain page numbering for artist image page given shortform reference
% \mention{JoBl}
\newcommand{ \mention}[1] { \emph{[p.\pageref{artist:#1}]}}
```
but I wanted to extend mention{} to take a variable length list of arguments
I found this [iterating-through-comma-separated-arguments](https://tex.stackexchange.com/questions/87407/iterating-through-comma-separated-arguments)
A case of running before I can walk, but bear with me I'm only a stupid artist, I tried this
```
%!TEX TS-program = lualatex
%!TEX encoding = UTF-8 Unicode
\documentclass{article}
\newcommand{\artist}[2]{
\newpage
\subsection{#1}
Lorem ipsum
\newpage
Et tu quoque! #2\label{artist:#2}
% page reserved for artwork by #1
}
% obtain page numbering for artist image page given short form reference
% \mention{HoBu}
\newcommand{ \mention}[1] { \emph{[p.\pageref{artist:#1}]}}
\makeatletter
\newcommand{\lmention}[2][$,$]{%
\def\nextitem{\def\nextitem{#1}}%
\@for \el:=#2\do{\nextitem\el}%
}
\makeatother
\begin{document}
\artist{Arty Blow}{Arty}
\artist{Jo Blow}{Jo}
What I want is the stylised \mention{Arty}
What would be nice would be an arg count to say p.18 or pp.18,23,24
A list of mentions is \lmention{Arty,Jo,Fred} tho we havent talked about Fred
Did I forget \lmention{Bart} who is yet to be referenced
\artist{Bart Beast}{Bart}
\artist{Fred Geest}{Fred}
\end{document}
```
Long story, short question?
How can I get it to do the \pageref lookup on an arg by arg basis
I try
```
\newcommand{\lmention}[2][$:$]{%
\def\nextitem{\def\nextitem{#1}}%
\@for \el:=#2\do{\pageref{artist:#2}\nextitem\el}%
}
```
but get
```
A list of mentions is ??Arty??:Jo??:Fred tho we havent talked about Fred
```
Well out of my depth here
|
https://tex.stackexchange.com/users/240033
|
handling a variable number of pagerefs
| false |
You can use `expl3` that provides all the tools you need.
As you see, there's just the `\mention` command, that can distinguish whether one or more references are provided.
```
\documentclass{article}
\newcommand{\artist}[2]{%
\newpage
\subsection{#1}
Lorem ipsum
\newpage
Et tu quoque! #2\label{artist:#2}
% page reserved for artwork by #1
}
\ExplSyntaxOn
\NewDocumentCommand{\mention}{m}
{
\aldobranti_mention:n { #1 }
}
\seq_new:N \l__aldobranti_mention_ref_seq
\tl_new:N \l__aldobranti_mention_first_tl
\cs_new_protected:Nn \aldobranti_mention:nn
{
% divide the item at the given delimiter
\seq_set_from_clist:Nn \l__aldobranti_mention_ref_seq { #1 }
% detach the last item
\seq_pop_right:NN \l__aldobranti_mention_ref_seq \l__aldobranti_mention_first_tl
% now process
\aldobranti_mention_format:n
{
% if the sequence is empty, there was just one item: issue 'p.'; otherwise 'pp.'
\seq_if_empty:NTF \l__aldobranti_mention_ref_seq { p. } { pp. } \nobreakspace
% now map the sequence to give 'pageref,<space>'
\seq_map_inline:Nn \l__aldobranti_mention_ref_seq { \pageref{artist:##1},~ }
% last item should not have comma and space
\pageref{artist:\l__aldobranti_mention_first_tl}
}
}
\cs_new_protected:Nn \aldobranti_mention_format:n
{% format the whole block (change as desired)
\textup{[}
\hspace*{0.1em}
\textit{#1}
\hspace*{0.1em}
\textup{]}
}
\ExplSyntaxOff
\begin{document}
\artist{Arty Blow}{Arty}
\artist{Jo Blow}{Jo}
What I want is the stylised \mention{Arty}
What would be nice would be an arg count to say p.18 or pp.18,23,24
A list of mentions is \mention{Arty,Jo,Fred} tho we haven't talked about Fred
Did I forget \mention{Bart} who is yet to be referenced
\artist{Bart Beast}{Bart}
\artist{Fred Geest}{Fred}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/4427
|
691844
| 320,933 |
https://tex.stackexchange.com/questions/643627
|
10
|
I am familiar with the package moodle. I however have a question in a reverse direction.
Is there a method or tool to convert xml moodle question banks to LaTeX?
Edit:
A sample of an xml file is like below
```
<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 0 -->
<question type="category">
<category>
<text>$course$/top/Default for my course</text>
</category>
<info format="moodle_auto_format">
<text>The default category for questions shared in context 'my course'.</text>
</info>
<idnumber></idnumber>
</question>
<!-- question: 137829 -->
<question type="essay">
<name>
<text>Vector space problem</text>
</name>
<questiontext format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">Prove that a vector space cannot be written as a union of two proper subspaces.<br></p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[If we replace 'two' by 'three" the assertion may not be true.<br>]]></text>
</generalfeedback>
<defaultgrade>7.0000000</defaultgrade>
<penalty>0.0000000</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<responseformat>editorfilepicker</responseformat>
<responserequired>0</responserequired>
<responsefieldlines>15</responsefieldlines>
<attachments>-1</attachments>
<attachmentsrequired>0</attachmentsrequired>
<maxbytes>0</maxbytes>
<filetypeslist>.odt,.pdf</filetypeslist>
<graderinfo format="html">
<text><![CDATA[The assertion is true for groups as well.<br>]]></text>
</graderinfo>
<responsetemplate format="html">
<text></text>
</responsetemplate>
</question>
<!-- question: 128217 -->
<question type="multichoice">
<name>
<text>Querstion 2</text>
</name>
<questiontext format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">The number of the subgroups of the alternating group \( A_4 \) is:<br></p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[\( A_4 \) is the subgroup of the symmetric group \( S_4 \) consisting of even permutations.<br>]]></text>
</generalfeedback>
<defaultgrade>10.0000000</defaultgrade>
<penalty>0.3333333</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<single>true</single>
<shuffleanswers>true</shuffleanswers>
<answernumbering>abc</answernumbering>
<showstandardinstruction>0</showstandardinstruction>
<correctfeedback format="html">
<text>Your answer is correct.</text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text>Your answer is partially correct.</text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text>Your answer is incorrect.</text>
</incorrectfeedback>
<shownumcorrect/>
<answer fraction="0" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">8<br></p>]]></text>
<feedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">oops!<br></p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">9<br></p>]]></text>
<feedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">oops!<br></p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">10<br></p>]]></text>
<feedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">Yes!<br></p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">11<br></p>]]></text>
<feedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">oops!<br></p>]]></text>
</feedback>
</answer>
</question>
<!-- question: 128220 -->
<question type="multichoice">
<name>
<text>Question 6</text>
</name>
<questiontext format="html">
<text><![CDATA[What is \( \lim_{n\to\infty}(1+\frac{1}{n})^n \)?<br>]]></text>
</questiontext>
<generalfeedback format="html">
<text></text>
</generalfeedback>
<defaultgrade>3.0000000</defaultgrade>
<penalty>0.3333333</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<single>true</single>
<shuffleanswers>true</shuffleanswers>
<answernumbering>abc</answernumbering>
<showstandardinstruction>0</showstandardinstruction>
<correctfeedback format="html">
<text>Your answer is correct.</text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text>Your answer is partially correct.</text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text>Your answer is incorrect.</text>
</incorrectfeedback>
<shownumcorrect/>
<answer fraction="100" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">e<br></p>]]></text>
<feedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">Yes.<br></p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">exp(1)<br></p>]]></text>
<feedback format="html">
<text></text>
</feedback>
</answer>
<answer fraction="80" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">2.7<br></p>]]></text>
<feedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">Good.<br></p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">2.9<br></p>]]></text>
<feedback format="html">
<text>near!</text>
</feedback>
</answer>
</question>
<!-- question: 128219 -->
<question type="numerical">
<name>
<text>Question 5</text>
</name>
<questiontext format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">What is the approximate value of \( \int_1^2\frac{1}{x}dx? \)<br></p>]]></text>
</questiontext>
<generalfeedback format="html">
<text></text>
</generalfeedback>
<defaultgrade>7.0000000</defaultgrade>
<penalty>0.3333333</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<answer fraction="100" format="moodle_auto_format">
<text>0.693147</text>
<feedback format="html">
<text></text>
</feedback>
<tolerance>0.001</tolerance>
</answer>
<answer fraction="50" format="moodle_auto_format">
<text>0.693147</text>
<feedback format="html">
<text></text>
</feedback>
<tolerance>0.01</tolerance>
</answer>
<unitgradingtype>0</unitgradingtype>
<unitpenalty>0.1000000</unitpenalty>
<showunits>3</showunits>
<unitsleft>0</unitsleft>
</question>
<!-- question: 128218 -->
<question type="shortanswer">
<name>
<text>Question 3</text>
</name>
<questiontext format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">What is the number of the subgroups of the alternating group \( A_4 \)?<br></p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">You should specify a number.<br></p>]]></text>
</generalfeedback>
<defaultgrade>2.0000000</defaultgrade>
<penalty>0.3333333</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<usecase>0</usecase>
<answer fraction="100" format="moodle_auto_format">
<text>10</text>
<feedback format="html">
<text></text>
</feedback>
</answer>
<answer fraction="100" format="moodle_auto_format">
<text>ten</text>
<feedback format="html">
<text></text>
</feedback>
</answer>
<answer fraction="100" format="moodle_auto_format">
<text>dix</text>
<feedback format="html">
<text></text>
</feedback>
</answer>
</question>
<!-- question: 128216 -->
<question type="truefalse">
<name>
<text>Question 1</text>
</name>
<questiontext format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">The vector space \( \mathbb{R}^3 \) has just four subspaces.<br></p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p dir="ltr" style="text-align: left;">General feedback: Subspace means subvector space.<br></p>]]></text>
</generalfeedback>
<defaultgrade>1.0000000</defaultgrade>
<penalty>1.0000000</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<answer fraction="0" format="moodle_auto_format">
<text>true</text>
<feedback format="html">
<text><![CDATA[<p>This space has infinitely many subspace!</p><br>]]></text>
</feedback>
</answer>
<answer fraction="100" format="moodle_auto_format">
<text>false</text>
<feedback format="html">
<text><![CDATA[<p>Bravo.<br></p>]]></text>
</feedback>
</answer>
</question>
</quiz>
```
|
https://tex.stackexchange.com/users/39306
|
moodle xml conversion to LaTeX
| false |
I'm actually working on the project started by @mgk, in a [fork](https://framagit.org/iiturbeb/xmoodle2tex.git):
* I've corrected some bugs related to image files (were not allways saved properly)
* I've "supported" the "calculatedsimple" question type, by converting it "shortanswer" type in order to be able to "compile" the generated code.
* I've set several options to generate the code in separated files
* ...
I will certainly make an important refactoring to the code on the following weeks, but I'll be gratefull to know if someone have been doing similar things. @projetmbc you proposed the refactoring, but did you do something finally?
|
1
|
https://tex.stackexchange.com/users/301244
|
691846
| 320,935 |
https://tex.stackexchange.com/questions/323751
|
15
|
How do I create a pdf file with a transparent background?
```
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\nopagecolor
hi
\end{document}
```
This doesn't work since `\nopagecolor` resets the page color to the default background, but how do I make it transparent, as one can with e.g. a png image?
|
https://tex.stackexchange.com/users/43843
|
how to create a pdf with a transparent background
| false |
I know this is an old post but this might help someone using Overleaf.
Create a file called latexmkrc. Populate it with the following:
```
END { system('convert -density 600 -background transparent -flatten output.pdf pages.png'); }
```
Compile this file.
In the logs, scroll down and select other logs and files. Your transparent file is "pages.png".
|
0
|
https://tex.stackexchange.com/users/290271
|
691847
| 320,936 |
https://tex.stackexchange.com/questions/691848
|
3
|
The following code produces error `! Missing \endgroup <inserted text>.` What is causing the error? It seems that the `breqn` is not working inside tabular environment.
```
\documentclass{article}
\usepackage{breqn}
\begin{document}
\begin{tabular}{l}
\begin{dmath*}
f (1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) +
f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1)
\end{dmath*}
\end{tabular}
\end{document}
```
|
https://tex.stackexchange.com/users/75476
|
Line-breaking equations in a tabular environment
| true |
`dmath` is a vertical display construct so can not work in an `l` column which is like `\mbox`. Use a `p{...}` column so it is in vertical mode, and has a target width for line breaking.
|
3
|
https://tex.stackexchange.com/users/1090
|
691849
| 320,937 |
https://tex.stackexchange.com/questions/691848
|
3
|
The following code produces error `! Missing \endgroup <inserted text>.` What is causing the error? It seems that the `breqn` is not working inside tabular environment.
```
\documentclass{article}
\usepackage{breqn}
\begin{document}
\begin{tabular}{l}
\begin{dmath*}
f (1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) +
f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1)
\end{dmath*}
\end{tabular}
\end{document}
```
|
https://tex.stackexchange.com/users/75476
|
Line-breaking equations in a tabular environment
| false |
I see no reason for a `tabular`.
```
\documentclass{article}
\usepackage{breqn}
\begin{document}
You can see an important quantity in table~\ref{q-important}.
\begin{table}[htp]
\begin{dmath*}
f (1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) +
f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1)
\end{dmath*}
\caption{This is an important quantity\label{q-important}}
\end{table}
\end{document}
```
|
3
|
https://tex.stackexchange.com/users/4427
|
691850
| 320,938 |
https://tex.stackexchange.com/questions/691778
|
2
|
I'm trying to have numbered paragraphs:
```
\documentclass{article}
\newcounter{para}
\setcounter{secnumdepth}{4}
\begin{document}
\section{Lorum ipsum}
\subsection{Lorum ipsum}
\paragraph{} Lorum ipsum
\end{document}
```
However, I do get an unnecessary "0" in numbering - so the paragraph in the example is 1.1.0.1. How can I avoid this?
|
https://tex.stackexchange.com/users/592
|
How to remove "0" from numbers of paragraphs when they are not in subsubsection
| false |
A modification to [Mico’s answer](https://tex.stackexchange.com/a/691779/4427), needed for a couple of reasons:
1. this is simpler code and more easily customizable;
2. you seem to use `\paragraph` with empty argument, so we need to fix the spacing.
```
\documentclass{article}
\usepackage{lipsum} % filler text
\setcounter{secnumdepth}{4} % default: 3
% Suppress value of subsubsection counter if equal to 0:
\renewcommand{\thesubsubsection}{%
\thesubsection
\ifnum\value{subsubsection}>0
.\arabic{subsubsection}%
\fi
}
\makeatletter
% by default, the fifth argument is -1em, but you don't want this amount
\renewcommand{\paragraph}{%
\@startsection{paragraph}% level name
{4}% level number
{\z@}% indentation
{3.25ex \@plus 1ex \@minus .2ex}% space before
{-1sp}% space after (negative for inline)
{\normalfont\normalsize\bfseries}% formatting
}
\makeatother
\begin{document}
\section{A first section title}
\subsection{This has no third level sections}
\paragraph{} \lipsum[1][1-3]
\section{A second section title}
\subsection{This has a third level section}
\subsubsection{Whatever you want}
\paragraph{} \lipsum[2][1-3]
\end{document}
```
If you change the code into
```
% Suppress value of subsubsection counter if equal to 0
% and make subsubsections letter numbered
\renewcommand{\thesubsubsection}{%
\thesubsection
\ifnum\value{subsubsection}>0
.\alph{subsubsection}%
\fi
}
```
you'd get something that would help in distinguishing the levels.
|
1
|
https://tex.stackexchange.com/users/4427
|
691851
| 320,939 |
https://tex.stackexchange.com/questions/691848
|
3
|
The following code produces error `! Missing \endgroup <inserted text>.` What is causing the error? It seems that the `breqn` is not working inside tabular environment.
```
\documentclass{article}
\usepackage{breqn}
\begin{document}
\begin{tabular}{l}
\begin{dmath*}
f (1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) +
f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1)
\end{dmath*}
\end{tabular}
\end{document}
```
|
https://tex.stackexchange.com/users/75476
|
Line-breaking equations in a tabular environment
| false |
*For referencing purpose. The output is put in a table which is referred*
You could remove the star and have a numbered equation to refer to. If you have a particular use case for captions, you may consider creating and formatting a custom float with a new label. It is also possible to format references.
Here is example code with an arbitrary new float `annotation`
```
\documentclass{article}
\usepackage{breqn}
\usepackage{newfloat,caption,cleveref}
\DeclareFloatingEnvironment[
fileext=note,
listname={List of annotations},
name=Annotation,
placement=htp,
]{annotation}
\captionsetup[annotation]{position=bottom,skip=3pt} % labelfont=bf
\crefformat{annotation}{Annotation~(#2#1#3)}
\usepackage{kantlipsum} % for dummy texts
\begin{document}
% \listofannotations\vspace{\baselineskip} % Creates a list of annotations
\kant[1][1]
\begin{annotation}
\begin{dmath*}
f (1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) +
f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1)
\end{dmath*}
\caption{Sum of functions}\label{note:1}
\end{annotation}
\kant[1][2]
A regular reference: \eqref{note:1}, and reference with a label via \verb!cleveref!: \Cref{note:1}.
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/31283
|
691857
| 320,943 |
https://tex.stackexchange.com/questions/691805
|
2
|
For some reason, TexShop started autocompleting any ampersand & by adding a period/full stop, which is not a feature that I consider desirable, given that I almost exclusively use the symbol for tabular and align environments. I feel that there is probably a simple way to turn this behavior off in the preferences, but I couldn't see how to do so. How do I change the default behavior?
|
https://tex.stackexchange.com/users/297024
|
TexShop Autocompletes & with a period
| false |
The comment of Alan Munn solved the problem; it was a MacOS autocomplete issue, now resolved. ("add period after double space")
|
2
|
https://tex.stackexchange.com/users/297024
|
691860
| 320,944 |
https://tex.stackexchange.com/questions/691863
|
5
|
>
> **Exercise 8.6**. Assume that the category codes of plain TEX are in force, except that the characters `^^A`, `^^B`, `^^C`, `^^M` belong respectively to categories 0, 7, 10, and 11. What tokens are produced from the (rather ridiculous) input line `^^B^^BM^^A^^B^^C^^M^^@\M␣`? (Remember that this line is followed by ⟨return⟩, which is `^^M`; and recall that `^^@` denotes the ⟨null⟩ character, which has category 9 when INITEX begins.)
>
>
>
To recall, `0` is for escape, `7` is for superscript, `10` is for space, and `11` is for letters.
The answer given is:
`^^B`7
`^^B`7
`M`11
`|^^B|`
`␣`10
`^^M`7
`|M^^M|`.
(I have used `|cs|` to denote the control sequence name "cs".)
**Question:** Why is `␣`10 there!? Firstly, `^^C` is a non-letter character that follows `^^A^^B` (an escape character followed by a non-letter), and thus goes into state S (*not* M), and it's clearly written that in such a case, any space character is "simply passed by".
|
https://tex.stackexchange.com/users/207649
|
Exercise 8.6 of The TeXbook
| false |
after an escape character followed by a character not of catcode 11, tex goes in to state M unless the character was a space. so spaces are skipped after `\` but not after `\$` or after `^^A^^B`
|
5
|
https://tex.stackexchange.com/users/1090
|
691865
| 320,946 |
https://tex.stackexchange.com/questions/691863
|
5
|
>
> **Exercise 8.6**. Assume that the category codes of plain TEX are in force, except that the characters `^^A`, `^^B`, `^^C`, `^^M` belong respectively to categories 0, 7, 10, and 11. What tokens are produced from the (rather ridiculous) input line `^^B^^BM^^A^^B^^C^^M^^@\M␣`? (Remember that this line is followed by ⟨return⟩, which is `^^M`; and recall that `^^@` denotes the ⟨null⟩ character, which has category 9 when INITEX begins.)
>
>
>
To recall, `0` is for escape, `7` is for superscript, `10` is for space, and `11` is for letters.
The answer given is:
`^^B`7
`^^B`7
`M`11
`|^^B|`
`␣`10
`^^M`7
`|M^^M|`.
(I have used `|cs|` to denote the control sequence name "cs".)
**Question:** Why is `␣`10 there!? Firstly, `^^C` is a non-letter character that follows `^^A^^B` (an escape character followed by a non-letter), and thus goes into state S (*not* M), and it's clearly written that in such a case, any space character is "simply passed by".
|
https://tex.stackexchange.com/users/207649
|
Exercise 8.6 of The TeXbook
| true |
This is explained in page 47:
>
> if TeX sees a character of category 10, the action depends on the current state. If is in state N or S it is passed by and remained in same state. Otherwise in state M the character is converted to space (character code 32) with catcode 10, and entering state S. The character code in a space token is always 32.
>
>
>
And on page 46,
>
> If TeX sees a category 0 in any state, …
> (b) if the next character is not of category 11, the name consists of that symbol. … This name becomes a control sequence token. TeX goes to state S … in case (b) with respect to a character of category 10, otherwise TeX goes into state M.
>
>
>
So it is in state M after `^^A^^B`, because `^^B` is not of category 10.
|
7
|
https://tex.stackexchange.com/users/246082
|
691866
| 320,947 |
https://tex.stackexchange.com/questions/689723
|
3
|
Is there a ready-made LaTeX package that produces a calendar in a format known as *Familienplaner* in German speaking countries:
Each month is set as a table on one sheet of paper. There is one row per day, and there are additional empty columns to be filled in (between one and five, typically). Sundays are specially marked (e.g., by red colour of the date, or by a grey row instead of a white one).
Nice-to-have features: German language support for day-of-week and month names, week numbers, German holidays.
P.S. Searching the net for "Familienplaner" results in a lot of free pdf offers for such calendars.
P.P.S. The *Familienplaner* layout is different from the monthly calendar layout of this question: [Calendar in LaTeX](https://tex.stackexchange.com/q/170462/50351)
|
https://tex.stackexchange.com/users/50351
|
Calendar in "Familienplaner" format?
| false |
Since there is no answer after one month here and own research also did not bring up such a package, I conclude that there is currently no popular calendar package for LaTeX implementing a *Familienplaner* layout.
|
0
|
https://tex.stackexchange.com/users/50351
|
691867
| 320,948 |
https://tex.stackexchange.com/questions/691780
|
1
|
I have a basic scheme of TeX Live installed. I installed the KOMA-Script package via tlmgr but when I try to compile my document, I get the ! LaTeX Error: File `scrartcl.cls' not found. I also tried with another class (scrbook). I used a MWE example:
```
\documentclass{scrartcl}
\begin{document}
test
\end{document}
```
I paste below the output when compiling from terminal:
```
(base) ignacio@ThinkPadE14g3:~$ tlmgr install koma-script
tlmgr: package repository https://ctan.mc1.root.project-creative.net/systems/texlive/tlnet (verified)
[1/2, ??:??/??:??] install: footmisc [533k]
[2/2, 00:01/00:14] install: koma-script [7176k]
running mktexlsr ...
done running mktexlsr.
tlmgr: package log updated: /usr/local/texlive/2023/texmf-var/web2c/tlmgr.log
tlmgr: command log updated: /usr/local/texlive/2023/texmf-var/web2c/tlmgr-commands.log
(base) ignacio@ThinkPadE14g3:~$ cd Downloads/
(base) ignacio@ThinkPadE14g3:~/Downloads$ pdflatex test.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2023-06-01>
L3 programming layer <2023-06-05>
! LaTeX Error: File `scrartcl.cls' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
Enter file name:
```
|
https://tex.stackexchange.com/users/292228
|
KOMA-Script installed but class not found
| true |
As you told in an command the class file `/usr/local/texlive/2023/texmf-dist/tex/latex/koma-script/scrartcl.cls` does not exist and this is also the tree used by your TeX Live distribution. So not finding `scrartcl.cls` usually happens, because the ls-R database has not been updated after installation of package `koma-script`. I do not know, why this happens. But manually updating it should help. To do so, you should either use `texhash` or `sudo texhash` (`sudo` is only needed, of your user has not permission to write to directory `/usr/local/texlive/2023/texmf-dist/`).
Alternatively you could try `tlmgr install --reinstall koma-script` (use `sudo` if needed) to re-install `koma-script` and `kpsewhich scrartcl.cls` to see whether the ls-R database has been updated by the re-installation.
|
2
|
https://tex.stackexchange.com/users/277964
|
691869
| 320,949 |
https://tex.stackexchange.com/questions/691873
|
1
|
I would (like many before me) like to take my lecture notes using LaTeX. As writing pure LaTeX-code is very time consuming and not nearly as fast as handwriting, I can only really consider switching to LaTeX if I can use snippets and anything else that makes notetaking faster.
I have discovered [this](https://castel.dev/post/lecture-notes-1/) post on how to get faster using vim, but at this point I don't really want to learn vim anymore. I know it is very hyped, and probably worth learning, but I have so much else do learn already that I don't know if I will ever find the time. At the moment I am very happy with VS Code (or really VSCodium) for all developing, scripting and stuff that I do, and as I can perfectly do just about everything within this one editor, I would very much like to keep it.
Saying this, has anyone an idea or a hint for me on how to set up something like the blog post describes using VS Code? That would be very appreciated.
|
https://tex.stackexchange.com/users/270796
|
Write Lecture Notes in VS Code
| false |
If you have the LaTeX Workshop extension installed (which I recommend) then many command completions are already installed which should speed up your input considerably. But you can add custom snippets to your editor environment to add more complex bits of markup.
To do this, go to Settings -> Configure User Snippets and then choose LaTeX as your language.
Snippets in VSCode have the following structure:
```
"Snippet Name": {
"prefix": "...",
"body": [ ... ],
"description": "..."
}
```
The prefix is the element you want type to insert the snippet. The body is an array object containing the code you want to insert. Each element of the array is a line. Within the body you can use `$1`, `$2` etc. to mark insertion points. These will be traversed sequentially using the Tab key when the snippet is inserted.
For more details see: <https://code.visualstudio.com/docs/editor/userdefinedsnippets>
Example
-------
I use the `gb4e` package extensively, so here's an example of a snippet that inserts a block of code corresponding to a linguistic example. Note that backslashes need to be doubled.
The snippet is the following:
```
"Insert Example":{
"prefix": "exe",
"body": [
"\\begin{exe}",
" \\ex\\label{$1}",
" \\begin{xlist}",
" \\ex{$2}",
" \\end{xlist}",
"\\end{exe}"
],
"description": "gb4e example"
}
```
When I type `exe` in the editor it gives me a selection to choose:
I then insert the snippet, and the following code is added to my document.
```
\begin{exe}
\ex\label{}
\begin{xlist}
\ex{}
\end{xlist}
\end{exe}
```
The cursor is placed inside the `\label{}` braces, so that I can enter a label for the example. If I then hit the Tab key the cursor will move to inside the `\ex{}` braces so that I can insert the first example.
|
1
|
https://tex.stackexchange.com/users/2693
|
691875
| 320,952 |
https://tex.stackexchange.com/questions/691889
|
7
|
How would one align the RHS by the "8"s in the following? I tried adding another column, and then left aligning the "999998" right, and the "00001" left, but there was a giant gap...
```
Table~\ref{tab:myNines} comes from the algebraic identitiy,
$(a-b)^2 = a^2 - 2ab + b^2$, taking $a=10^n$ and $b=1$.
\begin{table}[]
\centering
\begin{tabular}{l c l}
$9^2$ &$=$ &$81$\\
$99^2$ &$=$ &$9801$\\
$999^2$ &$=$ &$998001$\\
$9999^2$ &$=$ &$99980001$\\
$99999^2$ &$=$ &$9999800001$\\
$999999^2$ &$=$ &$999998000001$\\
$9999999^2$ &$=$ &$99999980000001$\\
$99999999^2$ &$=$ &$9999999800000001$\\
$999999999^2$ &$=$ &$999999998000000001$\\
$9999999999^2$ &$=$ &$99999999980000000001$
\end{tabular}
\caption{Note the Nines}
\label{tab:myNines}
\end{table}
```
|
https://tex.stackexchange.com/users/289717
|
align by any character in tabular
| true |
Piece of cake with the [dcolumn](https://www.ctan.org/pkg/dcolumn) package and its `D` column type.
I'm pretty sure that the `D` column type is used much more frequently with `.` or `,` as the decimal marker. However, there's no reason for not using some other symbol -- say, the numeral `8` -- as the input and output "decimal marker".
Aside: By using an `array` enviroment instead of a `tabular` environment, one doesn't have to provide all those `$` inline-math delimiters.
```
\documentclass{article}
\usepackage{dcolumn} % for 'D' column type
\begin{document}
Table~\ref{tab:myEights} comes from the algebraic identity $(a-b)^2 = a^2 - 2ab + b^2$, putting $a=10^n$ and $b=1$.
\begin{table}[h]
\centering
$\begin{array}{r @{{}={}} D{8}{8}{9.10}} % '9.10': 9 digits before '8', 10 digits after '8'
9^2 & 81\\
99^2 & 9801\\
999^2 & 998001\\
9999^2 & 99980001\\
99999^2 & 9999800001\\
999999^2 & 999998000001\\
9999999^2 & 99999980000001\\
99999999^2 & 9999999800000001\\
999999999^2 & 999999998000000001\\
9999999999^2 & 99999999980000000001
\end{array}$
\caption{Note the Eights} \label{tab:myEights}
\end{table}
\end{document}
```
---
*Addendum* -- some additional considerations, in no particular order>
* If you wanted to highlight the `8` numerals by, say, rendering them in blue, all you'd have to change is (a) load the `xcolor` package and (b) replace `D{8}{8}` with `D{8}{\color{blue}8}`.
* If you want to increase the line spacing in the `array` by, say, 30%, just issue the instruction `\renewcommand\arraystretch{1.3}` immediately before `\begin{array}`.
* If you're free to compile your document with LuaLaTeX, you could generate the contents of the `array` environment programmatically via a Lua `for` loop. E.g., to generate a nine-row `array`, you could run
```
$\begin{array}{r @{{}={}} D{8}{8}{8.9}}
\directlua{
```
```
for i=1,9 do
j = math.floor(10^i-1) % convert to 'integer' data type
tex.sprint ( j .. "^2 & " .. j*j .. "\\\\")
end
```
```
}
\end{array}$
```
---
*Second addendum*: In the preceding code, values of `n` greater than about 10 can lead to overflows in the calculations that generate `n^2`. (Lua can do integer arithmetic; however, overflows can still occur.) If you plan on showing arrays with more than 10 rows, you could switch to performing *string operations* to generate `n^2`. (Observe that for an integer `n` greater than 1, `n^2` may be written as the concatenation of n-1 copies of `9`, 1 copy of `8`, n-1 copies of `0`, and 1 copy of `1`.)
The following code produces two such arrays -- the first for `n=1`, and the second for `n=20`. Observe that the code for the second argument of the `D` column type is set to `\color{blue}8` and that the third argument of the `D` column type is evaluated "on the fly" -- `n-1` digits before the `8` marker and `n` digits after the `8` marker -- in order to guaranteed a compact appearance.
```
\documentclass{article}
\usepackage{xcolor} % for '\color' command
\usepackage{dcolumn} % for 'D' column type
% The Lua function 'myarray' does almost all of the work
\directlua{%
```
```
function myarray ( n ) % "n" should be an integer
tex.sprint ( "\\begin{array}{r @{{}={}} D{8}{\\color{blue}8}{"
.. n-1 .. "." .. n .."}}" )
for i=1,n do
tex.sprint ( string.rep ("9",i ) .. "^2 & " ..
string.rep ("9",i-1) .. "8" ..
string.rep ("0",i-1) .. "1\\\\" )
end
tex.sprint ( "\\end{array}" )
end
```
```
}
% LaTeX utility macro to access the Lua function
\newcommand\myarray[1]{$\directlua{myarray(#1)}$}
\begin{document}
\begin{table}[h]
\centering
\myarray{1}
\medskip
\myarray{20}
\caption{Note the nines and zeroes}
\label{tab:myNines}
\end{table}
\end{document}
```
|
10
|
https://tex.stackexchange.com/users/5001
|
691890
| 320,960 |
https://tex.stackexchange.com/questions/691889
|
7
|
How would one align the RHS by the "8"s in the following? I tried adding another column, and then left aligning the "999998" right, and the "00001" left, but there was a giant gap...
```
Table~\ref{tab:myNines} comes from the algebraic identitiy,
$(a-b)^2 = a^2 - 2ab + b^2$, taking $a=10^n$ and $b=1$.
\begin{table}[]
\centering
\begin{tabular}{l c l}
$9^2$ &$=$ &$81$\\
$99^2$ &$=$ &$9801$\\
$999^2$ &$=$ &$998001$\\
$9999^2$ &$=$ &$99980001$\\
$99999^2$ &$=$ &$9999800001$\\
$999999^2$ &$=$ &$999998000001$\\
$9999999^2$ &$=$ &$99999980000001$\\
$99999999^2$ &$=$ &$9999999800000001$\\
$999999999^2$ &$=$ &$999999998000000001$\\
$9999999999^2$ &$=$ &$99999999980000000001$
\end{tabular}
\caption{Note the Nines}
\label{tab:myNines}
\end{table}
```
|
https://tex.stackexchange.com/users/289717
|
align by any character in tabular
| false |
Using `alignat` from [`amsmath`](//ctan.org/pkg/amsmath) in two different ways, depending on the alignment of the first "column":
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Table~\ref{tab:myNines} comes from the algebraic identitiy, $(a - b)^2 = a^2 - 2ab + b^2$, taking $a = 10^n$ and $b = 1$.
\begin{table}
\begin{alignat*}{3}
& 9^2 & {}={} && &81 \\
& 99^2 & {}={} && 9&801 \\
& 999^2 & {}={} && 99&8001 \\
& 9999^2 & {}={} && 999&80001 \\
& 99999^2 & {}={} && 9999&800001 \\
& 999999^2 & {}={} && 99999&8000001 \\
& 9999999^2 & {}={} && 999999&80000001 \\
& 99999999^2 & {}={} && 9999999&800000001 \\
& 999999999^2 & {}={} && 99999999&8000000001 \\
& 9999999999^2 & {}={} && 999999999&80000000001
\end{alignat*}
\begin{alignat*}{2}
9^2 & ={} & &81 \\
99^2 & ={} & 9&801 \\
999^2 & ={} & 99&8001 \\
9999^2 & ={} & 999&80001 \\
99999^2 & ={} & 9999&800001 \\
999999^2 & ={} & 99999&8000001 \\
9999999^2 & ={} & 999999&80000001 \\
99999999^2 & ={} & 9999999&800000001 \\
999999999^2 & ={} & 99999999&8000000001 \\
9999999999^2 & ={} & 999999999&80000000001
\end{alignat*}
\caption{Note the Nines}
\label{tab:myNines}
\end{table}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/5764
|
691892
| 320,962 |
https://tex.stackexchange.com/questions/691889
|
7
|
How would one align the RHS by the "8"s in the following? I tried adding another column, and then left aligning the "999998" right, and the "00001" left, but there was a giant gap...
```
Table~\ref{tab:myNines} comes from the algebraic identitiy,
$(a-b)^2 = a^2 - 2ab + b^2$, taking $a=10^n$ and $b=1$.
\begin{table}[]
\centering
\begin{tabular}{l c l}
$9^2$ &$=$ &$81$\\
$99^2$ &$=$ &$9801$\\
$999^2$ &$=$ &$998001$\\
$9999^2$ &$=$ &$99980001$\\
$99999^2$ &$=$ &$9999800001$\\
$999999^2$ &$=$ &$999998000001$\\
$9999999^2$ &$=$ &$99999980000001$\\
$99999999^2$ &$=$ &$9999999800000001$\\
$999999999^2$ &$=$ &$999999998000000001$\\
$9999999999^2$ &$=$ &$99999999980000000001$
\end{tabular}
\caption{Note the Nines}
\label{tab:myNines}
\end{table}
```
|
https://tex.stackexchange.com/users/289717
|
align by any character in tabular
| false |
Just use an additional alignment point before the digits 8. Using `@{}` removes the intercolumn space. To ease input, I inserted `{}={}` between the first and second column automatically.
```
\documentclass{article}
\begin{document}
Table~\ref{tab:myNines} comes from the algebraic identitiy,
$(a-b)^2 = a^2 - 2ab + b^2$, taking $a=10^n$ and $b=1$.
\begin{table}[htp]
\centering
$\begin{array}{ l @{{}={}} r@{}l }
9^2 & &81\\
99^2 & 9&801\\
999^2 & 99&8001\\
9999^2 & 999&80001\\
99999^2 & 9999&800001\\
999999^2 & 99999&8000001\\
9999999^2 & 999999&80000001\\
99999999^2 & 9999999&800000001\\
999999999^2 & 99999999&8000000001\\
9999999999^2 & 999999999&80000000001\\
\end{array}$
\caption{Note the Nines}
\label{tab:myNines}
\end{table}
\end{document}
```
You can even let TeX do the computations.
```
\documentclass{article}
\usepackage{bigintcalc}
\ExplSyntaxOn
\cs_new_protected:Nn \__egreg_squarenines:n
{
\tl_set:Nx \l_tmpa_tl { \prg_replicate:nn { #1 } { 9 } }
\tl_set:Nx \l_tmpb_tl { \bigintcalcSqr { \l_tmpa_tl } }
\tl_replace_once:Nnn \l_tmpb_tl { 8 } { &8 }
\tl_put_right:Nx \l_tmpc_tl { \l_tmpa_tl^2 & \l_tmpb_tl \exp_not:N \\ }
}
\NewDocumentCommand{\makenines}{m}
{% #1 = number of rows
$\begin{array}{ l @{{}={}} r @{} l }
\tl_clear:N \l_tmpc_tl
\int_step_function:nN { #1 } \__egreg_squarenines:n
\l_tmpc_tl
\end{array}$
}
\ExplSyntaxOff
\begin{document}
Table~\ref{tab:myNines} comes from the algebraic identitiy,
$(a-b)^2 = a^2 - 2ab + b^2$, taking $a=10^n$ and $b=1$.
\begin{table}[htp]
\centering
\makenines{10}
\caption{Note the Nines}
\label{tab:myNines}
\end{table}
\begin{table}[htp]
\centering
\makenines{15}
\caption{Note the Nines}
\label{tab:myNines-big}
\end{table}
\end{document}
```
|
6
|
https://tex.stackexchange.com/users/4427
|
691894
| 320,963 |
https://tex.stackexchange.com/questions/691893
|
5
|
I used `qtree` for a while and although there's not much that it can do that `forest` can't, there is one effect that `qtree` has by default that I quite like, which is that it automatically increases the distance between nodes in a tree from the bottom up in a way that I haven't been able to get `forest` to do. This makes it so that (broadly) higher nodes in a tree are spaced out a bit and lower nodes are closer together.
Here's a MWE demonstrating what I'm talking about; first, there's a `qtree` tree and then a clumsy approximation I tried to make in `forest`, by playing with the read-only option `level`:
```
\documentclass{article}
\usepackage{qtree}
\usepackage[linguistics]{forest}
\begin{document}
\Tree [.x x [.x x [.x x [.x x [.x x x ]]]]]
\begin{center}
\begin{forest}
for tree={
l sep=0.8ex,
l sep+=(1/((level)+1))*1.28^1.5ex, % inter-node distance is relative to level
l-=3ex, % constrains spacing of nodes
inner sep=0,
calign=fixed edge angles,
calign angle=63,
},
%
%
[x[x][x[x][x[x][x[x][x[x][x]]]]]]
%
%
\end{forest}
\end{center}
\end{document}
```
My question is as follows: is there a proper way to achieve this effect in `forest`?
My rough impression is that `qtree` has a system whereby it automatically adds a bit more horizontal separation every level from the bottom up, i.e. it calculates the absolute distance of any given set of siblings from their lowest descendant in a tree somehow.
Having read the documentation, it seems that `forest` tracks absolute levels of nodes with the read-only option `level` , but this is calculated top-down. It may be instructive for me to understand if there is a way to calculate a nodes level relative to its most distant direct descendant in `forest`, but so far, I've not been able to figure this out. Or maybe there's some other reason why this wouldn't work to begin with.
|
https://tex.stackexchange.com/users/301278
|
Forest: increasing horizontal separation by level bottom-up
| true |
It is fairly straightforward to calculate how distant a node's most distant descendant is in terms of levels. In a non-fancy tree, we can do this early in the processing. If your tree changes its structure, you'd obviously need to do the calculation after the structure is finalised.
We start by defining a couple of `count` options for `forest`.
```
\forestset{%
declare count={level of most distant descendant}{0},
declare count={steps to most distant descendant}{0},
}
```
We can then use these keys in the tree's preamble together with one of `forest`s `aggregate` functions, `.max` and a little `forestmath` to calculate the number we want.
```
before typesetting nodes={%
where n children=0{}{% we don't calculate anything for terminal nodes which have no descendants by definition
level of most distant descendant/.max={ > O {level} }{descendants},% get the maximum level of the node's descendants
steps to most distant descendant/.process={ OOw2 {level of most distant descendant}{level}{#1-#2} },% subtract the node's own level to get the most distant descendant's distance in terms of number of levels
```
This example adds the number as a label for illustrative purposes, but you presumably want to use it to adjust the formatting of your tree.
```
label/.process={ Ow1 {steps to most distant descendant}{{[red, font=\tiny]east:#1}}},
}
}
```
```
\documentclass[]{standalone}
\usepackage[linguistics]{forest}
\forestset{%
declare count={level of most distant descendant}{0},
declare count={steps to most distant descendant}{0},
}
\begin{document}
\begin{forest}
for tree={
l sep'=0.8ex,
l sep+=(1/((level)+1))*1.28^1.5ex, % inter-node distance is relative to level
l'-=3ex, % constrains spacing of nodes
inner sep=0pt,
calign=fixed edge angles,
calign angle=63,
},
before typesetting nodes={%
where n children=0{}{%
level of most distant descendant/.max={ > O {level} }{descendants},
steps to most distant descendant/.process={ OOw2 {level of most distant descendant}{level}{#1-#2} },
label/.process={ Ow1 {steps to most distant descendant}{{[red, font=\tiny]east:#1}}},
}
}
[x[x][x[x][x[x][x[x][x[x][x]]]]]]
\end{forest}
\end{document}
```
Of course, if your trees were all this simply structured, you could get the number you wanted with less hassle because all nodes with descendants share a common pair of most distant descendants. Since that's not true of trees in general, however, we have to find the most distant descendant(s) for each node with descendants.
|
5
|
https://tex.stackexchange.com/users/39222
|
691903
| 320,967 |
https://tex.stackexchange.com/questions/691896
|
0
|
The code below presents a minimal example of my setup. This way, as the label "Figure 10" has 2 digits for the number, the "endash" character is on top of the caption.
```
\documentclass[12pt]{article}
\usepackage[
labelsep=endash,
figurewithin=none,
]{caption}
\makeatletter
\renewcommand\l@figure[2]{\@dottedtocline{1}{0pt}{4.6em}{#1}{#2}}
\renewcommand{\p@figure}{Figura }
\DeclareCaptionListFormat{format}{#1#2 -- }
\captionsetup[figure]{listformat=format}
\makeatother
\begin{document}
\listoffigures
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\end{document}
```
How do I resolve this? I tried to use the
```
\renewcommand{\numberline}[1]{#1\quad}
```
but it breaks tableofcontents alignment because of below code
```
\newcommand{\PosTextual}{
\clearpage
\pagestyle{plain}
\def\@schapter##1{
\addcontentsline{toc}{chapter}{\protect\numberline{}##1}
\if@twocolumn
\@topnewpage[\@makeschapterhead{##1}]%
\else
\@makeschapterhead{##1}%
\@afterheading
\fi
}
}
```
|
https://tex.stackexchange.com/users/223790
|
"Figure 10" caption alignment in listoffigures
| true |
This left aligns the numbers and aligns the `--` etc. The thing to remember is that `\numberline` is inside a box whose width is specified (in this case, 5.5em).
```
\documentclass[12pt]{article}
\RequirePackage[
labelsep=endash,
figurewithin=none,
]{caption}
\makeatletter
\renewcommand\l@figure[2]{\@dottedtocline{1}{0pt}{5.5em}{#1}{#2}}
\renewcommand{\p@figure}{Figura }
\DeclareCaptionListFormat{format}{#1#2\hfill -- }
\captionsetup[figure]{listformat=format}
\makeatother
\begin{document}
\listoffigures
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\captionof{figure}{Title of Figure}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/34505
|
691909
| 320,969 |
https://tex.stackexchange.com/questions/691901
|
1
|
Background
==========
A few different start/stop environments insert a TEX page.
ConTeXt Version: 2023.07.18 22:07
Problem
=======
The TEX page doesn't increment the user page number.
Code
====
For example:
```
\definestartstop[corrupted][
before={
\startTEXpage[
offset=\backspace,
width=\paperwidth,
height=\paperheight
]%
\incrementnumber[userpage]
},
after={\stopTEXpage},
]
\definestartstop[banned][
before={%
\startTEXpage[
align=middle,
offset=\backspace,
width=\paperwidth,
height=\paperheight,
]%
\incrementnumber[userpage]
},
after={\stopTEXpage},
]
```
XY Problem
==========
The deeper issue is inserting pages without headers/footers. TEX pages provide full control over the layout, including easily changing the page background before inserting the TEX page:
```
\setupbackgrounds[page][%
background=color,
backgroundcolor=TextColourBannedPage,
]
\startTEXpage[
% etc.
```
Question
========
Is there something like `\setupTEXpage` where the "inherited" behaviour is to increment the user page number? Such as:
```
\setupTEXpage[runnerless][
before={\incrementnumber[userpage]},
offset=\backspace,
width=\paperwidth,
height=\paperheight
]
```
Possibly `\setupfittingpage`?
I'm not sure if defining a macro would help because the two TEX pages have different alignments.
|
https://tex.stackexchange.com/users/2148
|
ConTeXt: Increment user page number for TEX page
| true |
`\setupTEXpage[pagestate=start]` should do what you want:
```
\setupTEXpage[pagestate=start]
\starttext
\dorecurse{100}{
\startTEXpage
\getnumber[userpage]
\stopTEXpage
}
\stoptext
```
>
> The deeper issue is inserting pages without headers/footers. TEX pages provide full control over the layout, including easily changing the page background before inserting the TEX page
>
>
>
That's not really the intended use for fitting (“TEX”) pages. You probably want `\definemakeup` (wiki [1](https://wiki.contextgarden.net/Command/setupmakeup), [2](https://wiki.contextgarden.net/Makeup), [3](https://wiki.contextgarden.net/Standardmakeup_background)) instead.
|
1
|
https://tex.stackexchange.com/users/270600
|
691915
| 320,972 |
https://tex.stackexchange.com/questions/691918
|
4
|
Is there a good way to get the German opening (lower) quotation mark `„` in plain TeX?
|
https://tex.stackexchange.com/users/301295
|
German opening (lower) quotation mark in plain TeX
| false |
It depends on used encoding. The pure plain TeX with Computer Modern fonts doesn't provide this because the character „ is missing in the Computer Modern fonts. It is inserted at various places in various extension fonts. For example CSfonts have it at slot 254 and csplain defines `\clqq` as
```
\chardef\clqq=254
```
so a user of csplain use it as `\clqq`. Or T1 encoded fonts have it at slot 18. But this all is history not recommended to use today. We have Unicode fonts and Unicode TeX engines able to load these fonts. If Unicode fonts are loaded (for example in OpTeX after `\fontfam`), then we can type „ in the TeX source and we get „ in the output.
If we are using a keyboard driver which doesn't support the „ then we can define it for example by
```
\def\clqq{„}
```
and then use `\clqq` in the source document.
|
6
|
https://tex.stackexchange.com/users/51799
|
691920
| 320,974 |
https://tex.stackexchange.com/questions/691486
|
3
|
I'm trying to implement a kind of chat inside my document using `tcolorbox`. But I either can set the width dynamically or allow a pagebreak inside a "chat-message".
```
\documentclass[11pt, a4paper]{article}
\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\usepackage{blindtext}
\tcbset{breakable, width=.8\linewidth, tcbox width=auto limited, size=title, arc=2mm, boxrule=.5pt, boxsep=1mm}
%page break possible
\newcommand{\coach}[1]{\begin{tcolorbox}[colback=yellow, sharp corners=northwest]#1\end{tcolorbox}}
%dynamic width
\newcommand{\klient}[1]{\tcbox[colback=green, sharp corners=southeast, flush right]{#1}}
\begin{document}
\blindtext[2]
\coach{Hello World}
\klient{Hello World}
\coach{\blindtext[2]}
\klient{\blindtext[3]}
\end{document}
```
Does anyone know how to meet both requirements?
Thank you in advance.
|
https://tex.stackexchange.com/users/300989
|
tcolorbox: Dynamic width and breakable
| true |
If made a workaround with an `\ifdim` statement, which meets my requirements.
```
\documentclass[11pt, a4paper]{article}
\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\usepackage{blindtext}
\tcbset{breakable, width=.8\linewidth, tcbox width=auto limited, size=title, arc=2mm, boxrule=.5pt, boxsep=1mm}
\newlength{\mylen}
\newcommand{\coach}[1]{
\def\content{#1}
\settowidth{\mylen}{\content}
\ifdim\mylen<.8\textwidth
\tcbox[colback=yellow, sharp corners=northwest]{\content}
\else
\begin{tcolorbox}[colback=red, sharp corners=northwest]\content\end{tcolorbox}
\fi
}
\begin{document}
\blindtext[2]
\coach{Hello World}
\coach{\blindtext[2]}
\end{document}
```
|
0
|
https://tex.stackexchange.com/users/300989
|
691921
| 320,975 |
https://tex.stackexchange.com/questions/691910
|
2
|
I am using TeX Live (MacTeX) 2023 with all updates (as of this morning). Consider two packages called `packageone.sty` and `packagetwo.sty`. `packageone.sty` contains a redefinition of `\vec` to include a starred version. `packagetwo.sty` contains a modified redefinition of `vec` to make the unstarred and starred versions identical if and only if `packageone.sty` is not loaded. For some reason, the custom `\vec` commands in each package cannot be seen from the main document and I do not understand why. The other commands defined in `packagetwo.sty` can be seen from the main document.
On one hand, I have been trying to understand this for the past two days and do not see anything obviously wrong because slightly different versions of the MWE have worked. On the other hand, I feel I am overlooking something obvious for some reason.
I was able to get the desired outcome by having `packagetwo` load `packageone` if it had not already been loaded (but that necessitated making the two new definitions of `\vec` identical, which is not a big deal in this case. They are different here merely for testing purposes). I was hoping to not make `packagetwo` load `packageone` but at least I now have a debugging strategy for figuring out why this extracted MWE doesn't work as I expected it to work.
Here is the MWE, which contains the two packages.
```
% !TEX program = lualatexmk
% !TEX encoding = UTF-8 Unicode
\begin{filecontents*}{packageone.sty}
\RequirePackage[g]{esvect}
\RenewDocumentCommand{\vec}{ s m e{_^} }%
{%
\IfBooleanTF{#1}
{%
\vv{#2}%
\IfValueT{#4}%
{\sp{\,#4\vphantom{\smash[t]{\big|}}}}
}%
{%
\symbfit{#2}
\IfValueT{#4}%
{\sp{#4\vphantom{\smash[t]{\big|}}}}
}%
\IfValueT{#3}%
{\sb{#3\vphantom{\smash[b]{|}}}}
}%
\end{filecontents*}
\begin{filecontents*}{packagetwo.sty}
\IfPackageLoadedTF{packageone}
{}%
{%
\RequirePackage[g]{esvect}
\NewDocumentCommand{\foo}{}{Hello.}
\RenewDocumentCommand{\vec}{ s m }
{%
\IfBooleanTF{#1}
{%
\vv{#2}%
}%
{%
\vv{#2}%
}%
}%
}%
\NewDocumentCommand{\lhsmomentumprinciple}{ s }%
{%
\Delta
\IfBooleanTF{#1}%
{%
\vec*{p}
}%
{%
\vec{p}%
}%
\sb{\symup{sys}}%
}%
\NewDocumentCommand{\rhsmomentumprinciple}{ s }%
{%
\IfBooleanTF{#1}%
{%
\vec*{F}%
}%
{%
\vec{F}%
}%
\sb{\symup{sys,net}}\,\Delta t%
}%
\NewDocumentCommand{\momentumprinciple}{ s }%
{%
\IfBooleanTF{#1}%
{%
\lhsmomentumprinciple* = \rhsmomentumprinciple*%
}%
{%
\lhsmomentumprinciple = \rhsmomentumprinciple%
}%
}%
\end{filecontents*}
\documentclass{article}
\usepackage{unicode-math}
\usepackage{packageone}
\usepackage{packagetwo}
\begin{document}
1 \( \vec*{E} \)\par
2 \( \vec{E} \)\par
\IfPackageLoadedTF{packagetwo}
{%
3 \( \momentumprinciple* \)\par
4 \( \momentumprinciple \)\par
5 \foo \par
}%
{}%
\end{document}
```
|
https://tex.stackexchange.com/users/218142
|
Why can these custom commands from packages not be seen in the main document?
| true |
The method to debug this sort of problems is to find out where the definition changes by planting `\ShowCommand` everywhere:
```
\documentclass{article}
\usepackage{unicode-math}
\renewcommand\vec{blub} % from package 1
\ShowCommand\vec
\renewcommand\vec{duck} % from package 2
\ShowCommand\vec
\begin{document} %what happens here??
\ShowCommand\vec
xxx
\end{document}
```
This will give answers like this (on the terminal or in the log):
```
> \vec=\long macro:
->blub.
<argument> \vec
> \vec=\long macro:
->duck.
<argument> \vec
> \vec=\protected macro:
->\Umathaccent fixed 7\symoperators "020D7\scan_stop: .
<argument> \vec
```
So obviously the definition changes in `\begin{document}` again, and the `\Umath` points to unicode-math as "culprit". If you want to learn more you could then inspect the begindocument hook (with `\ShowHook{begindocument}`, or search for answers with unicode-math and begindocument. Or you simply do your redefinition in `begindocument` too.
|
7
|
https://tex.stackexchange.com/users/2388
|
691923
| 320,976 |
https://tex.stackexchange.com/questions/691918
|
4
|
Is there a good way to get the German opening (lower) quotation mark `„` in plain TeX?
|
https://tex.stackexchange.com/users/301295
|
German opening (lower) quotation mark in plain TeX
| true |
You can use the EC fonts, where the lower German quotes are the ligature `,,`.
```
% define accents for T1 encoding
\def\`#1{{\accent0 #1}}
\def\'#1{{\accent1 #1}}
\def\^#1{{\accent2 #1}}
\def\~#1{{\accent3 #1}}
\def\"#1{{\accent4 #1}}
\def\H#1{{\accent5 #1}}
\def\r#1{{\accent6 #1}}
\def\v#1{{\accent7 #1}}
\def\u#1{{\accent8 #1}}
\def\=#1{{\accent9 #1}}
\def\.#1{{\accent10 #1}}
\def\c#1{%
\leavevmode\setbox0=\hbox{#1}%
\ifdim\ht0=1ex
{\accent11 #1}%
\else
{\ooalign{\unhbox0\crcr\hidewidth\char11\hidewidth}}%
\fi
}
\font\tenrm=ecrm1000
\font\tenit=ecti1000
\font\tenbf=ecbx1000
\font\tensl=ecsl1000
\rm
\hrule
\vskip 1in
\centerline{\bf A SHORT STORY}
\vskip 6pt
\centerline{\sl by A. U. Thor} % !`?`?! (modified)
\vskip .5cm
Once upon a time, in a distant
galaxy called \"O\"o\c c,
there lived a computer
named R.~J. Drofnats.
Mr.~Drofnats---or ,,R. J.,'' as
he preferred to be called---% error has been fixed!
was happiest when he was at work
typesetting beautiful documents.
\vskip 1in
\hrule
\vfill\eject
\bye
```
Of course you would need to support also UTF-8, see <https://tex.stackexchange.com/a/163887/4427>
|
4
|
https://tex.stackexchange.com/users/4427
|
691933
| 320,984 |
https://tex.stackexchange.com/questions/691919
|
1
|
I am using TikZ math library which is great.
However, I can't get my head around this (see MWE).
I missed something from the documentation (<https://tikz.dev/library-math>)?
```
\documentclass[tikz]{standalone}
\usetikzlibrary{math}
\begin{document}
\begin{tikzpicture}
\tikzmath{
\a = 2;
\b = 1;
}
\draw[step=1cm,gray,very thin] (0,0) grid (3,2); % just for orientation
\draw (\a, \b) circle (2pt); % no problem here, so \a and \b are fine
\draw [->] (2, 0) arc (0:360:2 and 1); % no problem here
%\draw [->] (2, 0) arc (0:360:\a and \b); % gives me an error after removing comment - why?
\end{tikzpicture}
\end{document}
```
|
https://tex.stackexchange.com/users/299754
|
TikZ math library syntax problem
| true |
You probaby did not miss anything from the manual, but you should note that the Ti*k*Z parser needs to understand a lot of different syntax uses and it is therefore often necessary to help it by wrapping macros or on-the-fly calculations in curly braces. In this case, the space after the macro `\a` is gobbled (so strictly speaking, it is not a parser problem, but wrapping macros in curly braces would still help here):
In this case, the following will solve the problem:
```
\draw [->] (2, 0) arc (0:360:{\a} and {\b});
```
However, note that there is a newer syntax for the `arc` fuction which also would allow you to omit the curly braces. The above would be written as:
```
\draw [->] (2, 0) arc[start angle=0, end angle=360, x radius=\a, y radius=\b];
```
|
2
|
https://tex.stackexchange.com/users/47927
|
691935
| 320,986 |
https://tex.stackexchange.com/questions/691480
|
6
|
I am reading Knuth's *The TeXbook*, and experimenting around as directed in Chapter 6, I found that the quality of **overfull** warnings is reported by `x pt too wide` where x is a decimal; whereas, that of **underfull** warnings are reported as `badness N` where N is a nonnegative integer.
**Questions:** Why not report both warnings in the same format (or in both formats)? Also, how to convert from one to another?
---
**Edit:**
This is how I understand it currently: `x pt too wide` means that the line sticks out of the right margin by x points; on the other hand, `badness N` means that the interword spacing is too wide (wide, not narrow, since we have "under"-full) by N units on a linear scale where 0 is "perfect". So, the underfill boxes won't stick out of the right margin. So it does make sense to not report the `x pt too wide` for underfill lines. However, not reporting the badness of overfull lines seems to suggest that **the badness of each of the overfulls is the same, namely the worst 10000, is that so**?
|
https://tex.stackexchange.com/users/207649
|
Why overfull in terms of pts and underfull in terms of badness?
| false |
TeX calculates badness of boxes wider than their implicit width but also of boxes narrower than their implicit width. There is symmetry from this point of view. The spaces include their implicit width and their stretch value and shrink value (i.e. there are three values for each space). When a box should be stretched from its implicit width then the sum of all stretching values from present spaces are counted. When the box should be narrowed then all shrinking values are counted. In both cases, denote this sum S.
Denote the required stretching or shrinking R. Then the badness is calculated as 100\*(R/S)^3.
The only difference (or asymmetry) between stretching and shrinking is that TeX allows boxes wider than S, i.e. R should be greater than S, i.e. badness should be greater than 100. But this isn't allowed for shrinking. The S is maximum allowed shrinking, never more. If the R>S in case of shrinking then the box is set as if R=S and the rest of box material exceeds over the box boundary to the right. This specific case is Overfull \hbox and the badness is assumed infinity (not calculated). The amount of exceeding over the box is reported.
When stretching box and R>S, then badness is calculated and spaces inside this box are stretched wider than their stretch value. The badness value has its allowed maximum 10000 and if the formula for badness (mentioned above) gives higher value then badness is set to 10000.
Assume the following example. The warning reports are added as a comment to appropriate line in this example:
```
\hbadness=0
\hbox to20pt{a b} % Underfull \hbox (badness 4927) detected at line 3
\hbox to18pt{a b} % Underfull \hbox (badness 1496) detected at line 4
\hbox to16pt{a b} % Underfull \hbox (badness 203) detected at line 5
\hbox to15pt{a b} % Loose \hbox (badness 29) detected at line 6
\hbox to14pt{a b}
\hbox to13pt{a b} % Tight \hbox (badness 51) detected at line 8
\hbox to12pt{a b} % Overfull \hbox (0.7778pt too wide) detected at line 9
\setbox0=\hbox{a b}
normal width: \the\wd0 % 13.88892pt
stretch value: \the\fontdimen3\font % 1.66666pt
shrink value: \the\fontdimen4\font % 1.11111pt
\bye
```
We want to print warnings for all positive badness values. This is done using `\hbadness=0`. We try to calculate the badness manually, for example for the line 5:
The implicit width of the box is 13.88892pt, the box should be 16pt width, i.e. 2.11108pt wider than its implicit width. This is R value and we want to stretch the box. The stretching value of the space in the box is 1.66666pt, this is S value. Badness is 100\*(2.11108/1.66666)^3 = 203.223. Badness is an integer value, i.e. 203.
Note that the line 6 reports "Loose" box (i.e. the box wider than its implicit width but with R<S). The line 6 reports "Tight" box, i.e. the box narrower than its implicit width but not overfull. The badness calculation for this line is b = 100\*(.88892/1.11111)^3 = 52. The shrink value 1.1111pt of the space is used here.
Note that the line 7 reports no warning, because badness is
100\*(.11108/1.6666)^3 = .029 = 0.
|
2
|
https://tex.stackexchange.com/users/51799
|
691942
| 320,991 |
https://tex.stackexchange.com/questions/691907
|
1
|
Let's say I have 2 nodes. Node 1 is placed anywhere and node 2 is placed right of node 1. Does tikz solve a set of constraints to solve this problem? Clearly it is underdefined as any position on the y axis would satisfy the constraint.
However, if I have 5 nodes
Node 1 is placed at the top.
Node 2 is places below and left of 1.
Node 3 is placed below 2.
Node 4 is placed below and right of 1.
Node 5 is placed right of node 3 and left of node 4.
Where on the y axis is node 5 placed? And could I get both node 4 and 5 to be placed at the same y level as node 3?
Code with ??? for unknown parameters.
```
\node (1) {1};
\node[below left of=1] (2) {2};
\node[below of=2] (3) {3};
\node[below right of 1, ??? and right of 3 ???] (4) {4};
\node[??? right of (3) and left of (4) ???] (5) {5};
```
Also, does tikz know to increase the x spacing between nodes 2 and 4 because I am placing node 5 in between them?
|
https://tex.stackexchange.com/users/236617
|
How can I use Tikz to place a node given a set of constraints?
| false |
I'm not sure about the position specification but this can be done with `positioning` library
```
\documentclass[tikz, border=1mm]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node[draw] (1) {1};
\node[draw, below left= of 1] (2) {2};
\node[draw, below=of 2] (3) {3};
\node[draw, below right= of 1] (4) {4};
\node[draw, right=of 3] (5) {5};
\end{tikzpicture}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/1952
|
691944
| 320,992 |
https://tex.stackexchange.com/questions/691904
|
1
|
I am using MikTeX and I have suddenly started to get a problem with amsmath. I have managed to reduce it to the following MWE:
```
\documentclass[a4paper,11pt]{article}
\usepackage{amsmath}
\begin{document}
Some text
\end{document}
```
When I compile, I get the message:
>
> `Unable to properly define \@@leqno. primitive \leqno no longer primitive\@saveprimitive\eqno\@@eqno`
>
>
>
I have recently updated MikTeX and I am using amsmath v2.17o.
If I comment out the `\usepackage{amsmath}` the file compiles without any error message.
|
https://tex.stackexchange.com/users/126162
|
amsmath - Unable to properly define \@@leqno. primitive \leqno no longer primitive
| false |
The problem is indeed a conflict between a new version of latex and an old version of amsmath. By looking in the log file I found that MikTeX was also loading old versions of the amsmath style files that had been provided with the style file of a journal, and which were stored in a local folder (....\TeX\texmf\tex\latex...). These were, of course, not updated when the packages were updated, and because they are stored locally they are loaded after the packages in the default folder, replacing the updated versions. I have removed these old versions and this has solved the problem.
|
1
|
https://tex.stackexchange.com/users/126162
|
691945
| 320,993 |
https://tex.stackexchange.com/questions/691943
|
4
|
I use the `memoir` class, which [defines](https://texdoc.org/serve/memman.pdf/0) `appendix` (§6.2.1) as
>
> The \appendix declaration changes the numbering of chapters to an alphabetic form and also changes the names of chapters from \chaptername (default Chapter) to the value of \appendixname (default Appendix). Thus, the first and any subsequent \chapters after the \appendix command will be ‘Appendix A . . . ’, ‘Appendix B . . . ’, and so on
>
>
>
---
MWE :
```
\documentclass[12pt,a4paper,twoside,openright,draft]{memoir}
\renewcommand\cftappendixname{\appendixname~}
\usepackage{tabularray}
\begin{document}
\appendix
\chapter{Example}
\renewcommand\thetable{A.\arabic{chapter}.\arabic{section}.\arabic{table}}
% \usepackage{tabularray}
\begin{table}
\centering
\refstepcounter{table}
\label{tab:to-grab}
\begin{tblr}{
}
A1 & B1 & C1 \\
A2 & B2 & C2 \\
A3 & B3 & C3
\end{tblr}
\caption[]{Example}
\end{table}
\end{document}
```
This gives me a caption of `Table A.1.0.2` which is what I want as output
My document is prone to changing at the phase it's in, and I would really like not to hard-code the `A` in there
Instead of A, I've tried
* `\arabic{part}` gives 0, which is correct, but this is not what I want
* `\arabic{appendix}` doesn't exist and fails with `Missing Number, treated as 0`
I would assume `\arabic` only gives a number. Is there a way to get the letter?
|
https://tex.stackexchange.com/users/240878
|
How to get the chapter letter (not the number)
| true |
If you want just the appendix "number" (in Alphabetic format) as a prefix, use
```
\thechapter
```
If you want both the appendix and section numbers as prefixes, use
```
\thesection
```
E.g., `\renewcommand\thetable{\thesection.\arabic{table}}`.
|
7
|
https://tex.stackexchange.com/users/5001
|
691946
| 320,994 |
https://tex.stackexchange.com/questions/691949
|
1
|
I have a serious problem with my latex file. I was working on my article, when suddenly **all the work I made disappeared** after running the document. I have to submit the article in one week. In the error line, only one error appeared:
**File ended while scanning use of \textbf**, but it didn't show in which line the problem is located.
Does someone know what to do and where can I find my work?
Thank you.
|
https://tex.stackexchange.com/users/301310
|
All of my work disapeared after running the file. Error: File ended while scanning use of \textbf
| true |
TeX never edits or changes your source file in any way, so any changes in your source (and any backups) are a feature of your editor (that you have not named).
The error means you have a missing `}`.
You should be able to detect the error from the log. There is no line number as the error is detected as the file ended, but for example
```
\documentclass{article}
\begin{document}
000
\clearpage
111
\clearpage
aaa
\textbf{bbb
ccc
\end{document}
```
Produces
```
] [2])
Runaway argument?
{bbb \par ccc \par \end {document}
! File ended while scanning use of \textbf .
<inserted text>
\par
<*> dd937
?
```
so here the `[2]` tells you it had just shipped out page 2 and then an argument starting `bbb` was never closed. From which you should be able to find
`\textbf{bbb` fairly easily.
|
4
|
https://tex.stackexchange.com/users/1090
|
691950
| 320,995 |
https://tex.stackexchange.com/questions/691952
|
0
|
I am drafting an article in LaTeX, but having troubles to move tables from the text to the Appendix. I am using \appendix command, and then using standard code for creating a table. However, the table does not appear in the Appendix, rather it shows up in the main text. Please help.
```
\documentclass[12pt]{article}
\usepackage{appendix}
\begin{document}
\section{Introduction}
\subsection{Literature}
\appendix
\section{Appendix: Additional Figures}
\begin{table}[]
\centering
\begin{tabular}{c|c}
& \\
&
\end{tabular}
\caption{Caption}
\label{tab:my_label}
\end{table}
\end{document}
```
|
https://tex.stackexchange.com/users/301311
|
Create table in appendix
| true |
`\begin{table}[]` means "do not allow the table anywhere". That generates a warning and the argument is changed:
```
LaTeX Warning: No positions in optional float specifier.
Default added (so using `tbp') on input line 9.
```
But you do not want a top float here so use `[hbp]`
```
\documentclass[12pt]{article}
\usepackage{appendix}
\begin{document}
\section{Introduction}
\subsection{Literature}
\appendix
\section{Appendix: Additional Figures}
\begin{table}[hbp]
\centering
\begin{tabular}{c|c}
& \\
&
\end{tabular}
\caption{Caption}
\label{tab:my_label}
\end{table}
\end{document}
```
|
2
|
https://tex.stackexchange.com/users/1090
|
691954
| 320,998 |
https://tex.stackexchange.com/questions/595469
|
2
|
Hi everyone I am working on MDPI submission using their template avaliable on [overleaf](https://www.overleaf.com/latex/templates/mdpi-article-template/fcpwsspfzsph) and [their site here](https://www.mdpi.com/data/MDPI_template.zip?v=20210406) I am highlighting changes using the soul package and the `\hl{}` but everytime I do this on the abstract Overleaf seems to freeze on compiling and I get no answear. The log files complain of something like:
`Use of \SOUL@n doesn't match its definition.`
I believe it has to do to the fact that the template defines the abstract as a macro, but I am not sure. Would be helpful some form of highlighting text not using `\hl{}`. The `mbox`is a problem because of line breaking, `\textcolor{}` works but it is not the same effect.
It is a big class and template file to include here, but the part that generates the error is located at line 106 if you add `\hl{}` to some part of the text. Like this:
```
...
\abstract{A single paragraph \hl{of about 200 words maximum.
For research articles, abstracts should give a pertinent overview of the
work. We strongly encourage authors} to use the following style of
structured abstracts, but without headings: (1) Background: place the
question addressed in a broad context and highlight the purpose of the
study; (2) Methods: describe briefly the main methods or treatments
applied; (3) Results: summarize the article's main findings; (4)
Conclusion: indicate the main conclusions or interpretations. The abstract
should be an objective representation of the article, it must not contain
results which are not presented and substantiated in the main text and
should not exaggerate the main conclusions.}
...
```
|
https://tex.stackexchange.com/users/241252
|
MDPI Default Template Highlight
| false |
The `\usepackage{siunitx}` suggested by Andrey L. also fixed the problem here. `\hl{}` works just fine in abstract section of the mdpi template.
|
0
|
https://tex.stackexchange.com/users/283197
|
691967
| 321,005 |
https://tex.stackexchange.com/questions/691352
|
1
|
I have been using org mode on my Manjaro system for more than two years, but after the latest update to the LaTeX repos, I can't seem to export org files to pdf or preview latex fragments.
The error I get whenever I try to preview my LaTeX is:
```
org-compile-file: File "/tmp/orgtexNnJFiR.dvi" wasn’t producedPlease
adjust ‘dvipng’ part of ‘org-preview-latex-process-alist’.
```
I tried [this](https://emacs.stackexchange.com/a/57917/38074), didn't work.
I checked basic exporting from org to pdf. I got the error:
```
! LaTeX Error: File `ulem.sty' not found.
```
Which is weird, since when I search for the file using `pacman -F ulem.sty`, I get:
```
extra/texlive-core 2021.58710-2 (texlive-most)
usr/share/texmf-dist/tex/generic/ulem/ulem.sty
```
Did someone experience that?
|
https://tex.stackexchange.com/users/300888
|
Can't produce a LaTeX file, error says I am missing 'ulem.sty'
| false |
Glad you found a solution. However, I was able to fix it with
```
sudo pacman -Fy
pacman -F ulem.sty
pamac install texlive-plaingeneric
```
The first command is important, since the location of ulem.sty has changed, from texlive-core to texlive-plaingeneric. I also upgraded the system before all that, with "pamac update".
Sorry for carelessly mixing pacman and pamac...
|
0
|
https://tex.stackexchange.com/users/301324
|
691971
| 321,006 |
https://tex.stackexchange.com/questions/691981
|
0
|
Consider
```
\documentclass[20pt]{amsart}
\begin{document}
Hello
\end{document}
```
No matter how I change the 20pt to anything, I cannot see any effect in the pdf output.
Does anyone know how to change the font size of the text in "amsart"?
|
https://tex.stackexchange.com/users/153012
|
Setting font size of amsart documentclass have no effect
| false |
You have a couple of different options:
If you only need a larger font size in part of a document, you can always wrap that text in `\begin{Huge}` and `\end{Huge}`. (Note: see comment below from David Carlisle; I have updated my answer with that information.)
If you need to control the line spacing as well, you can use the `\fontsize{}{}` command. See the below MWE:
```
\documentclass[a5]{amsart}
\begin{document}
Two roads diverged in a wood, and I, I took the one less travelled by, and that has made all the difference.
\begin{Huge}
Two roads diverged in a wood, and I, I took the one less travelled by, and that has made all the difference.
\end{Huge}
\fontsize{20}{36}\selectfont
Two roads diverged in a wood, and I, I took the one less travelled by, and that has made all the difference.
\end{document}
```
Just a note: the last example (`\fontsize{}{}`) may not be considered a best practice.
|
0
|
https://tex.stackexchange.com/users/245702
|
691983
| 321,011 |
https://tex.stackexchange.com/questions/689900
|
0
|
I am writing an article introducing TeX. The sentence may look like:
>
> … the name of the system named TeX, which is original from Greece words ΤЄΧ.
>
>
>
When I am using this symbol in my LaTeX document:
>
>
> ```
> ΤЄΧ
>
> ```
>
>
I found the symbol `Є` could not be rendered in the document. How to make LaTeX support this symbol?
This is the demo:
```
\documentclass{dolphinbook}
\usepackage{xeCJK}
\usepackage{subfiles}
\usepackage[bookmarksopen,bookmarksdepth=4]{hyperref}
\begin{document}
ΤЄΧ
\end{document}
```
this is my custom class file:
```
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{dolphinbook}
\LoadClass[8pt]{book}
\RequirePackage{listings}
\RequirePackage{xcolor}
\lstset{
alsolanguage= XML,
tabsize=4,
frame=shadowbox,
commentstyle=\color{red!50!green!50!blue!50},
frameround=tttt,
rulesepcolor=\color{red!20!green!20!blue!20},
keywordstyle=\color{blue!90}\bfseries,
showstringspaces=false,
stringstyle=\ttfamily,
keepspaces=true,
breakindent=22pt,
breaklines=true,
numbers=left,
stepnumber=1,
numberstyle={\color[RGB]{0,192,192}\tiny},
numbersep=8pt,
basicstyle=\ttfamily,
showspaces=false,
escapechar=`,
flexiblecolumns=true,
breaklines=true,
breakautoindent=true,
breakindent=4em,
aboveskip=1em,
tabsize=4,
showstringspaces=false,
backgroundcolor=\color[RGB]{245,245,244},
escapeinside={``}{\_},
fontadjust,
captionpos=t,
framextopmargin=2pt,
framexbottommargin=2pt,
abovecaptionskip=-3pt,
belowcaptionskip=3pt,
xleftmargin=1em,
xrightmargin=1em,
texcl=true
}
```
|
https://tex.stackexchange.com/users/69600
|
How to support Є in a LaTeX document
| true |
Sorry, but this is a *non sequitur*.
The letter you'd like to use is Є U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE, which doesn't look like Greek.
The story of this letter is long. Of course it derives from the (uppercase) letter “epsilon” of Greek, like most of the Cyrillic letterforms. In the uncial script the epsilon was written in a more roundish fashion than in the ancient capital script, where there always was a straight vertical bar (the horizontal ones were usually slanted, though, like in the Phoenician script). Ukrainian uses it as a distinct letter from Е (U+0415 CYRILLIC CAPITAL LETTER IE) that in Russian is pronounced the same as Ukrainian Є (iotated e), whereas in the latter language the Е is pronounced “e”.
Using U+0404 is definitely not a choice for describing the origin of the TeX logo. You may instead use lowercase Greek, which would be much sounder.
```
\documentclass{article}
\usepackage{xeCJK}
\newfontfamily{\greekalph}{Libertinus Serif}[Scale=MatchUppercase]
\begin{document}
The name of the program is \TeX, which Knuth derived from the
first three letters of the Greek word {\greekalph τέχνη},
meaning ``craft, skill, art''.
\end{document}
```
|
8
|
https://tex.stackexchange.com/users/4427
|
691985
| 321,012 |
https://tex.stackexchange.com/questions/691897
|
0
|
I started learning LaTeX (on Overleaf) and I have to insert a table.
Due to the size of the table, for convenience I want to import it as CSV.
I replicated the same code from internet (as [Importing csv file into latex as a table](https://tex.stackexchange.com/questions/146716/importing-csv-file-into-latex-as-a-table) )
With this code
```
\documentclass{book}
% Language setting
% Replace `english' with e.g. `spanish' to change the document language
\usepackage[english]{babel}
% Set page size and margins
% Replace `letterpaper' with `a4paper' for UK/EU standard size
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\usepackage{csvsimple}
\title{Your Paper}
\author{You}
\begin{document}
\maketitle
\section{Introduction}
\begin{tabular}{l|c}%
\bfseries Person & \bfseries Matr.~No.% specify table head
\csvreader[head to column names]{csv_dir/grade.csv}{}% use head of csv as column names
{\\\hline\givenname\ \name & \matriculation}% specify your coloumns here
\end{tabular}
\section{Some examples to get started}
\bibliographystyle{alpha}
\bibliography{sample}
\end{document}
```
I got this error
>
> Extra }, or forgotten \endgroup.
> Missing \endcsname inserted.
>
>
>
This is the csv, located in *csv\_dir* folder
```
\begin{filecontents*}{grade.csv}
name,givenname,matriculation,gender,grade
Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weisbaeck,Werner,34567,m,5.0
\end{filecontents*}
```
|
https://tex.stackexchange.com/users/301282
|
readcsv not working
| true |
Does your `csv` file actually start with `\begin{filecontents*}...`?
If so, please **delete** the first line (`\begin{filecontents*}{grade.csv}`) and the last line (`\end{filecontents*}`). They *do not* belong in the actual `csv` file.
---
The `filecontents` environment is a way to embed external data into the actual TeX file. When included in a `tex` file, when run, a modern TeX engine will extract the contents of the `filecontents` environment and dump it into a file with the specified name. This makes it easier for users to copy-and-paste when discussing code on an internet forum (such as this one): instead of pasting into two separate files that the user has to create by hand with the appropriate file name, using `filecontents` allows pasting only once into a file with essentially arbitrary name. [See this for more info on how to use it.](https://latexref.xyz/filecontents.html)
It is not meant to be part of the `csv` file in the example you linked to.
|
2
|
https://tex.stackexchange.com/users/119
|
691989
| 321,014 |
https://tex.stackexchange.com/questions/691981
|
0
|
Consider
```
\documentclass[20pt]{amsart}
\begin{document}
Hello
\end{document}
```
No matter how I change the 20pt to anything, I cannot see any effect in the pdf output.
Does anyone know how to change the font size of the text in "amsart"?
|
https://tex.stackexchange.com/users/153012
|
Setting font size of amsart documentclass have no effect
| false |
The `amsart` class only supports
```
8pt 9pt 10pt 11pt 12pt
```
as font size options. The first two just for preprints when you really want to save paper at the expense of readability. An unknown option is neglected and you're warned about that in the log file
```
LaTeX Warning: Unused global option(s):
[20pt].
```
The font size is then the default 10pt.
If you want a different main font size, I recommend the [`fontsize`](https://texdoc.org/serve/fontsize/0) package.
```
\RequirePackage{fix-cm}
\documentclass{amsart}
\usepackage[fontsize=20pt]{fontsize}
\begin{document}
Hello
\end{document}
```
For Computer Modern fonts, `fix-cm` is needed as shown.
|
2
|
https://tex.stackexchange.com/users/4427
|
691990
| 321,015 |
https://tex.stackexchange.com/questions/691939
|
0
|
I saw a post about this problem, but I can't fix my problem with the suggested solution. Maybe I am doing something wrong or the packages have changed. Can someone help me?
The code is:
```
\documentclass{scrbook}
\usepackage{iftex}
\ifLuaTeX
\usepackage{polyglossia}
\usepackage{fontspec}
\fi
\usepackage{graphicx}
\usepackage{pstool}
\begin{document}
\begin{figure}[h!]
\psfrag{A}{$\alpha_{xx}$}
\includegraphics[]{example-A.eps}
\end{figure}
\end{document}
```
The intention is to use psfrag to change the strings in the eps file to mathematical mode. If needed I am happy to send the image?
|
https://tex.stackexchange.com/users/301305
|
Converting strings in eps images to mathematical content with Lualatex and pstool
| false |
Something like this will probably work:
```
\documentclass{article}
\usepackage{iftex}
\ifluatex
\usepackage{fontspec}
\fi
\usepackage{graphicx}
\usepackage[crop=pdfcrop]{pstool}
\begin{filecontents}{example-image-a.tex}
\psfrag{A}{$\alpha_{xx}$}
\end{filecontents}
\begin{document}
\begin{figure}
\psfragfig{example-image-a}
\end{figure}
\end{document}
```
Remarks
-------
* the compilation for the psfrag will need `--shell-escape`
* pstool will call `latex + dvips + pspdf` for the picture, not lualatex. In your example it doesn't matter, as you are using only math. You need to take care that your document works with latex too.
It is currently not possible to use lualatex instead of latex as `dvips` can handle open type fonts (there is a replacement here <https://github.com/vtex-soft/texlive.xdvipsk/>, but it currently patches luaotfload files and files from graphics-def and so it not fully compatible with a current texlive. With miktex it probably doesn't work at all.).
* the crop option avoids to load the preview package which is not fully compatible with a current latex, e.g. there are problems with hyperref.
* Read the documentation of pstool regarding the files it needs and the options of the `\psfragfig` command.
|
0
|
https://tex.stackexchange.com/users/2388
|
691998
| 321,017 |
https://tex.stackexchange.com/questions/649406
|
0
|
I have a latex document in which I have included two images side by side within an enumerate function. The caption for those individual figures is aligned to the figure itself, but the overall Figure title is not aligned with the enumerate function instead it is aligned with the rest of the document
```
\begin{enumerate}
\item Consider the two figures given below,
\begin{figure}[h]
\centering
\begin{minipage}{0.4\linewidth}
\centering
\subfloat[\centering Figure 1 title.]
{
{
\includegraphics[width=1\linewidth]{Figures/Figure_1.png}
}
\label{Figure_1}
}
\end{minipage}
\begin{minipage}{0.4\linewidth}
\centering
\subfloat[\centering Figure 2 title.]
{
{
\includegraphics[width=1\linewidth]{Figures/Figure_.png}
}
\label{fig:Figure_2}
}
\end{minipage}
\caption{Common title for figure 1 and figure.}%
\label{fig:fig:power_response}
\end{figure}
\end{enumerate}
```
|
https://tex.stackexchange.com/users/273613
|
How to align the Figure title of two side by side images within enumerate function
| false |
* Your question is not clear at all... :
+ how should `enumerate` influence on figure,
+ are you aware that float `figure` can move out of enumerate or at least to some other item? Is this your problem?
+ which package you use for `\subfloat`,
+ why `\subfloat` should in inside of `\minipage`s,
+ what result you expected,
+ etc.
A simple example how can be written your code fragment is (without bothering with eventual problems with inserting figures into `enumerate` environment):
```
\documentclass{article}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum} % for dummy text
%---------------------------------------------------------------%
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{enumerate}
\item Consider the two figures given below,
\begin{figure}[!h]
\centering
\setkeys{Gin}{width=\linewidth}
\begin{subfigure}{0.4\linewidth}
\includegraphics{Figures/Figure_1.png}
\caption{Figure 1 title.}
\label{Figure_1}
\end{subfigure}
\hfil
\begin{subfigure}{0.4\linewidth}
\includegraphics{Figures/Figure_1.png}
\caption{Figure 2 title.}
\label{Figure_2}
\end{subfigure}
\caption{Common title for figure \ref{Figure_1} and figure \ref{Figure_2}.}%
\label{fig:fig:power_response}
\end{figure}
\end{enumerate}
\end{document}
```
where instead of `minipage` is used `subfigure` environment defined in the `subcaption` package. This MWE (Minimal Working Example) produce:
(red lines indicate part of page layout)
If you prefer to use of `subfloat` environment, you still can use `subcaption` package, but it should be of version 1.3 or newest. In this case the MWE body is:
```
\begin{document}
\begin{enumerate}
\item Consider the two figures given below,
\begin{figure}[!h]
\centering
\setkeys{Gin}{width=0.4\linewidth}
\subfloat[Figure 1 title. \protect\label{Figure_1}]%
{\includegraphics{Figures/Figure_1.png}}
\hfil
\subfloat[Figure 2 title. \protect\label{Figure_2}]%
{\includegraphics{Figures/Figure_2.png}}
\caption{Common title for figure \ref{Figure_1} and figure \ref{Figure_2}.}%
\label{fig:fig:power_response}
\end{figure}
\end{enumerate}
\end{document}
```
Result of compilation is the same as before.
However, Use of `minipage`s has sense when you like to have two parallel figures in one `figure` environment. In such cases, the MWE body can be
```
\begin{document}
\begin{enumerate}
\item Consider the two figures given below,
\begin{figure}[!h]
\centering
\setkeys{Gin}{width=\linewidth}
\begin{minipage}{0.4\linewidth}
\includegraphics{Figures/Figure_1.png}
\caption{Figure 1 title.}
\label{Figure_1}
\end{minipage}
\hfil
\begin{minipage}{0.4\linewidth}
\includegraphics{Figures/Figure_1.png}
\caption{Figure 2 title.}
\label{Figure_2}
\end{minipage}
\end{figure}
\end{enumerate}
\end{document}
```
Here you should be aware, the common caption for both figures now has no sense, so it is here drop out. Compilation result is:
So, still remains the main problem: what you after? Let us know!
|
0
|
https://tex.stackexchange.com/users/18189
|
692006
| 321,023 |
https://tex.stackexchange.com/questions/691982
|
1
|
This questions is a follow-up question to [Drawing A2xA2 Dynkin diagram with dynkin-diagrams](https://tex.stackexchange.com/questions/623504/drawing-a2xa2-dynkin-diagram-with-dynkin-diagrams)
I edited the above question but not sure if anyone saw that, apologies for duplicating a question.
The questions are
1. Is there existing code to draw an ellipse around several nodes in a Dynkin diagram?
2. In folding style can one choose to have the arms straight instead of curved.
|
https://tex.stackexchange.com/users/204083
|
Circles around several nodes Dynkin diagram + folding style
| false |
Here seems to be a way to do it:
To your first question, where I build upon the [solution from Sandy G](https://tex.stackexchange.com/a/623517/245790):
* this package is compatible with `Tikz`, see intro in manual
* so for orientation I draw a course (1cm) and a fine (2mm) grid
* with some trial and error I put an ellipse there
* see ch. "2.5 Circle Path Construction" in the tikz-manual
The position of the points inside the ellipse seem to depend on the scale chosen, here 0.3cm, and there may be better ways to access these coordinates without guessing.
For the second question I used the example on p. 57 in the dd-manual. On the fly I didn't recognise further options to modify lines. Feel free to contact the author of the package, e.g. via <https://ctan.org/pkg/dynkin-diagrams>.
```
\documentclass[12pt]{amsbook}
\usepackage{dynkin-diagrams}
% Adjusting solution from Sandy G, https://tex.stackexchange.com/a/623517/245790
\begin{document}
%Is this:
\begin{dynkinDiagram}[name=upper]A2
% ~~~ Where are we? ~~~~~~~~~~~~~~~~~~~~~~
% ~~~ adding grid for orientation ~~~~~~~~~~~~
\draw[help lines] (0,0) grid (1,1);
\draw[gray!20,step=2mm] (0,0) grid (1,1);
% ~~~ What's shown there? ~~~~~~~~~~~~~~~~
% ~~~ past solution ~~~~~~~~~~~~~~~~~~~~
\node (current) at ($(upper root 1)+(0,-.3cm)$) {};
\dynkin[at=(current),name=lower]A2
% ~~~ dropping the vertical lines ~~~~~~~~~~~~~
%\begin{pgfonlayer}{Dynkin behind}
%\foreach \i in {1,2}{%
%\draw[/Dynkin diagram/fold style] ($(upper root \i)$) -- ($(lower root \i)$);}
%\end{pgfonlayer}
% ~~~ Who let the ellipses out? ~~~~~~
% ~~~ with a little trial&error ~~~~~~~~
\draw[red] (0.35,-0.06) ellipse[x radius=0.15, y radius=.4];
\end{dynkinDiagram}
%what you want?
% ~~~ About the folds: taken from page 57, ch. "31 Other examples" ~~~~
\begin{tikzpicture}
\dynkin[odd,fold]A[2]{oo.oto.oo};% curved
\end{tikzpicture}
\begin{tikzpicture}
\dynkin[odd]A[2]{oo.oto.oo};% non-curved, i.e. dropped "fold"
\end{tikzpicture}
\end{document}
```
|
1
|
https://tex.stackexchange.com/users/245790
|
692010
| 321,025 |
https://tex.stackexchange.com/questions/234797
|
22
|
Is there a \ding symbol for a house? I need it for my CV, but can't find it. Thanks
|
https://tex.stackexchange.com/users/74850
|
Is there a \ding symbol for a house?
| false |
A alternate solution working with `pdflatex` (hence without `fontspec`) can use the Twitter's open source emoticons as pictures, as provided by the [`twemojis`](https://www.ctan.org/pkg/twemojis) package. With it, you can simply use `\twemoji{house}` in any text context.
The macro `\twemoji` is based on `\includegraphics` and accepts the related options.
The documentation provide several alternatives like, e.g
`\twemoji{house with garden}`.
It also gives some indications about the CC-BY licence of theses pictures if you intent to use them out of personal use.
|
0
|
https://tex.stackexchange.com/users/33514
|
692013
| 321,026 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.