a bib style to capitalize book titles but not paper titles [closed] - latex

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've heard that title capitalization in bibliography is the bibliography style's role (the bst file). Is there a bibliography style file that capitalizes book titles but not paper titles? For example, a paper title should be like
Hello world and hello kitty
a book title should be like
Hello World and Hello Kitty
bib style plain.bst doesn't seem to capitalize book titles. A minimal example:
minbib.tex
\documentclass{article}
\begin{document}
See \cite{book1}.
\bibliographystyle{plain}
\bibliography{min}
\end{document}
min.bib
#book{book1,
AUTHOR = {Petersen, K.},
TITLE = {Ergodic theory},
PUBLISHER = {Cambridge University Press},
YEAR = 1989,
}
The book title in the dvi output is "Ergodic theory", not "Ergodic Theory".

I've checked this against the contents of the plain.bst file, rather thanrelying on dimly recalled assertions about what bibtex does, as per the post of mine I deleted... plain.bst treats titles in one of two ways, using the functions it defines, first, format.title, used, e.g., for #article, which lowercases, and then format.btitle, used for #book, which puts the title in emphasis without touching the capitalisation.
Rules for capitalising titles are complex, complex enough that one can't expect a .bst file to completely automate it. For example, Chicago Manual of Style says one should "Lowercase prepositions, regardless of length" with a list of examples. But prepositionhood is a semantic role, that is syntactically generative: CMoS gives as an example preposition "according to". And one of the exceptions is to capitalise when the preposition is stressed: e.g., in "Alice Through the Looking Glass", where stress isn't even semantic, but a pragmatic property of the word. So it's not the bst's role.
So the Right Thing is to put title strings in title case, protecting the capitalisation of proper names with {}s (e.g., From {B}rouwer to {H}ilbert). Do this with articles too, since some reflist styles, e.g., MLA, put article titles into title case, but most scientif styles lowercase them.
plain.bst gets one thing wrong: for #article, it does not consider colons, which are used to indicate subtitles. So protect the capital letter after colons.

There is a tool to generate custom bib-styles, makebst.tex. When I run it as
latex /usr/share/texmf-texlive/tex/latex/custom-bib/makebst.tex
it asks a lot of questions, and in particular, it allows to select capitalization of article titles:
CAPITALIZATION OF ARTICLE TITLE:
(*) Sentence style (capitalize first word and those in braces)
(t) Title style (just as in bib entry)
Select:
\ans=t
You have selected: Title style
There is no such option for book titles though... But even in this case “Title” style means only “just as in bib entry”. So probably you need to capitalize titles manually.

Related

What is your opinion about blocking languages based on sy-langu [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Roses are red,
violets are blue
Unexpected 'Langu'
on line 32.
Well, to put things short: a technical limitation forced me to ignore Cyrillic material texts (short texts from table MAKT).
As an ABAP guy, I always take the pragmatic solution: I have excluded the languages manually by browsing through table T002 and googling if the languages are based on Cyrillic characters.
It works. But is not sexy. Feedback is appreciated.
REPORT Y_TEST_BLOCK_LANGU.
DATA langu_logon TYPE c LENGTH 2.
DATA langu_selected TYPE c LENGTH 1.
CONSTANTS:
BEGIN OF language,
german TYPE c LENGTH 1 VALUE 'D',
english TYPE c LENGTH 1 VALUE 'E',
END OF language.
CALL FUNCTION 'CONVERSION_EXIT_ISOLA_OUTPUT'
EXPORTING
input = sy-langu
IMPORTING
output = langu_logon.
IF
langu_logon = 'BG'
OR langu_logon = 'KK'
OR langu_logon = 'RU'
OR langu_logon = 'SR'
OR langu_logon = 'SH'
OR langu_logon = 'UK'
.
langu_selected = language-english.
ELSE.
langu_selected = sy-langu.
ENDIF.
START-OF-SELECTION.
PARAMETERS p_matnr TYPE matnr.
SELECT SINGLE maktx FROM makt INTO #DATA(maktx)
WHERE matnr = #p_matnr
AND spras = #langu_selected.
WRITE: /'This is the text',
/ maktx,
/'for Material number',
/ p_matnr
.
Alternatively, you can reverse-exclude starting from the material texts themselves. SELECT all short texts from MAKT that include undesired characters - whatever these are. Then track back which languages these texts belong to. Then put these languages on a deny list. The involved SELECTs may be too time-intensive for online processing, but could be repeated on a regular basis, to fill the DB-persisted deny list.
As some others already noted, the much cleaner solution would be to enable your UI to correctly display those characters. Or, if not possible, you could at least mask them, for example by escaping them to their HTML or UTF codes. This will not look nice, but at least the UI will display something at all.
Also ensure that you investigate other languages, as Dragonthoughts suggests. If your texts include other non-Latin-based languages, you may have the trouble in other places as well. Accidentally hitting Chinese characters may sound a bit off. But think of other widely used characters, such as widely used Greek symbols like alpha, epsilon, omega etc. that might well occur in otherwise English product descriptions.

Changing the in text citation for specific entries

I have been looking for an answer to my problem for quite a while now and was not able to find one that really meets my requirements.
I am using biblatex with citestyle alphabetic. For most cases this is absolutely fine. But now I would like to cite a study and would like a specific set of letters to appear in the text.
The biblatex source looks as follows:
#Report{Kost2018,
author = {Kost, Christoph and Shammugam, Shivenes},
title = {{Levelized Cost of Electricity Renewable Energy Technologies}},
institution = {Fraunhofer ISE},
year = {2018},
}
Now, with \autocite{Kost2018}, as expected, the citation comes out as [Kos+18].
What I would like instead is something like [ISE18] because the reader will more likely know this institute rather than the author. Also, if I cite several studies of that insistute, it is more clear to the reader.
I would be really greatfull if someone could help me on this.
You can use the biblatex key shorthand:
#Report{Kost2018,
author = {Kost, Christoph and Shammugam, Shivenes},
shorthand = {ISE18},
title = {{Levelized Cost of Electricity Renewable Energy Technologies}},
institution = {Fraunhofer ISE},
year = {2018}
}
Description from the biblatex documentation:
label
A designation to be used by the citation style as a substitute for the regular label if
any data required to generate the regular label is missing. For example, when an
author-year citation style is generating a citation for an entry which is missing the
author or the year, it may fall back to label. See § 2.3.2 for details. Note that, in contrast to shorthand, label is only used as a fallback. See also shorthand.
shorthand
A special designation to be used by the citation style instead of the usual label. If
defined, it overrides the default label. See also label.
Reference: How to specify bibliography alpha key without modifying the .bst file or using BibLaTeX

Remove spacing before \chapter in LaTeX [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am using the book style to write a research report and would like to know how to remove the top vertical space before a chapter heading. I need this for the 'Abstract' page. I would like it to start nearer to the top than standard chapters.
Here is some sample code using the titlesec package, Stefan's suggestion. The titleformat command leaves everything at default values, but you need to include it (I think) for the titlespacing changes to work. The second titlespacing command sets back to default values, with assumption that you wanted altered spacing only for first chapter:
\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
% this alters "before" spacing (the second length argument) to 0
\titlespacing*{\chapter}{0pt}{0pt}{40pt}
\begin{document}
\chapter{One}
% this changes "before" spacing back to its default of 50pt
\titlespacing*{\chapter}{0pt}{50pt}{40pt}
First sentence of chapter.
\chapter{two}
First sentence of chapter.
\chapter{three}
First sentence of chapter.
\end{document}
An easy way is using the titlesec package. The appendix 9.2 of its documentation shows how the standard classes typeset their headings - it's not hard to copy and to modify those commands according to the own requirements.
Having the same issue, i tried out the titlesec solution, which somehow didn't work as expected (too many errors with Texshop 2.47 on OsX).
However, i worked out a simpler solution (at least for my case) with the geometry package. The deal is to call a new page geometry only for the page of interest and then restore the page geometry defined by fncychap.
% in the preamble
\documentclass[11pt,a4paper,twoside,openright]{book}
\usepackage{geometry}
\usepackage[Sonny]{fncychap}
% in the document
\frontmatter
% adapt geometry options to your needs
\newgeometry{textwidth=16cm,textheight=28cm,voffset=-2cm,bottom=0cm}
\chapter*{Abstract}
\markboth{}{}
\addcontentsline{toc}{chapter}{Abstract}
% text
\restoregeometry
% from now on fncychap takes over again
\mainmatter

Preventing \texttt LaTeX tag from letting its content passing over the margin [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
In my report, I'm writing some class names or variable names inside of a paragraph, and I want these names to be rendered in a monospace font.
Example:
This is my class name: \texttt{baseAdminConfiguration}.
Sometimes when the single word inside of the \texttt tag is rendered at the end of a line, the word does not go to the next line, and there is no break in it neither: the end of the word passes over the margin.
How should I handle such a case?
Cheers.
This hasn’t got much to do with \texttt. The word is simply too long, and LaTeX doesn’t know how to hyphenate it. You can tell it how to do this manually, by declaring hyphenation rules:
\hyphenation{base-Admin-Configuration}
The \hyphenation command may take arbitrarily many words, separated by whitespace.
Alternatively, if this doesn’t the trick, you can introduce manual hypenation hints in the text:
This is a long text that uses the word \texttt{base\-Admin\-Configuration) …
Only the actual hyphenation will be displayed – unused so-called discretionary hyphens (\-) will not be displayed so you can freely sprinkle your text with them, if necessary.
[Read more about hyphenation in LaTeX]
To prevent LaTeX from overflowing lines in principle, the whole paragraph can be wrapped in a sloppypar environment (thanks to Will for pointing this out in the comments):
\begin{sloppypar}
Some text …
\end{sloppypar}
This manipulates the parameters of the line-breaking algorithm (in particular, \tolerance). The downside: this can lead to very ugly spacing. Alternatively, \tolerance and other internal parameters can be manipulated directly – the TeX FAQ shows how.
The solution is quite simple: use the url package and replace the texttt command with the path command.
I found out that here
https://tex.stackexchange.com/questions/299/how-to-get-long-texttt-sections-to-break
in the post of Will Robertson.
Cheers

How should I add an author subtitle under a chapter title? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Had trouble knowing what exactly to Google, so I'll ask here.
I'm typesetting a series of annotations to papers. Each chapter will be on a paper, so I'd like to put the paper authors right under the chapter names (the paper titles).
I can think of a hacky way of doing this, but I figured I'd ask the fine folks over at SO first for something more elegant / contribute to the knowledge base.
You can use the substr package in addition of titlesec (with explicit option) for create a semantic way of putting authors in titles.
Then, you can write your chapter on this way:
\chapter{About random things on Internet, and another
procrastination issues. Alice Marigold}
In this case the title and the author are separated for a ". " (You can use another separator if you use periods in one of your titles). Then you can modify the \chapter format with titlesec. With the explicit option you can access directly to the title content with #1. Then you can separate the title and the author with the commands \BeforeSubString and \BehindSubString of the substr package, respectively. They have two arguments: the separator token (in this case is ". ") and the string (the title. author).
For a simple example:
\titleformat{\chapter}[hang]{}{%
\Huge \thechapter.
}{1cm}{%
\LARGE \scshape \BeforeSubString{. }{#1}\\
{\Large \itshape ---\BehindSubString{. }{#1}---}%
}
The result is similar to this.
You can make very different forms of place titles and authors, including putting it on the left. This is a example I used in a LaTeX demonstration, with the calc package:
\titleformat{\chapter}[hang]{}{%
\Huge \thechapter.
}{1cm}{%
\LARGE \scshape \BeforeSubString{. }{#1}\\
\makebox[\textwidth - (1cm + \widthof{\Huge \thechapter.})][r]{\Large \itshape \BehindSubString{. }{#1}}%
}
About the table of contents, you can ignore it putting the title without the author in the \chapter optional argument, or modify it with titletoc.
And there are infinite possibilities of writing multi-information titles with these two packages...
PD: Sorry, but for some reason I can't put the CTAN links to the packages.
Why not use a package designed for things like conference proceedings, such as this one?
Grubbing around on CTAN a bit brought me to the bits package which appears to do exactly what you want. From the description:
A LaTeX package that provides a programmer's interface for a new idea called a “bit”, which is like an environment but has a title, author, and other attributes usually only associated with the document environment.
Be warned that the package claims to be "unsupported".
There is also combine:
The combine class lets you bundle individual documents into a single document, such as when preparing a conference proceedings. The auxiliary combinet package puts the titles and authors from \maketitle commands into the main document's Table of Contents. The package cooperates with the abstract and titling packages.
and there may be others, but as you say, it is not easy to search for.

Resources